mod does not rely on a fixed register anymore, the arguments are passed via the stack.
authorolivf@chromium.org <olivf@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 7 Aug 2013 16:47:24 +0000 (16:47 +0000)
committerolivf@chromium.org <olivf@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 7 Aug 2013 16:47:24 +0000 (16:47 +0000)
BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/21495005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/ia32/lithium-ia32.cc

index ef3f64d..5aa1a95 100644 (file)
@@ -809,10 +809,11 @@ LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
   ASSERT(instr->representation().IsDouble());
   ASSERT(instr->left()->representation().IsDouble());
   ASSERT(instr->right()->representation().IsDouble());
-  ASSERT(op != Token::MOD);
   LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
   LOperand* right = UseRegisterAtStart(instr->BetterRightOperand());
   LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
+  // We call a C function for double modulo. It can't trigger a GC.
+  if (op == Token::MOD) return MarkAsCall(DefineAsRegister(result), instr);
   return DefineSameAsFirst(result);
 }
 
@@ -1563,13 +1564,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) {
     return DoArithmeticT(Token::MOD, instr);
   } else {
     ASSERT(instr->representation().IsDouble());
-    // We call a C function for double modulo. It can't trigger a GC. We need
-    // to use fixed result register for the call.
-    // TODO(fschneider): Allow any register as input registers.
-    LArithmeticD* mod = new(zone()) LArithmeticD(Token::MOD,
-                                                 UseFixedDouble(left, xmm2),
-                                                 UseFixedDouble(right, xmm1));
-    return MarkAsCall(DefineFixedDouble(mod, xmm1), instr);
+    return DoArithmeticD(Token::MOD, instr);
   }
 }