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

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

Issue 2492263002: [heap] Add atomics to mark bit operations. (Closed)
Patch Set: comment Created 3 years, 9 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 | « no previous file | 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/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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // It doesn't matter whether the object is black, since it hasn't changed 134 // It doesn't matter whether the object is black, since it hasn't changed
135 // size, so the adjustment to the live data count will be zero anyway. 135 // size, so the adjustment to the live data count will be zero anyway.
136 if (from == to) return; 136 if (from == to) return;
137 137
138 MarkBit new_mark_bit = ObjectMarking::MarkBitFrom(to); 138 MarkBit new_mark_bit = ObjectMarking::MarkBitFrom(to);
139 MarkBit old_mark_bit = ObjectMarking::MarkBitFrom(from); 139 MarkBit old_mark_bit = ObjectMarking::MarkBitFrom(from);
140 140
141 if (Marking::IsBlack(old_mark_bit)) { 141 if (Marking::IsBlack(old_mark_bit)) {
142 Marking::MarkBlack(new_mark_bit); 142 Marking::MarkBlack(new_mark_bit);
143 } else if (Marking::IsGrey(old_mark_bit)) { 143 } else if (Marking::IsGrey(old_mark_bit)) {
144 Marking::MarkGrey(new_mark_bit); 144 Marking::WhiteToGrey(new_mark_bit);
145 heap->mark_compact_collector()->marking_deque()->Push(to); 145 heap->mark_compact_collector()->marking_deque()->Push(to);
146 heap->incremental_marking()->RestartIfNotMarking(); 146 heap->incremental_marking()->RestartIfNotMarking();
147 } 147 }
148 } 148 }
149 149
150 class IncrementalMarkingMarkingVisitor 150 class IncrementalMarkingMarkingVisitor
151 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> { 151 : public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> {
152 public: 152 public:
153 static void Initialize() { 153 static void Initialize() {
154 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); 154 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize();
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 idle_marking_delay_counter_++; 1156 idle_marking_delay_counter_++;
1157 } 1157 }
1158 1158
1159 1159
1160 void IncrementalMarking::ClearIdleMarkingDelayCounter() { 1160 void IncrementalMarking::ClearIdleMarkingDelayCounter() {
1161 idle_marking_delay_counter_ = 0; 1161 idle_marking_delay_counter_ = 0;
1162 } 1162 }
1163 1163
1164 } // namespace internal 1164 } // namespace internal
1165 } // namespace v8 1165 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698