Skip to content

Commit 7e6d923

Browse files
joyeecheungmarco-ippolito
authored andcommittedMay 3, 2024
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<v8::Data>) in a follow-up. Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5403888 PR-URL: #52638 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
1 parent 7d1f304 commit 7e6d923

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/memory_tracker-inl.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class MemoryRetainerNode : public v8::EmbedderGraph::Node {
2828
CHECK_NOT_NULL(retainer_);
2929
v8::HandleScope handle_scope(tracker->isolate());
3030
v8::Local<v8::Object> obj = retainer_->WrappedObject();
31-
if (!obj.IsEmpty()) wrapper_node_ = tracker->graph()->V8Node(obj);
31+
if (!obj.IsEmpty())
32+
wrapper_node_ = tracker->graph()->V8Node(obj.As<v8::Value>());
3233

3334
name_ = retainer_->MemoryInfoName();
3435
size_ = retainer_->SelfSize();
@@ -230,7 +231,9 @@ void MemoryTracker::TrackField(const char* edge_name,
230231
const v8::Local<T>& value,
231232
const char* node_name) {
232233
if (!value.IsEmpty())
233-
graph_->AddEdge(CurrentNode(), graph_->V8Node(value), edge_name);
234+
graph_->AddEdge(CurrentNode(),
235+
graph_->V8Node(value.template As<v8::Value>()),
236+
edge_name);
234237
}
235238

236239
template <typename T>

0 commit comments

Comments
 (0)
Please sign in to comment.