OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/interpreter/bytecode-array-builder.h" | 7 #include "src/interpreter/bytecode-array-builder.h" |
8 #include "src/interpreter/bytecode-array-iterator.h" | 8 #include "src/interpreter/bytecode-array-iterator.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 .JumpIfTrue(&start) | 193 .JumpIfTrue(&start) |
194 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) | 194 .CompareOperation(Token::Value::EQ, reg, Strength::WEAK) |
195 .JumpIfFalse(&start); | 195 .JumpIfFalse(&start); |
196 // Perform an operation that returns a non-boolean operation to | 196 // Perform an operation that returns a non-boolean operation to |
197 // generate JumpIfToBooleanTrue/False. | 197 // generate JumpIfToBooleanTrue/False. |
198 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 198 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
199 .JumpIfTrue(&start) | 199 .JumpIfTrue(&start) |
200 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) | 200 .BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) |
201 .JumpIfFalse(&start); | 201 .JumpIfFalse(&start); |
202 | 202 |
203 // Emit throw in it's own basic block so that the rest of the code isn't | 203 // Emit throw and re-throw in it's own basic block so that the rest of the |
204 // omitted due to being dead. | 204 // code isn't omitted due to being dead. |
205 BytecodeLabel after_throw; | 205 BytecodeLabel after_throw; |
206 builder.Jump(&after_throw).Throw().Bind(&after_throw); | 206 builder.Jump(&after_throw).Throw().Bind(&after_throw); |
| 207 BytecodeLabel after_rethrow; |
| 208 builder.Jump(&after_rethrow).ReThrow().Bind(&after_rethrow); |
207 | 209 |
208 builder.ForInPrepare(reg) | 210 builder.ForInPrepare(reg) |
209 .ForInDone(reg, reg) | 211 .ForInDone(reg, reg) |
210 .ForInNext(reg, reg, reg) | 212 .ForInNext(reg, reg, reg) |
211 .ForInStep(reg); | 213 .ForInStep(reg); |
212 builder.ForInPrepare(wide) | 214 builder.ForInPrepare(wide) |
213 .ForInDone(reg, other) | 215 .ForInDone(reg, other) |
214 .ForInNext(wide, wide, wide) | 216 .ForInNext(wide, wide, wide) |
215 .ForInStep(reg); | 217 .ForInStep(reg); |
216 | 218 |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 } | 684 } |
683 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 685 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
684 iterator.Advance(); | 686 iterator.Advance(); |
685 CHECK(iterator.done()); | 687 CHECK(iterator.done()); |
686 } | 688 } |
687 | 689 |
688 | 690 |
689 } // namespace interpreter | 691 } // namespace interpreter |
690 } // namespace internal | 692 } // namespace internal |
691 } // namespace v8 | 693 } // namespace v8 |
OLD | NEW |