Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Unified Diff: src/ia32/lithium-ia32.cc

Issue 22474007: Revert "mod does not rely on a fixed register anymore, the arguments are passed via the stack." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index 5aa1a95a1758a563109daa43487db1afbea24df0..ef3f64df61a88df647f23bf16e442a8441beed61 100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -809,11 +809,10 @@ 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);
}
@@ -1564,7 +1563,13 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) {
return DoArithmeticT(Token::MOD, instr);
} else {
ASSERT(instr->representation().IsDouble());
- return DoArithmeticD(Token::MOD, instr);
+ // 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);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698