deps: patch V8 to 6.6.346.32

PR-URL: https://github.com/nodejs/node/pull/20748
Refs: https://github.com/v8/v8/compare/6.6.346.31...6.6.346.32
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
Myles Borins 2018-05-15 12:12:09 -04:00 committed by Ruben Bridgewater
parent 59f71ea4dd
commit 3424f71cc9
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
2 changed files with 17 additions and 9 deletions

View File

@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6 #define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 6 #define V8_MINOR_VERSION 6
#define V8_BUILD_NUMBER 346 #define V8_BUILD_NUMBER 346
#define V8_PATCH_LEVEL 31 #define V8_PATCH_LEVEL 32
// Use 1 for candidates and 0 otherwise. // Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.) // (Boolean macro values are not supported by all preprocessors.)

24
deps/v8/src/managed.h vendored
View File

@ -59,22 +59,30 @@ class Managed : public Foreign {
isolate->factory()->NewForeign(reinterpret_cast<Address>(finalizer))); isolate->factory()->NewForeign(reinterpret_cast<Address>(finalizer)));
Handle<Object> global_handle = isolate->global_handles()->Create(*handle); Handle<Object> global_handle = isolate->global_handles()->Create(*handle);
finalizer->global_handle_location = global_handle.location(); finalizer->global_handle_location = global_handle.location();
GlobalHandles::MakeWeak(finalizer->global_handle_location, GlobalHandles::MakeWeak(
handle->GetFinalizer(), &Managed<CppType>::GCDelete, finalizer->global_handle_location, handle->GetFinalizer(),
v8::WeakCallbackType::kParameter); &ResetWeakAndScheduleGCDelete, v8::WeakCallbackType::kParameter);
return handle; return handle;
} }
private: private:
static void ResetWeakAndScheduleGCDelete(
const v8::WeakCallbackInfo<void>& data) {
FinalizerWithHandle* finalizer =
reinterpret_cast<FinalizerWithHandle*>(data.GetParameter());
GlobalHandles::Destroy(finalizer->global_handle_location);
Isolate* isolate = reinterpret_cast<Isolate*>(data.GetIsolate());
isolate->UnregisterFromReleaseAtTeardown(finalizer);
// We need to call GCDelete as a second pass callback because
// it can trigger garbage collection. The first pass callbacks
// are not allowed to invoke V8 API.
data.SetSecondPassCallback(&GCDelete);
}
static void GCDelete(const v8::WeakCallbackInfo<void>& data) { static void GCDelete(const v8::WeakCallbackInfo<void>& data) {
FinalizerWithHandle* finalizer = FinalizerWithHandle* finalizer =
reinterpret_cast<FinalizerWithHandle*>(data.GetParameter()); reinterpret_cast<FinalizerWithHandle*>(data.GetParameter());
Isolate* isolate = reinterpret_cast<Isolate*>(data.GetIsolate());
isolate->UnregisterFromReleaseAtTeardown(finalizer);
GlobalHandles::Destroy(finalizer->global_handle_location);
NativeDelete(finalizer); NativeDelete(finalizer);
} }