X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..a253471d7f8e4d91bf6ebabab00155c3b387d3d0:/debugger/DebuggerActivation.cpp diff --git a/debugger/DebuggerActivation.cpp b/debugger/DebuggerActivation.cpp index 0444d23..2a83f51 100644 --- a/debugger/DebuggerActivation.cpp +++ b/debugger/DebuggerActivation.cpp @@ -30,75 +30,81 @@ namespace JSC { -DebuggerActivation::DebuggerActivation(JSObject* activation) - : JSObject(DebuggerActivation::createStructure(jsNull())) -{ - ASSERT(activation); - ASSERT(activation->isActivationObject()); - m_activation = static_cast(activation); -} +ASSERT_HAS_TRIVIAL_DESTRUCTOR(DebuggerActivation); -void DebuggerActivation::markChildren(MarkStack& markStack) -{ - JSObject::markChildren(markStack); +const ClassInfo DebuggerActivation::s_info = { "DebuggerActivation", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(DebuggerActivation) }; - if (m_activation) - markStack.append(m_activation); -} - -UString DebuggerActivation::className() const +DebuggerActivation::DebuggerActivation(JSGlobalData& globalData) + : JSNonFinalObject(globalData, globalData.debuggerActivationStructure.get()) { - return m_activation->className(); } -bool DebuggerActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +void DebuggerActivation::finishCreation(JSGlobalData& globalData, JSObject* activation) { - return m_activation->getOwnPropertySlot(exec, propertyName, slot); + Base::finishCreation(globalData); + ASSERT(activation); + ASSERT(activation->isActivationObject()); + m_activation.set(globalData, this, jsCast(activation)); } -void DebuggerActivation::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) +void DebuggerActivation::visitChildren(JSCell* cell, SlotVisitor& visitor) { - m_activation->put(exec, propertyName, value, slot); + DebuggerActivation* thisObject = jsCast(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); + JSObject::visitChildren(thisObject, visitor); + + if (thisObject->m_activation) + visitor.append(&thisObject->m_activation); } -void DebuggerActivation::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes) +UString DebuggerActivation::className(const JSObject* object) { - m_activation->putWithAttributes(exec, propertyName, value, attributes); + const DebuggerActivation* thisObject = jsCast(object); + return thisObject->m_activation->methodTable()->className(thisObject->m_activation.get()); } -bool DebuggerActivation::deleteProperty(ExecState* exec, const Identifier& propertyName) +bool DebuggerActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { - return m_activation->deleteProperty(exec, propertyName); + DebuggerActivation* thisObject = jsCast(cell); + return thisObject->m_activation->methodTable()->getOwnPropertySlot(thisObject->m_activation.get(), exec, propertyName, slot); } -void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) +void DebuggerActivation::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { - m_activation->getPropertyNames(exec, propertyNames, mode); + DebuggerActivation* thisObject = jsCast(cell); + thisObject->m_activation->methodTable()->put(thisObject->m_activation.get(), exec, propertyName, value, slot); } -bool DebuggerActivation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +void DebuggerActivation::putDirectVirtual(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes) { - return m_activation->getOwnPropertyDescriptor(exec, propertyName, descriptor); + DebuggerActivation* thisObject = jsCast(object); + thisObject->m_activation->methodTable()->putDirectVirtual(thisObject->m_activation.get(), exec, propertyName, value, attributes); } -void DebuggerActivation::defineGetter(ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes) +bool DebuggerActivation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName) { - m_activation->defineGetter(exec, propertyName, getterFunction, attributes); + DebuggerActivation* thisObject = jsCast(cell); + return thisObject->m_activation->methodTable()->deleteProperty(thisObject->m_activation.get(), exec, propertyName); } -void DebuggerActivation::defineSetter(ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes) +void DebuggerActivation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { - m_activation->defineSetter(exec, propertyName, setterFunction, attributes); + DebuggerActivation* thisObject = jsCast(object); + thisObject->m_activation->methodTable()->getPropertyNames(thisObject->m_activation.get(), exec, propertyNames, mode); } -JSValue DebuggerActivation::lookupGetter(ExecState* exec, const Identifier& propertyName) +bool DebuggerActivation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { - return m_activation->lookupGetter(exec, propertyName); + DebuggerActivation* thisObject = jsCast(object); + return thisObject->m_activation->methodTable()->getOwnPropertyDescriptor(thisObject->m_activation.get(), exec, propertyName, descriptor); } -JSValue DebuggerActivation::lookupSetter(ExecState* exec, const Identifier& propertyName) +bool DebuggerActivation::defineOwnProperty(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, bool shouldThrow) { - return m_activation->lookupSetter(exec, propertyName); + DebuggerActivation* thisObject = jsCast(object); + return thisObject->m_activation->methodTable()->defineOwnProperty(thisObject->m_activation.get(), exec, propertyName, descriptor, shouldThrow); } } // namespace JSC