From e20d2f1de349aadde951c46fa8b2f17fe29fb44d Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 25 Apr 2024 18:52:01 +0200 Subject: [PATCH] src: cast to v8::Value before using v8::EmbedderGraph::V8Node This is required to disambiguate the call site for an upstream patch to support v8::Data in traced references and pass the Node.js integration in the V8 CI. When that lands in the upstream we can implement V8Node(const v8::Local) in a follow-up. Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5403888 PR-URL: https://github.com/nodejs/node/pull/52638 Reviewed-By: Chengzhong Wu Reviewed-By: Antoine du Hamel Reviewed-By: Anna Henningsen Reviewed-By: Yagiz Nizipli --- src/memory_tracker-inl.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/memory_tracker-inl.h b/src/memory_tracker-inl.h index 0e4f2870a5aae5..c99ff8607100ba 100644 --- a/src/memory_tracker-inl.h +++ b/src/memory_tracker-inl.h @@ -28,7 +28,8 @@ class MemoryRetainerNode : public v8::EmbedderGraph::Node { CHECK_NOT_NULL(retainer_); v8::HandleScope handle_scope(tracker->isolate()); v8::Local obj = retainer_->WrappedObject(); - if (!obj.IsEmpty()) wrapper_node_ = tracker->graph()->V8Node(obj); + if (!obj.IsEmpty()) + wrapper_node_ = tracker->graph()->V8Node(obj.As()); name_ = retainer_->MemoryInfoName(); size_ = retainer_->SelfSize(); @@ -230,7 +231,9 @@ void MemoryTracker::TrackField(const char* edge_name, const v8::Local& value, const char* node_name) { if (!value.IsEmpty()) - graph_->AddEdge(CurrentNode(), graph_->V8Node(value), edge_name); + graph_->AddEdge(CurrentNode(), + graph_->V8Node(value.template As()), + edge_name); } template