Changeset 166759 in webkit


Ignore:
Timestamp:
Apr 3, 2014 7:24:28 PM (10 years ago)
Author:
mhahnenberg@apple.com
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.

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r166756 r166759  
     12014-04-03  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        All Heap::writeBarriers should be inline
     4        https://bugs.webkit.org/show_bug.cgi?id=131197
     5
     6        Reviewed by Mark Lam.
     7
     8        One is in a JSCellInlines.h, another is in Heap.cpp. These are all critical
     9        enough and small enough to belong in HeapInlines.h. Also added the proper
     10        ENABLE(GGC) ifdefs to minimize the cost of C++ barriers for !ENABLE(GGC) builds.
     11
     12        * heap/Heap.cpp:
     13        (JSC::Heap::writeBarrier): Deleted.
     14        * heap/Heap.h:
     15        * heap/HeapInlines.h:
     16        (JSC::Heap::writeBarrier):
     17        * runtime/JSCellInlines.h:
     18        (JSC::Heap::writeBarrier): Deleted.
     19
    1202014-04-03  Joseph Pecoraro  <pecoraro@apple.com>
    221
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r166678 r166759  
    12971297}
    12981298
    1299 void Heap::writeBarrier(const JSCell* from)
    1300 {
    1301 #if ENABLE(GGC)
    1302     ASSERT_GC_OBJECT_LOOKS_VALID(const_cast<JSCell*>(from));
    1303     if (!from || !from->isMarked()) {
    1304         ASSERT(!from || !isMarked(from));
    1305         return;
    1306     }
    1307     ASSERT(isMarked(from));
    1308     addToRememberedSet(from);
    1309 #else
    1310     UNUSED_PARAM(from);
    1311 #endif
    1312 }
    1313 
    13141299void Heap::flushWriteBarrierBuffer(JSCell* cell)
    13151300{
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r166678 r166759  
    101101    JS_EXPORT_PRIVATE void addToRememberedSet(const JSCell*);
    102102    static bool isWriteBarrierEnabled();
    103     JS_EXPORT_PRIVATE void writeBarrier(const JSCell*);
     103    void writeBarrier(const JSCell*);
    104104    void writeBarrier(const JSCell*, JSValue);
    105105    void writeBarrier(const JSCell*, JSCell*);
  • trunk/Source/JavaScriptCore/heap/HeapInlines.h

    r166375 r166759  
    2929#include "Heap.h"
    3030#include "JSCell.h"
     31#include "Structure.h"
    3132
    3233namespace JSC {
     
    106107    WriteBarrierCounters::countWriteBarrier();
    107108#endif
     109#if ENABLE(GGC)
    108110    if (!to.isCell())
    109111        return;
    110112    writeBarrier(from, to.asCell());
     113#else
     114    UNUSED_PARAM(from);
     115    UNUSED_PARAM(to);
     116#endif
     117}
     118
     119inline void Heap::writeBarrier(const JSCell* from, JSCell* to)
     120{
     121#if ENABLE(WRITE_BARRIER_PROFILING)
     122    WriteBarrierCounters::countWriteBarrier();
     123#endif
     124#if ENABLE(GGC)
     125    if (!from || !from->isMarked()) {
     126        ASSERT(!from || !isMarked(from));
     127        return;
     128    }
     129    if (!to || to->isMarked()) {
     130        ASSERT(!to || isMarked(to));
     131        return;
     132    }
     133    addToRememberedSet(from);
     134#else
     135    UNUSED_PARAM(from);
     136    UNUSED_PARAM(to);
     137#endif
     138}
     139
     140inline void Heap::writeBarrier(const JSCell* from)
     141{
     142#if ENABLE(GGC)
     143    ASSERT_GC_OBJECT_LOOKS_VALID(const_cast<JSCell*>(from));
     144    if (!from || !from->isMarked()) {
     145        ASSERT(!from || !isMarked(from));
     146        return;
     147    }
     148    ASSERT(isMarked(from));
     149    addToRememberedSet(from);
     150#else
     151    UNUSED_PARAM(from);
     152#endif
    111153}
    112154
  • trunk/Source/JavaScriptCore/runtime/JSCellInlines.h

    r165135 r166759  
    243243}
    244244
    245 inline void Heap::writeBarrier(const JSCell* from, JSCell* to)
    246 {
    247 #if ENABLE(WRITE_BARRIER_PROFILING)
    248     WriteBarrierCounters::countWriteBarrier();
    249 #endif
    250     if (!from || !from->isMarked()) {
    251         ASSERT(!from || !isMarked(from));
    252         return;
    253     }
    254     if (!to || to->isMarked()) {
    255         ASSERT(!to || isMarked(to));
    256         return;
    257     }
    258     addToRememberedSet(from);
    259 }
    260 
    261245} // namespace JSC
    262246
Note: See TracChangeset for help on using the changeset viewer.