Index: src/interpreter/bytecode-peephole-optimizer.cc |
diff --git a/src/interpreter/bytecode-peephole-optimizer.cc b/src/interpreter/bytecode-peephole-optimizer.cc |
index 887f9ce9737525c9e12231d4f1dcfac796cb7016..acfe484ad37f85c6a32ff881d281ab3642c5f5ca 100644 |
--- a/src/interpreter/bytecode-peephole-optimizer.cc |
+++ b/src/interpreter/bytecode-peephole-optimizer.cc |
@@ -141,13 +141,14 @@ BytecodeNode TransformLdaZeroBinaryOpToBinaryOpWithZero( |
return node; |
} |
-BytecodeNode TransformEqualityWithNullOrUndefinedToTestUndetectable( |
- BytecodeNode* const last, BytecodeNode* const current) { |
+BytecodeNode TransformEqualityWithNullOrUndefined(Bytecode new_bytecode, |
+ BytecodeNode* const last, |
+ BytecodeNode* const current) { |
DCHECK((last->bytecode() == Bytecode::kLdaNull) || |
(last->bytecode() == Bytecode::kLdaUndefined)); |
- DCHECK_EQ(current->bytecode(), Bytecode::kTestEqual); |
- BytecodeNode node(BytecodeNode::TestUndetectable(current->source_info(), |
- current->operand(0))); |
+ DCHECK((current->bytecode() == Bytecode::kTestEqual) || |
+ (current->bytecode() == Bytecode::kTestEqualStrict)); |
+ BytecodeNode node(new_bytecode, current->operand(0), current->source_info()); |
if (last->source_info().is_valid()) { |
node.set_source_info(last->source_info()); |
} |
@@ -267,14 +268,13 @@ void BytecodePeepholeOptimizer:: |
} |
} |
-void BytecodePeepholeOptimizer:: |
- TransformEqualityWithNullOrUndefinedToTestUndetectableAction( |
- BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
+void BytecodePeepholeOptimizer::TransformEqualityWithNullOrUndefinedAction( |
+ BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
DCHECK(LastIsValid()); |
DCHECK(!Bytecodes::IsJump(node->bytecode())); |
// Fused last and current into current. |
- BytecodeNode new_node( |
- TransformEqualityWithNullOrUndefinedToTestUndetectable(last(), node)); |
+ BytecodeNode new_node(TransformEqualityWithNullOrUndefined( |
+ action_data->bytecode, last(), node)); |
SetLast(&new_node); |
} |