Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28
FPIIM-449
Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/include/v8config.h b/include/v8config.h
index d1ca22c..d2be685 100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -5,6 +5,8 @@
#ifndef V8CONFIG_H_
#define V8CONFIG_H_
+// clang-format off
+
// Platform headers for feature detection below.
#if defined(__ANDROID__)
# include <sys/cdefs.h>
@@ -42,8 +44,8 @@
((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
((major) * 10000 + (minor) * 100 + (patchlevel)))
#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
-# define V8_GNUC_PREREQ(major, minor, patchlevel) \
- ((__GNUC__ * 10000 + __GNUC_MINOR__) >= \
+# define V8_GNUC_PREREQ(major, minor, patchlevel) \
+ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= \
((major) * 10000 + (minor) * 100 + (patchlevel)))
#else
# define V8_GNUC_PREREQ(major, minor, patchlevel) 0
@@ -67,6 +69,7 @@
// V8_OS_POSIX - POSIX compatible (mostly everything except Windows)
// V8_OS_QNX - QNX Neutrino
// V8_OS_SOLARIS - Sun Solaris and OpenSolaris
+// V8_OS_AIX - AIX
// V8_OS_WIN - Microsoft Windows
#if defined(__ANDROID__)
@@ -89,6 +92,9 @@
#elif defined(__sun)
# define V8_OS_POSIX 1
# define V8_OS_SOLARIS 1
+#elif defined(_AIX)
+#define V8_OS_POSIX 1
+#define V8_OS_AIX 1
#elif defined(__FreeBSD__)
# define V8_OS_BSD 1
# define V8_OS_FREEBSD 1
@@ -120,6 +126,7 @@
// V8_LIBC_BIONIC - Bionic libc
// V8_LIBC_BSD - BSD libc derivate
// V8_LIBC_GLIBC - GNU C library
+// V8_LIBC_UCLIBC - uClibc
//
// Note that testing for libc must be done using #if not #ifdef. For example,
// to test for the GNU C library, use:
@@ -132,6 +139,9 @@
#elif defined(__BIONIC__)
# define V8_LIBC_BIONIC 1
# define V8_LIBC_BSD 1
+#elif defined(__UCLIBC__)
+// Must test for UCLIBC before GLIBC, as UCLIBC pretends to be GLIBC.
+# define V8_LIBC_UCLIBC 1
#elif defined(__GLIBC__) || defined(__GNU_LIBRARY__)
# define V8_LIBC_GLIBC 1
#else
@@ -153,10 +163,6 @@
//
// V8_HAS_CXX11_ALIGNAS - alignas specifier supported
// V8_HAS_CXX11_ALIGNOF - alignof(type) operator supported
-// V8_HAS_CXX11_STATIC_ASSERT - static_assert() supported
-// V8_HAS_CXX11_DELETE - deleted functions supported
-// V8_HAS_CXX11_FINAL - final marker supported
-// V8_HAS_CXX11_OVERRIDE - override marker supported
//
// Compiler-specific feature detection
//
@@ -167,6 +173,7 @@
// supported
// V8_HAS_ATTRIBUTE_DEPRECATED - __attribute__((deprecated)) supported
// V8_HAS_ATTRIBUTE_NOINLINE - __attribute__((noinline)) supported
+// V8_HAS_ATTRIBUTE_NORETURN - __attribute__((noreturn)) supported
// V8_HAS_ATTRIBUTE_UNUSED - __attribute__((unused)) supported
// V8_HAS_ATTRIBUTE_VISIBILITY - __attribute__((visibility)) supported
// V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT - __attribute__((warn_unused_result))
@@ -178,10 +185,12 @@
// V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported
// V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported
// V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported
+// V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported
// V8_HAS_DECLSPEC_ALIGN - __declspec(align(n)) supported
// V8_HAS_DECLSPEC_DEPRECATED - __declspec(deprecated) supported
// V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported
-// V8_HAS___FINAL - __final supported in non-C++11 mode
+// V8_HAS_DECLSPEC_SELECTANY - __declspec(selectany) supported
+// V8_HAS_DECLSPEC_NORETURN - __declspec(noreturn) supported
// V8_HAS___FORCEINLINE - __forceinline supported
//
// Note that testing for compilers and/or features must be done using #if
@@ -194,8 +203,6 @@
#if defined(__GNUC__) // Clang in gcc mode.
# define V8_CC_GNU 1
-#elif defined(_MSC_VER) // Clang in cl mode.
-# define V8_CC_MSVC 1
#endif
// Clang defines __alignof__ as alias for __alignof
@@ -206,6 +213,7 @@
# define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
# define V8_HAS_ATTRIBUTE_DEPRECATED (__has_attribute(deprecated))
# define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline))
+# define V8_HAS_ATTRIBUTE_NORETURN (__has_attribute(noreturn))
# define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused))
# define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility))
# define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
@@ -218,20 +226,22 @@
# define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount))
# define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow))
# define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow))
+# define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow))
# define V8_HAS_CXX11_ALIGNAS (__has_feature(cxx_alignas))
-# define V8_HAS_CXX11_STATIC_ASSERT (__has_feature(cxx_static_assert))
-# define V8_HAS_CXX11_DELETE (__has_feature(cxx_deleted_functions))
-# define V8_HAS_CXX11_FINAL (__has_feature(cxx_override_control))
-# define V8_HAS_CXX11_OVERRIDE (__has_feature(cxx_override_control))
#elif defined(__GNUC__)
# define V8_CC_GNU 1
-// Intel C++ also masquerades as GCC 3.2.0
-# define V8_CC_INTEL (defined(__INTEL_COMPILER))
-# define V8_CC_MINGW32 (defined(__MINGW32__))
-# define V8_CC_MINGW64 (defined(__MINGW64__))
+# if defined(__INTEL_COMPILER) // Intel C++ also masquerades as GCC 3.2.0
+# define V8_CC_INTEL 1
+# endif
+# if defined(__MINGW32__)
+# define V8_CC_MINGW32 1
+# endif
+# if defined(__MINGW64__)
+# define V8_CC_MINGW64 1
+# endif
# define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64)
# define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0))
@@ -244,6 +254,7 @@
# define V8_HAS_ATTRIBUTE_DEPRECATED (V8_GNUC_PREREQ(3, 4, 0))
# define V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE (V8_GNUC_PREREQ(4, 5, 0))
# define V8_HAS_ATTRIBUTE_NOINLINE (V8_GNUC_PREREQ(3, 4, 0))
+# define V8_HAS_ATTRIBUTE_NORETURN (V8_GNUC_PREREQ(2, 5, 0))
# define V8_HAS_ATTRIBUTE_UNUSED (V8_GNUC_PREREQ(2, 95, 0))
# define V8_HAS_ATTRIBUTE_VISIBILITY (V8_GNUC_PREREQ(4, 3, 0))
# define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \
@@ -264,27 +275,18 @@
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
# define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0))
# define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0))
-# define V8_HAS_CXX11_STATIC_ASSERT (V8_GNUC_PREREQ(4, 3, 0))
-# define V8_HAS_CXX11_DELETE (V8_GNUC_PREREQ(4, 4, 0))
-# define V8_HAS_CXX11_OVERRIDE (V8_GNUC_PREREQ(4, 7, 0))
-# define V8_HAS_CXX11_FINAL (V8_GNUC_PREREQ(4, 7, 0))
-# else
-// '__final' is a non-C++11 GCC synonym for 'final', per GCC r176655.
-# define V8_HAS___FINAL (V8_GNUC_PREREQ(4, 7, 0))
# endif
+#endif
-#elif defined(_MSC_VER)
-
+#if defined(_MSC_VER)
# define V8_CC_MSVC 1
-
# define V8_HAS___ALIGNOF 1
-# define V8_HAS_CXX11_FINAL 1
-# define V8_HAS_CXX11_OVERRIDE 1
-
# define V8_HAS_DECLSPEC_ALIGN 1
# define V8_HAS_DECLSPEC_DEPRECATED 1
# define V8_HAS_DECLSPEC_NOINLINE 1
+# define V8_HAS_DECLSPEC_SELECTANY 1
+# define V8_HAS_DECLSPEC_NORETURN 1
# define V8_HAS___FORCEINLINE 1
@@ -319,17 +321,44 @@
#endif
-// A macro to mark classes or functions as deprecated.
-#if defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE
-# define V8_DEPRECATED(message, declarator) \
-declarator __attribute__((deprecated(message)))
-#elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED
-# define V8_DEPRECATED(message, declarator) \
-declarator __attribute__((deprecated))
-#elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED
-# define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarator
+// A macro used to tell the compiler that a particular function never returns.
+// Use like:
+// V8_NORETURN void MyAbort() { abort(); }
+#if V8_HAS_ATTRIBUTE_NORETURN
+# define V8_NORETURN __attribute__((noreturn))
+#elif HAS_DECLSPEC_NORETURN
+# define V8_NORETURN __declspec(noreturn)
#else
-# define V8_DEPRECATED(message, declarator) declarator
+# define V8_NORETURN /* NOT SUPPORTED */
+#endif
+
+
+// A macro (V8_DEPRECATED) to mark classes or functions as deprecated.
+#if defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE
+#define V8_DEPRECATED(message, declarator) \
+ declarator __attribute__((deprecated(message)))
+#elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED
+#define V8_DEPRECATED(message, declarator) \
+ declarator __attribute__((deprecated))
+#elif defined(V8_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED
+#define V8_DEPRECATED(message, declarator) __declspec(deprecated) declarator
+#else
+#define V8_DEPRECATED(message, declarator) declarator
+#endif
+
+
+// A macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated.
+#if defined(V8_IMMINENT_DEPRECATION_WARNINGS) && \
+ V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE
+#define V8_DEPRECATE_SOON(message, declarator) \
+ declarator __attribute__((deprecated(message)))
+#elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) && V8_HAS_ATTRIBUTE_DEPRECATED
+#define V8_DEPRECATE_SOON(message, declarator) \
+ declarator __attribute__((deprecated))
+#elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) && V8_HAS_DECLSPEC_DEPRECATED
+#define V8_DEPRECATE_SOON(message, declarator) __declspec(deprecated) declarator
+#else
+#define V8_DEPRECATE_SOON(message, declarator) declarator
#endif
@@ -343,26 +372,6 @@
#endif
-// A macro to specify that a method is deleted from the corresponding class.
-// Any attempt to use the method will always produce an error at compile time
-// when this macro can be implemented (i.e. if the compiler supports C++11).
-// If the current compiler does not support C++11, use of the annotated method
-// will still cause an error, but the error will most likely occur at link time
-// rather than at compile time. As a backstop, method declarations using this
-// macro should be private.
-// Use like:
-// class A {
-// private:
-// A(const A& other) V8_DELETE;
-// A& operator=(const A& other) V8_DELETE;
-// };
-#if V8_HAS_CXX11_DELETE
-# define V8_DELETE = delete
-#else
-# define V8_DELETE /* NOT SUPPORTED */
-#endif
-
-
// This macro allows to specify memory alignment for structs, classes, etc.
// Use like:
// class V8_ALIGNED(16) MyClass { ... };
@@ -415,4 +424,15 @@
# define V8_ALIGNOF(type) (sizeof(::v8::AlignOfHelper<type>) - sizeof(type))
#endif
+// Annotate a function indicating the caller must examine the return value.
+// Use like:
+// int foo() WARN_UNUSED_RESULT;
+#if V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT
+#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+#define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */
+#endif
+
+// clang-format on
+
#endif // V8CONFIG_H_