| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 .StoreAccumulatorInRegister(reg_0) | 47 .StoreAccumulatorInRegister(reg_0) |
| 48 .LoadLiteral(smi_1) | 48 .LoadLiteral(smi_1) |
| 49 .StackCheck(1) | 49 .StackCheck(1) |
| 50 .StoreAccumulatorInRegister(reg_1) | 50 .StoreAccumulatorInRegister(reg_1) |
| 51 .LoadAccumulatorWithRegister(reg_0) | 51 .LoadAccumulatorWithRegister(reg_0) |
| 52 .BinaryOperation(Token::Value::ADD, reg_0, 2) | 52 .BinaryOperation(Token::Value::ADD, reg_0, 2) |
| 53 .StoreAccumulatorInRegister(reg_1) | 53 .StoreAccumulatorInRegister(reg_1) |
| 54 .LoadNamedProperty(reg_1, name, feedback_slot) | 54 .LoadNamedProperty(reg_1, name, feedback_slot) |
| 55 .BinaryOperation(Token::Value::ADD, reg_0, 3) | 55 .BinaryOperation(Token::Value::ADD, reg_0, 3) |
| 56 .StoreAccumulatorInRegister(param) | 56 .StoreAccumulatorInRegister(param) |
| 57 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, 1, reg_0) | 57 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, param, reg_0) |
| 58 .ForInPrepare(reg_0, reg_0) | 58 .ForInPrepare(reg_0, reg_0) |
| 59 .CallRuntime(Runtime::kLoadIC_Miss, reg_0, 1) | 59 .CallRuntime(Runtime::kLoadIC_Miss, reg_0) |
| 60 .Debugger() | 60 .Debugger() |
| 61 .LoadGlobal(0x10000000, TypeofMode::NOT_INSIDE_TYPEOF) | 61 .LoadGlobal(0x10000000, TypeofMode::NOT_INSIDE_TYPEOF) |
| 62 .Return(); | 62 .Return(); |
| 63 | 63 |
| 64 // Test iterator sees the expected output from the builder. | 64 // Test iterator sees the expected output from the builder. |
| 65 BytecodeArrayIterator iterator(builder.ToBytecodeArray(isolate())); | 65 BytecodeArrayIterator iterator(builder.ToBytecodeArray(isolate())); |
| 66 const int kPrefixByteSize = 1; | 66 const int kPrefixByteSize = 1; |
| 67 int offset = 0; | 67 int offset = 0; |
| 68 | 68 |
| 69 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant); | 69 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 CHECK_EQ(iterator.current_offset(), offset); | 276 CHECK_EQ(iterator.current_offset(), offset); |
| 277 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); | 277 CHECK_EQ(iterator.current_operand_scale(), OperandScale::kSingle); |
| 278 CHECK(!iterator.done()); | 278 CHECK(!iterator.done()); |
| 279 iterator.Advance(); | 279 iterator.Advance(); |
| 280 CHECK(iterator.done()); | 280 CHECK(iterator.done()); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace interpreter | 283 } // namespace interpreter |
| 284 } // namespace internal | 284 } // namespace internal |
| 285 } // namespace v8 | 285 } // namespace v8 |
| OLD | NEW |