From 14682d8be72da57391ac94d33058bb164e51c77f Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 23 Jul 2016 10:54:10 +0000 Subject: [PATCH] v8 5.1 => 5.2 git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3279 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- SConstruct | 2 +- src/Database.cpp | 4 ++-- src/Database.h | 2 +- src/Socket.cpp | 4 ++-- src/Socket.h | 2 +- src/Task.cpp | 15 ++++++++------- src/TaskStub.cpp | 5 +++-- src/TaskStub.h | 2 +- src/TlsContextWrapper.cpp | 4 ++-- src/TlsContextWrapper.h | 2 +- tools/update-deps | 2 +- 11 files changed, 23 insertions(+), 21 deletions(-) diff --git a/SConstruct b/SConstruct index 0c2dc4335..579e65e08 100644 --- a/SConstruct +++ b/SConstruct @@ -51,7 +51,7 @@ else: env.Append(LINKFLAGS=['-g']) env.Append(LIBPATH=[ os.path.join(v8, 'out/native/obj.target/third_party/icu'), - os.path.join(v8, 'out/native/obj.target/tools/gyp'), + os.path.join(v8, 'out/native/obj.target/src'), os.path.join(uv, 'out/Debug/obj.target'), ]) diff --git a/src/Database.cpp b/src/Database.cpp index ffba77248..011de798d 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -167,7 +167,7 @@ void Database::getAll(const v8::FunctionCallbackInfo& args) { } } -void Database::onRelease(const v8::WeakCallbackData& data) { +void Database::onRelease(const v8::WeakCallbackInfo& data) { data.GetParameter()->_object.Reset(); delete data.GetParameter(); } @@ -181,7 +181,7 @@ void Database::ref() { void Database::release() { assert(_refCount >= 1); if (--_refCount == 0) { - _object.SetWeak(this, onRelease); + _object.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter); } } diff --git a/src/Database.h b/src/Database.h index e4bd5d5ac..d4f4394b3 100644 --- a/src/Database.h +++ b/src/Database.h @@ -26,7 +26,7 @@ private: static int _count; static Database* get(v8::Handle databaseObject); - static void onRelease(const v8::WeakCallbackData& data); + static void onRelease(const v8::WeakCallbackInfo& data); static void get(const v8::FunctionCallbackInfo& args); static void set(const v8::FunctionCallbackInfo& args); diff --git a/src/Socket.cpp b/src/Socket.cpp index a6cde6f8c..6ed173986 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -643,11 +643,11 @@ void Socket::ref() { void Socket::release() { assert(_refCount >= 1); if (--_refCount == 0) { - _object.SetWeak(this, onRelease); + _object.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter); } } -void Socket::onRelease(const v8::WeakCallbackData& data) { +void Socket::onRelease(const v8::WeakCallbackInfo& data) { data.GetParameter()->_object.Reset(); data.GetParameter()->close(); } diff --git a/src/Socket.h b/src/Socket.h index b2fa0b254..0a5bb3d54 100644 --- a/src/Socket.h +++ b/src/Socket.h @@ -72,7 +72,7 @@ private: static void allocateBuffer(uv_handle_t* handle, size_t suggestedSize, uv_buf_t* buffer); static void onRead(uv_stream_t* stream, ssize_t readSize, const uv_buf_t* buffer); static void onWrite(uv_write_t* request, int status); - static void onRelease(const v8::WeakCallbackData& data); + static void onRelease(const v8::WeakCallbackInfo& data); void processTlsShutdown(promiseid_t promise); static void onTlsShutdown(uv_write_t* request, int status); diff --git a/src/Task.cpp b/src/Task.cpp index 966c8c0a5..208e09dee 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -62,7 +62,7 @@ struct ImportRecord { _task(taskId), _owner(owner), _useCount(0) { - _persistent.SetWeak(this, ImportRecord::onRelease); + _persistent.SetWeak(this, ImportRecord::onRelease, v8::WeakCallbackType::kParameter); } void ref() { @@ -75,11 +75,11 @@ struct ImportRecord { void release() { if (--_useCount == 0) { // All in-flight calls are finished. Make weak. - _persistent.SetWeak(this, ImportRecord::onRelease); + _persistent.SetWeak(this, ImportRecord::onRelease, v8::WeakCallbackType::kParameter); } } - static void onRelease(const v8::WeakCallbackData& data) { + static void onRelease(const v8::WeakCallbackInfo& data) { ImportRecord* import = data.GetParameter(); import->_owner->releaseExport(import->_task, import->_export); for (size_t i = 0; i < import->_owner->_imports.size(); ++i) { @@ -513,11 +513,12 @@ void Task::rejectPromise(promiseid_t promise, v8::Handle value) { exportid_t Task::exportFunction(v8::Handle function) { exportid_t exportId = -1; v8::Handle exportName = v8::String::NewFromUtf8(_isolate, "export"); + v8::Local privateKey = v8::Private::ForApi(_isolate, exportName); - v8::Local value = function->GetHiddenValue(exportName); - if (!value.IsEmpty() && value->IsNumber()) + v8::MaybeLocal value = function->GetPrivate(_isolate->GetCurrentContext(), privateKey); + if (!value.IsEmpty() && value.ToLocalChecked()->IsNumber()) { - exportid_t foundId = value->ToInteger(_isolate)->Int32Value(); + exportid_t foundId = value.ToLocalChecked()->ToInteger(_isolate)->Int32Value(); if (_exports[foundId]) { exportId = foundId; } @@ -528,7 +529,7 @@ exportid_t Task::exportFunction(v8::Handle function) { exportId = _nextExport++; } while (_exports[_nextExport]); ExportRecord* record = new ExportRecord(_isolate, function); - function->SetHiddenValue(exportName, v8::Integer::New(_isolate, exportId)); + function->SetPrivate(_isolate->GetCurrentContext(), privateKey, v8::Integer::New(_isolate, exportId)); _exports[exportId] = record; } diff --git a/src/TaskStub.cpp b/src/TaskStub.cpp index faf909642..e1ae016da 100644 --- a/src/TaskStub.cpp +++ b/src/TaskStub.cpp @@ -42,7 +42,7 @@ void TaskStub::ref() { void TaskStub::release() { if (--_refCount == 0) { - _taskObject.SetWeak(this, onRelease); + _taskObject.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter); } } @@ -162,7 +162,8 @@ void TaskStub::onProcessExit(uv_process_t* process, int64_t status, int terminat uv_close(reinterpret_cast(process), 0); } -void TaskStub::onRelease(const v8::WeakCallbackData& data) { +void TaskStub::onRelease(const v8::WeakCallbackInfo& data) { + // XXX? } void TaskStub::getExports(const v8::FunctionCallbackInfo& args) { diff --git a/src/TaskStub.h b/src/TaskStub.h index 97bf9a3e6..b1447e0cb 100644 --- a/src/TaskStub.h +++ b/src/TaskStub.h @@ -54,7 +54,7 @@ private: static void kill(const v8::FunctionCallbackInfo& args); static void statistics(const v8::FunctionCallbackInfo& args); - static void onRelease(const v8::WeakCallbackData& data); + static void onRelease(const v8::WeakCallbackInfo& data); static void onProcessExit(uv_process_t* process, int64_t status, int terminationSignal); }; diff --git a/src/TlsContextWrapper.cpp b/src/TlsContextWrapper.cpp index 162310bba..b1bda7b4d 100644 --- a/src/TlsContextWrapper.cpp +++ b/src/TlsContextWrapper.cpp @@ -49,7 +49,7 @@ void TlsContextWrapper::close() { } } -void TlsContextWrapper::onRelease(const v8::WeakCallbackData& data) { +void TlsContextWrapper::onRelease(const v8::WeakCallbackInfo& data) { data.GetParameter()->_object.Reset(); delete data.GetParameter(); } @@ -84,7 +84,7 @@ void TlsContextWrapper::ref() { void TlsContextWrapper::release() { assert(_refCount >= 1); if (--_refCount == 0) { - _object.SetWeak(this, onRelease); + _object.SetWeak(this, onRelease, v8::WeakCallbackType::kParameter); } } diff --git a/src/TlsContextWrapper.h b/src/TlsContextWrapper.h index 32db80f51..9f442d173 100644 --- a/src/TlsContextWrapper.h +++ b/src/TlsContextWrapper.h @@ -17,7 +17,7 @@ public: static void setPrivateKey(const v8::FunctionCallbackInfo& args); static void addTrustedCertificate(const v8::FunctionCallbackInfo& args); - static void onRelease(const v8::WeakCallbackData& data); + static void onRelease(const v8::WeakCallbackInfo& data); TlsContext* getContext() { return _context; } diff --git a/tools/update-deps b/tools/update-deps index de57aa670..fbaa289c4 100755 --- a/tools/update-deps +++ b/tools/update-deps @@ -25,7 +25,7 @@ kUvBranch = 'v1.9.1' kUvWork = 'uv' kV8Repository = 'https://github.com/v8/v8.git' -kV8Branch = 'branch-heads/5.1' +kV8Branch = 'branch-heads/5.2' kV8Work = 'v8' cores = multiprocessing.cpu_count()