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; | |
161 case OperandSize::kByte: | 160 case OperandSize::kByte: |
162 expected_operand = | 161 expected_operand = |
163 static_cast<uint32_t>(expected.bytecode[operand_index]); | 162 static_cast<uint32_t>(expected.bytecode[operand_index]); |
164 break; | 163 break; |
165 case OperandSize::kShort: | 164 case OperandSize::kShort: |
166 expected_operand = Bytecodes::ShortOperandFromBytes( | 165 expected_operand = Bytecodes::ShortOperandFromBytes( |
167 &expected.bytecode[operand_index]); | 166 &expected.bytecode[operand_index]); |
168 break; | 167 break; |
169 default: | |
170 UNREACHABLE(); | |
171 return; | |
172 } | 168 } |
173 if (raw_operand != expected_operand) { | 169 if (raw_operand != expected_operand) { |
174 std::ostringstream stream; | 170 std::ostringstream stream; |
175 stream << "Check failed: expected operand [" << j << "] for bytecode [" | 171 stream << "Check failed: expected operand [" << j << "] for bytecode [" |
176 << bytecode_index << "] to be " | 172 << bytecode_index << "] to be " |
177 << static_cast<unsigned int>(expected_operand) << " but got " | 173 << static_cast<unsigned int>(expected_operand) << " but got " |
178 << static_cast<unsigned int>(raw_operand); | 174 << static_cast<unsigned int>(raw_operand); |
179 FATAL(stream.str().c_str()); | 175 FATAL(stream.str().c_str()); |
180 } | 176 } |
181 } | 177 } |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 Handle<BytecodeArray> bytecode_array = | 1447 Handle<BytecodeArray> bytecode_array = |
1452 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 1448 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
1453 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 1449 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
1454 } | 1450 } |
1455 } | 1451 } |
1456 | 1452 |
1457 | 1453 |
1458 } // namespace interpreter | 1454 } // namespace interpreter |
1459 } // namespace internal | 1455 } // namespace internal |
1460 } // namespace v8 | 1456 } // namespace v8 |
OLD | NEW |