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/incremental-marking.h" | 5 #include "src/heap/incremental-marking.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
10 #include "src/heap/gc-idle-time-handler.h" | 10 #include "src/heap/gc-idle-time-handler.h" |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 double delta = end - start; | 923 double delta = end - start; |
924 heap_->tracer()->AddMarkingTime(delta); | 924 heap_->tracer()->AddMarkingTime(delta); |
925 if (FLAG_trace_incremental_marking) { | 925 if (FLAG_trace_incremental_marking) { |
926 PrintF("[IncrementalMarking] Complete (hurry), spent %d ms.\n", | 926 PrintF("[IncrementalMarking] Complete (hurry), spent %d ms.\n", |
927 static_cast<int>(delta)); | 927 static_cast<int>(delta)); |
928 } | 928 } |
929 } | 929 } |
930 } | 930 } |
931 | 931 |
932 Object* context = heap_->native_contexts_list(); | 932 Object* context = heap_->native_contexts_list(); |
933 while (!context->IsUndefined()) { | 933 while (!context->IsUndefined(heap_->isolate())) { |
934 // GC can happen when the context is not fully initialized, | 934 // GC can happen when the context is not fully initialized, |
935 // so the cache can be undefined. | 935 // so the cache can be undefined. |
936 HeapObject* cache = HeapObject::cast( | 936 HeapObject* cache = HeapObject::cast( |
937 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX)); | 937 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX)); |
938 if (!cache->IsUndefined()) { | 938 if (!cache->IsUndefined(heap_->isolate())) { |
939 MarkBit mark_bit = Marking::MarkBitFrom(cache); | 939 MarkBit mark_bit = Marking::MarkBitFrom(cache); |
940 if (Marking::IsGrey(mark_bit)) { | 940 if (Marking::IsGrey(mark_bit)) { |
941 Marking::GreyToBlack(mark_bit); | 941 Marking::GreyToBlack(mark_bit); |
942 MemoryChunk::IncrementLiveBytesFromGC(cache, cache->Size()); | 942 MemoryChunk::IncrementLiveBytesFromGC(cache, cache->Size()); |
943 } | 943 } |
944 } | 944 } |
945 context = Context::cast(context)->next_context_link(); | 945 context = Context::cast(context)->next_context_link(); |
946 } | 946 } |
947 } | 947 } |
948 | 948 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1245 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1246 idle_marking_delay_counter_++; | 1246 idle_marking_delay_counter_++; |
1247 } | 1247 } |
1248 | 1248 |
1249 | 1249 |
1250 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1250 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1251 idle_marking_delay_counter_ = 0; | 1251 idle_marking_delay_counter_ = 0; |
1252 } | 1252 } |
1253 } // namespace internal | 1253 } // namespace internal |
1254 } // namespace v8 | 1254 } // namespace v8 |
OLD | NEW |