From 4d03c3aabad6517ff058124bb799ca6a4156e570 Mon Sep 17 00:00:00 2001 From: ishell Date: Mon, 28 Sep 2015 09:40:52 -0700 Subject: [PATCH] Revert of Introduce a V8_NORETURN macro and use it to make GCC 4.9.2 happy again. (patchset #3 id:80001 of https://codereview.chromium.org/1361763004/ ) Reason for revert: This CL breaks cross-compiling to arm. Original issue's description: > Introduce a V8_NORETURN macro and use it to make GCC 4.9.2 happy again. > > Without that, it has a few false positives about out-of-bounds array accesses. > Also makes the clang static-analyzer happy. > > Original code review from Sven Panne: > https://codereview.chromium.org/790723002/ > > Committed: https://crrev.com/0b48b2a8ebfc791a36f4ec1f299f46db76265a3a > Cr-Commit-Position: refs/heads/master@{#30977} TBR=jochen@chromium.org,bmeurer@chromium.org,jkummerow@chromium.org,karl@skomski.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1370203002 Cr-Commit-Position: refs/heads/master@{#30982} --- include/v8config.h | 17 ----------------- src/base/logging.h | 3 +-- src/base/platform/platform.h | 2 +- src/heap/spaces-inl.h | 2 +- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/include/v8config.h b/include/v8config.h index c88e1da..4f4b2cd 100644 --- a/include/v8config.h +++ b/include/v8config.h @@ -174,7 +174,6 @@ // 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)) @@ -191,7 +190,6 @@ // V8_HAS_DECLSPEC_DEPRECATED - __declspec(deprecated) supported // V8_HAS_DECLSPEC_NOINLINE - __declspec(noinline) supported // 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 @@ -214,7 +212,6 @@ # 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 \ @@ -256,7 +253,6 @@ # 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 \ @@ -289,7 +285,6 @@ # 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 @@ -324,18 +319,6 @@ #endif -// 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_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) \ diff --git a/src/base/logging.h b/src/base/logging.h index a3f4987..511ebf1 100644 --- a/src/base/logging.h +++ b/src/base/logging.h @@ -11,8 +11,7 @@ #include "src/base/build_config.h" -extern "C" V8_NORETURN void V8_Fatal(const char* file, int line, - const char* format, ...); +extern "C" void V8_Fatal(const char* file, int line, const char* format, ...); // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during diff --git a/src/base/platform/platform.h b/src/base/platform/platform.h index 15f346a..2d08ecb 100644 --- a/src/base/platform/platform.h +++ b/src/base/platform/platform.h @@ -194,7 +194,7 @@ class OS { static void Sleep(TimeDelta interval); // Abort the current process. - V8_NORETURN static void Abort(); + static void Abort(); // Debug break. static void DebugBreak(); diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h index 8e99739..8dca9b1 100644 --- a/src/heap/spaces-inl.h +++ b/src/heap/spaces-inl.h @@ -446,7 +446,7 @@ AllocationResult NewSpace::AllocateRawAligned(int size_in_bytes, AllocationResult NewSpace::AllocateRawUnaligned(int size_in_bytes) { Address top = allocation_info_.top(); - if (allocation_info_.limit() < top + size_in_bytes) { + if (allocation_info_.limit() - top < size_in_bytes) { // See if we can create room. if (!EnsureAllocation(size_in_bytes, kWordAligned)) { return AllocationResult::Retry(); -- 2.7.4