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