| Index: src/compiler/escape-analysis-reducer.cc
|
| diff --git a/src/compiler/escape-analysis-reducer.cc b/src/compiler/escape-analysis-reducer.cc
|
| index 2e2f6781ebfe3f8b8e6f7ea17c273779cd83e4aa..6d0b602fa386ea4880e644bfbff7feac8e1d53ff 100644
|
| --- a/src/compiler/escape-analysis-reducer.cc
|
| +++ b/src/compiler/escape-analysis-reducer.cc
|
| @@ -34,7 +34,7 @@ Reduction EscapeAnalysisReducer::Reduce(Node* node) {
|
| return ReduceReferenceEqual(node);
|
| case IrOpcode::kStateValues:
|
| case IrOpcode::kFrameState:
|
| - return ReplaceWithDeoptDummy(node);
|
| + return ReduceStateValueInputs(node);
|
| default:
|
| break;
|
| }
|
| @@ -140,31 +140,32 @@ Reduction EscapeAnalysisReducer::ReduceReferenceEqual(Node* node) {
|
| }
|
|
|
|
|
| -// TODO(sigurds): This is a temporary solution until escape analysis
|
| -// supports deoptimization.
|
| -Reduction EscapeAnalysisReducer::ReplaceWithDeoptDummy(Node* node) {
|
| +Reduction EscapeAnalysisReducer::ReduceStateValueInputs(Node* node) {
|
| DCHECK(node->opcode() == IrOpcode::kStateValues ||
|
| node->opcode() == IrOpcode::kFrameState);
|
| + Node* effect = escape_analysis()->GetEffect(node);
|
| + DCHECK_NOT_NULL(effect);
|
| Reduction r = NoChange();
|
| for (int i = 0; i < node->op()->ValueInputCount(); ++i) {
|
| Node* input = NodeProperties::GetValueInput(node, i);
|
| if (input->opcode() == IrOpcode::kFinishRegion ||
|
| - input->opcode() == IrOpcode::kAllocate ||
|
| - input->opcode() == IrOpcode::kPhi) {
|
| + input->opcode() == IrOpcode::kAllocate) {
|
| if (escape_analysis()->IsVirtual(input)) {
|
| - NodeProperties::ReplaceValueInput(node, jsgraph()->UndefinedConstant(),
|
| - i);
|
| - if (FLAG_trace_turbo_escape) {
|
| - PrintF("Replaced state value (#%d) input with dummy\n", node->id());
|
| + if (Node* object_state =
|
| + escape_analysis()->GetOrCreateObjectState(effect, input)) {
|
| + NodeProperties::ReplaceValueInput(node, object_state, i);
|
| + if (FLAG_trace_turbo_escape) {
|
| + PrintF("Replaced state value (#%d) input with object state #%d\n",
|
| + node->id(), object_state->id());
|
| + }
|
| + r = Changed(node);
|
| }
|
| - r = Changed(node);
|
| }
|
| }
|
| }
|
| return r;
|
| }
|
|
|
| -
|
| } // namespace compiler
|
| } // namespace internal
|
| } // namespace v8
|
|
|