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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/interpreter/bytecode-array-iterator.h" | 8 #include "src/interpreter/bytecode-array-iterator.h" |
9 #include "src/interpreter/bytecode-generator.h" | 9 #include "src/interpreter/bytecode-generator.h" |
10 #include "src/interpreter/interpreter.h" | 10 #include "src/interpreter/interpreter.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // one we use to specify an unknown byte. | 150 // one we use to specify an unknown byte. |
151 CHECK_NE(raw_operand, _); | 151 CHECK_NE(raw_operand, _); |
152 if (expected.bytecode[operand_index] == _) { | 152 if (expected.bytecode[operand_index] == _) { |
153 continue; | 153 continue; |
154 } | 154 } |
155 } | 155 } |
156 uint32_t expected_operand; | 156 uint32_t expected_operand; |
157 switch (Bytecodes::SizeOfOperand(operand_type)) { | 157 switch (Bytecodes::SizeOfOperand(operand_type)) { |
158 case OperandSize::kNone: | 158 case OperandSize::kNone: |
159 UNREACHABLE(); | 159 UNREACHABLE(); |
| 160 return; |
160 case OperandSize::kByte: | 161 case OperandSize::kByte: |
161 expected_operand = | 162 expected_operand = |
162 static_cast<uint32_t>(expected.bytecode[operand_index]); | 163 static_cast<uint32_t>(expected.bytecode[operand_index]); |
163 break; | 164 break; |
164 case OperandSize::kShort: | 165 case OperandSize::kShort: |
165 expected_operand = Bytecodes::ShortOperandFromBytes( | 166 expected_operand = Bytecodes::ShortOperandFromBytes( |
166 &expected.bytecode[operand_index]); | 167 &expected.bytecode[operand_index]); |
167 break; | 168 break; |
| 169 default: |
| 170 UNREACHABLE(); |
| 171 return; |
168 } | 172 } |
169 if (raw_operand != expected_operand) { | 173 if (raw_operand != expected_operand) { |
170 std::ostringstream stream; | 174 std::ostringstream stream; |
171 stream << "Check failed: expected operand [" << j << "] for bytecode [" | 175 stream << "Check failed: expected operand [" << j << "] for bytecode [" |
172 << bytecode_index << "] to be " | 176 << bytecode_index << "] to be " |
173 << static_cast<unsigned int>(expected_operand) << " but got " | 177 << static_cast<unsigned int>(expected_operand) << " but got " |
174 << static_cast<unsigned int>(raw_operand); | 178 << static_cast<unsigned int>(raw_operand); |
175 FATAL(stream.str().c_str()); | 179 FATAL(stream.str().c_str()); |
176 } | 180 } |
177 } | 181 } |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 Handle<BytecodeArray> bytecode_array = | 1451 Handle<BytecodeArray> bytecode_array = |
1448 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 1452 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
1449 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 1453 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
1450 } | 1454 } |
1451 } | 1455 } |
1452 | 1456 |
1453 | 1457 |
1454 } // namespace interpreter | 1458 } // namespace interpreter |
1455 } // namespace internal | 1459 } // namespace internal |
1456 } // namespace v8 | 1460 } // namespace v8 |
OLD | NEW |