X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..HEAD:/API/JSAPIWrapperObject.mm diff --git a/API/JSAPIWrapperObject.mm b/API/JSAPIWrapperObject.mm index c06de39..ef54602 100644 --- a/API/JSAPIWrapperObject.mm +++ b/API/JSAPIWrapperObject.mm @@ -26,25 +26,22 @@ #include "config.h" #include "JSAPIWrapperObject.h" -#include "JSCJSValueInlines.h" +#include "JSCInlines.h" #include "JSCallbackObject.h" -#include "JSCellInlines.h" #include "JSVirtualMachineInternal.h" -#include "SlotVisitorInlines.h" #include "Structure.h" -#include "StructureInlines.h" #if JSC_OBJC_API_ENABLED class JSAPIWrapperObjectHandleOwner : public JSC::WeakHandleOwner { public: - virtual void finalize(JSC::Handle, void*); - virtual bool isReachableFromOpaqueRoots(JSC::Handle, void* context, JSC::SlotVisitor&); + virtual void finalize(JSC::Handle, void*) override; + virtual bool isReachableFromOpaqueRoots(JSC::Handle, void* context, JSC::SlotVisitor&) override; }; static JSAPIWrapperObjectHandleOwner* jsAPIWrapperObjectHandleOwner() { - DEFINE_STATIC_LOCAL(JSAPIWrapperObjectHandleOwner, jsWrapperObjectHandleOwner, ()); + DEPRECATED_DEFINE_STATIC_LOCAL(JSAPIWrapperObjectHandleOwner, jsWrapperObjectHandleOwner, ()); return &jsWrapperObjectHandleOwner; } @@ -53,7 +50,8 @@ void JSAPIWrapperObjectHandleOwner::finalize(JSC::Handle handle, v JSC::JSAPIWrapperObject* wrapperObject = JSC::jsCast(handle.get().asCell()); if (!wrapperObject->wrappedObject()) return; - [static_cast(wrapperObject->wrappedObject()) release]; + + JSC::Heap::heap(wrapperObject)->releaseSoon(adoptNS(static_cast(wrapperObject->wrappedObject()))); JSC::WeakSet::deallocate(JSC::WeakImpl::asWeakImpl(handle.slot())); } @@ -69,7 +67,7 @@ bool JSAPIWrapperObjectHandleOwner::isReachableFromOpaqueRoots(JSC::Handle const ClassInfo JSCallbackObject::s_info = { "JSAPIWrapperObject", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackObject) }; +template <> const ClassInfo JSCallbackObject::s_info = { "JSAPIWrapperObject", &Base::s_info, 0, CREATE_METHOD_TABLE(JSCallbackObject) }; template<> const bool JSCallbackObject::needsDestruction = true; @@ -100,7 +98,6 @@ void JSAPIWrapperObject::setWrappedObject(void* wrappedObject) void JSAPIWrapperObject::visitChildren(JSCell* cell, JSC::SlotVisitor& visitor) { JSAPIWrapperObject* thisObject = JSC::jsCast(cell); - COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); Base::visitChildren(cell, visitor); if (thisObject->wrappedObject())