OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.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/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2466 | 2466 |
2467 // Set up arguments for ResolvePossiblyDirectEval by copying callee, source | 2467 // Set up arguments for ResolvePossiblyDirectEval by copying callee, source |
2468 // strings and function closure, and loading language and | 2468 // strings and function closure, and loading language and |
2469 // position. | 2469 // position. |
2470 builder() | 2470 builder() |
2471 ->MoveRegister(callee, callee_for_eval) | 2471 ->MoveRegister(callee, callee_for_eval) |
2472 .MoveRegister(arg, source) | 2472 .MoveRegister(arg, source) |
2473 .MoveRegister(Register::function_closure(), function) | 2473 .MoveRegister(Register::function_closure(), function) |
2474 .LoadLiteral(Smi::FromInt(language_mode())) | 2474 .LoadLiteral(Smi::FromInt(language_mode())) |
2475 .StoreAccumulatorInRegister(language) | 2475 .StoreAccumulatorInRegister(language) |
2476 .LoadLiteral(Smi::FromInt(expr->position())) | 2476 .LoadLiteral( |
| 2477 Smi::FromInt(execution_context()->scope()->start_position())) |
2477 .StoreAccumulatorInRegister(position); | 2478 .StoreAccumulatorInRegister(position); |
2478 | 2479 |
2479 // Call ResolvePossiblyDirectEval and modify the callee. | 2480 // Call ResolvePossiblyDirectEval and modify the callee. |
2480 builder() | 2481 builder() |
2481 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 5) | 2482 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 5) |
2482 .StoreAccumulatorInRegister(callee); | 2483 .StoreAccumulatorInRegister(callee); |
2483 } | 2484 } |
2484 | 2485 |
2485 builder()->SetExpressionPosition(expr); | 2486 builder()->SetExpressionPosition(expr); |
2486 builder()->Call(callee, receiver, 1 + args->length(), | 2487 builder()->Call(callee, receiver, 1 + args->length(), |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3159 } | 3160 } |
3160 | 3161 |
3161 | 3162 |
3162 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3163 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3163 return info()->shared_info()->feedback_vector()->GetIndex(slot); | 3164 return info()->shared_info()->feedback_vector()->GetIndex(slot); |
3164 } | 3165 } |
3165 | 3166 |
3166 } // namespace interpreter | 3167 } // namespace interpreter |
3167 } // namespace internal | 3168 } // namespace internal |
3168 } // namespace v8 | 3169 } // namespace v8 |
OLD | NEW |