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

Side by Side Diff: src/interpreter/bytecode-array-iterator.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/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | 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/interpreter/bytecode-array-iterator.h" 5 #include "src/interpreter/bytecode-array-iterator.h"
6 6
7 #include "src/objects-inl.h" 7 #include "src/objects-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 30 matching lines...) Expand all
41 uint8_t* operand_start = 41 uint8_t* operand_start =
42 bytecode_array()->GetFirstBytecodeAddress() + bytecode_offset_ + 42 bytecode_array()->GetFirstBytecodeAddress() + bytecode_offset_ +
43 Bytecodes::GetOperandOffset(current_bytecode(), operand_index); 43 Bytecodes::GetOperandOffset(current_bytecode(), operand_index);
44 switch (Bytecodes::SizeOfOperand(operand_type)) { 44 switch (Bytecodes::SizeOfOperand(operand_type)) {
45 default: 45 default:
46 case OperandSize::kNone: 46 case OperandSize::kNone:
47 UNREACHABLE(); 47 UNREACHABLE();
48 case OperandSize::kByte: 48 case OperandSize::kByte:
49 return static_cast<uint32_t>(*operand_start); 49 return static_cast<uint32_t>(*operand_start);
50 case OperandSize::kShort: 50 case OperandSize::kShort:
51 return Bytecodes::ShortOperandFromBytes(operand_start); 51 return ReadUnalignedUInt16(operand_start);
52 } 52 }
53 } 53 }
54 54
55 55
56 int8_t BytecodeArrayIterator::GetImmediateOperand(int operand_index) const { 56 int8_t BytecodeArrayIterator::GetImmediateOperand(int operand_index) const {
57 uint32_t operand = GetRawOperand(operand_index, OperandType::kImm8); 57 uint32_t operand = GetRawOperand(operand_index, OperandType::kImm8);
58 return static_cast<int8_t>(operand); 58 return static_cast<int8_t>(operand);
59 } 59 }
60 60
61 61
(...skipping 21 matching lines...) Expand all
83 83
84 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand( 84 Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand(
85 int operand_index) const { 85 int operand_index) const {
86 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool()); 86 Handle<FixedArray> constants = handle(bytecode_array()->constant_pool());
87 return FixedArray::get(constants, GetIndexOperand(operand_index)); 87 return FixedArray::get(constants, GetIndexOperand(operand_index));
88 } 88 }
89 89
90 } // namespace interpreter 90 } // namespace interpreter
91 } // namespace internal 91 } // namespace internal
92 } // namespace v8 92 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698