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

Unified Diff: src/platform-win32.cc

Issue 20734002: Implement correct OS and CC detection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reverted changes to atomicops*.h Created 7 years, 5 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/platform-posix.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-win32.cc
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index 292c24a3dace86c6500acbd6634536d0dea7ddb6..767a3b3ce0da6e22b876e31eb9ea0a5c242aed8d 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -48,7 +48,7 @@
#include "simulator.h"
#include "vm-state-inl.h"
-#ifdef _MSC_VER
+#if V8_CC_MSVC
// Case-insensitive bounded string comparisons. Use stricmp() on Win32. Usually
// defined in strings.h.
@@ -56,7 +56,7 @@ int strncasecmp(const char* s1, const char* s2, int n) {
return _strnicmp(s1, s2, n);
}
-#endif // _MSC_VER
+#endif // V8_CC_MSVC
// Extra functions for MinGW. Most of these are the _s functions which are in
@@ -169,7 +169,7 @@ void OS::MemMove(void* dest, const void* src, size_t size) {
#endif // V8_TARGET_ARCH_IA32
-#ifdef _WIN64
+#if V8_OS_WIN64
typedef double (*ModuloFunction)(double, double);
static ModuloFunction modulo_function = NULL;
// Defined in codegen-x64.cc.
@@ -185,8 +185,7 @@ double modulo(double x, double y) {
// on all architectures we currently support.
return (*modulo_function)(x, y);
}
-#else // Win32
-
+#else
double modulo(double x, double y) {
// Workaround MS fmod bugs. ECMA-262 says:
// dividend is finite and divisor is an infinity => result equals dividend
@@ -197,8 +196,7 @@ double modulo(double x, double y) {
}
return x;
}
-
-#endif // _WIN64
+#endif // V8_OS_WIN64
#define UNARY_MATH_FUNCTION(name, generator) \
@@ -228,7 +226,7 @@ void lazily_initialize_fast_exp() {
void MathSetup() {
-#ifdef _WIN64
+#if V8_OS_WIN64
init_modulo_function();
#endif
init_fast_sin_function();
@@ -1009,11 +1007,11 @@ void OS::Abort() {
void OS::DebugBreak() {
-#ifdef _MSC_VER
+#if V8_CC_MSVC
__debugbreak();
#else
::DebugBreak();
-#endif
+#endif // V8_CC_MSVC
}
@@ -1361,7 +1359,7 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) {
// Initialize the stack walking
STACKFRAME64 stack_frame;
memset(&stack_frame, 0, sizeof(stack_frame));
-#ifdef _WIN64
+#if V8_OS _WIN64
stack_frame.AddrPC.Offset = context.Rip;
stack_frame.AddrFrame.Offset = context.Rbp;
stack_frame.AddrStack.Offset = context.Rsp;
@@ -1470,21 +1468,21 @@ uint64_t OS::CpuFeaturesImpliedByPlatform() {
double OS::nan_value() {
-#ifdef _MSC_VER
+#if V8_CC_MSVC
// Positive Quiet NaN with no payload (aka. Indeterminate) has all bits
// in mask set, so value equals mask.
static const __int64 nanval = kQuietNaNMask;
return *reinterpret_cast<const double*>(&nanval);
-#else // _MSC_VER
+#else // V8_CC_MSVC
return NAN;
-#endif // _MSC_VER
+#endif // V8_CC_MSVC
}
int OS::ActivationFrameAlignment() {
-#ifdef _WIN64
+#if V8_OS__WIN64
return 16; // Windows 64-bit ABI requires the stack to be 16-byte aligned.
-#elif defined(__MINGW32__)
+#elif V8_CC_MINGW
// With gcc 4.4 the tree vectorization optimizer can generate code
// that requires 16 byte alignment such as movdqa on x86.
return 16;
« no previous file with comments | « src/platform-posix.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698