Index: src/mips/lithium-mips.cc |
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc |
index fb8826b7f358eb0638205fd150593077c2d64b38..41487f6d744149a3702f066707ad4f1e75ba6b66 100644 |
--- a/src/mips/lithium-mips.cc |
+++ b/src/mips/lithium-mips.cc |
@@ -2340,8 +2340,15 @@ LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |
info()->MarkAsRequiresFrame(); |
LOperand* args = UseRegister(instr->arguments()); |
- LOperand* length = UseTempRegister(instr->length()); |
- LOperand* index = UseRegister(instr->index()); |
+ LOperand* length; |
+ LOperand* index; |
+ if (instr->length()->IsConstant() && instr->index()->IsConstant()) { |
+ length = UseRegisterOrConstant(instr->length()); |
+ index = UseOrConstant(instr->index()); |
+ } else { |
+ length = UseTempRegister(instr->length()); |
+ index = Use(instr->index()); |
+ } |
return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index)); |
} |