Changeset 39571 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Jan 2, 2009, 8:36:40 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ScopeChain.cpp
r38087 r39571 51 51 #endif 52 52 53 int 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 53 67 } // namespace JSC -
trunk/JavaScriptCore/runtime/ScopeChain.h
r38473 r39571 49 49 int refCount; 50 50 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; } 53 53 void release(); 54 54 … … 192 192 void mark() const; 193 193 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 194 201 #ifndef NDEBUG 195 202 void print() const { m_node->print(); }
Note:
See TracChangeset
for help on using the changeset viewer.