Changeset 37191 in webkit for trunk/JavaScriptCore/VM


Ignore:
Timestamp:
Oct 2, 2008, 9:22:58 AM (17 years ago)
Author:
[email protected]
Message:

2008-10-02 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.


Fixed https://bugs.webkit.org/show_bug.cgi?id=21283.
Profiler Crashes When Started

  • VM/Machine.cpp:
  • VM/Machine.h: (JSC::makeHostCallFramePointer): (JSC::isHostCallFrame): (JSC::stripHostCallFrameBit): Moved some things to the header so JSGlobalObject could use them.
  • kjs/JSGlobalObject.h: (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Call the new makeHostCallFramePointer API, since 0 no longer indicates a host call frame.
Location:
trunk/JavaScriptCore/VM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/Machine.cpp

    r37184 r37191  
    105105
    106106#endif // #ENABLE(CTI)
    107 
    108 static const intptr_t HostCallFrameMask = 1;
    109 
    110 static inline Register* makeHostCallFramePointer(Register* callFrame)
    111 {
    112     return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) | HostCallFrameMask);
    113 }
    114 
    115 static inline bool isHostCallFrame(Register* callFrame)
    116 {
    117     return reinterpret_cast<intptr_t>(callFrame) & HostCallFrameMask;
    118 }
    119 
    120 static inline Register* stripHostCallFrameBit(Register* callFrame)
    121 {
    122     return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) & ~HostCallFrameMask);
    123 }
    124107
    125108// Returns the depth of the scope chain within a given call frame.
  • trunk/JavaScriptCore/VM/Machine.h

    r37184 r37191  
    315315    ALWAYS_INLINE void Machine::initializeCallFrame(Register* callFrame, CodeBlock* codeBlock, Instruction* vPC, ScopeChainNode* scopeChain, Register* r, int returnValueRegister, int argc, JSValue* function)
    316316    {
     317        ASSERT(r); // use makeHostCallFramePointer(0) to create a host call frame sentinel.
    317318        callFrame[RegisterFile::CodeBlock] = codeBlock;
    318319        callFrame[RegisterFile::ScopeChain] = scopeChain;
     
    326327    }
    327328
     329    static const intptr_t HostCallFrameMask = 1;
     330
     331    static inline Register* makeHostCallFramePointer(Register* callFrame)
     332    {
     333        return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) | HostCallFrameMask);
     334    }
     335
     336    static inline bool isHostCallFrame(Register* callFrame)
     337    {
     338        return reinterpret_cast<intptr_t>(callFrame) & HostCallFrameMask;
     339    }
     340
     341    static inline Register* stripHostCallFrameBit(Register* callFrame)
     342    {
     343        return reinterpret_cast<Register*>(reinterpret_cast<intptr_t>(callFrame) & ~HostCallFrameMask);
     344    }
     345
    328346} // namespace JSC
    329347
Note: See TracChangeset for help on using the changeset viewer.