#include "MacroAssemblerCodeRef.h"
#include "ThunkGenerator.h"
#include "Weak.h"
+#include "WeakHandleOwner.h"
#include "WeakInlines.h"
#include <wtf/HashMap.h>
-#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/ThreadingPrimitives.h>
class VM;
class NativeExecutable;
-class JITThunks {
+class JITThunks final : private WeakHandleOwner {
+ WTF_MAKE_FAST_ALLOCATED;
public:
JITThunks();
- ~JITThunks();
+ virtual ~JITThunks();
MacroAssemblerCodePtr ctiNativeCall(VM*);
MacroAssemblerCodePtr ctiNativeConstruct(VM*);
// Main thread can hold this lock for a while, so use an adaptive mutex.
typedef Mutex Lock;
typedef MutexLocker Locker;
+
+ void finalize(Handle<Unknown>, void* context) override;
typedef HashMap<ThunkGenerator, MacroAssemblerCodeRef> CTIStubMap;
CTIStubMap m_ctiStubMap;
typedef HashMap<std::pair<NativeFunction, NativeFunction>, Weak<NativeExecutable>> HostFunctionStubMap;
- OwnPtr<HostFunctionStubMap> m_hostFunctionStubMap;
+ std::unique_ptr<HostFunctionStubMap> m_hostFunctionStubMap;
Lock m_lock;
};