X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..a253471d7f8e4d91bf6ebabab00155c3b387d3d0:/runtime/GetterSetter.h?ds=inline diff --git a/runtime/GetterSetter.h b/runtime/GetterSetter.h index aca7e3c..b8caf01 100644 --- a/runtime/GetterSetter.h +++ b/runtime/GetterSetter.h @@ -36,28 +36,37 @@ namespace JSC { // for a property. class GetterSetter : public JSCell { friend class JIT; - public: + + private: GetterSetter(ExecState* exec) : JSCell(exec->globalData(), exec->globalData().getterSetterStructure.get()) { } - virtual void visitChildren(SlotVisitor&); + public: + typedef JSCell Base; + + static GetterSetter* create(ExecState* exec) + { + GetterSetter* getterSetter = new (NotNull, allocateCell(*exec->heap())) GetterSetter(exec); + getterSetter->finishCreation(exec->globalData()); + return getterSetter; + } + + static void visitChildren(JSCell*, SlotVisitor&); JSObject* getter() const { return m_getter.get(); } - void setGetter(JSGlobalData& globalData, JSObject* getter) { m_getter.set(globalData, this, getter); } + void setGetter(JSGlobalData& globalData, JSObject* getter) { m_getter.setMayBeNull(globalData, this, getter); } JSObject* setter() const { return m_setter.get(); } - void setSetter(JSGlobalData& globalData, JSObject* setter) { m_setter.set(globalData, this, setter); } - static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) + void setSetter(JSGlobalData& globalData, JSObject* setter) { m_setter.setMayBeNull(globalData, this, setter); } + static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype) { - return Structure::create(globalData, prototype, TypeInfo(GetterSetterType, OverridesVisitChildren), AnonymousSlotCount, &s_info); + return Structure::create(globalData, globalObject, prototype, TypeInfo(GetterSetterType, OverridesVisitChildren), &s_info); } static const ClassInfo s_info; private: - virtual bool isGetterSetter() const; - WriteBarrier m_getter; WriteBarrier m_setter; };