| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // one we use to specify an unknown byte. | 162 // one we use to specify an unknown byte. |
| 163 CHECK_NE(raw_operand, _); | 163 CHECK_NE(raw_operand, _); |
| 164 if (expected.bytecode[operand_index] == _) { | 164 if (expected.bytecode[operand_index] == _) { |
| 165 continue; | 165 continue; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 uint32_t expected_operand; | 168 uint32_t expected_operand; |
| 169 switch (Bytecodes::SizeOfOperand(operand_type)) { | 169 switch (Bytecodes::SizeOfOperand(operand_type)) { |
| 170 case OperandSize::kNone: | 170 case OperandSize::kNone: |
| 171 UNREACHABLE(); | 171 UNREACHABLE(); |
| 172 return; |
| 172 case OperandSize::kByte: | 173 case OperandSize::kByte: |
| 173 expected_operand = | 174 expected_operand = |
| 174 static_cast<uint32_t>(expected.bytecode[operand_index]); | 175 static_cast<uint32_t>(expected.bytecode[operand_index]); |
| 175 break; | 176 break; |
| 176 case OperandSize::kShort: | 177 case OperandSize::kShort: |
| 177 expected_operand = Bytecodes::ShortOperandFromBytes( | 178 expected_operand = Bytecodes::ShortOperandFromBytes( |
| 178 &expected.bytecode[operand_index]); | 179 &expected.bytecode[operand_index]); |
| 179 break; | 180 break; |
| 181 default: |
| 182 UNREACHABLE(); |
| 183 return; |
| 180 } | 184 } |
| 181 if (raw_operand != expected_operand) { | 185 if (raw_operand != expected_operand) { |
| 182 std::ostringstream stream; | 186 std::ostringstream stream; |
| 183 stream << "Check failed: expected operand [" << j << "] for bytecode [" | 187 stream << "Check failed: expected operand [" << j << "] for bytecode [" |
| 184 << bytecode_index << "] to be " | 188 << bytecode_index << "] to be " |
| 185 << static_cast<unsigned int>(expected_operand) << " but got " | 189 << static_cast<unsigned int>(expected_operand) << " but got " |
| 186 << static_cast<unsigned int>(raw_operand); | 190 << static_cast<unsigned int>(raw_operand); |
| 187 FATAL(stream.str().c_str()); | 191 FATAL(stream.str().c_str()); |
| 188 } | 192 } |
| 189 } | 193 } |
| (...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 Handle<BytecodeArray> bytecode_array = | 1671 Handle<BytecodeArray> bytecode_array = |
| 1668 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 1672 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
| 1669 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 1673 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
| 1670 } | 1674 } |
| 1671 } | 1675 } |
| 1672 | 1676 |
| 1673 | 1677 |
| 1674 } // namespace interpreter | 1678 } // namespace interpreter |
| 1675 } // namespace internal | 1679 } // namespace internal |
| 1676 } // namespace v8 | 1680 } // namespace v8 |
| OLD | NEW |