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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/interpreter/control-flow-builders.h" | 8 #include "src/interpreter/control-flow-builders.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 #include "src/parser.h" | 10 #include "src/parser.h" |
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 // Store the closure we were called with in the given variable. | 2150 // Store the closure we were called with in the given variable. |
2151 builder()->LoadAccumulatorWithRegister(Register::function_closure()); | 2151 builder()->LoadAccumulatorWithRegister(Register::function_closure()); |
2152 VisitVariableAssignment(variable, FeedbackVectorSlot::Invalid()); | 2152 VisitVariableAssignment(variable, FeedbackVectorSlot::Invalid()); |
2153 } | 2153 } |
2154 | 2154 |
2155 | 2155 |
2156 void BytecodeGenerator::VisitNewTargetVariable(Variable* variable) { | 2156 void BytecodeGenerator::VisitNewTargetVariable(Variable* variable) { |
2157 if (variable == nullptr) return; | 2157 if (variable == nullptr) return; |
2158 | 2158 |
2159 // Store the new target we were called with in the given variable. | 2159 // Store the new target we were called with in the given variable. |
2160 builder()->CallRuntime(Runtime::kGetNewTarget, Register(), 0); | 2160 builder()->LoadAccumulatorWithRegister(Register::new_target()); |
2161 VisitVariableAssignment(variable, FeedbackVectorSlot::Invalid()); | 2161 VisitVariableAssignment(variable, FeedbackVectorSlot::Invalid()); |
2162 } | 2162 } |
2163 | 2163 |
2164 | 2164 |
2165 void BytecodeGenerator::VisitFunctionClosureForContext() { | 2165 void BytecodeGenerator::VisitFunctionClosureForContext() { |
2166 AccumulatorResultScope accumulator_execution_result(this); | 2166 AccumulatorResultScope accumulator_execution_result(this); |
2167 Scope* closure_scope = execution_context()->scope()->ClosureScope(); | 2167 Scope* closure_scope = execution_context()->scope()->ClosureScope(); |
2168 if (closure_scope->is_script_scope() || | 2168 if (closure_scope->is_script_scope() || |
2169 closure_scope->is_module_scope()) { | 2169 closure_scope->is_module_scope()) { |
2170 // Contexts nested in the native context have a canonical empty function as | 2170 // Contexts nested in the native context have a canonical empty function as |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 } | 2230 } |
2231 | 2231 |
2232 | 2232 |
2233 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2233 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
2234 return info()->feedback_vector()->GetIndex(slot); | 2234 return info()->feedback_vector()->GetIndex(slot); |
2235 } | 2235 } |
2236 | 2236 |
2237 } // namespace interpreter | 2237 } // namespace interpreter |
2238 } // namespace internal | 2238 } // namespace internal |
2239 } // namespace v8 | 2239 } // namespace v8 |
OLD | NEW |