Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1423373004: MIPS: Fix unaligned read of bytecodes in interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 uint32_t expected_operand; 173 uint32_t expected_operand;
174 switch (Bytecodes::SizeOfOperand(operand_type)) { 174 switch (Bytecodes::SizeOfOperand(operand_type)) {
175 case OperandSize::kNone: 175 case OperandSize::kNone:
176 UNREACHABLE(); 176 UNREACHABLE();
177 return; 177 return;
178 case OperandSize::kByte: 178 case OperandSize::kByte:
179 expected_operand = 179 expected_operand =
180 static_cast<uint32_t>(expected.bytecode[operand_index]); 180 static_cast<uint32_t>(expected.bytecode[operand_index]);
181 break; 181 break;
182 case OperandSize::kShort: 182 case OperandSize::kShort:
183 expected_operand = Bytecodes::ShortOperandFromBytes( 183 expected_operand =
184 &expected.bytecode[operand_index]); 184 ReadUnalignedUInt16(&expected.bytecode[operand_index]);
185 break; 185 break;
186 default: 186 default:
187 UNREACHABLE(); 187 UNREACHABLE();
188 return; 188 return;
189 } 189 }
190 if (raw_operand != expected_operand) { 190 if (raw_operand != expected_operand) {
191 std::ostringstream stream; 191 std::ostringstream stream;
192 stream << "Check failed: expected operand [" << j << "] for bytecode [" 192 stream << "Check failed: expected operand [" << j << "] for bytecode ["
193 << bytecode_index << "] to be " 193 << bytecode_index << "] to be "
194 << static_cast<unsigned int>(expected_operand) << " but got " 194 << static_cast<unsigned int>(expected_operand) << " but got "
(...skipping 3870 matching lines...) Expand 10 before | Expand all | Expand 10 after
4065 for (size_t i = 0; i < arraysize(snippets); i++) { 4065 for (size_t i = 0; i < arraysize(snippets); i++) {
4066 Handle<BytecodeArray> bytecode_array = 4066 Handle<BytecodeArray> bytecode_array =
4067 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); 4067 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
4068 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 4068 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
4069 } 4069 }
4070 } 4070 }
4071 4071
4072 } // namespace interpreter 4072 } // namespace interpreter
4073 } // namespace internal 4073 } // namespace internal
4074 } // namespace v8 4074 } // namespace v8
OLDNEW
« no previous file with comments | « src/utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698