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/context-slot-cache.h" | |
10 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
11 #include "src/base/once.h" | 10 #include "src/base/once.h" |
12 #include "src/base/utils/random-number-generator.h" | 11 #include "src/base/utils/random-number-generator.h" |
13 #include "src/bootstrapper.h" | 12 #include "src/bootstrapper.h" |
14 #include "src/codegen.h" | 13 #include "src/codegen.h" |
15 #include "src/compilation-cache.h" | 14 #include "src/compilation-cache.h" |
16 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" | 15 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" |
17 #include "src/conversions.h" | 16 #include "src/conversions.h" |
18 #include "src/debug/debug.h" | 17 #include "src/debug/debug.h" |
19 #include "src/deoptimizer.h" | 18 #include "src/deoptimizer.h" |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 mark_compact_collector()->marking_deque()->Uninitialize(); | 1467 mark_compact_collector()->marking_deque()->Uninitialize(); |
1469 mark_compact_collector()->EnsureMarkingDequeIsCommitted( | 1468 mark_compact_collector()->EnsureMarkingDequeIsCommitted( |
1470 MarkCompactCollector::kMinMarkingDequeSize); | 1469 MarkCompactCollector::kMinMarkingDequeSize); |
1471 } | 1470 } |
1472 | 1471 |
1473 | 1472 |
1474 void Heap::MarkCompactPrologue() { | 1473 void Heap::MarkCompactPrologue() { |
1475 // At any old GC clear the keyed lookup cache to enable collection of unused | 1474 // At any old GC clear the keyed lookup cache to enable collection of unused |
1476 // maps. | 1475 // maps. |
1477 isolate_->keyed_lookup_cache()->Clear(); | 1476 isolate_->keyed_lookup_cache()->Clear(); |
1478 isolate_->context_slot_cache()->Clear(); | |
1479 isolate_->descriptor_lookup_cache()->Clear(); | 1477 isolate_->descriptor_lookup_cache()->Clear(); |
1480 RegExpResultsCache::Clear(string_split_cache()); | 1478 RegExpResultsCache::Clear(string_split_cache()); |
1481 RegExpResultsCache::Clear(regexp_multiple_cache()); | 1479 RegExpResultsCache::Clear(regexp_multiple_cache()); |
1482 | 1480 |
1483 isolate_->compilation_cache()->MarkCompactPrologue(); | 1481 isolate_->compilation_cache()->MarkCompactPrologue(); |
1484 | 1482 |
1485 CompletelyClearInstanceofCache(); | 1483 CompletelyClearInstanceofCache(); |
1486 | 1484 |
1487 FlushNumberStringCache(); | 1485 FlushNumberStringCache(); |
1488 ClearNormalizedMapCaches(); | 1486 ClearNormalizedMapCaches(); |
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 | 2882 |
2885 set_serialized_templates(empty_fixed_array()); | 2883 set_serialized_templates(empty_fixed_array()); |
2886 | 2884 |
2887 set_weak_stack_trace_list(Smi::FromInt(0)); | 2885 set_weak_stack_trace_list(Smi::FromInt(0)); |
2888 | 2886 |
2889 set_noscript_shared_function_infos(Smi::FromInt(0)); | 2887 set_noscript_shared_function_infos(Smi::FromInt(0)); |
2890 | 2888 |
2891 // Initialize keyed lookup cache. | 2889 // Initialize keyed lookup cache. |
2892 isolate_->keyed_lookup_cache()->Clear(); | 2890 isolate_->keyed_lookup_cache()->Clear(); |
2893 | 2891 |
2894 // Initialize context slot cache. | |
2895 isolate_->context_slot_cache()->Clear(); | |
2896 | |
2897 // Initialize descriptor cache. | 2892 // Initialize descriptor cache. |
2898 isolate_->descriptor_lookup_cache()->Clear(); | 2893 isolate_->descriptor_lookup_cache()->Clear(); |
2899 | 2894 |
2900 // Initialize compilation cache. | 2895 // Initialize compilation cache. |
2901 isolate_->compilation_cache()->Clear(); | 2896 isolate_->compilation_cache()->Clear(); |
2902 } | 2897 } |
2903 | 2898 |
2904 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { | 2899 bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) { |
2905 switch (root_index) { | 2900 switch (root_index) { |
2906 case kNumberStringCacheRootIndex: | 2901 case kNumberStringCacheRootIndex: |
(...skipping 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6503 } | 6498 } |
6504 | 6499 |
6505 | 6500 |
6506 // static | 6501 // static |
6507 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6502 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6508 return StaticVisitorBase::GetVisitorId(map); | 6503 return StaticVisitorBase::GetVisitorId(map); |
6509 } | 6504 } |
6510 | 6505 |
6511 } // namespace internal | 6506 } // namespace internal |
6512 } // namespace v8 | 6507 } // namespace v8 |
OLD | NEW |