Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (107594 => 107595)
--- trunk/Source/_javascript_Core/ChangeLog 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-02-13 20:57:46 UTC (rev 107595)
@@ -1,3 +1,28 @@
+2012-02-13 Sam Weinig <[email protected]>
+
+ 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.
+
+ * GNUmakefile.list.am:
+ * _javascript_Core.gypi:
+ * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj:
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ 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.
+
2012-02-13 Chao-ying Fu <[email protected]>
Update MIPS patchOffsetGetByIdSlowCaseCall
Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (107594 => 107595)
--- trunk/Source/_javascript_Core/GNUmakefile.list.am 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am 2012-02-13 20:57:46 UTC (rev 107595)
@@ -192,6 +192,7 @@
Source/_javascript_Core/heap/ConservativeRoots.h \
Source/_javascript_Core/heap/DFGCodeBlocks.cpp \
Source/_javascript_Core/heap/DFGCodeBlocks.h \
+ Source/_javascript_Core/heap/GCAssertions.h \
Source/_javascript_Core/heap/Handle.h \
Source/_javascript_Core/heap/HandleHeap.cpp \
Source/_javascript_Core/heap/HandleHeap.h \
Modified: trunk/Source/_javascript_Core/_javascript_Core.gypi (107594 => 107595)
--- trunk/Source/_javascript_Core/_javascript_Core.gypi 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/_javascript_Core.gypi 2012-02-13 20:57:46 UTC (rev 107595)
@@ -31,6 +31,7 @@
'heap/BumpSpace.h',
'heap/BumpSpaceInlineMethods.h',
'heap/ConservativeRoots.h',
+ 'heap/GCAssertions.h',
'heap/Handle.h',
'heap/HandleHeap.h',
'heap/HeapBlock.h',
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj (107594 => 107595)
--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2012-02-13 20:57:46 UTC (rev 107595)
@@ -2062,6 +2062,10 @@
>
</File>
<File
+ RelativePath="..\..\heap\GCAssertions.h"
+ >
+ </File>
+ <File
RelativePath="..\..\heap\MachineStackMarker.cpp"
>
</File>
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (107594 => 107595)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-02-13 20:57:46 UTC (rev 107595)
@@ -706,6 +706,7 @@
BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC87CDB810712ACA000614CF /* JSONObject.lut.h */; };
BC9041480EB9250900FE26FA /* StructureTransitionTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9041470EB9250900FE26FA /* StructureTransitionTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC95437D0EBA70FD0072B6D3 /* PropertyMapHashTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BCBE2CAE14E985AA000593AD /* GCAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBE2CAD14E985AA000593AD /* GCAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCCF0D080EF0AAB900413C8F /* StructureStubInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCF0D070EF0AAB900413C8F /* StructureStubInfo.h */; };
BCCF0D0C0EF0B8A500413C8F /* StructureStubInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCF0D0B0EF0B8A500413C8F /* StructureStubInfo.cpp */; };
BCD202C20E1706A7002C7E82 /* RegExpConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD202BE0E1706A7002C7E82 /* RegExpConstructor.h */; };
@@ -1500,6 +1501,7 @@
BC9BB95B0E19680600DF8855 /* InternalFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InternalFunction.cpp; sourceTree = "<group>"; };
BCA62DFE0E2826230004F30D /* CallData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallData.cpp; sourceTree = "<group>"; };
BCA62DFF0E2826310004F30D /* ConstructData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstructData.cpp; sourceTree = "<group>"; };
+ BCBE2CAD14E985AA000593AD /* GCAssertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCAssertions.h; sourceTree = "<group>"; };
BCCF0D070EF0AAB900413C8F /* StructureStubInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureStubInfo.h; sourceTree = "<group>"; };
BCCF0D0B0EF0B8A500413C8F /* StructureStubInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureStubInfo.cpp; sourceTree = "<group>"; };
BCD202BD0E1706A7002C7E82 /* RegExpConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpConstructor.cpp; sourceTree = "<group>"; };
@@ -1829,6 +1831,7 @@
149DAAF212EB559D0083B12B /* ConservativeRoots.h */,
0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */,
0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */,
+ BCBE2CAD14E985AA000593AD /* GCAssertions.h */,
142E312B134FF0A600AFADB5 /* Handle.h */,
142E312C134FF0A600AFADB5 /* HandleHeap.cpp */,
142E312D134FF0A600AFADB5 /* HandleHeap.h */,
@@ -3222,6 +3225,7 @@
0F9FC8D114E612DA00D52AE0 /* DataLog.h in Headers */,
0F9FC8C414E1B60000D52AE0 /* PolymorphicPutByIdList.h in Headers */,
0F9FC8C514E1B60400D52AE0 /* PutKind.h in Headers */,
+ BCBE2CAE14E985AA000593AD /* GCAssertions.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Added: trunk/Source/_javascript_Core/heap/GCAssertions.h (0 => 107595)
--- trunk/Source/_javascript_Core/heap/GCAssertions.h (rev 0)
+++ trunk/Source/_javascript_Core/heap/GCAssertions.h 2012-02-13 20:57:46 UTC (rev 107595)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GCAssertions_h
+#define GCAssertions_h
+
+#include "Assertions.h"
+
+#if ENABLE(GC_VALIDATION)
+#define ASSERT_GC_OBJECT_LOOKS_VALID(cell) do { \
+ if (!(cell))\
+ CRASH();\
+ if (cell->unvalidatedStructure()->unvalidatedStructure() != cell->unvalidatedStructure()->unvalidatedStructure()->unvalidatedStructure())\
+ CRASH();\
+} while (0)
+
+#define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do {\
+ ASSERT_GC_OBJECT_LOOKS_VALID(object); \
+ if (!object->inherits(classInfo)) \
+ CRASH();\
+} 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)
+#endif
+
+#if COMPILER_SUPPORTS(HAS_TRIVIAL_DESTRUCTOR)
+#define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass) COMPILE_ASSERT(__has_trivial_destructor(klass), klass##_has_trivial_destructor_check)
+#else
+#define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass)
+#endif
+
+#endif // GCAssertions_h
Modified: trunk/Source/_javascript_Core/runtime/WriteBarrier.h (107594 => 107595)
--- trunk/Source/_javascript_Core/runtime/WriteBarrier.h 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/runtime/WriteBarrier.h 2012-02-13 20:57:46 UTC (rev 107595)
@@ -26,6 +26,7 @@
#ifndef WriteBarrier_h
#define WriteBarrier_h
+#include "GCAssertions.h"
#include "HandleTypes.h"
#include "Heap.h"
#include "SamplingCounter.h"
Modified: trunk/Source/_javascript_Core/wtf/Assertions.h (107594 => 107595)
--- trunk/Source/_javascript_Core/wtf/Assertions.h 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/wtf/Assertions.h 2012-02-13 20:57:46 UTC (rev 107595)
@@ -374,29 +374,4 @@
#define LOG_VERBOSE(channel, ...) WTFLogVerbose(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__)
#endif
-#if ENABLE(GC_VALIDATION)
-#define ASSERT_GC_OBJECT_LOOKS_VALID(cell) do { \
- if (!(cell))\
- CRASH();\
- if (cell->unvalidatedStructure()->unvalidatedStructure() != cell->unvalidatedStructure()->unvalidatedStructure()->unvalidatedStructure())\
- CRASH();\
-} while (0)
-
-#define ASSERT_GC_OBJECT_INHERITS(object, classInfo) do {\
- ASSERT_GC_OBJECT_LOOKS_VALID(object); \
- if (!object->inherits(classInfo)) \
- CRASH();\
-} 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)
-#endif
-
-#if COMPILER(CLANG)
-#define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass) COMPILE_ASSERT(__has_trivial_destructor(klass), klass##_has_trivial_destructor_check)
-#else
-#define ASSERT_HAS_TRIVIAL_DESTRUCTOR(klass)
-#endif
-
#endif /* WTF_Assertions_h */
Modified: trunk/Source/_javascript_Core/wtf/Compiler.h (107594 => 107595)
--- trunk/Source/_javascript_Core/wtf/Compiler.h 2012-02-13 20:31:43 UTC (rev 107594)
+++ trunk/Source/_javascript_Core/wtf/Compiler.h 2012-02-13 20:57:46 UTC (rev 107595)
@@ -50,6 +50,8 @@
#define WTF_COMPILER_SUPPORTS_BLOCKS __has_feature(blocks)
#define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT __has_extension(c_static_assert)
+#define WTF_COMPILER_SUPPORTS_HAS_TRIVIAL_DESTRUCTOR __has_extension(has_trivial_destructor)
+
#endif
/* COMPILER(MSVC) - Microsoft Visual C++ */