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 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2253 builder() | 2253 builder() |
2254 ->MoveRegister(input, value) | 2254 ->MoveRegister(input, value) |
2255 .LoadTrue() | 2255 .LoadTrue() |
2256 .StoreAccumulatorInRegister(done) | 2256 .StoreAccumulatorInRegister(done) |
2257 .CallRuntime(Runtime::kInlineCreateIterResultObject, value, 2); | 2257 .CallRuntime(Runtime::kInlineCreateIterResultObject, value, 2); |
2258 execution_control()->ReturnAccumulator(); | 2258 execution_control()->ReturnAccumulator(); |
2259 } | 2259 } |
2260 | 2260 |
2261 builder()->Bind(&resume_with_throw); | 2261 builder()->Bind(&resume_with_throw); |
2262 builder()->SetExpressionPosition(expr); | 2262 builder()->SetExpressionPosition(expr); |
2263 builder()->LoadAccumulatorWithRegister(input).Throw(); | 2263 builder()->LoadAccumulatorWithRegister(input); |
| 2264 if (expr->rethrow_on_exception()) { |
| 2265 builder()->ReThrow(); |
| 2266 } else { |
| 2267 builder()->Throw(); |
| 2268 } |
2264 | 2269 |
2265 builder()->Bind(&resume_with_next); | 2270 builder()->Bind(&resume_with_next); |
2266 builder()->LoadAccumulatorWithRegister(input); | 2271 builder()->LoadAccumulatorWithRegister(input); |
2267 } | 2272 } |
2268 execution_result()->SetResultInAccumulator(); | 2273 execution_result()->SetResultInAccumulator(); |
2269 } | 2274 } |
2270 | 2275 |
2271 void BytecodeGenerator::VisitThrow(Throw* expr) { | 2276 void BytecodeGenerator::VisitThrow(Throw* expr) { |
2272 VisitForAccumulatorValue(expr->exception()); | 2277 VisitForAccumulatorValue(expr->exception()); |
2273 builder()->SetExpressionPosition(expr); | 2278 builder()->SetExpressionPosition(expr); |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3167 return execution_context()->scope()->language_mode(); | 3172 return execution_context()->scope()->language_mode(); |
3168 } | 3173 } |
3169 | 3174 |
3170 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3175 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3171 return TypeFeedbackVector::GetIndex(slot); | 3176 return TypeFeedbackVector::GetIndex(slot); |
3172 } | 3177 } |
3173 | 3178 |
3174 } // namespace interpreter | 3179 } // namespace interpreter |
3175 } // namespace internal | 3180 } // namespace internal |
3176 } // namespace v8 | 3181 } // namespace v8 |
OLD | NEW |