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

Side by Side Diff: src/heap/heap.cc

Issue 1923253002: [generators] Create the fixed array holding the registers only once. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename Placeholder to StaleRegister Created 4 years, 7 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2280 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign) 2280 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign)
2281 2281
2282 ALLOCATE_PRIMITIVE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean, 2282 ALLOCATE_PRIMITIVE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean,
2283 Context::BOOLEAN_FUNCTION_INDEX); 2283 Context::BOOLEAN_FUNCTION_INDEX);
2284 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized); 2284 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized);
2285 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker); 2285 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker);
2286 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel); 2286 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel);
2287 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception); 2287 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception);
2288 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception); 2288 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception);
2289 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, optimized_out); 2289 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, optimized_out);
2290 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, stale_register);
2290 2291
2291 for (unsigned i = 0; i < arraysize(string_type_table); i++) { 2292 for (unsigned i = 0; i < arraysize(string_type_table); i++) {
2292 const StringTypeTable& entry = string_type_table[i]; 2293 const StringTypeTable& entry = string_type_table[i];
2293 { 2294 {
2294 AllocationResult allocation = AllocateMap(entry.type, entry.size); 2295 AllocationResult allocation = AllocateMap(entry.type, entry.size);
2295 if (!allocation.To(&obj)) return false; 2296 if (!allocation.To(&obj)) return false;
2296 } 2297 }
2297 Map* map = Map::cast(obj); 2298 Map* map = Map::cast(obj);
2298 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX); 2299 map->SetConstructorFunctionIndex(Context::STRING_FUNCTION_INDEX);
2299 // Mark cons string maps as unstable, because their objects can change 2300 // Mark cons string maps as unstable, because their objects can change
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 2655
2655 set_exception(*factory->NewOddball(factory->exception_map(), "exception", 2656 set_exception(*factory->NewOddball(factory->exception_map(), "exception",
2656 handle(Smi::FromInt(-5), isolate()), false, 2657 handle(Smi::FromInt(-5), isolate()), false,
2657 "undefined", Oddball::kException)); 2658 "undefined", Oddball::kException));
2658 2659
2659 set_optimized_out( 2660 set_optimized_out(
2660 *factory->NewOddball(factory->optimized_out_map(), "optimized_out", 2661 *factory->NewOddball(factory->optimized_out_map(), "optimized_out",
2661 handle(Smi::FromInt(-6), isolate()), false, 2662 handle(Smi::FromInt(-6), isolate()), false,
2662 "undefined", Oddball::kOptimizedOut)); 2663 "undefined", Oddball::kOptimizedOut));
2663 2664
2665 set_stale_register(
2666 *factory->NewOddball(factory->stale_register_map(), "stale_register",
2667 handle(Smi::FromInt(-7), isolate()), false,
2668 "undefined", Oddball::kStaleRegister));
2669
2664 for (unsigned i = 0; i < arraysize(constant_string_table); i++) { 2670 for (unsigned i = 0; i < arraysize(constant_string_table); i++) {
2665 Handle<String> str = 2671 Handle<String> str =
2666 factory->InternalizeUtf8String(constant_string_table[i].contents); 2672 factory->InternalizeUtf8String(constant_string_table[i].contents);
2667 roots_[constant_string_table[i].index] = *str; 2673 roots_[constant_string_table[i].index] = *str;
2668 } 2674 }
2669 2675
2670 // Create the code_stubs dictionary. The initial size is set to avoid 2676 // Create the code_stubs dictionary. The initial size is set to avoid
2671 // expanding the dictionary during bootstrapping. 2677 // expanding the dictionary during bootstrapping.
2672 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); 2678 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128));
2673 2679
(...skipping 3675 matching lines...) Expand 10 before | Expand all | Expand 10 after
6349 } 6355 }
6350 6356
6351 6357
6352 // static 6358 // static
6353 int Heap::GetStaticVisitorIdForMap(Map* map) { 6359 int Heap::GetStaticVisitorIdForMap(Map* map) {
6354 return StaticVisitorBase::GetVisitorId(map); 6360 return StaticVisitorBase::GetVisitorId(map);
6355 } 6361 }
6356 6362
6357 } // namespace internal 6363 } // namespace internal
6358 } // namespace v8 6364 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698