Title: [166759] trunk/Source/_javascript_Core
Revision
166759
Author
[email protected]
Date
2014-04-03 19:24:28 -0700 (Thu, 03 Apr 2014)

Log Message

All Heap::writeBarriers should be inline
https://bugs.webkit.org/show_bug.cgi?id=131197

Reviewed by Mark Lam.

One is in a JSCellInlines.h, another is in Heap.cpp. These are all critical
enough and small enough to belong in HeapInlines.h. Also added the proper
ENABLE(GGC) ifdefs to minimize the cost of C++ barriers for !ENABLE(GGC) builds.

* heap/Heap.cpp:
(JSC::Heap::writeBarrier): Deleted.
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::writeBarrier):
* runtime/JSCellInlines.h:
(JSC::Heap::writeBarrier): Deleted.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (166758 => 166759)


--- trunk/Source/_javascript_Core/ChangeLog	2014-04-04 01:56:47 UTC (rev 166758)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-04-04 02:24:28 UTC (rev 166759)
@@ -1,3 +1,22 @@
+2014-04-03  Mark Hahnenberg  <[email protected]>
+
+        All Heap::writeBarriers should be inline
+        https://bugs.webkit.org/show_bug.cgi?id=131197
+
+        Reviewed by Mark Lam.
+
+        One is in a JSCellInlines.h, another is in Heap.cpp. These are all critical 
+        enough and small enough to belong in HeapInlines.h. Also added the proper 
+        ENABLE(GGC) ifdefs to minimize the cost of C++ barriers for !ENABLE(GGC) builds.
+
+        * heap/Heap.cpp:
+        (JSC::Heap::writeBarrier): Deleted.
+        * heap/Heap.h:
+        * heap/HeapInlines.h:
+        (JSC::Heap::writeBarrier):
+        * runtime/JSCellInlines.h:
+        (JSC::Heap::writeBarrier): Deleted.
+
 2014-04-03  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: JSContext inspection provide a way to opt-out of including Native Call Stacks in Exception traces reported to Web Inspector

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (166758 => 166759)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2014-04-04 01:56:47 UTC (rev 166758)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2014-04-04 02:24:28 UTC (rev 166759)
@@ -1296,21 +1296,6 @@
     m_objectSpace.forEachDeadCell<Zombify>(iterationScope);
 }
 
-void Heap::writeBarrier(const JSCell* from)
-{
-#if ENABLE(GGC)
-    ASSERT_GC_OBJECT_LOOKS_VALID(const_cast<JSCell*>(from));
-    if (!from || !from->isMarked()) {
-        ASSERT(!from || !isMarked(from));
-        return;
-    }
-    ASSERT(isMarked(from));
-    addToRememberedSet(from);
-#else
-    UNUSED_PARAM(from);
-#endif
-}
-
 void Heap::flushWriteBarrierBuffer(JSCell* cell)
 {
 #if ENABLE(GGC)

Modified: trunk/Source/_javascript_Core/heap/Heap.h (166758 => 166759)


--- trunk/Source/_javascript_Core/heap/Heap.h	2014-04-04 01:56:47 UTC (rev 166758)
+++ trunk/Source/_javascript_Core/heap/Heap.h	2014-04-04 02:24:28 UTC (rev 166759)
@@ -100,7 +100,7 @@
 
     JS_EXPORT_PRIVATE void addToRememberedSet(const JSCell*);
     static bool isWriteBarrierEnabled();
-    JS_EXPORT_PRIVATE void writeBarrier(const JSCell*);
+    void writeBarrier(const JSCell*);
     void writeBarrier(const JSCell*, JSValue);
     void writeBarrier(const JSCell*, JSCell*);
 

Modified: trunk/Source/_javascript_Core/heap/HeapInlines.h (166758 => 166759)


--- trunk/Source/_javascript_Core/heap/HeapInlines.h	2014-04-04 01:56:47 UTC (rev 166758)
+++ trunk/Source/_javascript_Core/heap/HeapInlines.h	2014-04-04 02:24:28 UTC (rev 166759)
@@ -28,6 +28,7 @@
 
 #include "Heap.h"
 #include "JSCell.h"
+#include "Structure.h"
 
 namespace JSC {
 
@@ -105,11 +106,52 @@
 #if ENABLE(WRITE_BARRIER_PROFILING)
     WriteBarrierCounters::countWriteBarrier();
 #endif
+#if ENABLE(GGC)
     if (!to.isCell())
         return;
     writeBarrier(from, to.asCell());
+#else
+    UNUSED_PARAM(from);
+    UNUSED_PARAM(to);
+#endif
 }
 
+inline void Heap::writeBarrier(const JSCell* from, JSCell* to)
+{
+#if ENABLE(WRITE_BARRIER_PROFILING)
+    WriteBarrierCounters::countWriteBarrier();
+#endif
+#if ENABLE(GGC)
+    if (!from || !from->isMarked()) {
+        ASSERT(!from || !isMarked(from));
+        return;
+    }
+    if (!to || to->isMarked()) {
+        ASSERT(!to || isMarked(to));
+        return;
+    }
+    addToRememberedSet(from);
+#else
+    UNUSED_PARAM(from);
+    UNUSED_PARAM(to);
+#endif
+}
+
+inline void Heap::writeBarrier(const JSCell* from)
+{
+#if ENABLE(GGC)
+    ASSERT_GC_OBJECT_LOOKS_VALID(const_cast<JSCell*>(from));
+    if (!from || !from->isMarked()) {
+        ASSERT(!from || !isMarked(from));
+        return;
+    }
+    ASSERT(isMarked(from));
+    addToRememberedSet(from);
+#else
+    UNUSED_PARAM(from);
+#endif
+}
+
 inline void Heap::reportExtraMemoryCost(size_t cost)
 {
     if (cost > minExtraCost) 

Modified: trunk/Source/_javascript_Core/runtime/JSCellInlines.h (166758 => 166759)


--- trunk/Source/_javascript_Core/runtime/JSCellInlines.h	2014-04-04 01:56:47 UTC (rev 166758)
+++ trunk/Source/_javascript_Core/runtime/JSCellInlines.h	2014-04-04 02:24:28 UTC (rev 166759)
@@ -242,22 +242,6 @@
     return MixedTriState;
 }
 
-inline void Heap::writeBarrier(const JSCell* from, JSCell* to)
-{
-#if ENABLE(WRITE_BARRIER_PROFILING)
-    WriteBarrierCounters::countWriteBarrier();
-#endif
-    if (!from || !from->isMarked()) {
-        ASSERT(!from || !isMarked(from));
-        return;
-    }
-    if (!to || to->isMarked()) {
-        ASSERT(!to || isMarked(to));
-        return;
-    }
-    addToRememberedSet(from);
-}
-
 } // namespace JSC
 
 #endif // JSCellInlines_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to