Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Side by Side Diff: src/heap/incremental-marking.cc

Issue 1040443002: MarkBit cleanup: They have to be accessed through Marking accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 } 135 }
136 136
137 137
138 static inline void MarkBlackOrKeepBlack(HeapObject* heap_object, 138 static inline void MarkBlackOrKeepBlack(HeapObject* heap_object,
139 MarkBit mark_bit, int size) { 139 MarkBit mark_bit, int size) {
140 DCHECK(!Marking::IsImpossible(mark_bit)); 140 DCHECK(!Marking::IsImpossible(mark_bit));
141 if (Marking::IsBlack(mark_bit)) return; 141 if (Marking::IsBlack(mark_bit)) return;
142 Marking::MarkBlack(mark_bit); 142 Marking::MarkBlack(mark_bit);
143 MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(), size); 143 MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(), size);
144 DCHECK(Marking::IsBlack(mark_bit));
145 } 144 }
146 145
147 146
148 class IncrementalMarkingMarkingVisitor 147 class IncrementalMarkingMarkingVisitor
149 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> { 148 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> {
150 public: 149 public:
151 static void Initialize() { 150 static void Initialize() {
152 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); 151 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize();
153 table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental); 152 table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental);
154 table_.Register(kVisitNativeContext, &VisitNativeContextIncremental); 153 table_.Register(kVisitNativeContext, &VisitNativeContextIncremental);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 INLINE(static void MarkObject(Heap* heap, Object* obj)) { 243 INLINE(static void MarkObject(Heap* heap, Object* obj)) {
245 IncrementalMarking::MarkObject(heap, HeapObject::cast(obj)); 244 IncrementalMarking::MarkObject(heap, HeapObject::cast(obj));
246 } 245 }
247 246
248 // Marks the object black without pushing it on the marking stack. 247 // Marks the object black without pushing it on the marking stack.
249 // Returns true if object needed marking and false otherwise. 248 // Returns true if object needed marking and false otherwise.
250 INLINE(static bool MarkObjectWithoutPush(Heap* heap, Object* obj)) { 249 INLINE(static bool MarkObjectWithoutPush(Heap* heap, Object* obj)) {
251 HeapObject* heap_object = HeapObject::cast(obj); 250 HeapObject* heap_object = HeapObject::cast(obj);
252 MarkBit mark_bit = Marking::MarkBitFrom(heap_object); 251 MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
253 if (Marking::IsWhite(mark_bit)) { 252 if (Marking::IsWhite(mark_bit)) {
254 mark_bit.Set(); 253 Marking::MarkBlack(mark_bit);
255 MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(), 254 MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(),
256 heap_object->Size()); 255 heap_object->Size());
257 return true; 256 return true;
258 } 257 }
259 return false; 258 return false;
260 } 259 }
261 }; 260 };
262 261
263 262
264 class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor { 263 class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor {
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { 1010 void IncrementalMarking::IncrementIdleMarkingDelayCounter() {
1012 idle_marking_delay_counter_++; 1011 idle_marking_delay_counter_++;
1013 } 1012 }
1014 1013
1015 1014
1016 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1015 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1017 idle_marking_delay_counter_ = 0; 1016 idle_marking_delay_counter_ = 0;
1018 } 1017 }
1019 } 1018 }
1020 } // namespace v8::internal 1019 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698