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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/heap/incremental-marking.h" | 7 #include "src/heap/incremental-marking.h" |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
11 #include "src/conversions.h" | 11 #include "src/conversions.h" |
12 #include "src/heap/objects-visiting.h" | 12 #include "src/heap/objects-visiting.h" |
13 #include "src/heap/objects-visiting-inl.h" | 13 #include "src/heap/objects-visiting-inl.h" |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 | 17 |
18 | 18 |
19 IncrementalMarking::StepActions IncrementalMarking::NoForcedStepActions() { | 19 IncrementalMarking::StepActions IncrementalMarking::NoForcedStepActions() { |
20 return StepActions(IncrementalMarking::NO_GC_VIA_STACK_GUARD, | 20 return StepActions(IncrementalMarking::NO_GC_VIA_STACK_GUARD, |
21 IncrementalMarking::DO_NOT_FORCE_MARKING, | 21 IncrementalMarking::DO_NOT_FORCE_MARKING, |
22 IncrementalMarking::DO_NOT_FORCE_COMPLETION); | 22 IncrementalMarking::DO_NOT_FORCE_COMPLETION); |
23 } | 23 } |
24 | 24 |
25 | 25 |
26 IncrementalMarking::IncrementalMarking(Heap* heap) | 26 IncrementalMarking::IncrementalMarking(Heap* heap) |
27 : heap_(heap), | 27 : heap_(heap), |
28 state_(STOPPED), | 28 state_(STOPPED), |
| 29 is_compacting_(false), |
29 steps_count_(0), | 30 steps_count_(0), |
30 old_generation_space_available_at_start_of_incremental_(0), | 31 old_generation_space_available_at_start_of_incremental_(0), |
31 old_generation_space_used_at_start_of_incremental_(0), | 32 old_generation_space_used_at_start_of_incremental_(0), |
| 33 bytes_rescanned_(0), |
32 should_hurry_(false), | 34 should_hurry_(false), |
33 marking_speed_(0), | 35 marking_speed_(0), |
| 36 bytes_scanned_(0), |
34 allocated_(0), | 37 allocated_(0), |
| 38 write_barriers_invoked_since_last_step_(0), |
35 idle_marking_delay_counter_(0), | 39 idle_marking_delay_counter_(0), |
36 no_marking_scope_depth_(0), | 40 no_marking_scope_depth_(0), |
37 unscanned_bytes_of_large_object_(0), | 41 unscanned_bytes_of_large_object_(0), |
38 was_activated_(false), | 42 was_activated_(false), |
39 weak_closure_was_overapproximated_(false), | 43 weak_closure_was_overapproximated_(false), |
40 weak_closure_approximation_rounds_(0), | 44 weak_closure_approximation_rounds_(0), |
41 request_type_(COMPLETE_MARKING) {} | 45 request_type_(COMPLETE_MARKING), |
| 46 gc_callback_flags_(kNoGCCallbackFlags) {} |
42 | 47 |
43 | 48 |
44 void IncrementalMarking::RecordWriteSlow(HeapObject* obj, Object** slot, | 49 void IncrementalMarking::RecordWriteSlow(HeapObject* obj, Object** slot, |
45 Object* value) { | 50 Object* value) { |
46 if (BaseRecordWrite(obj, slot, value) && slot != NULL) { | 51 if (BaseRecordWrite(obj, slot, value) && slot != NULL) { |
47 MarkBit obj_bit = Marking::MarkBitFrom(obj); | 52 MarkBit obj_bit = Marking::MarkBitFrom(obj); |
48 if (Marking::IsBlack(obj_bit)) { | 53 if (Marking::IsBlack(obj_bit)) { |
49 // Object is not going to be rescanned we need to record the slot. | 54 // Object is not going to be rescanned we need to record the slot. |
50 heap_->mark_compact_collector()->RecordSlot(obj, slot, value); | 55 heap_->mark_compact_collector()->RecordSlot(obj, slot, value); |
51 } | 56 } |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1025 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1021 idle_marking_delay_counter_++; | 1026 idle_marking_delay_counter_++; |
1022 } | 1027 } |
1023 | 1028 |
1024 | 1029 |
1025 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1030 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1026 idle_marking_delay_counter_ = 0; | 1031 idle_marking_delay_counter_ = 0; |
1027 } | 1032 } |
1028 } // namespace internal | 1033 } // namespace internal |
1029 } // namespace v8 | 1034 } // namespace v8 |
OLD | NEW |