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 2438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 int arg_count = args->length(); | 2449 int arg_count = args->length(); |
2450 | 2450 |
2451 // Extract callee and source string from the environment. | 2451 // Extract callee and source string from the environment. |
2452 Node* callee = environment()->Peek(arg_count + 1); | 2452 Node* callee = environment()->Peek(arg_count + 1); |
2453 Node* source = environment()->Peek(arg_count - 1); | 2453 Node* source = environment()->Peek(arg_count - 1); |
2454 | 2454 |
2455 // Create node to ask for help resolving potential eval call. This will | 2455 // Create node to ask for help resolving potential eval call. This will |
2456 // provide a fully resolved callee to patch into the environment. | 2456 // provide a fully resolved callee to patch into the environment. |
2457 Node* function = GetFunctionClosure(); | 2457 Node* function = GetFunctionClosure(); |
2458 Node* language = jsgraph()->Constant(language_mode()); | 2458 Node* language = jsgraph()->Constant(language_mode()); |
2459 Node* position = jsgraph()->Constant(expr->position()); | 2459 Node* position = jsgraph()->Constant(current_scope()->start_position()); |
2460 const Operator* op = | 2460 const Operator* op = |
2461 javascript()->CallRuntime(Runtime::kResolvePossiblyDirectEval); | 2461 javascript()->CallRuntime(Runtime::kResolvePossiblyDirectEval); |
2462 Node* new_callee = | 2462 Node* new_callee = |
2463 NewNode(op, callee, source, function, language, position); | 2463 NewNode(op, callee, source, function, language, position); |
2464 PrepareFrameState(new_callee, expr->EvalId(), | 2464 PrepareFrameState(new_callee, expr->EvalId(), |
2465 OutputFrameStateCombine::PokeAt(arg_count + 1)); | 2465 OutputFrameStateCombine::PokeAt(arg_count + 1)); |
2466 | 2466 |
2467 // Patch callee on the environment. | 2467 // Patch callee on the environment. |
2468 environment()->Poke(arg_count + 1, new_callee); | 2468 environment()->Poke(arg_count + 1, new_callee); |
2469 } | 2469 } |
(...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4369 // Phi does not exist yet, introduce one. | 4369 // Phi does not exist yet, introduce one. |
4370 value = NewPhi(inputs, value, control); | 4370 value = NewPhi(inputs, value, control); |
4371 value->ReplaceInput(inputs - 1, other); | 4371 value->ReplaceInput(inputs - 1, other); |
4372 } | 4372 } |
4373 return value; | 4373 return value; |
4374 } | 4374 } |
4375 | 4375 |
4376 } // namespace compiler | 4376 } // namespace compiler |
4377 } // namespace internal | 4377 } // namespace internal |
4378 } // namespace v8 | 4378 } // namespace v8 |
OLD | NEW |