Index: test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc |
diff --git a/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc b/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc |
index ee6d1478bd7dc96fa7e656d02cebbfbbf83c4671..c7ebc5d31496725b4e222d57918c2dba40663ced 100644 |
--- a/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc |
+++ b/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc |
@@ -321,81 +321,6 @@ TEST_F(BytecodePeepholeOptimizerTest, NopStatementStackCheck) { |
// Tests covering BytecodePeepholeOptimizer::UpdateLastAndCurrentBytecodes(). |
-TEST_F(BytecodePeepholeOptimizerTest, MergeLdaGlobalStar) { |
- const uint32_t operands[] = {19191, |
- static_cast<uint32_t>(Register(1).ToOperand())}; |
- const int expected_operand_count = static_cast<int>(arraysize(operands)); |
- |
- BytecodeNode first(Bytecode::kLdaGlobal, operands[0]); |
- BytecodeNode second(Bytecode::kStar, operands[1]); |
- BytecodeNode third(Bytecode::kReturn); |
- optimizer()->Write(&first); |
- optimizer()->Write(&second); |
- CHECK_EQ(write_count(), 1); |
- CHECK_EQ(last_written().bytecode(), Bytecode::kLdrGlobal); |
- CHECK_EQ(last_written().operand_count(), expected_operand_count); |
- for (int i = 0; i < expected_operand_count; ++i) { |
- CHECK_EQ(last_written().operand(i), operands[i]); |
- } |
- optimizer()->Write(&third); |
- CHECK_EQ(write_count(), 2); |
- CHECK_EQ(last_written().bytecode(), Bytecode::kLdar); |
- CHECK_EQ(last_written().operand(0), operands[expected_operand_count - 1]); |
- Flush(); |
- CHECK_EQ(last_written().bytecode(), third.bytecode()); |
-} |
- |
-TEST_F(BytecodePeepholeOptimizerTest, MergeLdaContextSlotStar) { |
- const uint32_t operands[] = { |
- static_cast<uint32_t>(Register(200000).ToOperand()), 55005500, |
- static_cast<uint32_t>(Register(0).ToOperand()), |
- static_cast<uint32_t>(Register(1).ToOperand())}; |
- const int expected_operand_count = static_cast<int>(arraysize(operands)); |
- |
- BytecodeNode first(Bytecode::kLdaContextSlot, operands[0], operands[1], |
- operands[2]); |
- BytecodeNode second(Bytecode::kStar, operands[3]); |
- BytecodeNode third(Bytecode::kReturn); |
- optimizer()->Write(&first); |
- optimizer()->Write(&second); |
- CHECK_EQ(write_count(), 1); |
- CHECK_EQ(last_written().bytecode(), Bytecode::kLdrContextSlot); |
- CHECK_EQ(last_written().operand_count(), expected_operand_count); |
- for (int i = 0; i < expected_operand_count; ++i) { |
- CHECK_EQ(last_written().operand(i), operands[i]); |
- } |
- optimizer()->Write(&third); |
- CHECK_EQ(write_count(), 2); |
- CHECK_EQ(last_written().bytecode(), Bytecode::kLdar); |
- CHECK_EQ(last_written().operand(0), operands[expected_operand_count - 1]); |
- Flush(); |
- CHECK_EQ(last_written().bytecode(), third.bytecode()); |
-} |
- |
-TEST_F(BytecodePeepholeOptimizerTest, MergeLdaUndefinedStar) { |
- const uint32_t operands[] = { |
- static_cast<uint32_t>(Register(100000).ToOperand())}; |
- const int expected_operand_count = static_cast<int>(arraysize(operands)); |
- |
- BytecodeNode first(Bytecode::kLdaUndefined); |
- BytecodeNode second(Bytecode::kStar, operands[0]); |
- BytecodeNode third(Bytecode::kReturn); |
- optimizer()->Write(&first); |
- optimizer()->Write(&second); |
- CHECK_EQ(write_count(), 1); |
- CHECK_EQ(last_written().bytecode(), Bytecode::kLdrUndefined); |
- CHECK_EQ(last_written().operand_count(), expected_operand_count); |
- for (int i = 0; i < expected_operand_count; ++i) { |
- CHECK_EQ(last_written().operand(i), operands[i]); |
- } |
- optimizer()->Write(&third); |
- CHECK_EQ(write_count(), 2); |
- CHECK_EQ(last_written().bytecode(), Bytecode::kLdar); |
- CHECK_EQ(last_written().operand(0), operands[expected_operand_count - 1]); |
- Flush(); |
- CHECK_EQ(last_written().bytecode(), third.bytecode()); |
-} |
- |
TEST_F(BytecodePeepholeOptimizerTest, MergeLdaSmiWithBinaryOp) { |
Bytecode operator_replacement_pairs[][2] = { |
{Bytecode::kAdd, Bytecode::kAddSmi}, |