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

Unified Diff: src/runtime.cc

Issue 300004: X64 Win64: Reimplement fmod so that it works. (Closed)
Patch Set: And it lints. Created 11 years, 2 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
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 9eeffd10c0f1097d60226c3753d402c101fcc422..5771e4c0f64fb8513fad4c0a971510b3eea2c2dd 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -3747,9 +3747,12 @@ static Object* Runtime_NumberMod(Arguments args) {
// dividend is finite and divisor is an infinity => result equals dividend
// dividend is a zero and divisor is nonzero finite => result equals dividend
if (!(isfinite(x) && (!isfinite(y) && !isnan(y))) &&
- !(x == 0 && (y != 0 && isfinite(y))))
-#endif
+ !(x == 0 && (y != 0 && isfinite(y)))) {
+ x = fmod(x, y);
+ }
+#else
x = fmod(x, y);
+#endif
// NewNumberFromDouble may return a Smi instead of a Number object
return Heap::NewNumberFromDouble(x);
}
@@ -4364,6 +4367,12 @@ static Object* Runtime_NewArgumentsFast(Arguments args) {
}
+static Object* Runtime_AllocateHeapNumber(Arguments args) {
+ ASSERT_EQ(0, args.length());
+ return Heap::AllocateHeapNumber(0.0);
+}
+
+
static Object* Runtime_NewClosure(Arguments args) {
HandleScope scope;
ASSERT(args.length() == 2);

Powered by Google App Engine
This is Rietveld 408576698