Commit 211814e6 authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[turbofan] Brokerize ReduceJSAsyncFunction*

Async related reducers in native context specialization
are now heap-access free.

Bug: v8:7790
Change-Id: I467b86e54cb808985343e54df71c3b8b950a61e7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1758320
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63244}
parent ff4ae37e
......@@ -211,6 +211,8 @@ bool IsStringConstant(JSHeapBroker* broker, Node* node) {
Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionEnter(
Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining);
DCHECK_EQ(IrOpcode::kJSAsyncFunctionEnter, node->opcode());
Node* closure = NodeProperties::GetValueInput(node, 0);
Node* receiver = NodeProperties::GetValueInput(node, 1);
......@@ -227,11 +229,12 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionEnter(
// Create the JSAsyncFunctionObject based on the SharedFunctionInfo
// extracted from the top-most frame in {frame_state}.
Handle<SharedFunctionInfo> shared =
FrameStateInfoOf(frame_state->op()).shared_info().ToHandleChecked();
DCHECK(shared->is_compiled());
int register_count = shared->internal_formal_parameter_count() +
shared->GetBytecodeArray().register_count();
SharedFunctionInfoRef shared(
broker(),
FrameStateInfoOf(frame_state->op()).shared_info().ToHandleChecked());
DCHECK(shared.is_compiled());
int register_count = shared.internal_formal_parameter_count() +
shared.GetBytecodeArray().register_count();
Node* value = effect =
graph()->NewNode(javascript()->CreateAsyncFunctionObject(register_count),
closure, receiver, promise, context, effect, control);
......@@ -241,6 +244,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionEnter(
Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionReject(
Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining);
DCHECK_EQ(IrOpcode::kJSAsyncFunctionReject, node->opcode());
Node* async_function_object = NodeProperties::GetValueInput(node, 0);
Node* reason = NodeProperties::GetValueInput(node, 1);
......@@ -277,6 +282,8 @@ Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionReject(
Reduction JSNativeContextSpecialization::ReduceJSAsyncFunctionResolve(
Node* node) {
DisallowHeapAccessIf disallow_heap_access(FLAG_concurrent_inlining);
DCHECK_EQ(IrOpcode::kJSAsyncFunctionResolve, node->opcode());
Node* async_function_object = NodeProperties::GetValueInput(node, 0);
Node* value = NodeProperties::GetValueInput(node, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment