From 9842e8d66230e48b88941914413371ef99291343 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 22 Apr 2024 15:12:35 +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 --- 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