diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-07-25 19:30:07 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-07-26 08:31:50 +0200 |
commit | 6a31d05340b22fc413ee83eaacd0a5565bbbe799 (patch) | |
tree | 78f9e1c2f417244842f6422f17e1816e70317100 /deps/v8/src/base/macros.h | |
parent | 4d94bb2b1f72b6b612983a517a39c5545724a3ad (diff) | |
download | android-node-v8-6a31d05340b22fc413ee83eaacd0a5565bbbe799.tar.gz android-node-v8-6a31d05340b22fc413ee83eaacd0a5565bbbe799.tar.bz2 android-node-v8-6a31d05340b22fc413ee83eaacd0a5565bbbe799.zip |
deps: update V8 to 6.8.275.24
PR-URL: https://github.com/nodejs/node/pull/21079
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Diffstat (limited to 'deps/v8/src/base/macros.h')
-rw-r--r-- | deps/v8/src/base/macros.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/deps/v8/src/base/macros.h b/deps/v8/src/base/macros.h index db2f194591..3437309bc7 100644 --- a/deps/v8/src/base/macros.h +++ b/deps/v8/src/base/macros.h @@ -43,7 +43,6 @@ template <typename T, size_t N> char (&ArraySizeHelper(const T (&array)[N]))[N]; #endif - // bit_cast<Dest,Source> is a template function that implements the // equivalent of "*reinterpret_cast<Dest*>(&source)". We need this in // very low-level functions like the protobuf library and fast math @@ -150,20 +149,27 @@ V8_INLINE Dest bit_cast(Source const& source) { #define INLINE(declarator) V8_INLINE declarator #define NO_INLINE(declarator) V8_NOINLINE declarator -// Define V8_USE_ADDRESS_SANITIZER macros. +// Define V8_USE_ADDRESS_SANITIZER macro. #if defined(__has_feature) #if __has_feature(address_sanitizer) #define V8_USE_ADDRESS_SANITIZER 1 #endif #endif -// Define DISABLE_ASAN macros. +// Define DISABLE_ASAN macro. #ifdef V8_USE_ADDRESS_SANITIZER #define DISABLE_ASAN __attribute__((no_sanitize_address)) #else #define DISABLE_ASAN #endif +// Define V8_USE_MEMORY_SANITIZER macro. +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) +#define V8_USE_MEMORY_SANITIZER 1 +#endif +#endif + // Helper macro to define no_sanitize attributes only with clang. #if defined(__clang__) && defined(__has_attribute) #if __has_attribute(no_sanitize) @@ -271,6 +277,14 @@ struct Use { } // namespace base } // namespace v8 +// implicit_cast<A>(x) triggers an implicit cast from {x} to type {A}. This is +// useful in situations where static_cast<A>(x) would do too much. +// Only use this for cheap-to-copy types, or use move semantics explicitly. +template <class A> +V8_INLINE A implicit_cast(A x) { + return x; +} + // Define our own macros for writing 64-bit constants. This is less fragile // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it // works on compilers that don't have it (like MSVC). @@ -296,6 +310,14 @@ struct Use { #define V8PRIdPTR V8_PTR_PREFIX "d" #define V8PRIuPTR V8_PTR_PREFIX "u" +#ifdef V8_TARGET_ARCH_64_BIT +#define V8_PTR_HEX_DIGITS 12 +#define V8PRIxPTR_FMT "0x%012" V8PRIxPTR +#else +#define V8_PTR_HEX_DIGITS 8 +#define V8PRIxPTR_FMT "0x%08" V8PRIxPTR +#endif + // ptrdiff_t is 't' according to the standard, but MSVC uses 'I'. #if V8_CC_MSVC #define V8PRIxPTRDIFF "Ix" |