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

Unified Diff: src/profiler/heap-snapshot-generator.cc

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | src/snapshot/code-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/heap-snapshot-generator.cc
diff --git a/src/profiler/heap-snapshot-generator.cc b/src/profiler/heap-snapshot-generator.cc
index b360fccdfe3e6a5f588fc8af6c4ac21d7e56ae2f..5da78c7fb8ae62fa898d6b6ef4a186c40f9a63b5 100644
--- a/src/profiler/heap-snapshot-generator.cc
+++ b/src/profiler/heap-snapshot-generator.cc
@@ -18,6 +18,7 @@
#include "src/profiler/heap-snapshot-generator-inl.h"
#include "src/prototype.h"
#include "src/transitions.h"
+#include "src/visitors.h"
namespace v8 {
namespace internal {
@@ -1685,8 +1686,7 @@ HeapEntry* V8HeapExplorer::GetEntry(Object* obj) {
return filler_->FindOrAddEntry(obj, this);
}
-
-class RootsReferencesExtractor : public ObjectVisitor {
+class RootsReferencesExtractor : public RootVisitor {
private:
struct IndexTag {
IndexTag(int index, VisitorSynchronization::SyncTag tag)
@@ -1702,7 +1702,7 @@ class RootsReferencesExtractor : public ObjectVisitor {
heap_(heap) {
}
- void VisitPointers(Object** start, Object** end) override {
+ void VisitRootPointers(Root root, Object** start, Object** end) override {
if (collecting_all_references_) {
for (Object** p = start; p < end; p++) all_references_.Add(*p);
} else {
@@ -2147,9 +2147,9 @@ void V8HeapExplorer::TagFixedArraySubType(const FixedArray* array,
array_types_[array] = type;
}
-class GlobalObjectsEnumerator : public ObjectVisitor {
+class GlobalObjectsEnumerator : public RootVisitor {
public:
- void VisitPointers(Object** start, Object** end) override {
+ void VisitRootPointers(Root root, Object** start, Object** end) override {
for (Object** p = start; p < end; p++) {
if ((*p)->IsNativeContext()) {
Context* context = Context::cast(*p);
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | src/snapshot/code-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698