Index: src/interpreter/bytecode-peephole-optimizer.cc |
diff --git a/src/interpreter/bytecode-peephole-optimizer.cc b/src/interpreter/bytecode-peephole-optimizer.cc |
index 8570ddd843b317897c66d7786bf2f6073879d92a..4e9d27fcbfbdc6117e4d1afe22e2b5dcf178a867 100644 |
--- a/src/interpreter/bytecode-peephole-optimizer.cc |
+++ b/src/interpreter/bytecode-peephole-optimizer.cc |
@@ -221,18 +221,6 @@ void BytecodePeepholeOptimizer::ElideCurrentIfOperand0MatchesAction( |
} |
} |
-void BytecodePeepholeOptimizer::ElideCurrentIfLoadingNameConstantAction( |
- BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
- DCHECK_EQ(last()->bytecode(), Bytecode::kLdaConstant); |
- DCHECK(!Bytecodes::IsJump(node->bytecode())); |
- |
- if (GetConstantForIndexOperand(last(), 0)->IsName()) { |
- ElideCurrentAction(node); |
- } else { |
- DefaultAction(node); |
- } |
-} |
- |
void BytecodePeepholeOptimizer::ElideLastAction( |
BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
DCHECK(LastIsValid()); |
@@ -256,7 +244,7 @@ void BytecodePeepholeOptimizer::ChangeBytecodeAction( |
DCHECK(LastIsValid()); |
DCHECK(!Bytecodes::IsJump(node->bytecode())); |
- node->set_bytecode(action_data->bytecode); |
+ node->replace_bytecode(action_data->bytecode); |
DefaultAction(node); |
} |
@@ -301,6 +289,17 @@ void BytecodePeepholeOptimizer:: |
} |
} |
+void BytecodePeepholeOptimizer::TransformToStarIfLoadingNameConstantAction( |
+ BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
+ DCHECK_EQ(last()->bytecode(), Bytecode::kLdaConstant); |
+ DCHECK(!Bytecodes::IsJump(node->bytecode())); |
+ |
+ if (GetConstantForIndexOperand(last(), 0)->IsName()) { |
+ node->replace_bytecode(Bytecode::kStar); |
+ } |
+ DefaultAction(node); |
+} |
+ |
void BytecodePeepholeOptimizer::DefaultJumpAction( |
BytecodeNode* const node, const PeepholeActionAndData* action_data) { |
DCHECK(LastIsValid()); |