Revision: 16775
Author:   [email protected]
Date:     Tue Sep 17 15:26:18 2013 UTC
Log:      Make v8 compile on VS2013.

VS2013 contains a number of improvements, most notably the addition of all C99 math functions.

I'm a little bit concerned about the change I had to make in cpu-profiler.cc, but I spent quite a bit of time looking at it and was unable to figure out any rational explanation for the warning. It's possible it's spurious. Since it seems like a useful warning in general though, I chose not to disable globally at the gyp level.

I do think someone with expertise here should probably try to determine if this is a legitimate warning.

BUG=288948
[email protected]

Review URL: https://codereview.chromium.org/23449035

Patch from Zach Turner <[email protected]>.
http://code.google.com/p/v8/source/detail?r=16775

Modified:
 /branches/bleeding_edge/src/cpu-profiler.cc
 /branches/bleeding_edge/src/platform.h
 /branches/bleeding_edge/src/preparser.cc
 /branches/bleeding_edge/src/win32-math.cc
 /branches/bleeding_edge/src/win32-math.h

=======================================
--- /branches/bleeding_edge/src/cpu-profiler.cc Wed Sep 11 07:14:41 2013 UTC
+++ /branches/bleeding_edge/src/cpu-profiler.cc Tue Sep 17 15:26:18 2013 UTC
@@ -435,8 +435,18 @@
     logger->is_logging_ = false;
     generator_ = new ProfileGenerator(profiles_);
     Sampler* sampler = logger->sampler();
+#if V8_CC_MSVC && (_MSC_VER >= 1800)
+ // VS2013 reports "warning C4316: 'v8::internal::ProfilerEventsProcessor'
+    // : object allocated on the heap may not be aligned 64".  We need to
+    // figure out if this is a legitimate warning or a compiler bug.
+    #pragma warning(push)
+    #pragma warning(disable:4316)
+#endif
     processor_ = new ProfilerEventsProcessor(
         generator_, sampler, sampling_interval_);
+#if V8_CC_MSVC && (_MSC_VER >= 1800)
+    #pragma warning(pop)
+#endif
     is_profiling_ = true;
     // Enumerate stuff we already have in the heap.
     ASSERT(isolate_->heap()->HasBeenSetUp());
=======================================
--- /branches/bleeding_edge/src/platform.h      Fri Sep 13 13:45:53 2013 UTC
+++ /branches/bleeding_edge/src/platform.h      Tue Sep 17 15:26:18 2013 UTC
@@ -67,6 +67,8 @@

 int strncasecmp(const char* s1, const char* s2, int n);

+// Visual C++ 2013 and higher implement this function.
+#if (_MSC_VER < 1800)
 inline int lrint(double flt) {
   int intgr;
 #if V8_TARGET_ARCH_IA32
@@ -83,6 +85,8 @@
 #endif
   return intgr;
 }
+
+#endif  // _MSC_VER < 1800

 #endif  // V8_CC_MSVC

=======================================
--- /branches/bleeding_edge/src/preparser.cc    Mon Jul 29 12:12:39 2013 UTC
+++ /branches/bleeding_edge/src/preparser.cc    Tue Sep 17 15:26:18 2013 UTC
@@ -42,10 +42,10 @@
 #include "unicode.h"
 #include "utils.h"

-#ifdef _MSC_VER
+#if V8_CC_MSVC && (_MSC_VER < 1800)
 namespace std {

-// Usually defined in math.h, but not in MSVC.
+// Usually defined in math.h, but not in MSVC until VS2013+.
 // Abstracted to work
 int isfinite(double value);

=======================================
--- /branches/bleeding_edge/src/win32-math.cc   Thu Aug 29 09:15:13 2013 UTC
+++ /branches/bleeding_edge/src/win32-math.cc   Tue Sep 17 15:26:18 2013 UTC
@@ -29,7 +29,7 @@
// refer to The Open Group Base Specification for specification of the correct
 // semantics for these functions.
 // (http://www.opengroup.org/onlinepubs/000095399/)
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER < 1800)

 #include "win32-headers.h"
 #include <limits.h>        // Required for INT_MAX etc.
=======================================
--- /branches/bleeding_edge/src/win32-math.h    Fri Apr 19 13:26:47 2013 UTC
+++ /branches/bleeding_edge/src/win32-math.h    Tue Sep 17 15:26:18 2013 UTC
@@ -37,6 +37,8 @@
 #error Wrong environment, expected MSVC.
 #endif  // _MSC_VER

+// MSVC 2013+ provides implementations of all standard math functions.
+#if (_MSC_VER < 1800)
 enum {
   FP_NAN,
   FP_INFINITE,
@@ -58,4 +60,6 @@

 }  // namespace std

+#endif  // _MSC_VER < 1800
+
 #endif  // V8_WIN32_MATH_H_

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to