| Index: src/ia32/lithium-ia32.cc
|
| ===================================================================
|
| --- src/ia32/lithium-ia32.cc (revision 7161)
|
| +++ src/ia32/lithium-ia32.cc (working copy)
|
| @@ -1366,13 +1366,23 @@
|
| if (instr->representation().IsInteger32()) {
|
| ASSERT(instr->left()->representation().IsInteger32());
|
| ASSERT(instr->right()->representation().IsInteger32());
|
| - // The temporary operand is necessary to ensure that right is not allocated
|
| - // into edx.
|
| - LOperand* temp = FixedTemp(edx);
|
| - LOperand* value = UseFixed(instr->left(), eax);
|
| - LOperand* divisor = UseRegister(instr->right());
|
| - LModI* mod = new LModI(value, divisor, temp);
|
| - LInstruction* result = DefineFixed(mod, edx);
|
| +
|
| + LInstruction* result;
|
| + if (instr->HasPowerOf2Divisor()) {
|
| + ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
|
| + LOperand* value = UseRegisterAtStart(instr->left());
|
| + LModI* mod = new LModI(value, UseOrConstant(instr->right()), NULL);
|
| + result = DefineSameAsFirst(mod);
|
| + } else {
|
| + // The temporary operand is necessary to ensure that right is
|
| + // not allocated into edx.
|
| + LOperand* temp = FixedTemp(edx);
|
| + LOperand* value = UseFixed(instr->left(), eax);
|
| + LOperand* divisor = UseRegister(instr->right());
|
| + LModI* mod = new LModI(value, divisor, temp);
|
| + result = DefineFixed(mod, edx);
|
| + }
|
| +
|
| return (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
|
| instr->CheckFlag(HValue::kCanBeDivByZero))
|
| ? AssignEnvironment(result)
|
| @@ -1933,6 +1943,13 @@
|
| }
|
|
|
|
|
| +LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
|
| + LOperand* char_code = UseRegister(instr->value());
|
| + LStringCharFromCode* result = new LStringCharFromCode(char_code);
|
| + return AssignPointerMap(DefineAsRegister(result));
|
| +}
|
| +
|
| +
|
| LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
|
| LOperand* string = UseRegisterAtStart(instr->value());
|
| return DefineAsRegister(new LStringLength(string));
|
|
|