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 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 | 2455 |
2456 // Set up arguments for ResolvePossiblyDirectEval by copying callee, source | 2456 // Set up arguments for ResolvePossiblyDirectEval by copying callee, source |
2457 // strings and function closure, and loading language and | 2457 // strings and function closure, and loading language and |
2458 // position. | 2458 // position. |
2459 builder() | 2459 builder() |
2460 ->MoveRegister(callee, callee_for_eval) | 2460 ->MoveRegister(callee, callee_for_eval) |
2461 .MoveRegister(arg, source) | 2461 .MoveRegister(arg, source) |
2462 .MoveRegister(Register::function_closure(), function) | 2462 .MoveRegister(Register::function_closure(), function) |
2463 .LoadLiteral(Smi::FromInt(language_mode())) | 2463 .LoadLiteral(Smi::FromInt(language_mode())) |
2464 .StoreAccumulatorInRegister(language) | 2464 .StoreAccumulatorInRegister(language) |
2465 .LoadLiteral( | 2465 .LoadLiteral(Smi::FromInt(expr->position())) |
2466 Smi::FromInt(execution_context()->scope()->start_position())) | |
2467 .StoreAccumulatorInRegister(position); | 2466 .StoreAccumulatorInRegister(position); |
2468 | 2467 |
2469 // Call ResolvePossiblyDirectEval and modify the callee. | 2468 // Call ResolvePossiblyDirectEval and modify the callee. |
2470 builder() | 2469 builder() |
2471 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 5) | 2470 ->CallRuntime(Runtime::kResolvePossiblyDirectEval, callee_for_eval, 5) |
2472 .StoreAccumulatorInRegister(callee); | 2471 .StoreAccumulatorInRegister(callee); |
2473 } | 2472 } |
2474 | 2473 |
2475 builder()->SetExpressionPosition(expr); | 2474 builder()->SetExpressionPosition(expr); |
2476 builder()->Call(callee, receiver, 1 + args->length(), | 2475 builder()->Call(callee, receiver, 1 + args->length(), |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3147 } | 3146 } |
3148 | 3147 |
3149 | 3148 |
3150 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3149 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3151 return info()->feedback_vector()->GetIndex(slot); | 3150 return info()->feedback_vector()->GetIndex(slot); |
3152 } | 3151 } |
3153 | 3152 |
3154 } // namespace interpreter | 3153 } // namespace interpreter |
3155 } // namespace internal | 3154 } // namespace internal |
3156 } // namespace v8 | 3155 } // namespace v8 |
OLD | NEW |