summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/GCAssertions.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/heap/GCAssertions.h
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/heap/GCAssertions.h')
-rw-r--r--Source/JavaScriptCore/heap/GCAssertions.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/Source/JavaScriptCore/heap/GCAssertions.h b/Source/JavaScriptCore/heap/GCAssertions.h
index 836244fe6..b0676bfee 100644
--- a/Source/JavaScriptCore/heap/GCAssertions.h
+++ b/Source/JavaScriptCore/heap/GCAssertions.h
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
- * Copyright (C) 2015 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -33,7 +32,7 @@
#if ENABLE(GC_VALIDATION)
#define ASSERT_GC_OBJECT_LOOKS_VALID(cell) do { \
RELEASE_ASSERT(cell);\
- RELEASE_ASSERT(cell->structure()->structure() == cell->structure()->structure()->structure()); \
+ RELEASE_ASSERT(cell->unvalidatedStructure()->unvalidatedStructure() == cell->unvalidatedStructure()->unvalidatedStructure()->unvalidatedStructure()); \
} while (0)
#define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do {\
@@ -41,23 +40,19 @@
RELEASE_ASSERT(object->inherits(classInfo)); \
} while (0)
-// Used to avoid triggering -Wundefined-bool-conversion.
-#define ASSERT_THIS_GC_OBJECT_LOOKS_VALID() do { \
- RELEASE_ASSERT(this->structure()->structure() == this->structure()->structure()->structure()); \
-} while (0)
-
-#define ASSERT_THIS_GC_OBJECT_INHERITS(classInfo) do {\
- ASSERT_THIS_GC_OBJECT_LOOKS_VALID(); \
- RELEASE_ASSERT(this->inherits(classInfo)); \
-} while (0)
-
#else
#define ASSERT_GC_OBJECT_LOOKS_VALID(cell) do { (void)cell; } while (0)
#define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do { (void)object; (void)classInfo; } while (0)
-#define ASSERT_THIS_GC_OBJECT_LOOKS_VALID()
-#define ASSERT_THIS_GC_OBJECT_INHERITS(classInfo) do { (void)classInfo; } while (0)
#endif
+#if COMPILER(CLANG)
#define STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(klass) static_assert(std::is_trivially_destructible<klass>::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<klass>::value, #klass " must have a trivial destructor")
+#else
+// 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