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 // TODO(mvstanton): Verify that we only come in here when we _need_ to be |
| 103 // here, the slow case should be dealt with before calling into C. |
| 104 marking->RecordWriteOfCodeEntry(host, slot, value); |
| 105 } |
94 | 106 |
95 void IncrementalMarking::RecordCodeTargetPatch(Code* host, Address pc, | 107 void IncrementalMarking::RecordCodeTargetPatch(Code* host, Address pc, |
96 HeapObject* value) { | 108 HeapObject* value) { |
97 if (IsMarking()) { | 109 if (IsMarking()) { |
98 RelocInfo rinfo(heap_->isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 110 RelocInfo rinfo(heap_->isolate(), pc, RelocInfo::CODE_TARGET, 0, host); |
99 RecordWriteIntoCode(host, &rinfo, value); | 111 RecordWriteIntoCode(host, &rinfo, value); |
100 } | 112 } |
101 } | 113 } |
102 | 114 |
103 | 115 |
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1258 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1247 idle_marking_delay_counter_++; | 1259 idle_marking_delay_counter_++; |
1248 } | 1260 } |
1249 | 1261 |
1250 | 1262 |
1251 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1263 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1252 idle_marking_delay_counter_ = 0; | 1264 idle_marking_delay_counter_ = 0; |
1253 } | 1265 } |
1254 } // namespace internal | 1266 } // namespace internal |
1255 } // namespace v8 | 1267 } // namespace v8 |
OLD | NEW |