From 508d728b5e27fd0c81669050869cf52c41538a87 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 7 Nov 2019 10:45:58 -0500 Subject: [PATCH] upgrade: V8 8.0.192 --- core/libdeno/api.cc | 20 ++++++++------------ core/libdeno/build | 2 +- core/libdeno/exceptions.cc | 1 + core/libdeno/internal.h | 6 ++++++ core/libdeno/modules.cc | 14 +++++++------- third_party | 2 +- tools/gclient_config.py | 2 +- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/core/libdeno/api.cc b/core/libdeno/api.cc index 332a1c5553..1ded39e1b3 100644 --- a/core/libdeno/api.cc +++ b/core/libdeno/api.cc @@ -75,25 +75,21 @@ Deno* deno_new(deno_config config) { return reinterpret_cast(d); } -deno::DenoIsolate* unwrap(Deno* d_) { - return reinterpret_cast(d_); -} - void deno_lock(Deno* d_) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); CHECK_NULL(d->locker_); d->locker_ = new v8::Locker(d->isolate_); } void deno_unlock(Deno* d_) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); CHECK_NOT_NULL(d->locker_); delete d->locker_; d->locker_ = nullptr; } deno_snapshot deno_snapshot_new(Deno* d_) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); CHECK_NOT_NULL(d->snapshot_creator_); d->ClearModules(); d->context_.Reset(); @@ -134,7 +130,7 @@ void deno_set_v8_flags(int* argc, char** argv) { } const char* deno_last_exception(Deno* d_) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); if (d->last_exception_.length() > 0) { return d->last_exception_.c_str(); } else { @@ -144,7 +140,7 @@ const char* deno_last_exception(Deno* d_) { void deno_execute(Deno* d_, void* user_data, const char* js_filename, const char* js_source) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); deno::UserDataScope user_data_scope(d, user_data); auto* isolate = d->isolate_; v8::Locker locker(isolate); @@ -161,13 +157,13 @@ void deno_pinned_buf_delete(deno_pinned_buf* buf) { } void deno_throw_exception(Deno* d_, const char* text) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); auto* isolate = d->isolate_; isolate->ThrowException(deno::v8_str(text)); } void deno_respond(Deno* d_, void* user_data, deno_op_id op_id, deno_buf buf) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); if (d->current_args_ != nullptr) { // Synchronous response. // Note op_id is not passed back in the case of synchronous response. @@ -213,7 +209,7 @@ void deno_respond(Deno* d_, void* user_data, deno_op_id op_id, deno_buf buf) { } void deno_check_promise_errors(Deno* d_) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); if (d->pending_promise_map_.size() > 0) { auto* isolate = d->isolate_; v8::Locker locker(isolate); diff --git a/core/libdeno/build b/core/libdeno/build index 6af664c48e..b3fe5cb48e 160000 --- a/core/libdeno/build +++ b/core/libdeno/build @@ -1 +1 @@ -Subproject commit 6af664c48ed657b89e99a9a8692dc15d7f7a6d9c +Subproject commit b3fe5cb48e9399765ec103ca0c14057f77cf9fc3 diff --git a/core/libdeno/exceptions.cc b/core/libdeno/exceptions.cc index 5f4d578b6c..64328e94d2 100644 --- a/core/libdeno/exceptions.cc +++ b/core/libdeno/exceptions.cc @@ -1,6 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. #include "exceptions.h" #include +#include "internal.h" namespace deno { diff --git a/core/libdeno/internal.h b/core/libdeno/internal.h index 89c746d048..7f29f4d81f 100644 --- a/core/libdeno/internal.h +++ b/core/libdeno/internal.h @@ -148,6 +148,12 @@ static inline v8::Local v8_str(const char* x) { .ToLocalChecked(); } +static inline DenoIsolate* unwrap(Deno* d_) { + return reinterpret_cast(d_); +} + +const char* ToCString(const v8::String::Utf8Value& value); + void Print(const v8::FunctionCallbackInfo& args); void Recv(const v8::FunctionCallbackInfo& args); void Send(const v8::FunctionCallbackInfo& args); diff --git a/core/libdeno/modules.cc b/core/libdeno/modules.cc index 5293fc95fb..bb7dc5d980 100644 --- a/core/libdeno/modules.cc +++ b/core/libdeno/modules.cc @@ -67,24 +67,24 @@ extern "C" { deno_mod deno_mod_new(Deno* d_, bool main, const char* name_cstr, const char* source_cstr) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); return d->RegisterModule(main, name_cstr, source_cstr); } const char* deno_mod_name(Deno* d_, deno_mod id) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); auto* info = d->GetModuleInfo(id); return info->name.c_str(); } size_t deno_mod_imports_len(Deno* d_, deno_mod id) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); auto* info = d->GetModuleInfo(id); return info->import_specifiers.size(); } const char* deno_mod_imports_get(Deno* d_, deno_mod id, size_t index) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); auto* info = d->GetModuleInfo(id); if (info == nullptr || index >= info->import_specifiers.size()) { return nullptr; @@ -95,7 +95,7 @@ const char* deno_mod_imports_get(Deno* d_, deno_mod id, size_t index) { void deno_mod_instantiate(Deno* d_, void* user_data, deno_mod id, deno_resolve_cb cb) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); deno::UserDataScope user_data_scope(d, user_data); auto* isolate = d->isolate_; @@ -130,7 +130,7 @@ void deno_mod_instantiate(Deno* d_, void* user_data, deno_mod id, } void deno_mod_evaluate(Deno* d_, void* user_data, deno_mod id) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); deno::UserDataScope user_data_scope(d, user_data); auto* isolate = d->isolate_; @@ -170,7 +170,7 @@ void deno_mod_evaluate(Deno* d_, void* user_data, deno_mod id) { void deno_dyn_import_done(Deno* d_, void* user_data, deno_dyn_import_id import_id, deno_mod mod_id, const char* error_str) { - auto* d = unwrap(d_); + auto* d = deno::unwrap(d_); CHECK((mod_id == 0 && error_str != nullptr) || (mod_id != 0 && error_str == nullptr) || (mod_id == 0 && !d->last_exception_handle_.IsEmpty())); diff --git a/third_party b/third_party index 3be244fe90..989bc2a030 160000 --- a/third_party +++ b/third_party @@ -1 +1 @@ -Subproject commit 3be244fe9064e57cb106d6a270662a27e76a7223 +Subproject commit 989bc2a0309782d3ce5c23d945a952ee610e15af diff --git a/tools/gclient_config.py b/tools/gclient_config.py index f7ca728e7e..e100e9947c 100644 --- a/tools/gclient_config.py +++ b/tools/gclient_config.py @@ -2,7 +2,7 @@ # pylint: disable=line-too-long solutions = [ { - 'url': 'https://chromium.googlesource.com/v8/v8.git@7.9.317.12', + 'url': 'https://chromium.googlesource.com/v8/v8.git@8.0.192', 'name': 'v8', 'deps_file': 'DEPS', 'custom_deps': {