Ignore:
Timestamp:
Aug 24, 2011, 2:50:40 AM (14 years ago)
Author:
[email protected]
Message:

There is no facility for profiling how the write barrier is used
https://bugs.webkit.org/show_bug.cgi?id=66747

Reviewed by Geoffrey Garen.

Added facilities for the JIT to specify the kind of write barrier
being executed. Added code for profiling the number of each kind
of barrier encountered.

(JSC::DFG::JITCodeGenerator::writeBarrier):
(JSC::DFG::JITCodeGenerator::cachedPutById):

  • dfg/DFGJITCodeGenerator.h:
  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::emitCount):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::emitCount):

  • dfg/DFGNonSpeculativeJIT.cpp:

(JSC::DFG::NonSpeculativeJIT::compile):

  • dfg/DFGRepatch.cpp:

(JSC::DFG::tryCachePutByID):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • heap/Heap.h:

(JSC::Heap::writeBarrier):

  • heap/WriteBarrierSupport.cpp: Added.

(JSC::WriteBarrierCounters::initialize):

  • heap/WriteBarrierSupport.h: Added.

(JSC::WriteBarrierCounters::WriteBarrierCounters):
(JSC::WriteBarrierCounters::jitCounterFor):
(JSC::WriteBarrierCounters::countWriteBarrier):

  • jit/JIT.h:
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::emit_op_put_scoped_var):
(JSC::JIT::emit_op_put_global_var):
(JSC::JIT::emitWriteBarrier):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::emit_op_put_scoped_var):
(JSC::JIT::emit_op_put_global_var):
(JSC::JIT::emitWriteBarrier):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce):

  • runtime/WriteBarrier.h:

(JSC::WriteBarrierBase::setWithoutWriteBarrier):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r92224 r93698  
    2929#include "NewSpace.h"
    3030#include "SlotVisitor.h"
     31#include "WriteBarrierSupport.h"
    3132#include <wtf/Forward.h>
    3233#include <wtf/HashCountedSet.h>
     
    130131       
    131132        enum AllocationEffort { AllocationMustSucceed, AllocationCanFail };
     133       
     134#if ENABLE(GGC)
     135        static void writeBarrierFastCase(const JSCell* owner, JSCell*);
     136#endif
    132137
    133138        bool isValidAllocation(size_t);
     
    237242
    238243#if ENABLE(GGC)
    239     inline void Heap::writeBarrier(const JSCell* owner, JSCell* cell)
     244    inline void Heap::writeBarrierFastCase(const JSCell* owner, JSCell* cell)
    240245    {
    241246        if (MarkedBlock::blockFor(owner)->inNewSpace())
     
    244249    }
    245250
     251    inline void Heap::writeBarrier(const JSCell* owner, JSCell* cell)
     252    {
     253        WriteBarrierCounters::countWriteBarrier();
     254        writeBarrierFastCase(owner, cell);
     255    }
     256
    246257    inline void Heap::writeBarrier(const JSCell* owner, JSValue value)
    247258    {
     259        WriteBarrierCounters::countWriteBarrier();
    248260        if (!value)
    249261            return;
    250262        if (!value.isCell())
    251263            return;
    252         writeBarrier(owner, value.asCell());
    253     }
    254 
     264        writeBarrierFastCase(owner, value.asCell());
     265    }
    255266#else
    256267
    257268    inline void Heap::writeBarrier(const JSCell*, JSCell*)
    258269    {
     270        WriteBarrierCounters::countWriteBarrier();
    259271    }
    260272
    261273    inline void Heap::writeBarrier(const JSCell*, JSValue)
    262274    {
     275        WriteBarrierCounters::countWriteBarrier();
    263276    }
    264277#endif
Note: See TracChangeset for help on using the changeset viewer.