summaryrefslogtreecommitdiff
path: root/deps/v8/src/bootstrapper.cc
diff options
context:
space:
mode:
authorMaya Lekova <mslekova@chromium.org>2018-05-14 10:55:07 +0200
committerMyles Borins <mylesborins@google.com>2018-06-01 16:44:33 +0200
commit4e788dc2f5113d44508af89cbb6f4b2be91cdc13 (patch)
tree228602e81a4a43e9549a738aa1ef583750b0b9a9 /deps/v8/src/bootstrapper.cc
parentfb2686148e167cd630ba403f9ade40faeea496ae (diff)
downloadnode-new-4e788dc2f5113d44508af89cbb6f4b2be91cdc13.tar.gz
deps: backport 91ddb65d from upstream V8
Original commit message: Revert promises optimizations due to regressions in async hooks Revert "[async-await] Eliminate throwaway promise in async functions." This reverts commit a840f1f8f7e6c9ab32dec456a954612619855093. Revert "[async-generators] Also avoid throwaway promise here." This reverts commit feb545ceba5cb477ba883b46b60142f441ad5a3d. Revert "[async-await] Turn await closures into intrinsics." This reverts commit d97bb317386506a6798386b74647cbe0502fce35. Revert "[async-generators] Add fast-path for primitives in AsyncGeneratorYield." This reverts commit e57b500eb26dc595609613963468910eb4bcae2e. Revert "[async-generators] Add fast-path to skip "then" lookup in AsyncGeneratorResolve." This reverts commit c15802e11e30976528d1b711a9b9e6ff6b490117. Revert "[promises] Correctly run before/after hooks for await." This reverts commit ca7639239fc13e992e857710cbf7dbaac87163bf. Bug: v8:7253, v8:7745 Change-Id: I25ad0d2df3cfbc84dbb431aa25b268bce8a39e89 Reviewed-on: https://chromium-review.googlesource.com/1049975 Commit-Queue: Maya Lekova <mslekova@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#53139} Refs: https://github.com/v8/v8/commit/91ddb65d3b34c07c5026727de84dc91b5e0a43cd Fixes: https://github.com/nodejs/node/issues/20516 Co-authored-by: Matteo Collina <matteo.collina@gmail.com> PR-URL: https://github.com/nodejs/node/pull/19989 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/bootstrapper.cc')
-rw-r--r--deps/v8/src/bootstrapper.cc72
1 files changed, 72 insertions, 0 deletions
diff --git a/deps/v8/src/bootstrapper.cc b/deps/v8/src/bootstrapper.cc
index 43c7527de9..2138b9c73d 100644
--- a/deps/v8/src/bootstrapper.cc
+++ b/deps/v8/src/bootstrapper.cc
@@ -1584,6 +1584,50 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
native_context()->set_async_iterator_value_unwrap_shared_fun(*info);
}
+ { // --- A s y n c G e n e r a t o r ---
+ Handle<JSFunction> await_caught =
+ SimpleCreateFunction(isolate, factory->empty_string(),
+ Builtins::kAsyncGeneratorAwaitCaught, 1, false);
+ native_context()->set_async_generator_await_caught(*await_caught);
+
+ Handle<JSFunction> await_uncaught =
+ SimpleCreateFunction(isolate, factory->empty_string(),
+ Builtins::kAsyncGeneratorAwaitUncaught, 1, false);
+ native_context()->set_async_generator_await_uncaught(*await_uncaught);
+
+ Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncGeneratorAwaitResolveClosure,
+ factory->empty_string(), 1);
+ native_context()->set_async_generator_await_resolve_shared_fun(*info);
+
+ info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncGeneratorAwaitRejectClosure,
+ factory->empty_string(), 1);
+ native_context()->set_async_generator_await_reject_shared_fun(*info);
+
+ info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncGeneratorYieldResolveClosure,
+ factory->empty_string(), 1);
+ native_context()->set_async_generator_yield_resolve_shared_fun(*info);
+
+ info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncGeneratorReturnResolveClosure,
+ factory->empty_string(), 1);
+ native_context()->set_async_generator_return_resolve_shared_fun(*info);
+
+ info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncGeneratorReturnClosedResolveClosure,
+ factory->empty_string(), 1);
+ native_context()->set_async_generator_return_closed_resolve_shared_fun(
+ *info);
+
+ info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncGeneratorReturnClosedRejectClosure,
+ factory->empty_string(), 1);
+ native_context()->set_async_generator_return_closed_reject_shared_fun(
+ *info);
+ }
+
{ // --- A r r a y ---
Handle<JSFunction> array_function = InstallFunction(
global, "Array", JS_ARRAY_TYPE, JSArray::kSize, 0,
@@ -4001,6 +4045,34 @@ void Bootstrapper::ExportFromRuntime(Isolate* isolate,
{
Handle<JSFunction> function =
SimpleCreateFunction(isolate, factory->empty_string(),
+ Builtins::kAsyncFunctionAwaitCaught, 2, false);
+ native_context->set_async_function_await_caught(*function);
+ }
+
+ {
+ Handle<JSFunction> function =
+ SimpleCreateFunction(isolate, factory->empty_string(),
+ Builtins::kAsyncFunctionAwaitUncaught, 2, false);
+ native_context->set_async_function_await_uncaught(*function);
+ }
+
+ {
+ Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncFunctionAwaitRejectClosure,
+ factory->empty_string(), 1);
+ native_context->set_async_function_await_reject_shared_fun(*info);
+ }
+
+ {
+ Handle<SharedFunctionInfo> info = SimpleCreateSharedFunctionInfo(
+ isolate, Builtins::kAsyncFunctionAwaitResolveClosure,
+ factory->empty_string(), 1);
+ native_context->set_async_function_await_resolve_shared_fun(*info);
+ }
+
+ {
+ Handle<JSFunction> function =
+ SimpleCreateFunction(isolate, factory->empty_string(),
Builtins::kAsyncFunctionPromiseCreate, 0, false);
native_context->set_async_function_promise_create(*function);
}