| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant); | 72 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdaConstant); |
| 73 CHECK_EQ(*iterator.GetConstantForIndexOperand(0), smi_1); | 73 CHECK_EQ(*iterator.GetConstantForIndexOperand(0), smi_1); |
| 74 CHECK(!iterator.done()); | 74 CHECK(!iterator.done()); |
| 75 iterator.Advance(); | 75 iterator.Advance(); |
| 76 | 76 |
| 77 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdar); | 77 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLdar); |
| 78 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index()); | 78 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_0.index()); |
| 79 CHECK(!iterator.done()); | 79 CHECK(!iterator.done()); |
| 80 iterator.Advance(); | 80 iterator.Advance(); |
| 81 | 81 |
| 82 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLoadIC); | 82 CHECK_EQ(iterator.current_bytecode(), Bytecode::kLoadICSloppy); |
| 83 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index()); | 83 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_1.index()); |
| 84 CHECK_EQ(iterator.GetIndexOperand(1), feedback_slot); | 84 CHECK_EQ(iterator.GetIndexOperand(1), feedback_slot); |
| 85 CHECK(!iterator.done()); | 85 CHECK(!iterator.done()); |
| 86 iterator.Advance(); | 86 iterator.Advance(); |
| 87 | 87 |
| 88 CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar); | 88 CHECK_EQ(iterator.current_bytecode(), Bytecode::kStar); |
| 89 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_2.index()); | 89 CHECK_EQ(iterator.GetRegisterOperand(0).index(), reg_2.index()); |
| 90 CHECK(!iterator.done()); | 90 CHECK(!iterator.done()); |
| 91 iterator.Advance(); | 91 iterator.Advance(); |
| 92 | 92 |
| 93 CHECK_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime); | 93 CHECK_EQ(iterator.current_bytecode(), Bytecode::kCallRuntime); |
| 94 CHECK_EQ(static_cast<Runtime::FunctionId>(iterator.GetIndexOperand(0)), | 94 CHECK_EQ(static_cast<Runtime::FunctionId>(iterator.GetIndexOperand(0)), |
| 95 Runtime::kLoadIC_Miss); | 95 Runtime::kLoadIC_Miss); |
| 96 CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index()); | 96 CHECK_EQ(iterator.GetRegisterOperand(1).index(), reg_0.index()); |
| 97 CHECK_EQ(iterator.GetCountOperand(2), 1); | 97 CHECK_EQ(iterator.GetCountOperand(2), 1); |
| 98 CHECK(!iterator.done()); | 98 CHECK(!iterator.done()); |
| 99 iterator.Advance(); | 99 iterator.Advance(); |
| 100 | 100 |
| 101 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 101 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
| 102 CHECK(!iterator.done()); | 102 CHECK(!iterator.done()); |
| 103 iterator.Advance(); | 103 iterator.Advance(); |
| 104 CHECK(iterator.done()); | 104 CHECK(iterator.done()); |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace interpreter | 107 } // namespace interpreter |
| 108 } // namespace internal | 108 } // namespace internal |
| 109 } // namespace v8 | 109 } // namespace v8 |
| OLD | NEW |