Line data Source code
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
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_HEAP_INCREMENTAL_MARKING_INL_H_
6 : #define V8_HEAP_INCREMENTAL_MARKING_INL_H_
7 :
8 : #include "src/heap/incremental-marking.h"
9 : #include "src/isolate.h"
10 :
11 : namespace v8 {
12 : namespace internal {
13 :
14 :
15 : void IncrementalMarking::RecordWrite(HeapObject* obj, Object** slot,
16 : Object* value) {
17 2584059881 : if (IsMarking() && value->IsHeapObject()) {
18 245250133 : RecordWriteSlow(obj, slot, value);
19 : }
20 : }
21 :
22 : void IncrementalMarking::RecordWrites(HeapObject* obj) {
23 2438101 : if (IsMarking()) {
24 287895 : if (FLAG_concurrent_marking || marking_state()->IsBlack(obj)) {
25 287800 : RevisitObject(obj);
26 : }
27 : }
28 : }
29 :
30 : void IncrementalMarking::RecordWriteIntoCode(Code* host, RelocInfo* rinfo,
31 : Object* value) {
32 12095276 : if (IsMarking() && value->IsHeapObject()) {
33 569540 : RecordWriteIntoCodeSlow(host, rinfo, value);
34 : }
35 : }
36 :
37 24500298 : void IncrementalMarking::RestartIfNotMarking() {
38 24500298 : if (state_ == COMPLETE) {
39 1403 : state_ = MARKING;
40 1403 : if (FLAG_trace_incremental_marking) {
41 : heap()->isolate()->PrintWithTimestamp(
42 0 : "[IncrementalMarking] Restarting (new grey objects)\n");
43 : }
44 : }
45 24500298 : }
46 :
47 : } // namespace internal
48 : } // namespace v8
49 :
50 : #endif // V8_HEAP_INCREMENTAL_MARKING_INL_H_
|