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 "test/unittests/test-utils.h" | 9 #include "test/unittests/test-utils.h" |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 builder.Jump(&start) | 143 builder.Jump(&start) |
144 .JumpIfTrue(&start) | 144 .JumpIfTrue(&start) |
145 .JumpIfFalse(&start) | 145 .JumpIfFalse(&start) |
146 .JumpIfToBooleanTrue(&start) | 146 .JumpIfToBooleanTrue(&start) |
147 .JumpIfToBooleanFalse(&start); | 147 .JumpIfToBooleanFalse(&start); |
148 | 148 |
149 builder.EnterBlock() | 149 builder.EnterBlock() |
150 .Throw() | 150 .Throw() |
151 .LeaveBlock(); | 151 .LeaveBlock(); |
152 | 152 |
| 153 builder.ForInPrepare().ForInDone(reg).ForInNext(reg); |
| 154 |
153 builder.Return(); | 155 builder.Return(); |
154 | 156 |
155 // Generate BytecodeArray. | 157 // Generate BytecodeArray. |
156 Handle<BytecodeArray> the_array = builder.ToBytecodeArray(); | 158 Handle<BytecodeArray> the_array = builder.ToBytecodeArray(); |
157 CHECK_EQ(the_array->frame_size(), | 159 CHECK_EQ(the_array->frame_size(), |
158 builder.fixed_register_count() * kPointerSize); | 160 builder.fixed_register_count() * kPointerSize); |
159 | 161 |
160 // Build scorecard of bytecodes encountered in the BytecodeArray. | 162 // Build scorecard of bytecodes encountered in the BytecodeArray. |
161 std::vector<int> scorecard(Bytecodes::ToByte(Bytecode::kLast) + 1); | 163 std::vector<int> scorecard(Bytecodes::ToByte(Bytecode::kLast) + 1); |
162 Bytecode final_bytecode = Bytecode::kLdaZero; | 164 Bytecode final_bytecode = Bytecode::kLdaZero; |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 539 |
538 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 540 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
539 iterator.Advance(); | 541 iterator.Advance(); |
540 CHECK(iterator.done()); | 542 CHECK(iterator.done()); |
541 } | 543 } |
542 | 544 |
543 | 545 |
544 } // namespace interpreter | 546 } // namespace interpreter |
545 } // namespace internal | 547 } // namespace internal |
546 } // namespace v8 | 548 } // namespace v8 |
OLD | NEW |