diff options
author | Maya Lekova <mslekova@chromium.org> | 2018-05-14 10:55:07 +0200 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-06-01 09:59:19 +0200 |
commit | f781758d41a2fe76d3c8060accea77917bc29812 (patch) | |
tree | 7fd3ba2cadd159c31512ebe2d5a0b40beaf94f3f /deps/v8/src/interpreter | |
parent | 109ba58b5f6fe42a4a22b990eb5fb21946012727 (diff) | |
download | android-node-v8-f781758d41a2fe76d3c8060accea77917bc29812.tar.gz android-node-v8-f781758d41a2fe76d3c8060accea77917bc29812.tar.bz2 android-node-v8-f781758d41a2fe76d3c8060accea77917bc29812.zip |
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/interpreter')
-rw-r--r-- | deps/v8/src/interpreter/bytecode-generator.cc | 18 | ||||
-rw-r--r-- | deps/v8/src/interpreter/interpreter-intrinsics-generator.cc | 24 | ||||
-rw-r--r-- | deps/v8/src/interpreter/interpreter-intrinsics.h | 4 |
3 files changed, 10 insertions, 36 deletions
diff --git a/deps/v8/src/interpreter/bytecode-generator.cc b/deps/v8/src/interpreter/bytecode-generator.cc index 29ad2c2a82..744c6614f7 100644 --- a/deps/v8/src/interpreter/bytecode-generator.cc +++ b/deps/v8/src/interpreter/bytecode-generator.cc @@ -3239,20 +3239,22 @@ void BytecodeGenerator::BuildAwait(Expression* await_expr) { // Await(operand) and suspend. RegisterAllocationScope register_scope(this); - Runtime::FunctionId id; + int await_builtin_context_index; RegisterList args; if (IsAsyncGeneratorFunction(function_kind())) { - id = catch_prediction() == HandlerTable::ASYNC_AWAIT - ? Runtime::kInlineAsyncGeneratorAwaitUncaught - : Runtime::kInlineAsyncGeneratorAwaitCaught; + await_builtin_context_index = + catch_prediction() == HandlerTable::ASYNC_AWAIT + ? Context::ASYNC_GENERATOR_AWAIT_UNCAUGHT + : Context::ASYNC_GENERATOR_AWAIT_CAUGHT; args = register_allocator()->NewRegisterList(2); builder() ->MoveRegister(generator_object(), args[0]) .StoreAccumulatorInRegister(args[1]); } else { - id = catch_prediction() == HandlerTable::ASYNC_AWAIT - ? Runtime::kInlineAsyncFunctionAwaitUncaught - : Runtime::kInlineAsyncFunctionAwaitCaught; + await_builtin_context_index = + catch_prediction() == HandlerTable::ASYNC_AWAIT + ? Context::ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX + : Context::ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX; args = register_allocator()->NewRegisterList(3); builder() ->MoveRegister(generator_object(), args[0]) @@ -3265,7 +3267,7 @@ void BytecodeGenerator::BuildAwait(Expression* await_expr) { builder()->StoreAccumulatorInRegister(args[2]); } - builder()->CallRuntime(id, args); + builder()->CallJSRuntime(await_builtin_context_index, args); } BuildSuspendPoint(await_expr); diff --git a/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc b/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc index 675a8bcccc..0480dec6cc 100644 --- a/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc +++ b/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc @@ -402,30 +402,6 @@ Node* IntrinsicsGenerator::GetImportMetaObject( return return_value.value(); } -Node* IntrinsicsGenerator::AsyncFunctionAwaitCaught( - const InterpreterAssembler::RegListNodePair& args, Node* context) { - return IntrinsicAsBuiltinCall(args, context, - Builtins::kAsyncFunctionAwaitCaught); -} - -Node* IntrinsicsGenerator::AsyncFunctionAwaitUncaught( - const InterpreterAssembler::RegListNodePair& args, Node* context) { - return IntrinsicAsBuiltinCall(args, context, - Builtins::kAsyncFunctionAwaitUncaught); -} - -Node* IntrinsicsGenerator::AsyncGeneratorAwaitCaught( - const InterpreterAssembler::RegListNodePair& args, Node* context) { - return IntrinsicAsBuiltinCall(args, context, - Builtins::kAsyncGeneratorAwaitCaught); -} - -Node* IntrinsicsGenerator::AsyncGeneratorAwaitUncaught( - const InterpreterAssembler::RegListNodePair& args, Node* context) { - return IntrinsicAsBuiltinCall(args, context, - Builtins::kAsyncGeneratorAwaitUncaught); -} - Node* IntrinsicsGenerator::AsyncGeneratorReject( const InterpreterAssembler::RegListNodePair& args, Node* context) { return IntrinsicAsBuiltinCall(args, context, Builtins::kAsyncGeneratorReject); diff --git a/deps/v8/src/interpreter/interpreter-intrinsics.h b/deps/v8/src/interpreter/interpreter-intrinsics.h index 6cdfec2d04..3016183c0b 100644 --- a/deps/v8/src/interpreter/interpreter-intrinsics.h +++ b/deps/v8/src/interpreter/interpreter-intrinsics.h @@ -14,10 +14,6 @@ namespace interpreter { // List of supported intrisics, with upper case name, lower case name and // expected number of arguments (-1 denoting argument count is variable). #define INTRINSICS_LIST(V) \ - V(AsyncFunctionAwaitCaught, async_function_await_caught, 3) \ - V(AsyncFunctionAwaitUncaught, async_function_await_uncaught, 3) \ - V(AsyncGeneratorAwaitCaught, async_generator_await_caught, 2) \ - V(AsyncGeneratorAwaitUncaught, async_generator_await_uncaught, 2) \ V(AsyncGeneratorReject, async_generator_reject, 2) \ V(AsyncGeneratorResolve, async_generator_resolve, 3) \ V(AsyncGeneratorYield, async_generator_yield, 3) \ |