X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..2d39b0e377c0896910ee49ae70082ba665faf986:/debugger/DebuggerActivation.cpp diff --git a/debugger/DebuggerActivation.cpp b/debugger/DebuggerActivation.cpp index 8711b5c..1340ff7 100644 --- a/debugger/DebuggerActivation.cpp +++ b/debugger/DebuggerActivation.cpp @@ -27,81 +27,72 @@ #include "DebuggerActivation.h" #include "JSActivation.h" +#include "JSCInlines.h" namespace JSC { -DebuggerActivation::DebuggerActivation(JSGlobalData& globalData, JSObject* activation) - : JSNonFinalObject(globalData, globalData.debuggerActivationStructure.get()) -{ - ASSERT(activation); - ASSERT(activation->isActivationObject()); - m_activation.set(globalData, this, static_cast(activation)); -} - -void DebuggerActivation::visitChildren(SlotVisitor& visitor) -{ - ASSERT_GC_OBJECT_INHERITS(this, &s_info); - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); - ASSERT(structure()->typeInfo().overridesVisitChildren()); - JSObject::visitChildren(visitor); - - if (m_activation) - visitor.append(&m_activation); -} +STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DebuggerActivation); -UString DebuggerActivation::className() const -{ - return m_activation->className(); -} +const ClassInfo DebuggerActivation::s_info = { "DebuggerActivation", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(DebuggerActivation) }; -bool DebuggerActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +DebuggerActivation::DebuggerActivation(VM& vm) + : JSNonFinalObject(vm, vm.debuggerActivationStructure.get()) { - return m_activation->getOwnPropertySlot(exec, propertyName, slot); } -void DebuggerActivation::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) +void DebuggerActivation::finishCreation(VM& vm, JSObject* activation) { - m_activation->put(exec, propertyName, value, slot); + Base::finishCreation(vm); + ASSERT(activation); + ASSERT(activation->isActivationObject()); + m_activation.set(vm, this, jsCast(activation)); } -void DebuggerActivation::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes) +void DebuggerActivation::visitChildren(JSCell* cell, SlotVisitor& visitor) { - m_activation->putWithAttributes(exec, propertyName, value, attributes); -} + DebuggerActivation* thisObject = jsCast(cell); + ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); -bool DebuggerActivation::deleteProperty(ExecState* exec, const Identifier& propertyName) -{ - return m_activation->deleteProperty(exec, propertyName); + JSObject::visitChildren(thisObject, visitor); + visitor.append(&thisObject->m_activation); } -void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) +String DebuggerActivation::className(const JSObject* object) { - m_activation->getPropertyNames(exec, propertyNames, mode); + const DebuggerActivation* thisObject = jsCast(object); + return thisObject->m_activation->methodTable()->className(thisObject->m_activation.get()); } -bool DebuggerActivation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +bool DebuggerActivation::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) { - return m_activation->getOwnPropertyDescriptor(exec, propertyName, descriptor); + DebuggerActivation* thisObject = jsCast(object); + return thisObject->m_activation->methodTable()->getOwnPropertySlot(thisObject->m_activation.get(), exec, propertyName, slot); } -void DebuggerActivation::defineGetter(ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes) +void DebuggerActivation::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) { - m_activation->defineGetter(exec, propertyName, getterFunction, attributes); + DebuggerActivation* thisObject = jsCast(cell); + thisObject->m_activation->methodTable()->put(thisObject->m_activation.get(), exec, propertyName, value, slot); } -void DebuggerActivation::defineSetter(ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes) +bool DebuggerActivation::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName) { - m_activation->defineSetter(exec, propertyName, setterFunction, attributes); + DebuggerActivation* thisObject = jsCast(cell); + return thisObject->m_activation->methodTable()->deleteProperty(thisObject->m_activation.get(), exec, propertyName); } -JSValue DebuggerActivation::lookupGetter(ExecState* exec, const Identifier& propertyName) +void DebuggerActivation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { - return m_activation->lookupGetter(exec, propertyName); + DebuggerActivation* thisObject = jsCast(object); + thisObject->m_activation->methodTable()->getPropertyNames(thisObject->m_activation.get(), exec, propertyNames, mode); } -JSValue DebuggerActivation::lookupSetter(ExecState* exec, const Identifier& propertyName) +bool DebuggerActivation::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const 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