Changeset 172372 in webkit for trunk/Source/JavaScriptCore/debugger/DebuggerScope.h
- Timestamp:
- Aug 8, 2014, 11:50:19 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/debugger/DebuggerScope.h
r172176 r172372 31 31 namespace JSC { 32 32 33 class DebuggerCallFrame;34 class JSScope;35 36 33 class DebuggerScope : public JSNonFinalObject { 37 34 public: 38 35 typedef JSNonFinalObject Base; 39 36 40 static DebuggerScope* create(VM& vm, JS Scope* scope)37 static DebuggerScope* create(VM& vm, JSObject* object) 41 38 { 42 DebuggerScope* debuggerScope = new (NotNull, allocateCell<DebuggerScope>(vm.heap)) DebuggerScope(vm, scope);43 debuggerScope->finishCreation(vm);44 return debuggerScope;39 DebuggerScope* activation = new (NotNull, allocateCell<DebuggerScope>(vm.heap)) DebuggerScope(vm); 40 activation->finishCreation(vm, object); 41 return activation; 45 42 } 46 43 … … 60 57 } 61 58 62 class Iterator { 63 public: 64 Iterator(DebuggerScope* node) 65 : m_node(node) 66 { 67 } 59 protected: 60 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags; 68 61 69 DebuggerScope* get() { return m_node; } 70 Iterator& operator++() { m_node = m_node->next(); return *this; } 71 // postfix ++ intentionally omitted 72 73 bool operator==(const Iterator& other) const { return m_node == other.m_node; } 74 bool operator!=(const Iterator& other) const { return m_node != other.m_node; } 75 76 private: 77 DebuggerScope* m_node; 78 }; 79 80 Iterator begin(); 81 Iterator end(); 82 DebuggerScope* next(); 83 84 void invalidateChain(); 85 bool isValid() const { return !!m_scope; } 86 87 bool isWithScope() const; 88 bool isGlobalScope() const; 89 bool isFunctionScope() const; 62 JS_EXPORT_PRIVATE void finishCreation(VM&, JSObject* activation); 90 63 91 64 private: 92 JS_EXPORT_PRIVATE DebuggerScope(VM&, JSScope*); 93 JS_EXPORT_PRIVATE void finishCreation(VM&); 94 95 JSScope* jsScope() const { return m_scope.get(); } 96 97 static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags; 98 99 WriteBarrier<JSScope> m_scope; 100 WriteBarrier<DebuggerScope> m_next; 101 102 friend class DebuggerCallFrame; 65 JS_EXPORT_PRIVATE DebuggerScope(VM&); 66 WriteBarrier<JSActivation> m_activation; 103 67 }; 104 105 inline DebuggerScope::Iterator DebuggerScope::begin()106 {107 return Iterator(this);108 }109 110 inline DebuggerScope::Iterator DebuggerScope::end()111 {112 return Iterator(0);113 }114 68 115 69 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.