Changeset 160982 in webkit


Ignore:
Timestamp:
Dec 22, 2013 4:02:40 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

CStack: Add #if ENABLE(LLINT_C_LOOP) to C loop LLINT only parts of JSStack.
https://bugs.webkit.org/show_bug.cgi?id=126140.

Not yet reviewed.

Also moved startOfFrameFor() to the ENABLE(DEBUG_JSSTACK) section because
it's only needed there.

  • interpreter/JSStack.cpp:

(JSC::JSStack::JSStack):
(JSC::JSStack::gatherConservativeRoots):
(JSC::JSStack::sanitizeStack):

  • interpreter/JSStack.h:

(JSC::JSStack::gatherConservativeRoots):
(JSC::JSStack::sanitizeStack):
(JSC::JSStack::initializeThreading):

  • interpreter/JSStackInlines.h:

(JSC::JSStack::topOfFrameFor):

Location:
branches/jsCStack/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/jsCStack/Source/JavaScriptCore/ChangeLog

    r160981 r160982  
     12013-12-22  Mark Lam  <mark.lam@apple.com>
     2
     3        CStack: Add #if ENABLE(LLINT_C_LOOP) to C loop LLINT only parts of JSStack.
     4        https://bugs.webkit.org/show_bug.cgi?id=126140.
     5
     6        Not yet reviewed.
     7
     8        Also moved startOfFrameFor() to the ENABLE(DEBUG_JSSTACK) section because
     9        it's only needed there.
     10
     11        * interpreter/JSStack.cpp:
     12        (JSC::JSStack::JSStack):
     13        (JSC::JSStack::gatherConservativeRoots):
     14        (JSC::JSStack::sanitizeStack):
     15        * interpreter/JSStack.h:
     16        (JSC::JSStack::gatherConservativeRoots):
     17        (JSC::JSStack::sanitizeStack):
     18        (JSC::JSStack::initializeThreading):
     19        * interpreter/JSStackInlines.h:
     20        (JSC::JSStack::topOfFrameFor):
     21
    1222013-12-22  Mark Lam  <mark.lam@apple.com>
    223
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.cpp

    r160981 r160982  
    3636namespace JSC {
    3737
     38#if ENABLE(LLINT_C_LOOP)
    3839static size_t committedBytesCount = 0;
    3940
     
    4344    return staticMutex;
    4445}   
    45 
    46 JSStack::JSStack(VM& vm, size_t capacity)
     46#endif // ENABLE(LLINT_C_LOOP)
     47
     48JSStack::JSStack(VM& vm)
    4749    : m_vm(vm)
     50    , m_topCallFrame(vm.topCallFrame)
     51#if ENABLE(LLINT_C_LOOP)
    4852    , m_end(0)
    49     , m_topCallFrame(vm.topCallFrame)
    50 {
     53#endif
     54{
     55#if ENABLE(LLINT_C_LOOP)
     56    size_t capacity = defaultCapacity;
    5157    ASSERT(capacity && isPageAligned(capacity));
    5258
     
    5864
    5965    disableErrorStackReserve();
     66#endif // ENABLE(LLINT_C_LOOP)
    6067
    6168    m_topCallFrame = 0;
    6269}
    6370
     71#if ENABLE(LLINT_C_LOOP)
    6472JSStack::~JSStack()
    6573{
     
    97105void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots)
    98106{
    99 #if ENABLE(LLINT_CLOOP)
    100107    conservativeRoots.add(baseOfStack(), topOfStack());
    101 #else
    102     UNUSED_PARAM(conservativeRoots);
    103 #endif
    104108}
    105109
    106110void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks)
    107111{
    108 #if ENABLE(LLINT_CLOOP)
    109112    conservativeRoots.add(baseOfStack(), topOfStack(), jitStubRoutines, codeBlocks);
    110 #else
    111     UNUSED_PARAM(conservativeRoots);
    112     UNUSED_PARAM(jitStubRoutines);
    113     UNUSED_PARAM(codeBlocks);
    114 #endif
    115113}
    116114
    117115void JSStack::sanitizeStack()
    118116{
    119 #if ENABLE(LLINT_CLOOP)
    120117    ASSERT(topOfStack() <= baseOfStack());
    121118   
     
    127124   
    128125    m_lastStackTop = topOfStack();
    129 #endif
    130126}
    131127
     
    170166    }
    171167}
     168#endif // ENABLE(LLINT_C_LOOP)
    172169
    173170#if !ENABLE(LLINT_C_LOOP)
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h

    r160981 r160982  
    3636#include <wtf/VMTags.h>
    3737
     38#if ENABLE(LLINT_C_LOOP)
    3839#define ENABLE_DEBUG_JSSTACK 0
    3940#if !defined(NDEBUG) && !defined(ENABLE_DEBUG_JSSTACK)
    4041#define ENABLE_DEBUG_JSSTACK 1
    4142#endif
     43#endif // ENABLE(LLINT_C_LOOP)
    4244
    4345namespace JSC {
     
    7981        static const ptrdiff_t maxExcessCapacity = 8 * 1024;
    8082
    81         JSStack(VM&, size_t capacity = defaultCapacity);
    82         ~JSStack();
     83        JSStack(VM&);
    8384       
    8485        bool ensureCapacityFor(Register* newTopOfStack);
     
    8889        bool containsAddress(Register* address) { return (lowAddress() <= address && address < highAddress()); }
    8990        static size_t committedByteCount();
     91
     92#if !ENABLE(LLINT_C_LOOP)
     93        void gatherConservativeRoots(ConservativeRoots&) { }
     94        void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, CodeBlockSet&) { }
     95        void sanitizeStack() { }
     96        static void initializeThreading() { }
     97#else
     98        ~JSStack();
    9099
    91100        void gatherConservativeRoots(ConservativeRoots&);
     
    102111        static void initializeThreading();
    103112
    104         Register* startOfFrameFor(CallFrame*);
    105 
    106113        CallFrame* pushFrame(class CodeBlock*, JSScope*, int argsCount, JSObject* callee);
    107114
     
    116123        void validateFence(CallFrame*, const char* = "", int = 0) { }
    117124#endif // !ENABLE(DEBUG_JSSTACK)
     125#endif // ENABLE(LLINT_C_LOOP)
    118126
    119127    private:
     
    138146#endif // ENABLE(LLINT_C_LOOP)
    139147
     148#if ENABLE(LLINT_C_LOOP)
    140149        Register* reservationEnd() const
    141150        {
     
    147156        static JSValue generateFenceValue(size_t argIndex);
    148157        void installTrapsAfterFrame(CallFrame*);
     158        Register* startOfFrameFor(CallFrame*);
    149159#else
    150160        void installTrapsAfterFrame(CallFrame*) { }
     
    158168
    159169        void setStackLimit(Register* newEnd);
     170#endif // ENABLE(LLINT_C_LOOP)
    160171
    161172        void enableErrorStackReserve();
     
    163174
    164175        VM& m_vm;
     176        CallFrame*& m_topCallFrame;
     177#if ENABLE(LLINT_C_LOOP)
    165178        Register* m_end;
    166179        Register* m_commitEnd;
    167180        Register* m_useableEnd;
    168181        PageReservation m_reservation;
    169         CallFrame*& m_topCallFrame;
    170182        Register* m_lastStackTop;
     183#endif // ENABLE(LLINT_C_LOOP)
    171184
    172185        friend class LLIntOffsetsExtractor;
  • branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h

    r160967 r160982  
    6666inline Register* JSStack::topOfFrameFor(CallFrame* frame)
    6767{
     68#if ENABLE(LLINT_C_LOOP)
    6869    if (UNLIKELY(!frame))
    6970        return baseOfStack();
     71#endif
    7072    return frame->topOfFrame() - 1;
    7173}
     
    7678}
    7779
     80#if ENABLE(LLINT_C_LOOP)
     81
     82#if ENABLE(DEBUG_JSSTACK)
    7883inline Register* JSStack::startOfFrameFor(CallFrame* frame)
    7984{
     
    8186    return topOfFrameFor(callerFrame);
    8287}
     88#endif // ENABLE(DEBUG_JSSTACK)
    8389
    8490inline CallFrame* JSStack::pushFrame(class CodeBlock* codeBlock, JSScope* scope, int argsCount, JSObject* callee)
     
    292298}
    293299#endif // ENABLE(DEBUG_JSSTACK)
     300#endif // ENABLE(LLINT_C_LOOP)
    294301
    295302} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.