| Index: src/x64/lithium-x64.cc
|
| ===================================================================
|
| --- src/x64/lithium-x64.cc (revision 11854)
|
| +++ src/x64/lithium-x64.cc (working copy)
|
| @@ -1601,9 +1601,16 @@
|
|
|
|
|
| LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
|
| - LOperand* value = UseRegisterOrConstantAtStart(instr->index());
|
| - LOperand* length = Use(instr->length());
|
| - return AssignEnvironment(new(zone()) LBoundsCheck(value, length));
|
| + if (instr->index()->IsConstant() ||
|
| + (instr->lower_offset() == 0 && instr->upper_offset() == 0)) {
|
| + return AssignEnvironment(new(zone()) LBoundsCheck(
|
| + UseRegisterOrConstantAtStart(instr->index()),
|
| + Use(instr->length()), NULL));
|
| + } else {
|
| + return AssignEnvironment(new(zone()) LBoundsCheck(
|
| + UseRegisterOrConstant(instr->index()),
|
| + Use(instr->length()), TempRegister()));
|
| + }
|
| }
|
|
|
|
|
|
|