X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..ef99ff287df9046eb88937225e0554eabb00e33c:/debugger/DebuggerActivation.h diff --git a/debugger/DebuggerActivation.h b/debugger/DebuggerActivation.h index c2ede4f..e90383e 100644 --- a/debugger/DebuggerActivation.h +++ b/debugger/DebuggerActivation.h @@ -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 @@ -30,33 +30,41 @@ namespace JSC { - class JSActivation; - - class DebuggerActivation : public JSObject { - public: - DebuggerActivation(JSObject*); - - virtual void mark(); - virtual UString className() const; - virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); - virtual void put(ExecState*, const Identifier& propertyName, JSValuePtr, PutPropertySlot&); - virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValuePtr, unsigned attributes); - virtual bool deleteProperty(ExecState*, const Identifier& propertyName); - virtual void getPropertyNames(ExecState*, PropertyNameArray&); - virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const; - virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction); - virtual void defineSetter(ExecState*, const Identifier& propertyName, JSObject* setterFunction); - virtual JSValuePtr lookupGetter(ExecState*, const Identifier& propertyName); - virtual JSValuePtr lookupSetter(ExecState*, const Identifier& propertyName); - - static PassRefPtr createStructure(JSValuePtr prototype) - { - return Structure::create(prototype, TypeInfo(ObjectType)); - } - - private: - JSActivation* m_activation; - }; +class DebuggerActivation : public JSNonFinalObject { +public: + typedef JSNonFinalObject Base; + + static DebuggerActivation* create(VM& vm, JSObject* object) + { + DebuggerActivation* activation = new (NotNull, allocateCell(vm.heap)) DebuggerActivation(vm); + activation->finishCreation(vm, object); + return activation; + } + + static void visitChildren(JSCell*, SlotVisitor&); + static String className(const JSObject*); + static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); + static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); + static bool deleteProperty(JSCell*, ExecState*, PropertyName); + static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); + static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow); + + DECLARE_EXPORT_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | JSObject::StructureFlags; + + JS_EXPORT_PRIVATE void finishCreation(VM&, JSObject* activation); + +private: + JS_EXPORT_PRIVATE DebuggerActivation(VM&); + WriteBarrier m_activation; +}; } // namespace JSC