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

Side by Side Diff: src/interpreter/bytecodes.h

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-iterator.cc ('k') | src/interpreter/bytecodes.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 #ifndef V8_INTERPRETER_BYTECODES_H_ 5 #ifndef V8_INTERPRETER_BYTECODES_H_
6 #define V8_INTERPRETER_BYTECODES_H_ 6 #define V8_INTERPRETER_BYTECODES_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 // Clients of this interface shouldn't depend on lots of interpreter internals. 10 // Clients of this interface shouldn't depend on lots of interpreter internals.
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 static OperandSize SizeOfOperand(OperandType operand); 293 static OperandSize SizeOfOperand(OperandType operand);
294 294
295 // Return true if the bytecode is a jump or a conditional jump taking 295 // Return true if the bytecode is a jump or a conditional jump taking
296 // an immediate byte operand (OperandType::kImm8). 296 // an immediate byte operand (OperandType::kImm8).
297 static bool IsJump(Bytecode bytecode); 297 static bool IsJump(Bytecode bytecode);
298 298
299 // Return true if the bytecode is a jump or conditional jump taking a 299 // Return true if the bytecode is a jump or conditional jump taking a
300 // constant pool entry (OperandType::kIdx). 300 // constant pool entry (OperandType::kIdx).
301 static bool IsJumpConstant(Bytecode bytecode); 301 static bool IsJumpConstant(Bytecode bytecode);
302 302
303 // Converts bytes[0] and bytes[1] to a 16 bit 'short' operand value.
304 static uint16_t ShortOperandFromBytes(const uint8_t* bytes);
305
306 // Converts 16 bit 'short' |operand| into bytes_out[0] and bytes_out[1].
307 static void ShortOperandToBytes(uint16_t operand, uint8_t* bytes_out);
308
309 // Decode a single bytecode and operands to |os|. 303 // Decode a single bytecode and operands to |os|.
310 static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start, 304 static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start,
311 int number_of_parameters); 305 int number_of_parameters);
312 306
313 private: 307 private:
314 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); 308 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes);
315 }; 309 };
316 310
317 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); 311 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode);
318 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); 312 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type);
319 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); 313 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type);
320 314
321 } // namespace interpreter 315 } // namespace interpreter
322 } // namespace internal 316 } // namespace internal
323 } // namespace v8 317 } // namespace v8
324 318
325 #endif // V8_INTERPRETER_BYTECODES_H_ 319 #endif // V8_INTERPRETER_BYTECODES_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecodes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698