X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..refs/heads/master:/bytecompiler/LabelScope.h diff --git a/bytecompiler/LabelScope.h b/bytecompiler/LabelScope.h index cc21fff..9b84cb3 100644 --- a/bytecompiler/LabelScope.h +++ b/bytecompiler/LabelScope.h @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -49,13 +49,6 @@ namespace JSC { , m_continueTarget(continueTarget) { } - - void ref() { ++m_refCount; } - void deref() - { - --m_refCount; - ASSERT(m_refCount >= 0); - } int refCount() const { return m_refCount; } Label* breakTarget() const { return m_breakTarget.get(); } @@ -66,6 +59,15 @@ namespace JSC { int scopeDepth() const { return m_scopeDepth; } private: + friend class LabelScopePtr; + + void ref() { ++m_refCount; } + void deref() + { + --m_refCount; + ASSERT(m_refCount >= 0); + } + int m_refCount; Type m_type; const Identifier* m_name; @@ -74,6 +76,61 @@ namespace JSC { RefPtr