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

Unified Diff: src/api.cc

Issue 2798923004: Call PersistentHandleVisitor directly instead of using ObjectVisitor. (Closed)
Patch Set: 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 | « no previous file | src/global-handles.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index ae42da4ae6dbd09d300b2b4dcedd53455efc3ac2..43be499b3d88ff78ce7c5d16791a7dcac0ee5c03 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -8796,30 +8796,10 @@ bool Isolate::IsInUse() {
}
-class VisitorAdapter : public i::ObjectVisitor {
- public:
- explicit VisitorAdapter(PersistentHandleVisitor* visitor)
- : visitor_(visitor) {}
- void VisitPointers(i::Object** start, i::Object** end) override {
- UNREACHABLE();
- }
- DISABLE_CFI_PERF
- void VisitEmbedderReference(i::Object** p, uint16_t class_id) override {
- Value* value = ToApi<Value>(i::Handle<i::Object>(p));
- visitor_->VisitPersistentHandle(
- reinterpret_cast<Persistent<Value>*>(&value), class_id);
- }
-
- private:
- PersistentHandleVisitor* visitor_;
-};
-
-
void Isolate::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
i::DisallowHeapAllocation no_allocation;
- VisitorAdapter visitor_adapter(visitor);
- isolate->global_handles()->IterateAllRootsWithClassIds(&visitor_adapter);
+ isolate->global_handles()->IterateAllRootsWithClassIds(visitor);
}
@@ -8827,18 +8807,14 @@ void Isolate::VisitHandlesForPartialDependence(
PersistentHandleVisitor* visitor) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
i::DisallowHeapAllocation no_allocation;
- VisitorAdapter visitor_adapter(visitor);
- isolate->global_handles()->IterateAllRootsInNewSpaceWithClassIds(
- &visitor_adapter);
+ isolate->global_handles()->IterateAllRootsInNewSpaceWithClassIds(visitor);
}
void Isolate::VisitWeakHandles(PersistentHandleVisitor* visitor) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
i::DisallowHeapAllocation no_allocation;
- VisitorAdapter visitor_adapter(visitor);
- isolate->global_handles()->IterateWeakRootsInNewSpaceWithClassIds(
- &visitor_adapter);
+ isolate->global_handles()->IterateWeakRootsInNewSpaceWithClassIds(visitor);
}
« no previous file with comments | « no previous file | src/global-handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698