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

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

Issue 2810653002: Add a host parameter to ObjectVisitor methods. (Closed)
Patch Set: rebase Created 3 years, 7 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/arm64/assembler-arm64-inl.h ('k') | src/heap/heap.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 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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/concurrent-marking.h" 5 #include "src/heap/concurrent-marking.h"
6 6
7 #include <stack> 7 #include <stack>
8 #include <unordered_map> 8 #include <unordered_map>
9 9
10 #include "src/heap/heap-inl.h" 10 #include "src/heap/heap-inl.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 void FreeBitmap(Bitmap* bitmap) { free(bitmap); } 47 void FreeBitmap(Bitmap* bitmap) { free(bitmap); }
48 48
49 private: 49 private:
50 std::unordered_map<MemoryChunk*, Bitmap*> bitmap_; 50 std::unordered_map<MemoryChunk*, Bitmap*> bitmap_;
51 }; 51 };
52 52
53 class ConcurrentMarkingVisitor : public ObjectVisitor { 53 class ConcurrentMarkingVisitor : public ObjectVisitor {
54 public: 54 public:
55 ConcurrentMarkingVisitor() : bytes_marked_(0) {} 55 ConcurrentMarkingVisitor() : bytes_marked_(0) {}
56 56
57 void VisitPointers(Object** start, Object** end) override { 57 void VisitPointers(HeapObject* host, Object** start, Object** end) override {
58 for (Object** p = start; p < end; p++) { 58 for (Object** p = start; p < end; p++) {
59 if (!(*p)->IsHeapObject()) continue; 59 if (!(*p)->IsHeapObject()) continue;
60 MarkObject(HeapObject::cast(*p)); 60 MarkObject(HeapObject::cast(*p));
61 } 61 }
62 } 62 }
63 63
64 void MarkObject(HeapObject* obj) { 64 void MarkObject(HeapObject* obj) {
65 if (markbits_.Mark(obj)) { 65 if (markbits_.Mark(obj)) {
66 bytes_marked_ += obj->Size(); 66 bytes_marked_ += obj->Size();
67 marking_stack_.push(obj); 67 marking_stack_.push(obj);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 void ConcurrentMarking::EnsureTaskCompleted() { 154 void ConcurrentMarking::EnsureTaskCompleted() {
155 if (IsTaskPending()) { 155 if (IsTaskPending()) {
156 WaitForTaskToComplete(); 156 WaitForTaskToComplete();
157 } 157 }
158 } 158 }
159 159
160 } // namespace internal 160 } // namespace internal
161 } // namespace v8 161 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/assembler-arm64-inl.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698