Rename DestroyFunc to avoid redefinition on unified build
authorticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Dec 2017 23:00:47 +0000 (23:00 +0000)
committerticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Dec 2017 23:00:47 +0000 (23:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180335

Reviewed by Filip Pizlo.

Changing DestroyFunc structures to more specific names to avoid
conflits on unified builds.

* heap/HeapCellType.cpp:
(JSC::HeapCellType::finishSweep):
(JSC::HeapCellType::destroy):
* runtime/JSDestructibleObjectHeapCellType.cpp:
(JSC::JSDestructibleObjectHeapCellType::finishSweep):
(JSC::JSDestructibleObjectHeapCellType::destroy):
* runtime/JSSegmentedVariableObjectHeapCellType.cpp:
(JSC::JSSegmentedVariableObjectHeapCellType::finishSweep):
(JSC::JSSegmentedVariableObjectHeapCellType::destroy):
* runtime/JSStringHeapCellType.cpp:
(JSC::JSStringHeapCellType::finishSweep):
(JSC::JSStringHeapCellType::destroy):
* wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp:
(JSC::JSWebAssemblyCodeBlockHeapCellType::finishSweep):
(JSC::JSWebAssemblyCodeBlockHeapCellType::destroy):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225464 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/HeapCellType.cpp
Source/JavaScriptCore/runtime/JSDestructibleObjectHeapCellType.cpp
Source/JavaScriptCore/runtime/JSSegmentedVariableObjectHeapCellType.cpp
Source/JavaScriptCore/runtime/JSStringHeapCellType.cpp
Source/JavaScriptCore/wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp

index fd28e3b..01a699e 100644 (file)
@@ -1,3 +1,29 @@
+2017-12-03  Caio Lima  <ticaiolima@gmail.com>
+
+        Rename DestroyFunc to avoid redefinition on unified build
+        https://bugs.webkit.org/show_bug.cgi?id=180335
+
+        Reviewed by Filip Pizlo.
+
+        Changing DestroyFunc structures to more specific names to avoid
+        conflits on unified builds.
+
+        * heap/HeapCellType.cpp:
+        (JSC::HeapCellType::finishSweep):
+        (JSC::HeapCellType::destroy):
+        * runtime/JSDestructibleObjectHeapCellType.cpp:
+        (JSC::JSDestructibleObjectHeapCellType::finishSweep):
+        (JSC::JSDestructibleObjectHeapCellType::destroy):
+        * runtime/JSSegmentedVariableObjectHeapCellType.cpp:
+        (JSC::JSSegmentedVariableObjectHeapCellType::finishSweep):
+        (JSC::JSSegmentedVariableObjectHeapCellType::destroy):
+        * runtime/JSStringHeapCellType.cpp:
+        (JSC::JSStringHeapCellType::finishSweep):
+        (JSC::JSStringHeapCellType::destroy):
+        * wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp:
+        (JSC::JSWebAssemblyCodeBlockHeapCellType::finishSweep):
+        (JSC::JSWebAssemblyCodeBlockHeapCellType::destroy):
+
 2017-12-01  JF Bastien  <jfbastien@apple.com>
 
         JavaScriptCore: missing exception checks in Math functions that take more than one argument
index 473deeb..ce35883 100644 (file)
 
 namespace JSC {
 
-namespace {
-
 // Writing it this way ensures that when you pass this as a functor, the callee is specialized for
 // this callback. If you wrote this as a normal function then the callee would be specialized for
 // the function's type and it would have indirect calls to that function. And unlike a lambda, it's
 // possible to mark this ALWAYS_INLINE.
-struct DestroyFunc {
+struct DefaultDestroyFunc {
     ALWAYS_INLINE void operator()(VM& vm, JSCell* cell) const
     {
         ASSERT(cell->structureID());
@@ -49,8 +47,6 @@ struct DestroyFunc {
     }
 };
 
-} // anonymous namespace
-
 HeapCellType::HeapCellType(AllocatorAttributes attributes)
     : m_attributes(attributes)
 {
@@ -62,12 +58,12 @@ HeapCellType::~HeapCellType()
 
 void HeapCellType::finishSweep(MarkedBlock::Handle& block, FreeList* freeList)
 {
-    block.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+    block.finishSweepKnowingHeapCellType(freeList, DefaultDestroyFunc());
 }
 
 void HeapCellType::destroy(VM& vm, JSCell* cell)
 {
-    DestroyFunc()(vm, cell);
+    DefaultDestroyFunc()(vm, cell);
 }
 
 } // namespace JSC
index 296764a..34e6c88 100644 (file)
 
 namespace JSC {
 
-namespace {
-
-struct DestroyFunc {
+struct JSDestructibleObjectDestroyFunc {
     ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
     {
         static_cast<JSDestructibleObject*>(cell)->classInfo()->methodTable.destroy(cell);
     }
 };
 
-} // anonymous namespace
-
 JSDestructibleObjectHeapCellType::JSDestructibleObjectHeapCellType()
     : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
 {
@@ -53,12 +49,12 @@ JSDestructibleObjectHeapCellType::~JSDestructibleObjectHeapCellType()
 
 void JSDestructibleObjectHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
 {
-    handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+    handle.finishSweepKnowingHeapCellType(freeList, JSDestructibleObjectDestroyFunc());
 }
 
 void JSDestructibleObjectHeapCellType::destroy(VM& vm, JSCell* cell)
 {
-    DestroyFunc()(vm, cell);
+    JSDestructibleObjectDestroyFunc()(vm, cell);
 }
 
 } // namespace JSC
index f1b3ba2..1828d95 100644 (file)
 
 namespace JSC {
 
-namespace {
-
-struct DestroyFunc {
+struct JSSegmentedVariableObjectDestroyFunc {
     ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
     {
         static_cast<JSSegmentedVariableObject*>(cell)->classInfo()->methodTable.destroy(cell);
     }
 };
 
-} // anonymous namespace
-
 JSSegmentedVariableObjectHeapCellType::JSSegmentedVariableObjectHeapCellType()
     : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
 {
@@ -53,12 +49,12 @@ JSSegmentedVariableObjectHeapCellType::~JSSegmentedVariableObjectHeapCellType()
 
 void JSSegmentedVariableObjectHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
 {
-    handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+    handle.finishSweepKnowingHeapCellType(freeList, JSSegmentedVariableObjectDestroyFunc());
 }
 
 void JSSegmentedVariableObjectHeapCellType::destroy(VM& vm, JSCell* cell)
 {
-    DestroyFunc()(vm, cell);
+    JSSegmentedVariableObjectDestroyFunc()(vm, cell);
 }
 
 } // namespace JSC
index b28e089..c4bc439 100644 (file)
 
 namespace JSC {
 
-namespace {
-
-struct DestroyFunc {
+struct JSStringDestroyFunc {
     ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
     {
         static_cast<JSString*>(cell)->JSString::~JSString();
     }
 };
 
-} // anonymous namespace
-
 JSStringHeapCellType::JSStringHeapCellType()
     : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
 {
@@ -53,12 +49,12 @@ JSStringHeapCellType::~JSStringHeapCellType()
 
 void JSStringHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
 {
-    handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+    handle.finishSweepKnowingHeapCellType(freeList, JSStringDestroyFunc());
 }
 
 void JSStringHeapCellType::destroy(VM& vm, JSCell* cell)
 {
-    DestroyFunc()(vm, cell);
+    JSStringDestroyFunc()(vm, cell);
 }
 
 } // namespace JSC
index 3889144..54ce60f 100644 (file)
@@ -34,9 +34,7 @@
 
 namespace JSC {
 
-namespace {
-
-struct DestroyFunc {
+struct JSWebAssemblyCodeBlockDestroyFunc {
     ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
     {
         static_assert(std::is_final<JSWebAssemblyCodeBlock>::value, "Otherwise, this code would not be correct.");
@@ -44,8 +42,6 @@ struct DestroyFunc {
     }
 };
 
-} // anonymous namespace
-
 JSWebAssemblyCodeBlockHeapCellType::JSWebAssemblyCodeBlockHeapCellType()
     : HeapCellType(AllocatorAttributes(NeedsDestruction, HeapCell::JSCell))
 {
@@ -57,12 +53,12 @@ JSWebAssemblyCodeBlockHeapCellType::~JSWebAssemblyCodeBlockHeapCellType()
 
 void JSWebAssemblyCodeBlockHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
 {
-    handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+    handle.finishSweepKnowingHeapCellType(freeList, JSWebAssemblyCodeBlockDestroyFunc());
 }
 
 void JSWebAssemblyCodeBlockHeapCellType::destroy(VM& vm, JSCell* cell)
 {
-    DestroyFunc()(vm, cell);
+    JSWebAssemblyCodeBlockDestroyFunc()(vm, cell);
 }
 
 } // namespace JSC