@@ -3579,10 +3579,6 @@ Reduction JSCallReducer::ReduceJSCall(Node* node,
35793579 return ReduceAsyncFunctionPromiseCreate (node);
35803580 case Builtins::kAsyncFunctionPromiseRelease :
35813581 return ReduceAsyncFunctionPromiseRelease (node);
3582- case Builtins::kPromiseCapabilityDefaultReject :
3583- return ReducePromiseCapabilityDefaultReject (node);
3584- case Builtins::kPromiseCapabilityDefaultResolve :
3585- return ReducePromiseCapabilityDefaultResolve (node);
35863582 case Builtins::kPromiseInternalConstructor :
35873583 return ReducePromiseInternalConstructor (node);
35883584 case Builtins::kPromiseInternalReject :
@@ -5343,120 +5339,6 @@ Reduction JSCallReducer::ReduceAsyncFunctionPromiseRelease(Node* node) {
53435339 return Replace (value);
53445340}
53455341
5346- // ES section #sec-promise-reject-functions
5347- Reduction JSCallReducer::ReducePromiseCapabilityDefaultReject (Node* node) {
5348- DCHECK_EQ (IrOpcode::kJSCall , node->opcode ());
5349- Node* target = NodeProperties::GetValueInput (node, 0 );
5350- Node* resolution = node->op ()->ValueInputCount () > 2
5351- ? NodeProperties::GetValueInput (node, 2 )
5352- : jsgraph ()->UndefinedConstant ();
5353- Node* frame_state = NodeProperties::GetFrameStateInput (node);
5354- Node* effect = NodeProperties::GetEffectInput (node);
5355- Node* control = NodeProperties::GetControlInput (node);
5356-
5357- // We need to execute in the {target}s context.
5358- Node* context = effect = graph ()->NewNode (
5359- simplified ()->LoadField (AccessBuilder::ForJSFunctionContext ()), target,
5360- effect, control);
5361-
5362- // Grab the promise closed over by {target}.
5363- Node* promise = effect =
5364- graph ()->NewNode (simplified ()->LoadField (AccessBuilder::ForContextSlot (
5365- PromiseBuiltinsAssembler::kPromiseSlot )),
5366- context, effect, control);
5367-
5368- // Check if the {promise} is still pending or already settled.
5369- Node* check = graph ()->NewNode (simplified ()->ReferenceEqual (), promise,
5370- jsgraph ()->UndefinedConstant ());
5371- Node* branch =
5372- graph ()->NewNode (common ()->Branch (BranchHint::kFalse ), check, control);
5373-
5374- Node* if_true = graph ()->NewNode (common ()->IfTrue (), branch);
5375- Node* etrue = effect;
5376-
5377- Node* if_false = graph ()->NewNode (common ()->IfFalse (), branch);
5378- Node* efalse = effect;
5379- {
5380- // Mark the {promise} as settled.
5381- efalse = graph ()->NewNode (
5382- simplified ()->StoreField (AccessBuilder::ForContextSlot (
5383- PromiseBuiltinsAssembler::kPromiseSlot )),
5384- context, jsgraph ()->UndefinedConstant (), efalse, if_false);
5385-
5386- // Check if we should emit a debug event.
5387- Node* debug_event = efalse =
5388- graph ()->NewNode (simplified ()->LoadField (AccessBuilder::ForContextSlot (
5389- PromiseBuiltinsAssembler::kDebugEventSlot )),
5390- context, efalse, if_false);
5391-
5392- // Actually reject the {promise}.
5393- efalse =
5394- graph ()->NewNode (javascript ()->RejectPromise (), promise, resolution,
5395- debug_event, context, frame_state, efalse, if_false);
5396- }
5397-
5398- control = graph ()->NewNode (common ()->Merge (2 ), if_true, if_false);
5399- effect = graph ()->NewNode (common ()->EffectPhi (2 ), etrue, efalse, control);
5400-
5401- Node* value = jsgraph ()->UndefinedConstant ();
5402- ReplaceWithValue (node, value, effect, control);
5403- return Replace (value);
5404- }
5405-
5406- // ES section #sec-promise-resolve-functions
5407- Reduction JSCallReducer::ReducePromiseCapabilityDefaultResolve (Node* node) {
5408- DCHECK_EQ (IrOpcode::kJSCall , node->opcode ());
5409- Node* target = NodeProperties::GetValueInput (node, 0 );
5410- Node* resolution = node->op ()->ValueInputCount () > 2
5411- ? NodeProperties::GetValueInput (node, 2 )
5412- : jsgraph ()->UndefinedConstant ();
5413- Node* frame_state = NodeProperties::GetFrameStateInput (node);
5414- Node* effect = NodeProperties::GetEffectInput (node);
5415- Node* control = NodeProperties::GetControlInput (node);
5416-
5417- // We need to execute in the {target}s context.
5418- Node* context = effect = graph ()->NewNode (
5419- simplified ()->LoadField (AccessBuilder::ForJSFunctionContext ()), target,
5420- effect, control);
5421-
5422- // Grab the promise closed over by {target}.
5423- Node* promise = effect =
5424- graph ()->NewNode (simplified ()->LoadField (AccessBuilder::ForContextSlot (
5425- PromiseBuiltinsAssembler::kPromiseSlot )),
5426- context, effect, control);
5427-
5428- // Check if the {promise} is still pending or already settled.
5429- Node* check = graph ()->NewNode (simplified ()->ReferenceEqual (), promise,
5430- jsgraph ()->UndefinedConstant ());
5431- Node* branch =
5432- graph ()->NewNode (common ()->Branch (BranchHint::kFalse ), check, control);
5433-
5434- Node* if_true = graph ()->NewNode (common ()->IfTrue (), branch);
5435- Node* etrue = effect;
5436-
5437- Node* if_false = graph ()->NewNode (common ()->IfFalse (), branch);
5438- Node* efalse = effect;
5439- {
5440- // Mark the {promise} as settled.
5441- efalse = graph ()->NewNode (
5442- simplified ()->StoreField (AccessBuilder::ForContextSlot (
5443- PromiseBuiltinsAssembler::kPromiseSlot )),
5444- context, jsgraph ()->UndefinedConstant (), efalse, if_false);
5445-
5446- // Actually resolve the {promise}.
5447- efalse =
5448- graph ()->NewNode (javascript ()->ResolvePromise (), promise, resolution,
5449- context, frame_state, efalse, if_false);
5450- }
5451-
5452- control = graph ()->NewNode (common ()->Merge (2 ), if_true, if_false);
5453- effect = graph ()->NewNode (common ()->EffectPhi (2 ), etrue, efalse, control);
5454-
5455- Node* value = jsgraph ()->UndefinedConstant ();
5456- ReplaceWithValue (node, value, effect, control);
5457- return Replace (value);
5458- }
5459-
54605342Node* JSCallReducer::CreateArtificialFrameState (
54615343 Node* node, Node* outer_frame_state, int parameter_count,
54625344 BailoutId bailout_id, FrameStateType frame_state_type,
0 commit comments