Commit ca4457e8 authored by olivf@chromium.org's avatar olivf@chromium.org

mod does not rely on a fixed register anymore, the arguments are passed via the stack.

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
parent 5021e726
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment