Index: test/unittests/interpreter/bytecode-array-builder-unittest.cc |
diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc |
index a569c9404785a965af2a0ac16c8796f3f895a767..514b26f778f4918d4ae92cd9cae1d20c16d69f2b 100644 |
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc |
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc |
@@ -47,7 +47,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { |
.LoadLiteral(factory->NewStringFromStaticChars("A constant")) |
.StoreAccumulatorInRegister(reg) |
.LoadUndefined() |
- .StoreAccumulatorInRegister(reg) |
+ .Debugger() // Prevent peephole optimization LdaNull, Star -> LdrNull. |
.LoadNull() |
.StoreAccumulatorInRegister(reg) |
.LoadTheHole() |
@@ -349,6 +349,13 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { |
// Insert entry for nop bytecode as this often gets optimized out. |
scorecard[Bytecodes::ToByte(Bytecode::kNop)] = 1; |
+ // Insert entries for bytecodes only emiited by peephole optimizer. |
+ scorecard[Bytecodes::ToByte(Bytecode::kLdrNamedProperty)] = 1; |
+ scorecard[Bytecodes::ToByte(Bytecode::kLdrKeyedProperty)] = 1; |
+ scorecard[Bytecodes::ToByte(Bytecode::kLdrGlobal)] = 1; |
+ scorecard[Bytecodes::ToByte(Bytecode::kLdrContextSlot)] = 1; |
+ scorecard[Bytecodes::ToByte(Bytecode::kLdrUndefined)] = 1; |
+ |
// Check return occurs at the end and only once in the BytecodeArray. |
CHECK_EQ(final_bytecode, Bytecode::kReturn); |
CHECK_EQ(scorecard[Bytecodes::ToByte(final_bytecode)], 1); |