From 1f3fbd43b7e73e16cb383bda36663517bf20540b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 17 Apr 2018 17:47:09 +0200 Subject: [PATCH] src: remove `MarkIndependent()` calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method has been deprecated in upstream V8, with messaging indicating that it is the default for handles to be independent now anyway. PR-URL: https://github.com/nodejs/node/pull/20108 Refs: https://github.com/v8/v8/commit/71ad48fb8f214e80518ba0419796e4c571351255 Reviewed-By: Anatoli Papirovski Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina --- src/base_object-inl.h | 1 - src/node_api.cc | 2 -- src/node_buffer.cc | 1 - src/node_contextify.cc | 1 - src/node_object_wrap.h | 1 - 5 files changed, 6 deletions(-) diff --git a/src/base_object-inl.h b/src/base_object-inl.h index 51ef46599667df..5ff211f473b86b 100644 --- a/src/base_object-inl.h +++ b/src/base_object-inl.h @@ -70,7 +70,6 @@ inline void BaseObject::MakeWeak(Type* ptr) { v8::Local handle = object(); CHECK_GT(handle->InternalFieldCount(), 0); Wrap(handle, ptr); - persistent_handle_.MarkIndependent(); persistent_handle_.SetWeak(ptr, WeakCallback, v8::WeakCallbackType::kParameter); } diff --git a/src/node_api.cc b/src/node_api.cc index 3a02e5effa7a4f..ea7ddba77dc2e2 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -387,7 +387,6 @@ class Reference : private Finalizer { if (initial_refcount == 0) { _persistent.SetWeak( this, FinalizeCallback, v8::WeakCallbackType::kParameter); - _persistent.MarkIndependent(); } } @@ -431,7 +430,6 @@ class Reference : private Finalizer { if (--_refcount == 0) { _persistent.SetWeak( this, FinalizeCallback, v8::WeakCallbackType::kParameter); - _persistent.MarkIndependent(); } return _refcount; diff --git a/src/node_buffer.cc b/src/node_buffer.cc index b00886f5e680ba..38b473b8cedb55 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -144,7 +144,6 @@ CallbackInfo::CallbackInfo(Isolate* isolate, persistent_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); persistent_.SetWrapperClassId(BUFFER_ID); - persistent_.MarkIndependent(); isolate->AdjustAmountOfExternalAllocatedMemory(sizeof(*this)); } diff --git a/src/node_contextify.cc b/src/node_contextify.cc index ce235765018775..68251004d57a99 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -104,7 +104,6 @@ ContextifyContext::ContextifyContext( if (context_.IsEmpty()) return; context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); - context_.MarkIndependent(); } diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h index 37c759fb894f13..b8ed2f99135a65 100644 --- a/src/node_object_wrap.h +++ b/src/node_object_wrap.h @@ -83,7 +83,6 @@ class ObjectWrap { inline void MakeWeak(void) { persistent().SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); - persistent().MarkIndependent(); } /* Ref() marks the object as being attached to an event loop.