OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |