Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index 64083e8597381c7549a356bb79e253cc6a8f13c5..8039b5ac0ecaeeea5bfb35aea06636d7c3bb6814 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -2457,8 +2457,15 @@ LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { |
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)); |
} |