X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..8b637bb680022adfddad653280734877951535a9:/debugger/DebuggerActivation.cpp?ds=inline diff --git a/debugger/DebuggerActivation.cpp b/debugger/DebuggerActivation.cpp index 9d4dcbf..eec2d6b 100644 --- a/debugger/DebuggerActivation.cpp +++ b/debugger/DebuggerActivation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,77 +27,84 @@ #include "DebuggerActivation.h" #include "JSActivation.h" +#include "Operations.h" 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::mark() -{ - JSObject::mark(); - if (m_activation && !m_activation->marked()) - m_activation->mark(); -} +const ClassInfo DebuggerActivation::s_info = { "DebuggerActivation", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(DebuggerActivation) }; -UString DebuggerActivation::className() const +DebuggerActivation::DebuggerActivation(VM& vm) + : JSNonFinalObject(vm, vm.debuggerActivationStructure.get()) { - return m_activation->className(); } -bool DebuggerActivation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +void DebuggerActivation::finishCreation(VM& vm, JSObject* activation) { - return m_activation->getOwnPropertySlot(exec, propertyName, slot); + Base::finishCreation(vm); + ASSERT(activation); + ASSERT(activation->isActivationObject()); + m_activation.set(vm, this, jsCast(activation)); } -void DebuggerActivation::put(ExecState* exec, const Identifier& propertyName, JSValuePtr 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); + visitor.append(&thisObject->m_activation); } -void DebuggerActivation::putWithAttributes(ExecState* exec, const Identifier& propertyName, JSValuePtr value, unsigned attributes) +String 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, PropertyName 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::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) +void DebuggerActivation::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot) { - m_activation->getPropertyNames(exec, propertyNames); + DebuggerActivation* thisObject = jsCast(cell); + thisObject->m_activation->methodTable()->put(thisObject->m_activation.get(), exec, propertyName, value, slot); } -bool DebuggerActivation::getPropertyAttributes(JSC::ExecState* exec, const Identifier& propertyName, unsigned& attributes) const +void DebuggerActivation::putDirectVirtual(JSObject* object, ExecState* exec, PropertyName propertyName, JSValue value, unsigned attributes) { - return m_activation->getPropertyAttributes(exec, propertyName, attributes); + 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) +bool DebuggerActivation::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName) { - m_activation->defineGetter(exec, propertyName, getterFunction); + 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) +void DebuggerActivation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { - m_activation->defineSetter(exec, propertyName, setterFunction); + DebuggerActivation* thisObject = jsCast(object); + thisObject->m_activation->methodTable()->getPropertyNames(thisObject->m_activation.get(), exec, propertyNames, mode); } -JSValuePtr DebuggerActivation::lookupGetter(ExecState* exec, const Identifier& propertyName) +bool DebuggerActivation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName 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); } -JSValuePtr DebuggerActivation::lookupSetter(ExecState* exec, const Identifier& propertyName) +bool DebuggerActivation::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName 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