Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: src/bootstrapper.cc

Issue 17091002: Hydrogen array constructor cleanup and improvements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nit Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 isolate->initial_object_prototype(), 859 isolate->initial_object_prototype(),
860 Builtins::kArrayCode, true, true); 860 Builtins::kArrayCode, true, true);
861 array_function->shared()->DontAdaptArguments(); 861 array_function->shared()->DontAdaptArguments();
862 array_function->shared()->set_function_data(Smi::FromInt(kArrayCode)); 862 array_function->shared()->set_function_data(Smi::FromInt(kArrayCode));
863 863
864 // This seems a bit hackish, but we need to make sure Array.length 864 // This seems a bit hackish, but we need to make sure Array.length
865 // is 1. 865 // is 1.
866 array_function->shared()->set_length(1); 866 array_function->shared()->set_length(1);
867 867
868 Handle<Map> initial_map(array_function->initial_map()); 868 Handle<Map> initial_map(array_function->initial_map());
869
870 // This assert protects an optimization in
871 // HGraphBuilder::JSArrayBuilder::EmitMapCode()
872 ASSERT(initial_map->elements_kind() == GetInitialFastElementsKind());
873
869 Handle<DescriptorArray> array_descriptors( 874 Handle<DescriptorArray> array_descriptors(
870 factory->NewDescriptorArray(0, 1)); 875 factory->NewDescriptorArray(0, 1));
871 DescriptorArray::WhitenessWitness witness(*array_descriptors); 876 DescriptorArray::WhitenessWitness witness(*array_descriptors);
872 877
873 Handle<Foreign> array_length(factory->NewForeign(&Accessors::ArrayLength)); 878 Handle<Foreign> array_length(factory->NewForeign(&Accessors::ArrayLength));
874 PropertyAttributes attribs = static_cast<PropertyAttributes>( 879 PropertyAttributes attribs = static_cast<PropertyAttributes>(
875 DONT_ENUM | DONT_DELETE); 880 DONT_ENUM | DONT_DELETE);
876 initial_map->set_instance_descriptors(*array_descriptors); 881 initial_map->set_instance_descriptors(*array_descriptors);
877 882
878 { // Add length. 883 { // Add length.
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 return from + sizeof(NestingCounterType); 2645 return from + sizeof(NestingCounterType);
2641 } 2646 }
2642 2647
2643 2648
2644 // Called when the top-level V8 mutex is destroyed. 2649 // Called when the top-level V8 mutex is destroyed.
2645 void Bootstrapper::FreeThreadResources() { 2650 void Bootstrapper::FreeThreadResources() {
2646 ASSERT(!IsActive()); 2651 ASSERT(!IsActive());
2647 } 2652 }
2648 2653
2649 } } // namespace v8::internal 2654 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698