Index: test/unittests/interpreter/bytecodes-unittest.cc |
diff --git a/test/unittests/interpreter/bytecodes-unittest.cc b/test/unittests/interpreter/bytecodes-unittest.cc |
index b3554c385372869de67591df26a31a14b0e6ead8..a1e1bab5ee47bca43c69ef90dfbccc1c9021abeb 100644 |
--- a/test/unittests/interpreter/bytecodes-unittest.cc |
+++ b/test/unittests/interpreter/bytecodes-unittest.cc |
@@ -187,37 +187,73 @@ TEST(Bytecodes, DecodeBytecodeAndOperands) { |
#define B(Name) static_cast<uint8_t>(Bytecode::k##Name) |
const BytecodesAndResult cases[] = { |
- {{B(LdaSmi), 0x01}, 2, 0, " LdaSmi [1]"}, |
- {{B(Wide), B(LdaSmi), 0xe8, 0x03}, 4, 0, " LdaSmi.Wide [1000]"}, |
- {{B(ExtraWide), B(LdaSmi), 0xa0, 0x86, 0x01, 0x00}, |
- 6, |
- 0, |
- "LdaSmi.ExtraWide [100000]"}, |
- {{B(LdaSmi), 0xff}, 2, 0, " LdaSmi [-1]"}, |
- {{B(Wide), B(LdaSmi), 0x18, 0xfc}, 4, 0, " LdaSmi.Wide [-1000]"}, |
- {{B(ExtraWide), B(LdaSmi), 0x60, 0x79, 0xfe, 0xff}, |
- 6, |
- 0, |
- "LdaSmi.ExtraWide [-100000]"}, |
- {{B(Star), 0xfb}, 2, 0, " Star r5"}, |
- {{B(Wide), B(Star), 0x78, 0xff}, 4, 0, " Star.Wide r136"}, |
- {{B(Wide), B(Call), 0x7a, 0xff, 0x79, 0xff, 0x02, 0x00, 0xb1, 0x00}, |
- 10, |
- 0, |
- "Call.Wide r134, r135, #2, [177]"}, |
- {{B(Ldar), |
- static_cast<uint8_t>(Register::FromParameterIndex(2, 3).ToOperand())}, |
- 2, |
- 3, |
- " Ldar a1"}, |
- {{B(Wide), B(CreateObjectLiteral), 0x01, 0x02, 0x03, 0x04, 0xa5}, |
- 7, |
- 0, |
- "CreateObjectLiteral.Wide [513], [1027], #165"}, |
- {{B(ExtraWide), B(JumpIfNull), 0x15, 0xcd, 0x5b, 0x07}, |
- 6, |
- 0, |
- "JumpIfNull.ExtraWide [123456789]"}, |
+#if V8_TARGET_LITTLE_ENDIAN |
+ {{B(LdaSmi), 0x01}, 2, 0, " LdaSmi [1]"}, |
+ {{B(Wide), B(LdaSmi), 0xe8, 0x03}, 4, 0, " LdaSmi.Wide [1000]"}, |
+ {{B(ExtraWide), B(LdaSmi), 0xa0, 0x86, 0x01, 0x00}, |
+ 6, |
+ 0, |
+ "LdaSmi.ExtraWide [100000]"}, |
+ {{B(LdaSmi), 0xff}, 2, 0, " LdaSmi [-1]"}, |
+ {{B(Wide), B(LdaSmi), 0x18, 0xfc}, 4, 0, " LdaSmi.Wide [-1000]"}, |
+ {{B(ExtraWide), B(LdaSmi), 0x60, 0x79, 0xfe, 0xff}, |
+ 6, |
+ 0, |
+ "LdaSmi.ExtraWide [-100000]"}, |
+ {{B(Star), 0xfb}, 2, 0, " Star r5"}, |
+ {{B(Wide), B(Star), 0x78, 0xff}, 4, 0, " Star.Wide r136"}, |
+ {{B(Wide), B(Call), 0x7a, 0xff, 0x79, 0xff, 0x02, 0x00, 0xb1, 0x00}, |
+ 10, |
+ 0, |
+ "Call.Wide r134, r135, #2, [177]"}, |
+ {{B(Ldar), |
+ static_cast<uint8_t>(Register::FromParameterIndex(2, 3).ToOperand())}, |
+ 2, |
+ 3, |
+ " Ldar a1"}, |
+ {{B(Wide), B(CreateObjectLiteral), 0x01, 0x02, 0x03, 0x04, 0xa5}, |
+ 7, |
+ 0, |
+ "CreateObjectLiteral.Wide [513], [1027], #165"}, |
+ {{B(ExtraWide), B(JumpIfNull), 0x15, 0xcd, 0x5b, 0x07}, |
+ 6, |
+ 0, |
+ "JumpIfNull.ExtraWide [123456789]"}, |
+#elif V8_TARGET_BIG_ENDIAN |
+ {{B(LdaSmi), 0x01}, 2, 0, " LdaSmi [1]"}, |
+ {{B(Wide), B(LdaSmi), 0x03, 0xe8}, 4, 0, " LdaSmi.Wide [1000]"}, |
+ {{B(ExtraWide), B(LdaSmi), 0x00, 0x01, 0x86, 0xa0}, |
+ 6, |
+ 0, |
+ "LdaSmi.ExtraWide [100000]"}, |
+ {{B(LdaSmi), 0xff}, 2, 0, " LdaSmi [-1]"}, |
+ {{B(Wide), B(LdaSmi), 0xfc, 0x18}, 4, 0, " LdaSmi.Wide [-1000]"}, |
+ {{B(ExtraWide), B(LdaSmi), 0xff, 0xfe, 0x79, 0x60}, |
+ 6, |
+ 0, |
+ "LdaSmi.ExtraWide [-100000]"}, |
+ {{B(Star), 0xfb}, 2, 0, " Star r5"}, |
+ {{B(Wide), B(Star), 0xff, 0x78}, 4, 0, " Star.Wide r136"}, |
+ {{B(Wide), B(Call), 0xff, 0x7a, 0xff, 0x79, 0x00, 0x02, 0x00, 0xb1}, |
+ 10, |
+ 0, |
+ "Call.Wide r134, r135, #2, [177]"}, |
+ {{B(Ldar), |
+ static_cast<uint8_t>(Register::FromParameterIndex(2, 3).ToOperand())}, |
+ 2, |
+ 3, |
+ " Ldar a1"}, |
+ {{B(Wide), B(CreateObjectLiteral), 0x02, 0x01, 0x04, 0x03, 0xa5}, |
+ 7, |
+ 0, |
+ "CreateObjectLiteral.Wide [513], [1027], #165"}, |
+ {{B(ExtraWide), B(JumpIfNull), 0x07, 0x5b, 0xcd, 0x15}, |
+ 6, |
+ 0, |
+ "JumpIfNull.ExtraWide [123456789]"}, |
+#else |
+#error "Unknown Architecture" |
+#endif |
}; |
#undef B |