Skip to content

Commit 50212e4

Browse files
sigurdschneiderCommit Bot
authored andcommitted
[turbofan] Add framestate to JSPerformPromiseThen operator
The framestate is necessary, because the PerformPromiseThen builtin calls into the runtime function PromiseRevokeReject, which ultimately calls back into the embedder. Node may execute JavaScript in the callback, and the missing framestate can then make our stack frame walker unhappy. Bug: v8:7659 Change-Id: I47391fd2b9b3c10ef26204a41e58f8082243c702 Reviewed-on: https://chromium-review.googlesource.com/1015361 Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Sigurd Schneider <[email protected]> Cr-Commit-Position: refs/heads/master@{#52663}
1 parent b4a4309 commit 50212e4

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/compiler/js-call-reducer.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5840,6 +5840,7 @@ Reduction JSCallReducer::ReducePromisePrototypeThen(Node* node) {
58405840
Node* context = NodeProperties::GetContextInput(node);
58415841
Node* effect = NodeProperties::GetEffectInput(node);
58425842
Node* control = NodeProperties::GetControlInput(node);
5843+
Node* frame_state = NodeProperties::GetFrameStateInput(node);
58435844

58445845
// Check that promises aren't being observed through (debug) hooks.
58455846
if (!isolate()->IsPromiseHookProtectorIntact()) return NoChange();
@@ -5898,9 +5899,9 @@ Reduction JSCallReducer::ReducePromisePrototypeThen(Node* node) {
58985899
graph()->NewNode(javascript()->CreatePromise(), context, effect);
58995900

59005901
// Chain {result} onto {receiver}.
5901-
result = effect = graph()->NewNode(javascript()->PerformPromiseThen(),
5902-
receiver, on_fulfilled, on_rejected,
5903-
result, context, effect, control);
5902+
result = effect = graph()->NewNode(
5903+
javascript()->PerformPromiseThen(), receiver, on_fulfilled, on_rejected,
5904+
result, context, frame_state, effect, control);
59045905
ReplaceWithValue(node, result, effect, control);
59055906
return Replace(result);
59065907
}

src/compiler/operator-properties.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ bool OperatorProperties::HasFrameStateInput(const Operator* op) {
119119
case IrOpcode::kJSPromiseResolve:
120120
case IrOpcode::kJSRejectPromise:
121121
case IrOpcode::kJSResolvePromise:
122+
case IrOpcode::kJSPerformPromiseThen:
122123
return true;
123124

124125
default:

0 commit comments

Comments
 (0)