OLD | NEW |
---|---|
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 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1474 isolate_->context_slot_cache()->Clear(); | 1474 isolate_->context_slot_cache()->Clear(); |
1475 isolate_->descriptor_lookup_cache()->Clear(); | 1475 isolate_->descriptor_lookup_cache()->Clear(); |
1476 RegExpResultsCache::Clear(string_split_cache()); | 1476 RegExpResultsCache::Clear(string_split_cache()); |
1477 RegExpResultsCache::Clear(regexp_multiple_cache()); | 1477 RegExpResultsCache::Clear(regexp_multiple_cache()); |
1478 | 1478 |
1479 isolate_->compilation_cache()->MarkCompactPrologue(); | 1479 isolate_->compilation_cache()->MarkCompactPrologue(); |
1480 | 1480 |
1481 CompletelyClearInstanceofCache(); | 1481 CompletelyClearInstanceofCache(); |
1482 | 1482 |
1483 FlushNumberStringCache(); | 1483 FlushNumberStringCache(); |
1484 if (FLAG_cleanup_code_caches_at_gc) { | |
1485 polymorphic_code_cache()->set_cache(undefined_value()); | |
1486 } | |
1487 | |
1488 ClearNormalizedMapCaches(); | 1484 ClearNormalizedMapCaches(); |
1489 } | 1485 } |
1490 | 1486 |
1491 | 1487 |
1492 #ifdef VERIFY_HEAP | 1488 #ifdef VERIFY_HEAP |
1493 // Visitor class to verify pointers in code or data space do not point into | 1489 // Visitor class to verify pointers in code or data space do not point into |
1494 // new space. | 1490 // new space. |
1495 class VerifyNonPointerSpacePointersVisitor : public ObjectVisitor { | 1491 class VerifyNonPointerSpacePointersVisitor : public ObjectVisitor { |
1496 public: | 1492 public: |
1497 explicit VerifyNonPointerSpacePointersVisitor(Heap* heap) : heap_(heap) {} | 1493 explicit VerifyNonPointerSpacePointersVisitor(Heap* heap) : heap_(heap) {} |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2173 | 2169 |
2174 | 2170 |
2175 const Heap::StructTable Heap::struct_table[] = { | 2171 const Heap::StructTable Heap::struct_table[] = { |
2176 #define STRUCT_TABLE_ELEMENT(NAME, Name, name) \ | 2172 #define STRUCT_TABLE_ELEMENT(NAME, Name, name) \ |
2177 { NAME##_TYPE, Name::kSize, k##Name##MapRootIndex } \ | 2173 { NAME##_TYPE, Name::kSize, k##Name##MapRootIndex } \ |
2178 , | 2174 , |
2179 STRUCT_LIST(STRUCT_TABLE_ELEMENT) | 2175 STRUCT_LIST(STRUCT_TABLE_ELEMENT) |
2180 #undef STRUCT_TABLE_ELEMENT | 2176 #undef STRUCT_TABLE_ELEMENT |
2181 }; | 2177 }; |
2182 | 2178 |
2179 namespace { | |
2180 | |
2181 void FinalizeMap(Heap* heap, Map* map) { | |
ulan
2016/04/06 09:34:18
Let's include "PartialMap" in the name to be more
| |
2182 map->set_code_cache(heap->empty_fixed_array()); | |
2183 map->set_dependent_code(DependentCode::cast(heap->empty_fixed_array())); | |
2184 map->set_raw_transitions(Smi::FromInt(0)); | |
2185 map->set_instance_descriptors(heap->empty_descriptor_array()); | |
2186 if (FLAG_unbox_double_fields) { | |
2187 map->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | |
2188 } | |
2189 map->set_prototype(heap->null_value()); | |
2190 map->set_constructor_or_backpointer(heap->null_value()); | |
2191 } | |
2192 | |
2193 } // namespace | |
2183 | 2194 |
2184 bool Heap::CreateInitialMaps() { | 2195 bool Heap::CreateInitialMaps() { |
2185 HeapObject* obj = nullptr; | 2196 HeapObject* obj = nullptr; |
2186 { | 2197 { |
2187 AllocationResult allocation = AllocatePartialMap(MAP_TYPE, Map::kSize); | 2198 AllocationResult allocation = AllocatePartialMap(MAP_TYPE, Map::kSize); |
2188 if (!allocation.To(&obj)) return false; | 2199 if (!allocation.To(&obj)) return false; |
2189 } | 2200 } |
2190 // Map::cast cannot be used due to uninitialized map field. | 2201 // Map::cast cannot be used due to uninitialized map field. |
2191 Map* new_meta_map = reinterpret_cast<Map*>(obj); | 2202 Map* new_meta_map = reinterpret_cast<Map*>(obj); |
2192 set_meta_map(new_meta_map); | 2203 set_meta_map(new_meta_map); |
2193 new_meta_map->set_map(new_meta_map); | 2204 new_meta_map->set_map(new_meta_map); |
2194 | 2205 |
2195 { // Partial map allocation | 2206 { // Partial map allocation |
2196 #define ALLOCATE_PARTIAL_MAP(instance_type, size, field_name) \ | 2207 #define ALLOCATE_PARTIAL_MAP(instance_type, size, field_name) \ |
2197 { \ | 2208 { \ |
2198 Map* map; \ | 2209 Map* map; \ |
2199 if (!AllocatePartialMap((instance_type), (size)).To(&map)) return false; \ | 2210 if (!AllocatePartialMap((instance_type), (size)).To(&map)) return false; \ |
2200 set_##field_name##_map(map); \ | 2211 set_##field_name##_map(map); \ |
2201 } | 2212 } |
2202 | 2213 |
2203 ALLOCATE_PARTIAL_MAP(FIXED_ARRAY_TYPE, kVariableSizeSentinel, fixed_array); | 2214 ALLOCATE_PARTIAL_MAP(FIXED_ARRAY_TYPE, kVariableSizeSentinel, fixed_array); |
2204 ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, undefined); | 2215 ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, undefined); |
2205 ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, null); | 2216 ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, null); |
2217 ALLOCATE_PARTIAL_MAP(ODDBALL_TYPE, Oddball::kSize, the_hole); | |
2206 | 2218 |
2207 #undef ALLOCATE_PARTIAL_MAP | 2219 #undef ALLOCATE_PARTIAL_MAP |
2208 } | 2220 } |
2209 | 2221 |
2210 // Allocate the empty array. | 2222 // Allocate the empty array. |
2211 { | 2223 { |
2212 AllocationResult allocation = AllocateEmptyFixedArray(); | 2224 AllocationResult allocation = AllocateEmptyFixedArray(); |
2213 if (!allocation.To(&obj)) return false; | 2225 if (!allocation.To(&obj)) return false; |
2214 } | 2226 } |
2215 set_empty_fixed_array(FixedArray::cast(obj)); | 2227 set_empty_fixed_array(FixedArray::cast(obj)); |
2216 | 2228 |
2217 { | 2229 { |
2218 AllocationResult allocation = Allocate(null_map(), OLD_SPACE); | 2230 AllocationResult allocation = Allocate(null_map(), OLD_SPACE); |
2219 if (!allocation.To(&obj)) return false; | 2231 if (!allocation.To(&obj)) return false; |
2220 } | 2232 } |
2221 set_null_value(Oddball::cast(obj)); | 2233 set_null_value(Oddball::cast(obj)); |
2222 Oddball::cast(obj)->set_kind(Oddball::kNull); | 2234 Oddball::cast(obj)->set_kind(Oddball::kNull); |
2223 | 2235 |
2224 { | 2236 { |
2225 AllocationResult allocation = Allocate(undefined_map(), OLD_SPACE); | 2237 AllocationResult allocation = Allocate(undefined_map(), OLD_SPACE); |
2226 if (!allocation.To(&obj)) return false; | 2238 if (!allocation.To(&obj)) return false; |
2227 } | 2239 } |
2228 set_undefined_value(Oddball::cast(obj)); | 2240 set_undefined_value(Oddball::cast(obj)); |
2229 Oddball::cast(obj)->set_kind(Oddball::kUndefined); | 2241 Oddball::cast(obj)->set_kind(Oddball::kUndefined); |
2230 DCHECK(!InNewSpace(undefined_value())); | 2242 DCHECK(!InNewSpace(undefined_value())); |
2243 { | |
2244 AllocationResult allocation = Allocate(the_hole_map(), OLD_SPACE); | |
2245 if (!allocation.To(&obj)) return false; | |
2246 } | |
2247 set_the_hole_value(Oddball::cast(obj)); | |
2248 Oddball::cast(obj)->set_kind(Oddball::kTheHole); | |
2231 | 2249 |
2232 // Set preliminary exception sentinel value before actually initializing it. | 2250 // Set preliminary exception sentinel value before actually initializing it. |
2233 set_exception(null_value()); | 2251 set_exception(null_value()); |
2234 | 2252 |
2235 // Allocate the empty descriptor array. | 2253 // Allocate the empty descriptor array. |
2236 { | 2254 { |
2237 AllocationResult allocation = AllocateEmptyFixedArray(); | 2255 AllocationResult allocation = AllocateEmptyFixedArray(); |
2238 if (!allocation.To(&obj)) return false; | 2256 if (!allocation.To(&obj)) return false; |
2239 } | 2257 } |
2240 set_empty_descriptor_array(DescriptorArray::cast(obj)); | 2258 set_empty_descriptor_array(DescriptorArray::cast(obj)); |
2241 | 2259 |
2242 // Fix the instance_descriptors for the existing maps. | 2260 // Fix the instance_descriptors for the existing maps. |
2243 meta_map()->set_code_cache(empty_fixed_array()); | 2261 FinalizeMap(this, meta_map()); |
2244 meta_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | 2262 FinalizeMap(this, fixed_array_map()); |
2245 meta_map()->set_raw_transitions(Smi::FromInt(0)); | 2263 FinalizeMap(this, undefined_map()); |
2246 meta_map()->set_instance_descriptors(empty_descriptor_array()); | 2264 undefined_map()->set_is_undetectable(); |
2247 if (FLAG_unbox_double_fields) { | 2265 FinalizeMap(this, null_map()); |
2248 meta_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | |
2249 } | |
2250 | |
2251 fixed_array_map()->set_code_cache(empty_fixed_array()); | |
2252 fixed_array_map()->set_dependent_code( | |
2253 DependentCode::cast(empty_fixed_array())); | |
2254 fixed_array_map()->set_raw_transitions(Smi::FromInt(0)); | |
2255 fixed_array_map()->set_instance_descriptors(empty_descriptor_array()); | |
2256 if (FLAG_unbox_double_fields) { | |
2257 fixed_array_map()->set_layout_descriptor( | |
2258 LayoutDescriptor::FastPointerLayout()); | |
2259 } | |
2260 | |
2261 undefined_map()->set_code_cache(empty_fixed_array()); | |
2262 undefined_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | |
2263 undefined_map()->set_raw_transitions(Smi::FromInt(0)); | |
2264 undefined_map()->set_instance_descriptors(empty_descriptor_array()); | |
2265 if (FLAG_unbox_double_fields) { | |
2266 undefined_map()->set_layout_descriptor( | |
2267 LayoutDescriptor::FastPointerLayout()); | |
2268 } | |
2269 | |
2270 null_map()->set_code_cache(empty_fixed_array()); | |
2271 null_map()->set_dependent_code(DependentCode::cast(empty_fixed_array())); | |
2272 null_map()->set_raw_transitions(Smi::FromInt(0)); | |
2273 null_map()->set_instance_descriptors(empty_descriptor_array()); | |
2274 if (FLAG_unbox_double_fields) { | |
2275 null_map()->set_layout_descriptor(LayoutDescriptor::FastPointerLayout()); | |
2276 } | |
2277 null_map()->set_is_undetectable(); | 2266 null_map()->set_is_undetectable(); |
2278 | 2267 FinalizeMap(this, the_hole_map()); |
2279 // Fix prototype object for existing maps. | |
2280 meta_map()->set_prototype(null_value()); | |
2281 meta_map()->set_constructor_or_backpointer(null_value()); | |
2282 | |
2283 fixed_array_map()->set_prototype(null_value()); | |
2284 fixed_array_map()->set_constructor_or_backpointer(null_value()); | |
2285 | |
2286 undefined_map()->set_prototype(null_value()); | |
2287 undefined_map()->set_constructor_or_backpointer(null_value()); | |
2288 undefined_map()->set_is_undetectable(); | |
2289 | |
2290 null_map()->set_prototype(null_value()); | |
2291 null_map()->set_constructor_or_backpointer(null_value()); | |
2292 | 2268 |
2293 { // Map allocation | 2269 { // Map allocation |
2294 #define ALLOCATE_MAP(instance_type, size, field_name) \ | 2270 #define ALLOCATE_MAP(instance_type, size, field_name) \ |
2295 { \ | 2271 { \ |
2296 Map* map; \ | 2272 Map* map; \ |
2297 if (!AllocateMap((instance_type), size).To(&map)) return false; \ | 2273 if (!AllocateMap((instance_type), size).To(&map)) return false; \ |
2298 set_##field_name##_map(map); \ | 2274 set_##field_name##_map(map); \ |
2299 } | 2275 } |
2300 | 2276 |
2301 #define ALLOCATE_VARSIZE_MAP(instance_type, field_name) \ | 2277 #define ALLOCATE_VARSIZE_MAP(instance_type, field_name) \ |
(...skipping 17 matching lines...) Expand all Loading... | |
2319 mutable_heap_number) | 2295 mutable_heap_number) |
2320 ALLOCATE_PRIMITIVE_MAP(SYMBOL_TYPE, Symbol::kSize, symbol, | 2296 ALLOCATE_PRIMITIVE_MAP(SYMBOL_TYPE, Symbol::kSize, symbol, |
2321 Context::SYMBOL_FUNCTION_INDEX) | 2297 Context::SYMBOL_FUNCTION_INDEX) |
2322 #define ALLOCATE_SIMD128_MAP(TYPE, Type, type, lane_count, lane_type) \ | 2298 #define ALLOCATE_SIMD128_MAP(TYPE, Type, type, lane_count, lane_type) \ |
2323 ALLOCATE_PRIMITIVE_MAP(SIMD128_VALUE_TYPE, Type::kSize, type, \ | 2299 ALLOCATE_PRIMITIVE_MAP(SIMD128_VALUE_TYPE, Type::kSize, type, \ |
2324 Context::TYPE##_FUNCTION_INDEX) | 2300 Context::TYPE##_FUNCTION_INDEX) |
2325 SIMD128_TYPES(ALLOCATE_SIMD128_MAP) | 2301 SIMD128_TYPES(ALLOCATE_SIMD128_MAP) |
2326 #undef ALLOCATE_SIMD128_MAP | 2302 #undef ALLOCATE_SIMD128_MAP |
2327 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign) | 2303 ALLOCATE_MAP(FOREIGN_TYPE, Foreign::kSize, foreign) |
2328 | 2304 |
2329 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, the_hole); | |
2330 ALLOCATE_PRIMITIVE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean, | 2305 ALLOCATE_PRIMITIVE_MAP(ODDBALL_TYPE, Oddball::kSize, boolean, |
2331 Context::BOOLEAN_FUNCTION_INDEX); | 2306 Context::BOOLEAN_FUNCTION_INDEX); |
2332 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized); | 2307 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, uninitialized); |
2333 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker); | 2308 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, arguments_marker); |
2334 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel); | 2309 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, no_interceptor_result_sentinel); |
2335 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception); | 2310 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, exception); |
2336 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception); | 2311 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, termination_exception); |
2337 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, optimized_out); | 2312 ALLOCATE_MAP(ODDBALL_TYPE, Oddball::kSize, optimized_out); |
2338 | 2313 |
2339 for (unsigned i = 0; i < arraysize(string_type_table); i++) { | 2314 for (unsigned i = 0; i < arraysize(string_type_table); i++) { |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2643 // The -0 value must be set before NewNumber works. | 2618 // The -0 value must be set before NewNumber works. |
2644 set_minus_zero_value(*factory->NewHeapNumber(-0.0, IMMUTABLE, TENURED)); | 2619 set_minus_zero_value(*factory->NewHeapNumber(-0.0, IMMUTABLE, TENURED)); |
2645 DCHECK(std::signbit(minus_zero_value()->Number()) != 0); | 2620 DCHECK(std::signbit(minus_zero_value()->Number()) != 0); |
2646 | 2621 |
2647 set_nan_value(*factory->NewHeapNumber( | 2622 set_nan_value(*factory->NewHeapNumber( |
2648 std::numeric_limits<double>::quiet_NaN(), IMMUTABLE, TENURED)); | 2623 std::numeric_limits<double>::quiet_NaN(), IMMUTABLE, TENURED)); |
2649 set_infinity_value(*factory->NewHeapNumber(V8_INFINITY, IMMUTABLE, TENURED)); | 2624 set_infinity_value(*factory->NewHeapNumber(V8_INFINITY, IMMUTABLE, TENURED)); |
2650 set_minus_infinity_value( | 2625 set_minus_infinity_value( |
2651 *factory->NewHeapNumber(-V8_INFINITY, IMMUTABLE, TENURED)); | 2626 *factory->NewHeapNumber(-V8_INFINITY, IMMUTABLE, TENURED)); |
2652 | 2627 |
2653 // The hole has not been created yet, but we want to put something | |
2654 // predictable in the gaps in the string table, so lets make that Smi zero. | |
2655 set_the_hole_value(reinterpret_cast<Oddball*>(Smi::FromInt(0))); | |
2656 | |
2657 // Allocate initial string table. | 2628 // Allocate initial string table. |
2658 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); | 2629 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); |
2659 | 2630 |
2660 // Allocate | 2631 // Allocate |
2661 | 2632 |
2662 // Finish initializing oddballs after creating the string table. | 2633 // Finish initializing oddballs after creating the string table. |
2663 Oddball::Initialize(isolate(), factory->undefined_value(), "undefined", | 2634 Oddball::Initialize(isolate(), factory->undefined_value(), "undefined", |
2664 factory->nan_value(), false, "undefined", | 2635 factory->nan_value(), false, "undefined", |
2665 Oddball::kUndefined); | 2636 Oddball::kUndefined); |
2666 | 2637 |
2667 // Initialize the null_value. | 2638 // Initialize the null_value. |
2668 Oddball::Initialize(isolate(), factory->null_value(), "null", | 2639 Oddball::Initialize(isolate(), factory->null_value(), "null", |
2669 handle(Smi::FromInt(0), isolate()), false, "object", | 2640 handle(Smi::FromInt(0), isolate()), false, "object", |
2670 Oddball::kNull); | 2641 Oddball::kNull); |
2671 | 2642 |
2643 // Initialize the_hole_value. | |
2644 Oddball::Initialize(isolate(), factory->the_hole_value(), "hole", | |
2645 handle(Smi::FromInt(-1), isolate()), false, "undefined", | |
2646 Oddball::kTheHole); | |
2647 | |
2672 // Initialize the true_value. | 2648 // Initialize the true_value. |
2673 Oddball::Initialize(isolate(), factory->true_value(), "true", | 2649 Oddball::Initialize(isolate(), factory->true_value(), "true", |
2674 handle(Smi::FromInt(1), isolate()), true, "boolean", | 2650 handle(Smi::FromInt(1), isolate()), true, "boolean", |
2675 Oddball::kTrue); | 2651 Oddball::kTrue); |
2676 | 2652 |
2677 // Initialize the false_value. | 2653 // Initialize the false_value. |
2678 Oddball::Initialize(isolate(), factory->false_value(), "false", | 2654 Oddball::Initialize(isolate(), factory->false_value(), "false", |
2679 handle(Smi::FromInt(0), isolate()), false, "boolean", | 2655 handle(Smi::FromInt(0), isolate()), false, "boolean", |
2680 Oddball::kFalse); | 2656 Oddball::kFalse); |
2681 | 2657 |
2682 set_the_hole_value(*factory->NewOddball( | |
2683 factory->the_hole_map(), "hole", handle(Smi::FromInt(-1), isolate()), | |
2684 false, "undefined", Oddball::kTheHole)); | |
2685 | |
2686 set_uninitialized_value( | 2658 set_uninitialized_value( |
2687 *factory->NewOddball(factory->uninitialized_map(), "uninitialized", | 2659 *factory->NewOddball(factory->uninitialized_map(), "uninitialized", |
2688 handle(Smi::FromInt(-1), isolate()), false, | 2660 handle(Smi::FromInt(-1), isolate()), false, |
2689 "undefined", Oddball::kUninitialized)); | 2661 "undefined", Oddball::kUninitialized)); |
2690 | 2662 |
2691 set_arguments_marker( | 2663 set_arguments_marker( |
2692 *factory->NewOddball(factory->arguments_marker_map(), "arguments_marker", | 2664 *factory->NewOddball(factory->arguments_marker_map(), "arguments_marker", |
2693 handle(Smi::FromInt(-4), isolate()), false, | 2665 handle(Smi::FromInt(-4), isolate()), false, |
2694 "undefined", Oddball::kArgumentsMarker)); | 2666 "undefined", Oddball::kArgumentsMarker)); |
2695 | 2667 |
(...skipping 23 matching lines...) Expand all Loading... | |
2719 } | 2691 } |
2720 | 2692 |
2721 // Create the code_stubs dictionary. The initial size is set to avoid | 2693 // Create the code_stubs dictionary. The initial size is set to avoid |
2722 // expanding the dictionary during bootstrapping. | 2694 // expanding the dictionary during bootstrapping. |
2723 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); | 2695 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); |
2724 | 2696 |
2725 // Create the non_monomorphic_cache used in stub-cache.cc. The initial size | 2697 // Create the non_monomorphic_cache used in stub-cache.cc. The initial size |
2726 // is set to avoid expanding the dictionary during bootstrapping. | 2698 // is set to avoid expanding the dictionary during bootstrapping. |
2727 set_non_monomorphic_cache(*UnseededNumberDictionary::New(isolate(), 64)); | 2699 set_non_monomorphic_cache(*UnseededNumberDictionary::New(isolate(), 64)); |
2728 | 2700 |
2729 set_polymorphic_code_cache(PolymorphicCodeCache::cast( | |
2730 *factory->NewStruct(POLYMORPHIC_CODE_CACHE_TYPE))); | |
2731 | |
2732 set_instanceof_cache_function(Smi::FromInt(0)); | 2701 set_instanceof_cache_function(Smi::FromInt(0)); |
2733 set_instanceof_cache_map(Smi::FromInt(0)); | 2702 set_instanceof_cache_map(Smi::FromInt(0)); |
2734 set_instanceof_cache_answer(Smi::FromInt(0)); | 2703 set_instanceof_cache_answer(Smi::FromInt(0)); |
2735 | 2704 |
2736 { | 2705 { |
2737 HandleScope scope(isolate()); | 2706 HandleScope scope(isolate()); |
2738 #define SYMBOL_INIT(name) \ | 2707 #define SYMBOL_INIT(name) \ |
2739 { \ | 2708 { \ |
2740 Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ | 2709 Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ |
2741 Handle<Symbol> symbol(isolate()->factory()->NewPrivateSymbol()); \ | 2710 Handle<Symbol> symbol(isolate()->factory()->NewPrivateSymbol()); \ |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2925 | 2894 |
2926 | 2895 |
2927 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { | 2896 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { |
2928 switch (root_index) { | 2897 switch (root_index) { |
2929 case kNumberStringCacheRootIndex: | 2898 case kNumberStringCacheRootIndex: |
2930 case kInstanceofCacheFunctionRootIndex: | 2899 case kInstanceofCacheFunctionRootIndex: |
2931 case kInstanceofCacheMapRootIndex: | 2900 case kInstanceofCacheMapRootIndex: |
2932 case kInstanceofCacheAnswerRootIndex: | 2901 case kInstanceofCacheAnswerRootIndex: |
2933 case kCodeStubsRootIndex: | 2902 case kCodeStubsRootIndex: |
2934 case kNonMonomorphicCacheRootIndex: | 2903 case kNonMonomorphicCacheRootIndex: |
2935 case kPolymorphicCodeCacheRootIndex: | |
2936 case kEmptyScriptRootIndex: | 2904 case kEmptyScriptRootIndex: |
2937 case kSymbolRegistryRootIndex: | 2905 case kSymbolRegistryRootIndex: |
2938 case kScriptListRootIndex: | 2906 case kScriptListRootIndex: |
2939 case kMaterializedObjectsRootIndex: | 2907 case kMaterializedObjectsRootIndex: |
2940 case kMicrotaskQueueRootIndex: | 2908 case kMicrotaskQueueRootIndex: |
2941 case kDetachedContextsRootIndex: | 2909 case kDetachedContextsRootIndex: |
2942 case kWeakObjectToCodeTableRootIndex: | 2910 case kWeakObjectToCodeTableRootIndex: |
2943 case kRetainedMapsRootIndex: | 2911 case kRetainedMapsRootIndex: |
2944 case kNoScriptSharedFunctionInfosRootIndex: | 2912 case kNoScriptSharedFunctionInfosRootIndex: |
2945 case kWeakStackTraceListRootIndex: | 2913 case kWeakStackTraceListRootIndex: |
(...skipping 3511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6457 } | 6425 } |
6458 | 6426 |
6459 | 6427 |
6460 // static | 6428 // static |
6461 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6429 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6462 return StaticVisitorBase::GetVisitorId(map); | 6430 return StaticVisitorBase::GetVisitorId(map); |
6463 } | 6431 } |
6464 | 6432 |
6465 } // namespace internal | 6433 } // namespace internal |
6466 } // namespace v8 | 6434 } // namespace v8 |
OLD | NEW |