| Index: src/arm/lithium-arm.cc
|
| ===================================================================
|
| --- src/arm/lithium-arm.cc (revision 7161)
|
| +++ src/arm/lithium-arm.cc (working copy)
|
| @@ -1350,10 +1350,21 @@
|
| // when we provide a native implementation.
|
| ASSERT(instr->left()->representation().IsInteger32());
|
| ASSERT(instr->right()->representation().IsInteger32());
|
| - LOperand* value = UseFixed(instr->left(), r0);
|
| - LOperand* divisor = UseFixed(instr->right(), r1);
|
| - LInstruction* result = DefineFixed(new LModI(value, divisor), r0);
|
| - result = AssignEnvironment(AssignPointerMap(result));
|
| +
|
| + LInstruction* result;
|
| + if (instr->HasPowerOf2Divisor()) {
|
| + ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
|
| + LOperand* value = UseRegisterAtStart(instr->left());
|
| + LModI* mod = new LModI(value, UseOrConstant(instr->right()));
|
| + result = DefineSameAsFirst(mod);
|
| + result = AssignEnvironment(result);
|
| + } else {
|
| + LOperand* value = UseFixed(instr->left(), r0);
|
| + LOperand* divisor = UseFixed(instr->right(), r1);
|
| + result = DefineFixed(new LModI(value, divisor), r0);
|
| + result = AssignEnvironment(AssignPointerMap(result));
|
| + }
|
| +
|
| return result;
|
| } else if (instr->representation().IsTagged()) {
|
| return DoArithmeticT(Token::MOD, instr);
|
| @@ -1893,6 +1904,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));
|
|
|