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