Reviewers: Dmitry Lomov (chromium),
Description:
Make v8 compile on VS2013.
VS2013 contains a number of improvements, most notably the addition of
almost
all C99 math functions. The other big change is that std::min and std::max
require <algorithm> to compile.
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
Please review this at https://codereview.chromium.org/23449035/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files (+21, -3 lines):
M src/cpu-profiler.cc
M src/platform.h
M src/preparser.cc
M src/win32-math.h
M src/win32-math.cc
Index: src/cpu-profiler.cc
===================================================================
--- src/cpu-profiler.cc (revision 16721)
+++ src/cpu-profiler.cc (working copy)
@@ -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());
Index: src/platform.h
===================================================================
--- src/platform.h (revision 16721)
+++ src/platform.h (working copy)
@@ -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
@@ -84,6 +86,8 @@
return intgr;
}
+#endif // _MSC_VER < 1800
+
#endif // V8_CC_MSVC
namespace v8 {
Index: src/preparser.cc
===================================================================
--- src/preparser.cc (revision 16721)
+++ src/preparser.cc (working copy)
@@ -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);
Index: src/win32-math.cc
===================================================================
--- src/win32-math.cc (revision 16721)
+++ src/win32-math.cc (working copy)
@@ -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.
Index: src/win32-math.h
===================================================================
--- src/win32-math.h (revision 16721)
+++ src/win32-math.h (working copy)
@@ -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.