Chromium Code Reviews| Index: src/ia32/lithium-ia32.cc |
| =================================================================== |
| --- src/ia32/lithium-ia32.cc (revision 5948) |
| +++ src/ia32/lithium-ia32.cc (working copy) |
| @@ -1366,6 +1366,8 @@ |
| return AssignEnvironment(DefineAsRegister(result)); |
| case kMathSqrt: |
| return DefineSameAsFirst(result); |
| + case kMathPowHalf: |
| + return AssignEnvironment(DefineSameAsFirst(result)); |
| default: |
| UNREACHABLE(); |
| return NULL; |
| @@ -1566,6 +1568,25 @@ |
| } |
| +LInstruction* LChunkBuilder::DoPower(HPower* instr) { |
| + ASSERT(instr->representation().IsDouble()); |
| + // We call a C function for double power. It can't trigger a GC. |
| + // We need to use fixed result register for the call. |
| + Representation exponent_type = instr->right()->representation(); |
| + ASSERT(instr->left()->representation().IsDouble()); |
| + // if (instr->right()->representation().IsTagged()) { |
| + // Abort("Tagged expoinent in Math.pow not yet workign."); |
|
Florian Schneider
2010/12/08 14:09:27
Remove commented code?
William Hesse
2010/12/08 14:53:16
Done.
|
| + // return NULL; |
| + // } |
| + LOperand* left = UseFixedDouble(instr->left(), xmm1); |
| + LOperand* right = exponent_type.IsDouble() ? |
| + UseFixedDouble(instr->right(), xmm2) : |
| + UseFixed(instr->right(), eax); |
| + LPower* result = new LPower(left, right, exponent_type); |
| + return MarkAsCall(DefineFixedDouble(result, xmm1), instr); |
|
Florian Schneider
2010/12/08 14:09:27
In case of a tagged exponent you need to pass CAN_
William Hesse
2010/12/08 14:53:16
Done.
|
| +} |
| + |
| + |
| LInstruction* LChunkBuilder::DoCompare(HCompare* instr) { |
| Token::Value op = instr->token(); |
| if (instr->left()->representation().IsInteger32()) { |