Changeset 39571 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Jan 2, 2009, 8:36:40 PM (16 years ago)
Author:
[email protected]
Message:

Build fix. Include FrameState.h

Location:
trunk/JavaScriptCore/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/ScopeChain.cpp

    r38087 r39571  
    5151#endif
    5252
     53int ScopeChain::localDepth() const
     54{
     55    int scopeDepth = 0;
     56    ScopeChainIterator iter = this->begin();
     57    ScopeChainIterator end = this->end();
     58    while (!(*iter)->isObject(&JSActivation::info)) {
     59        ++iter;
     60        if (iter == end)
     61            break;
     62        ++scopeDepth;
     63    }
     64    return scopeDepth;
     65}
     66
    5367} // namespace JSC
  • trunk/JavaScriptCore/runtime/ScopeChain.h

    r38473 r39571  
    4949        int refCount;
    5050
    51         void deref() { if (--refCount == 0) release(); }
    52         void ref() { ++refCount; }
     51        void deref() { ASSERT(refCount); if (--refCount == 0) { release();} }
     52        void ref() { ASSERT(refCount); ++refCount; }
    5353        void release();
    5454
     
    192192        void mark() const;
    193193
     194        // Caution: this should only be used if the codeblock this is being used
     195        // with needs a full scope chain, otherwise this returns the depth of
     196        // the preceeding call frame
     197        //
     198        // Returns the depth of the current call frame's scope chain
     199        int localDepth() const;
     200
    194201#ifndef NDEBUG       
    195202        void print() const { m_node->print(); }
Note: See TracChangeset for help on using the changeset viewer.