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

Unified Diff: src/codegen.cc

Issue 866843003: Contribution of PowerPC port (continuation of 422063005) - AIX Common1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address second set of comments Created 5 years, 11 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 | « src/code-stubs.h ('k') | src/d8.cc » ('j') | src/serialize.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
diff --git a/src/codegen.cc b/src/codegen.cc
index 66b605a4206658d2feebf56c084d2ff03b2e530c..178ba4a69df8d1e423a6d9611518c11307135678 100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -4,6 +4,9 @@
#include "src/v8.h"
+#if defined(V8_OS_AIX)
+#include <fenv.h>
+#endif
#include "src/bootstrapper.h"
#include "src/codegen.h"
#include "src/compiler.h"
@@ -48,7 +51,15 @@ double modulo(double x, double y) {
#else // POSIX
double modulo(double x, double y) {
+#if defined(V8_OS_AIX)
+ // AIX raises an underflow exception for (Number.MIN_VALUE % Number.MAX_VALUE)
+ feclearexcept(FE_ALL_EXCEPT);
+ double result = std::fmod(x, y);
+ int exception = fetestexcept(FE_UNDERFLOW);
+ return (exception ? x : result);
+#else
return std::fmod(x, y);
+#endif
}
#endif // defined(_WIN64)
« no previous file with comments | « src/code-stubs.h ('k') | src/d8.cc » ('j') | src/serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698