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

Unified Diff: src/interpreter/bytecodes.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecodes.cc
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc
index 8b99f4fb1ce97bc46763a45d71e85117ae015a86..3ddd7d5fce818cc6a97a45685f018fd164a7dee2 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -182,18 +182,6 @@ bool Bytecodes::IsJumpConstant(Bytecode bytecode) {
// static
-uint16_t Bytecodes::ShortOperandFromBytes(const uint8_t* bytes) {
- return *reinterpret_cast<const uint16_t*>(bytes);
-}
-
-
-// static
-void Bytecodes::ShortOperandToBytes(uint16_t operand, uint8_t* bytes_out) {
- *reinterpret_cast<uint16_t*>(bytes_out) = operand;
-}
-
-
-// static
std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start,
int parameter_count) {
Vector<char> buf = Vector<char>::New(50);
@@ -225,7 +213,7 @@ std::ostream& Bytecodes::Decode(std::ostream& os, const uint8_t* bytecode_start,
os << "[" << static_cast<unsigned int>(*operand_start) << "]";
break;
case interpreter::OperandType::kIdx16: {
- os << "[" << Bytecodes::ShortOperandFromBytes(operand_start) << "]";
+ os << "[" << ReadUnalignedUInt16(operand_start) << "]";
break;
}
case interpreter::OperandType::kImm8:
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698