#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<JSActivation*>(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<JSActivation*>(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<DebuggerActivation*>(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<const DebuggerActivation*>(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<DebuggerActivation*>(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<DebuggerActivation*>(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<DebuggerActivation*>(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<DebuggerActivation*>(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<DebuggerActivation*>(object);
+ return thisObject->m_activation->methodTable()->defineOwnProperty(thisObject->m_activation.get(), exec, propertyName, descriptor, shouldThrow);
}
} // namespace JSC