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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 marking->write_barriers_invoked_since_last_step_ += | 84 marking->write_barriers_invoked_since_last_step_ += |
85 MemoryChunk::kWriteBarrierCounterGranularity - | 85 MemoryChunk::kWriteBarrierCounterGranularity - |
86 chunk->write_barrier_counter(); | 86 chunk->write_barrier_counter(); |
87 chunk->set_write_barrier_counter( | 87 chunk->set_write_barrier_counter( |
88 MemoryChunk::kWriteBarrierCounterGranularity); | 88 MemoryChunk::kWriteBarrierCounterGranularity); |
89 } | 89 } |
90 | 90 |
91 marking->RecordWrite(obj, slot, *slot); | 91 marking->RecordWrite(obj, slot, *slot); |
92 } | 92 } |
93 | 93 |
| 94 // static |
| 95 void IncrementalMarking::RecordWriteOfCodeEntryFromCode(JSFunction* host, |
| 96 Object** slot, |
| 97 Isolate* isolate) { |
| 98 DCHECK(host->IsJSFunction()); |
| 99 IncrementalMarking* marking = isolate->heap()->incremental_marking(); |
| 100 Code* value = Code::cast( |
| 101 Code::GetObjectFromEntryAddress(reinterpret_cast<Address>(slot))); |
| 102 marking->RecordWriteOfCodeEntry(host, slot, value); |
| 103 } |
94 | 104 |
95 void IncrementalMarking::RecordCodeTargetPatch(Code* host, Address pc, | 105 void IncrementalMarking::RecordCodeTargetPatch(Code* host, Address pc, |
96 HeapObject* value) { | 106 HeapObject* value) { |
97 if (IsMarking()) { | 107 if (IsMarking()) { |
98 RelocInfo rinfo(heap_->isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 108 RelocInfo rinfo(heap_->isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
99 RecordWriteIntoCode(host, &rinfo, value); | 109 RecordWriteIntoCode(host, &rinfo, value); |
100 } | 110 } |
101 } | 111 } |
102 | 112 |
103 | 113 |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1235 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1226 idle_marking_delay_counter_++; | 1236 idle_marking_delay_counter_++; |
1227 } | 1237 } |
1228 | 1238 |
1229 | 1239 |
1230 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1240 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1231 idle_marking_delay_counter_ = 0; | 1241 idle_marking_delay_counter_ = 0; |
1232 } | 1242 } |
1233 } // namespace internal | 1243 } // namespace internal |
1234 } // namespace v8 | 1244 } // namespace v8 |
OLD | NEW |