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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/interpreter/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCall), 2); | 88 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCall), 2); |
89 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntime), 1); | 89 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntime), 1); |
90 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntimeWide), 1); | 90 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntimeWide), 1); |
91 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntimeForPair), | 91 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntimeForPair), |
92 2); | 92 2); |
93 CHECK_EQ( | 93 CHECK_EQ( |
94 Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntimeForPairWide), | 94 Bytecodes::NumberOfRegisterOperands(Bytecode::kCallRuntimeForPairWide), |
95 2); | 95 2); |
96 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kDeletePropertyStrict), | 96 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kDeletePropertyStrict), |
97 1); | 97 1); |
98 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kDeleteLookupSlot), 0); | |
99 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kForInPrepare), 1); | 98 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kForInPrepare), 1); |
100 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kForInPrepareWide), 1); | 99 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kForInPrepareWide), 1); |
101 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kInc), 0); | 100 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kInc), 0); |
102 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kJumpIfTrue), 0); | 101 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kJumpIfTrue), 0); |
103 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kNew), 2); | 102 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kNew), 2); |
104 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kToName), 0); | 103 CHECK_EQ(Bytecodes::NumberOfRegisterOperands(Bytecode::kToName), 0); |
105 } | 104 } |
106 | 105 |
107 TEST(Bytecodes, RegisterOperandBitmaps) { | 106 TEST(Bytecodes, RegisterOperandBitmaps) { |
108 CHECK_EQ(Bytecodes::GetRegisterOperandBitmap(Bytecode::kAdd), 1); | 107 CHECK_EQ(Bytecodes::GetRegisterOperandBitmap(Bytecode::kAdd), 1); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 #define IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE(Name, _) \ | 151 #define IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE(Name, _) \ |
153 CHECK(!Bytecodes::IsRegisterOutputOperandType(OperandType::k##Name)); | 152 CHECK(!Bytecodes::IsRegisterOutputOperandType(OperandType::k##Name)); |
154 NON_REGISTER_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) | 153 NON_REGISTER_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) |
155 REGISTER_INPUT_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) | 154 REGISTER_INPUT_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) |
156 #undef IS_NOT_REGISTER_INPUT_OPERAND_TYPE | 155 #undef IS_NOT_REGISTER_INPUT_OPERAND_TYPE |
157 } | 156 } |
158 | 157 |
159 } // namespace interpreter | 158 } // namespace interpreter |
160 } // namespace internal | 159 } // namespace internal |
161 } // namespace v8 | 160 } // namespace v8 |
OLD | NEW |