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 21 matching lines...) Expand all Loading... |
32 steps_count_(0), | 32 steps_count_(0), |
33 old_generation_space_available_at_start_of_incremental_(0), | 33 old_generation_space_available_at_start_of_incremental_(0), |
34 old_generation_space_used_at_start_of_incremental_(0), | 34 old_generation_space_used_at_start_of_incremental_(0), |
35 bytes_rescanned_(0), | 35 bytes_rescanned_(0), |
36 should_hurry_(false), | 36 should_hurry_(false), |
37 marking_speed_(0), | 37 marking_speed_(0), |
38 bytes_scanned_(0), | 38 bytes_scanned_(0), |
39 allocated_(0), | 39 allocated_(0), |
40 write_barriers_invoked_since_last_step_(0), | 40 write_barriers_invoked_since_last_step_(0), |
41 idle_marking_delay_counter_(0), | 41 idle_marking_delay_counter_(0), |
42 no_marking_scope_depth_(0), | |
43 unscanned_bytes_of_large_object_(0), | 42 unscanned_bytes_of_large_object_(0), |
44 was_activated_(false), | 43 was_activated_(false), |
45 black_allocation_(false), | 44 black_allocation_(false), |
46 finalize_marking_completed_(false), | 45 finalize_marking_completed_(false), |
47 incremental_marking_finalization_rounds_(0), | 46 incremental_marking_finalization_rounds_(0), |
48 request_type_(NONE) {} | 47 request_type_(NONE) {} |
49 | 48 |
50 bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object* value) { | 49 bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object* value) { |
51 HeapObject* value_heap_obj = HeapObject::cast(value); | 50 HeapObject* value_heap_obj = HeapObject::cast(value); |
52 MarkBit value_bit = Marking::MarkBitFrom(value_heap_obj); | 51 MarkBit value_bit = Marking::MarkBitFrom(value_heap_obj); |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 kWriteBarriersInvokedThreshold) { | 1144 kWriteBarriersInvokedThreshold) { |
1146 return 0; | 1145 return 0; |
1147 } | 1146 } |
1148 | 1147 |
1149 // If an idle notification happened recently, we delay marking steps. | 1148 // If an idle notification happened recently, we delay marking steps. |
1150 if (marking == DO_NOT_FORCE_MARKING && | 1149 if (marking == DO_NOT_FORCE_MARKING && |
1151 heap_->RecentIdleNotificationHappened()) { | 1150 heap_->RecentIdleNotificationHappened()) { |
1152 return 0; | 1151 return 0; |
1153 } | 1152 } |
1154 | 1153 |
1155 if (state_ == MARKING && no_marking_scope_depth_ > 0) return 0; | |
1156 | |
1157 intptr_t bytes_processed = 0; | 1154 intptr_t bytes_processed = 0; |
1158 { | 1155 { |
1159 HistogramTimerScope incremental_marking_scope( | 1156 HistogramTimerScope incremental_marking_scope( |
1160 heap_->isolate()->counters()->gc_incremental_marking()); | 1157 heap_->isolate()->counters()->gc_incremental_marking()); |
1161 TRACE_EVENT0("v8", "V8.GCIncrementalMarking"); | 1158 TRACE_EVENT0("v8", "V8.GCIncrementalMarking"); |
1162 double start = heap_->MonotonicallyIncreasingTimeInMs(); | 1159 double start = heap_->MonotonicallyIncreasingTimeInMs(); |
1163 | 1160 |
1164 // The marking speed is driven either by the allocation rate or by the rate | 1161 // The marking speed is driven either by the allocation rate or by the rate |
1165 // at which we are having to check the color of objects in the write | 1162 // at which we are having to check the color of objects in the write |
1166 // barrier. | 1163 // barrier. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1243 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1247 idle_marking_delay_counter_++; | 1244 idle_marking_delay_counter_++; |
1248 } | 1245 } |
1249 | 1246 |
1250 | 1247 |
1251 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1248 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1252 idle_marking_delay_counter_ = 0; | 1249 idle_marking_delay_counter_ = 0; |
1253 } | 1250 } |
1254 } // namespace internal | 1251 } // namespace internal |
1255 } // namespace v8 | 1252 } // namespace v8 |
OLD | NEW |