Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index 1147f85a6377c5978b39a5701438d789779b1aab..1848c76cbc76b3d75315b6c6ef41b9072410341f 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -2360,7 +2360,7 @@ void AstGraphBuilder::VisitCall(Call* expr) { |
callee_value = NewNode(common()->Projection(0), pair); |
receiver_value = NewNode(common()->Projection(1), pair); |
- PrepareFrameState(pair, expr->EvalOrLookupId(), |
+ PrepareFrameState(pair, expr->LookupId(), |
OutputFrameStateCombine::Push(2)); |
break; |
} |
@@ -2428,6 +2428,18 @@ void AstGraphBuilder::VisitCall(Call* expr) { |
break; |
case Call::POSSIBLY_EVAL_CALL: |
possibly_eval = true; |
+ if (callee->AsVariableProxy()->var()->IsLookupSlot()) { |
+ Variable* variable = callee->AsVariableProxy()->var(); |
+ Node* name = jsgraph()->Constant(variable->name()); |
+ const Operator* op = |
+ javascript()->CallRuntime(Runtime::kLoadLookupSlot, 2); |
+ Node* pair = NewNode(op, current_context(), name); |
+ callee_value = NewNode(common()->Projection(0), pair); |
+ receiver_value = NewNode(common()->Projection(1), pair); |
+ PrepareFrameState(pair, expr->LookupId(), |
+ OutputFrameStateCombine::Push(2)); |
+ break; |
+ } |
// Fall through. |
case Call::OTHER_CALL: |
VisitForValue(callee); |
@@ -2463,7 +2475,7 @@ void AstGraphBuilder::VisitCall(Call* expr) { |
javascript()->CallRuntime(Runtime::kResolvePossiblyDirectEval, 5); |
Node* new_callee = |
NewNode(op, callee, source, function, language, position); |
- PrepareFrameState(new_callee, expr->EvalOrLookupId(), |
+ PrepareFrameState(new_callee, expr->EvalId(), |
OutputFrameStateCombine::PokeAt(arg_count + 1)); |
// Patch callee on the environment. |