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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1508293003: [Interpreter] Add support for calling eval. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comments Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/ast-loop-assignment-analyzer.h" 9 #include "src/compiler/ast-loop-assignment-analyzer.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 2458
2459 // The callee and the receiver both have to be pushed onto the operand stack 2459 // The callee and the receiver both have to be pushed onto the operand stack
2460 // before arguments are being evaluated. 2460 // before arguments are being evaluated.
2461 environment()->Push(callee_value); 2461 environment()->Push(callee_value);
2462 environment()->Push(receiver_value); 2462 environment()->Push(receiver_value);
2463 2463
2464 // Evaluate all arguments to the function call, 2464 // Evaluate all arguments to the function call,
2465 ZoneList<Expression*>* args = expr->arguments(); 2465 ZoneList<Expression*>* args = expr->arguments();
2466 VisitForValues(args); 2466 VisitForValues(args);
2467 2467
2468 // Resolve callee and receiver for a potential direct eval call. This block 2468 // Resolve callee for a potential direct eval call. This block will mutate the
2469 // will mutate the callee and receiver values pushed onto the environment. 2469 // callee value pushed onto the environment.
2470 if (possibly_eval && args->length() > 0) { 2470 if (possibly_eval && args->length() > 0) {
2471 int arg_count = args->length(); 2471 int arg_count = args->length();
2472 2472
2473 // Extract callee and source string from the environment. 2473 // Extract callee and source string from the environment.
2474 Node* callee = environment()->Peek(arg_count + 1); 2474 Node* callee = environment()->Peek(arg_count + 1);
2475 Node* source = environment()->Peek(arg_count - 1); 2475 Node* source = environment()->Peek(arg_count - 1);
2476 2476
2477 // Create node to ask for help resolving potential eval call. This will 2477 // Create node to ask for help resolving potential eval call. This will
2478 // provide a fully resolved callee to patch into the environment. 2478 // provide a fully resolved callee to patch into the environment.
2479 Node* function = GetFunctionClosure(); 2479 Node* function = GetFunctionClosure();
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after
4357 // Phi does not exist yet, introduce one. 4357 // Phi does not exist yet, introduce one.
4358 value = NewPhi(inputs, value, control); 4358 value = NewPhi(inputs, value, control);
4359 value->ReplaceInput(inputs - 1, other); 4359 value->ReplaceInput(inputs - 1, other);
4360 } 4360 }
4361 return value; 4361 return value;
4362 } 4362 }
4363 4363
4364 } // namespace compiler 4364 } // namespace compiler
4365 } // namespace internal 4365 } // namespace internal
4366 } // namespace v8 4366 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698