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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 REGISTER_OUTPUT_OPERAND_TYPE_LIST(IS_REGISTER_OUTPUT_OPERAND_TYPE) | 148 REGISTER_OUTPUT_OPERAND_TYPE_LIST(IS_REGISTER_OUTPUT_OPERAND_TYPE) |
149 #undef IS_REGISTER_OUTPUT_OPERAND_TYPE | 149 #undef IS_REGISTER_OUTPUT_OPERAND_TYPE |
150 | 150 |
151 #define IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE(Name, _) \ | 151 #define IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE(Name, _) \ |
152 CHECK(!Bytecodes::IsRegisterOutputOperandType(OperandType::k##Name)); | 152 CHECK(!Bytecodes::IsRegisterOutputOperandType(OperandType::k##Name)); |
153 NON_REGISTER_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) | 153 NON_REGISTER_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) |
154 REGISTER_INPUT_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) | 154 REGISTER_INPUT_OPERAND_TYPE_LIST(IS_NOT_REGISTER_OUTPUT_OPERAND_TYPE) |
155 #undef IS_NOT_REGISTER_INPUT_OPERAND_TYPE | 155 #undef IS_NOT_REGISTER_INPUT_OPERAND_TYPE |
156 } | 156 } |
157 | 157 |
| 158 TEST(Bytecodes, DebugBreak) { |
| 159 for (uint32_t i = 0; i < Bytecodes::ToByte(Bytecode::kLast); i++) { |
| 160 Bytecode bytecode = Bytecodes::FromByte(i); |
| 161 Bytecode debugbreak = Bytecodes::GetDebugBreak(bytecode); |
| 162 if (!Bytecodes::IsDebugBreak(debugbreak)) { |
| 163 PrintF("Bytecode %s has no matching debug break with length %d\n", |
| 164 Bytecodes::ToString(bytecode), Bytecodes::Size(bytecode)); |
| 165 CHECK(false); |
| 166 } |
| 167 } |
| 168 } |
| 169 |
158 } // namespace interpreter | 170 } // namespace interpreter |
159 } // namespace internal | 171 } // namespace internal |
160 } // namespace v8 | 172 } // namespace v8 |
OLD | NEW |