v8 5.1 => 5.2

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3279 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2016-07-23 10:54:10 +00:00
parent ef1fa591e5
commit 14682d8be7
11 changed files with 23 additions and 21 deletions

View File

@ -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'),
])

View File

@ -167,7 +167,7 @@ void Database::getAll(const v8::FunctionCallbackInfo<v8::Value>& args) {
}
}
void Database::onRelease(const v8::WeakCallbackData<v8::Object, Database>& data) {
void Database::onRelease(const v8::WeakCallbackInfo<Database>& 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);
}
}

View File

@ -26,7 +26,7 @@ private:
static int _count;
static Database* get(v8::Handle<v8::Value> databaseObject);
static void onRelease(const v8::WeakCallbackData<v8::Object, Database>& data);
static void onRelease(const v8::WeakCallbackInfo<Database>& data);
static void get(const v8::FunctionCallbackInfo<v8::Value>& args);
static void set(const v8::FunctionCallbackInfo<v8::Value>& args);

View File

@ -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<v8::Object, Socket>& data) {
void Socket::onRelease(const v8::WeakCallbackInfo<Socket>& data) {
data.GetParameter()->_object.Reset();
data.GetParameter()->close();
}

View File

@ -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<v8::Object, Socket>& data);
static void onRelease(const v8::WeakCallbackInfo<Socket>& data);
void processTlsShutdown(promiseid_t promise);
static void onTlsShutdown(uv_write_t* request, int status);

View File

@ -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<v8::Function, ImportRecord >& data) {
static void onRelease(const v8::WeakCallbackInfo<ImportRecord >& 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<v8::Value> value) {
exportid_t Task::exportFunction(v8::Handle<v8::Function> function) {
exportid_t exportId = -1;
v8::Handle<v8::String> exportName = v8::String::NewFromUtf8(_isolate, "export");
v8::Local<v8::Private> privateKey = v8::Private::ForApi(_isolate, exportName);
v8::Local<v8::Value> value = function->GetHiddenValue(exportName);
if (!value.IsEmpty() && value->IsNumber())
v8::MaybeLocal<v8::Value> 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<v8::Function> 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;
}

View File

@ -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<uv_handle_t*>(process), 0);
}
void TaskStub::onRelease(const v8::WeakCallbackData<v8::Object, TaskStub>& data) {
void TaskStub::onRelease(const v8::WeakCallbackInfo<TaskStub>& data) {
// XXX?
}
void TaskStub::getExports(const v8::FunctionCallbackInfo<v8::Value>& args) {

View File

@ -54,7 +54,7 @@ private:
static void kill(const v8::FunctionCallbackInfo<v8::Value>& args);
static void statistics(const v8::FunctionCallbackInfo<v8::Value>& args);
static void onRelease(const v8::WeakCallbackData<v8::Object, TaskStub>& data);
static void onRelease(const v8::WeakCallbackInfo<TaskStub>& data);
static void onProcessExit(uv_process_t* process, int64_t status, int terminationSignal);
};

View File

@ -49,7 +49,7 @@ void TlsContextWrapper::close() {
}
}
void TlsContextWrapper::onRelease(const v8::WeakCallbackData<v8::Object, TlsContextWrapper>& data) {
void TlsContextWrapper::onRelease(const v8::WeakCallbackInfo<TlsContextWrapper>& 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);
}
}

View File

@ -17,7 +17,7 @@ public:
static void setPrivateKey(const v8::FunctionCallbackInfo<v8::Value>& args);
static void addTrustedCertificate(const v8::FunctionCallbackInfo<v8::Value>& args);
static void onRelease(const v8::WeakCallbackData<v8::Object, TlsContextWrapper>& data);
static void onRelease(const v8::WeakCallbackInfo<TlsContextWrapper>& data);
TlsContext* getContext() { return _context; }

View File

@ -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()