X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..refs/heads/master:/heap/GCAssertions.h?ds=inline diff --git a/heap/GCAssertions.h b/heap/GCAssertions.h index 7c7054d..c163a19 100644 --- a/heap/GCAssertions.h +++ b/heap/GCAssertions.h @@ -26,12 +26,13 @@ #ifndef GCAssertions_h #define GCAssertions_h +#include #include #if ENABLE(GC_VALIDATION) #define ASSERT_GC_OBJECT_LOOKS_VALID(cell) do { \ RELEASE_ASSERT(cell);\ - RELEASE_ASSERT(cell->unvalidatedStructure()->unvalidatedStructure() == cell->unvalidatedStructure()->unvalidatedStructure()->unvalidatedStructure()); \ + RELEASE_ASSERT(cell->structure()->structure() == cell->structure()->structure()->structure()); \ } while (0) #define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do {\ @@ -44,10 +45,14 @@ #define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do { (void)object; (void)classInfo; } while (0) #endif -#if COMPILER_SUPPORTS(HAS_TRIVIAL_DESTRUCTOR) -#define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass) COMPILE_ASSERT(__has_trivial_destructor(klass), klass##_has_trivial_destructor_check) +#if COMPILER(CLANG) +#define STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(klass) static_assert(std::is_trivially_destructible::value, #klass " must have a trivial destructor") +#elif COMPILER(MSVC) +// An earlier verison of the C++11 spec used to call this type trait std::has_trivial_destructor, and that's what MSVC uses. +#define STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(klass) static_assert(std::has_trivial_destructor::value, #klass " must have a trivial destructor") #else -#define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass) +// This is not enabled on GCC due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52702 +#define STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(klass) #endif #endif // GCAssertions_h