| 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/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
| (...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2323 Register done = register_allocator()->NextConsecutiveRegister(); | 2323 Register done = register_allocator()->NextConsecutiveRegister(); |
| 2324 builder() | 2324 builder() |
| 2325 ->MoveRegister(input, value) | 2325 ->MoveRegister(input, value) |
| 2326 .LoadTrue() | 2326 .LoadTrue() |
| 2327 .StoreAccumulatorInRegister(done) | 2327 .StoreAccumulatorInRegister(done) |
| 2328 .CallRuntime(Runtime::kCreateIterResultObject, value, 2); | 2328 .CallRuntime(Runtime::kCreateIterResultObject, value, 2); |
| 2329 execution_control()->ReturnAccumulator(); | 2329 execution_control()->ReturnAccumulator(); |
| 2330 } | 2330 } |
| 2331 | 2331 |
| 2332 builder()->Bind(&resume_with_throw); | 2332 builder()->Bind(&resume_with_throw); |
| 2333 builder() | 2333 builder()->LoadAccumulatorWithRegister(input).Throw(); |
| 2334 ->LoadAccumulatorWithRegister(input) | |
| 2335 .Throw(); | |
| 2336 | 2334 |
| 2337 builder()->Bind(&resume_with_next); | 2335 builder()->Bind(&resume_with_next); |
| 2338 builder()->LoadAccumulatorWithRegister(input); | 2336 builder()->LoadAccumulatorWithRegister(input); |
| 2339 } | 2337 } |
| 2340 execution_result()->SetResultInAccumulator(); | 2338 execution_result()->SetResultInAccumulator(); |
| 2341 } | 2339 } |
| 2342 | 2340 |
| 2343 void BytecodeGenerator::VisitThrow(Throw* expr) { | 2341 void BytecodeGenerator::VisitThrow(Throw* expr) { |
| 2344 VisitForAccumulatorValue(expr->exception()); | 2342 VisitForAccumulatorValue(expr->exception()); |
| 2345 builder()->SetExpressionPosition(expr); | 2343 builder()->SetExpressionPosition(expr); |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3264 Visit(stmt); | 3262 Visit(stmt); |
| 3265 } | 3263 } |
| 3266 | 3264 |
| 3267 | 3265 |
| 3268 LanguageMode BytecodeGenerator::language_mode() const { | 3266 LanguageMode BytecodeGenerator::language_mode() const { |
| 3269 return execution_context()->scope()->language_mode(); | 3267 return execution_context()->scope()->language_mode(); |
| 3270 } | 3268 } |
| 3271 | 3269 |
| 3272 | 3270 |
| 3273 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3271 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 3274 return info()->shared_info()->feedback_vector()->GetIndex(slot); | 3272 return TypeFeedbackVector::GetIndex(slot); |
| 3275 } | 3273 } |
| 3276 | 3274 |
| 3277 } // namespace interpreter | 3275 } // namespace interpreter |
| 3278 } // namespace internal | 3276 } // namespace internal |
| 3279 } // namespace v8 | 3277 } // namespace v8 |
| OLD | NEW |