Changeset 107595 in webkit for trunk/Source/JavaScriptCore/wtf


Ignore:
Timestamp:
Feb 13, 2012, 12:57:46 PM (13 years ago)
Author:
[email protected]
Message:

Move JSC related assertions out of Assertions.h and into their own header
https://bugs.webkit.org/show_bug.cgi?id=78508

Reviewed by Gavin Barraclough.

Add GCAssertions.h

  • heap/GCAssertions.h: Added.

Move assertions here.

  • runtime/WriteBarrier.h:

Add #include of GCAssertions.h

  • wtf/Assertions.h:

Remove JSC related assertions.

  • wtf/Compiler.h:

Add compiler check for has_trivial_destructor.

Location:
trunk/Source/JavaScriptCore/wtf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wtf/Assertions.h

    r107581 r107595  
    375375#endif
    376376
    377 #if ENABLE(GC_VALIDATION)
    378 #define ASSERT_GC_OBJECT_LOOKS_VALID(cell) do { \
    379     if (!(cell))\
    380         CRASH();\
    381     if (cell->unvalidatedStructure()->unvalidatedStructure() != cell->unvalidatedStructure()->unvalidatedStructure()->unvalidatedStructure())\
    382         CRASH();\
    383 } while (0)
    384 
    385 #define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do {\
    386     ASSERT_GC_OBJECT_LOOKS_VALID(object); \
    387     if (!object->inherits(classInfo)) \
    388         CRASH();\
    389 } while (0)
    390 
    391 #else
    392 #define ASSERT_GC_OBJECT_LOOKS_VALID(cell) do { (void)cell; } while (0)
    393 #define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do { (void)object; (void)classInfo; } while (0)
    394 #endif
    395 
    396 #if COMPILER(CLANG)
    397 #define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass) COMPILE_ASSERT(__has_trivial_destructor(klass), klass##_has_trivial_destructor_check)
    398 #else
    399 #define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass)
    400 #endif
    401 
    402377#endif /* WTF_Assertions_h */
  • trunk/Source/JavaScriptCore/wtf/Compiler.h

    r107581 r107595  
    5151#define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT __has_extension(c_static_assert)
    5252
     53#define WTF_COMPILER_SUPPORTS_HAS_TRIVIAL_DESTRUCTOR __has_extension(has_trivial_destructor)
     54
    5355#endif
    5456
Note: See TracChangeset for help on using the changeset viewer.