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/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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); | 222 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); |
223 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index()); | 223 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index()); |
224 CHECK_EQ(iterator.GetRegisterOperandRange(0), 3); | 224 CHECK_EQ(iterator.GetRegisterOperandRange(0), 3); |
225 CHECK(!iterator.done()); | 225 CHECK(!iterator.done()); |
226 offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle); | 226 offset += Bytecodes::Size(Bytecode::kForInPrepare, OperandScale::kSingle); |
227 iterator.Advance(); | 227 iterator.Advance(); |
228 | 228 |
229 CHECK_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime); | 229 CHECK_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime); |
230 CHECK_EQ(iterator.current_offset(), offset); | 230 CHECK_EQ(iterator.current_offset(), offset); |
231 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); | 231 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); |
232 CHECK_EQ(iterator.GetRuntimeIdOperand(0), Runtime::kLoadIC_Miss); | 232 CHECK_EQ(static_cast<Runtime::FunctionId>(iterator.GetRuntimeIdOperand(0)), |
| 233 Runtime::kLoadIC_Miss); |
233 CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index()); | 234 CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index()); |
234 CHECK_EQ(iterator.GetRegisterCountOperand(2), 1); | 235 CHECK_EQ(iterator.GetRegisterCountOperand(2), 1); |
235 CHECK(!iterator.done()); | 236 CHECK(!iterator.done()); |
236 offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle); | 237 offset += Bytecodes::Size(Bytecode::kCallRuntime, OperandScale::kSingle); |
237 iterator.Advance(); | 238 iterator.Advance(); |
238 | 239 |
239 CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger); | 240 CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger); |
240 CHECK_EQ(iterator.current_offset(), offset); | 241 CHECK_EQ(iterator.current_offset(), offset); |
241 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); | 242 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); |
242 CHECK(!iterator.done()); | 243 CHECK(!iterator.done()); |
(...skipping 13 matching lines...) Expand all Loading... |
256 CHECK_EQ(iterator.current_offset(), offset); | 257 CHECK_EQ(iterator.current_offset(), offset); |
257 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); | 258 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); |
258 CHECK(!iterator.done()); | 259 CHECK(!iterator.done()); |
259 iterator.Advance(); | 260 iterator.Advance(); |
260 CHECK(iterator.done()); | 261 CHECK(iterator.done()); |
261 } | 262 } |
262 | 263 |
263 } // namespace interpreter | 264 } // namespace interpreter |
264 } // namespace internal | 265 } // namespace internal |
265 } // namespace v8 | 266 } // namespace v8 |
OLD | NEW |