Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index e34c6337b18db291a2c44ac3ad54dd0c1cf22617..64d828305e65a1e29a69d3b1ee5984375a3caaa8 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -276,11 +276,23 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister( |
Register reg) { |
// TODO(oth): Avoid storing the accumulator in the register if the |
// previous bytecode loaded the accumulator with the same register. |
+ // |
+ // TODO(oth): If the previous bytecode is a MOV into this register, |
+ // the previous instruction can be removed. The logic for determining |
+ // these redundant MOVs appears complex. |
Output(Bytecode::kStar, reg.ToOperand()); |
return *this; |
} |
+BytecodeArrayBuilder& BytecodeArrayBuilder::MoveRegister(Register from, |
+ Register to) { |
+ DCHECK(from != to); |
+ Output(Bytecode::kMov, from.ToOperand(), to.ToOperand()); |
+ return *this; |
+} |
+ |
+ |
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal( |
size_t name_index, int feedback_slot, LanguageMode language_mode) { |
Bytecode bytecode = BytecodeForLoadGlobal(language_mode); |