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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2487483004: Only treat possible eval calls going through 'with' as special. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index a5d81cbdf1240db722d47ff147229fc94bad2b6d..089b751c029b4372d0ef7410ed93b8e3b55cf290 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2391,31 +2391,26 @@ void BytecodeGenerator::VisitCall(Call* expr) {
builder()->StoreAccumulatorInRegister(callee);
break;
}
- case Call::WITH_CALL:
- case Call::POSSIBLY_EVAL_CALL: {
- if (callee_expr->AsVariableProxy()->var()->IsLookupSlot()) {
- RegisterAllocationScope inner_register_scope(this);
- Register name = register_allocator()->NewRegister();
-
- // Call %LoadLookupSlotForCall to get the callee and receiver.
- DCHECK(Register::AreContiguous(callee, receiver));
- RegisterList result_pair(callee.index(), 2);
- Variable* variable = callee_expr->AsVariableProxy()->var();
- builder()
- ->LoadLiteral(variable->name())
- .StoreAccumulatorInRegister(name)
- .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, name,
- result_pair);
- break;
- }
- // Fall through.
- DCHECK_EQ(call_type, Call::POSSIBLY_EVAL_CALL);
+ case Call::WITH_CALL: {
+ DCHECK(callee_expr->AsVariableProxy()->var()->IsLookupSlot());
+ RegisterAllocationScope inner_register_scope(this);
+ Register name = register_allocator()->NewRegister();
+
+ // Call %LoadLookupSlotForCall to get the callee and receiver.
+ DCHECK(Register::AreContiguous(callee, receiver));
+ RegisterList result_pair(callee.index(), 2);
+ Variable* variable = callee_expr->AsVariableProxy()->var();
+ builder()
+ ->LoadLiteral(variable->name())
+ .StoreAccumulatorInRegister(name)
+ .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, name,
+ result_pair);
+ break;
}
- case Call::OTHER_CALL: {
+ case Call::OTHER_CALL:
builder()->LoadUndefined().StoreAccumulatorInRegister(receiver);
VisitForRegisterValue(callee_expr, callee);
break;
- }
case Call::NAMED_SUPER_PROPERTY_CALL: {
Property* property = callee_expr->AsProperty();
VisitNamedSuperPropertyLoad(property, receiver);
@@ -2439,8 +2434,7 @@ void BytecodeGenerator::VisitCall(Call* expr) {
// Resolve callee for a potential direct eval call. This block will mutate the
// callee value.
- if (call_type == Call::POSSIBLY_EVAL_CALL &&
- expr->arguments()->length() > 0) {
+ if (expr->is_possibly_eval() && expr->arguments()->length() > 0) {
RegisterAllocationScope inner_register_scope(this);
// Set up arguments for ResolvePossiblyDirectEval by copying callee, source
// strings and function closure, and loading language and
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698