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

Side by Side Diff: src/interpreter/bytecode-array-builder.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 | « no previous file | src/interpreter/bytecode-array-iterator.cc » ('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-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 for (int i = 0; i < static_cast<int>(N); i++) { 116 for (int i = 0; i < static_cast<int>(N); i++) {
117 DCHECK(OperandIsValid(bytecode, i, operands[i])); 117 DCHECK(OperandIsValid(bytecode, i, operands[i]));
118 switch (Bytecodes::GetOperandSize(bytecode, i)) { 118 switch (Bytecodes::GetOperandSize(bytecode, i)) {
119 case OperandSize::kNone: 119 case OperandSize::kNone:
120 UNREACHABLE(); 120 UNREACHABLE();
121 case OperandSize::kByte: 121 case OperandSize::kByte:
122 bytecodes()->push_back(static_cast<uint8_t>(operands[i])); 122 bytecodes()->push_back(static_cast<uint8_t>(operands[i]));
123 break; 123 break;
124 case OperandSize::kShort: { 124 case OperandSize::kShort: {
125 uint8_t operand_bytes[2]; 125 uint8_t operand_bytes[2];
126 Bytecodes::ShortOperandToBytes(operands[i], operand_bytes); 126 WriteUnalignedUInt16(operand_bytes, operands[i]);
127 bytecodes()->insert(bytecodes()->end(), operand_bytes, 127 bytecodes()->insert(bytecodes()->end(), operand_bytes,
128 operand_bytes + 2); 128 operand_bytes + 2);
129 break; 129 break;
130 } 130 }
131 } 131 }
132 } 132 }
133 } 133 }
134 134
135 135
136 void BytecodeArrayBuilder::Output(Bytecode bytecode, uint32_t operand0, 136 void BytecodeArrayBuilder::Output(Bytecode bytecode, uint32_t operand0,
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 DCHECK_GT(next_consecutive_count_, 0); 1151 DCHECK_GT(next_consecutive_count_, 0);
1152 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); 1152 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_);
1153 allocated_.push_back(next_consecutive_register_); 1153 allocated_.push_back(next_consecutive_register_);
1154 next_consecutive_count_--; 1154 next_consecutive_count_--;
1155 return Register(next_consecutive_register_++); 1155 return Register(next_consecutive_register_++);
1156 } 1156 }
1157 1157
1158 } // namespace interpreter 1158 } // namespace interpreter
1159 } // namespace internal 1159 } // namespace internal
1160 } // namespace v8 1160 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698