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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger); | 239 CHECK_EQ(iterator.current_bytecode(), Bytecode::kDebugger); |
240 CHECK_EQ(iterator.current_offset(), offset); | 240 CHECK_EQ(iterator.current_offset(), offset); |
241 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); | 241 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); |
242 CHECK(!iterator.done()); | 242 CHECK(!iterator.done()); |
243 offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle); | 243 offset += Bytecodes::Size(Bytecode::kDebugger, OperandScale::kSingle); |
244 iterator.Advance(); | 244 iterator.Advance(); |
245 | 245 |
246 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaGlobal); | 246 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaGlobal); |
247 CHECK_EQ(iterator.current_offset(), offset); | 247 CHECK_EQ(iterator.current_offset(), offset); |
248 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple); | 248 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kQuadruple); |
249 CHECK_EQ(iterator.current_bytecode_size(), 10); | 249 CHECK_EQ(iterator.current_bytecode_size(), 6); |
250 CHECK_EQ(iterator.GetIndexOperand(1), 0x10000000); | 250 CHECK_EQ(iterator.GetIndexOperand(0), 0x10000000); |
251 offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) + | 251 offset += Bytecodes::Size(Bytecode::kLdaGlobal, OperandScale::kQuadruple) + |
252 kPrefixByteSize; | 252 kPrefixByteSize; |
253 iterator.Advance(); | 253 iterator.Advance(); |
254 | 254 |
255 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 255 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
256 CHECK_EQ(iterator.current_offset(), offset); | 256 CHECK_EQ(iterator.current_offset(), offset); |
257 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); | 257 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); |
258 CHECK(!iterator.done()); | 258 CHECK(!iterator.done()); |
259 iterator.Advance(); | 259 iterator.Advance(); |
260 CHECK(iterator.done()); | 260 CHECK(iterator.done()); |
261 } | 261 } |
262 | 262 |
263 } // namespace interpreter | 263 } // namespace interpreter |
264 } // namespace internal | 264 } // namespace internal |
265 } // namespace v8 | 265 } // namespace v8 |
OLD | NEW |