Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1202963005: Fix receiver when calling eval() bound by with scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Full-codegen impls for all arches Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.h ('k') | src/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/ast.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698