summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/jit/JITStubRoutine.h
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-05-30 12:48:17 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-05-30 12:48:17 +0200
commit881da28418d380042aa95a97f0cbd42560a64f7c (patch)
treea794dff3274695e99c651902dde93d934ea7a5af /Source/JavaScriptCore/jit/JITStubRoutine.h
parent7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff)
parent0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff)
downloadqtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/JavaScriptCore/jit/JITStubRoutine.h')
-rw-r--r--Source/JavaScriptCore/jit/JITStubRoutine.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/jit/JITStubRoutine.h b/Source/JavaScriptCore/jit/JITStubRoutine.h
index 020ef6907..db9aaa770 100644
--- a/Source/JavaScriptCore/jit/JITStubRoutine.h
+++ b/Source/JavaScriptCore/jit/JITStubRoutine.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,8 +26,6 @@
#ifndef JITStubRoutine_h
#define JITStubRoutine_h
-#include <wtf/Platform.h>
-
#if ENABLE(JIT)
#include "ExecutableAllocator.h"
@@ -61,13 +59,14 @@ public:
// Use this if you want to pass a CodePtr to someone who insists on taking
// a RefPtr<JITStubRoutine>.
- static PassRefPtr<JITStubRoutine> createSelfManagedRoutine(
+ static Ref<JITStubRoutine> createSelfManagedRoutine(
MacroAssemblerCodePtr rawCodePointer)
{
- return adoptRef(new JITStubRoutine(MacroAssemblerCodeRef::createSelfManagedCodeRef(rawCodePointer)));
+ return adoptRef(*new JITStubRoutine(MacroAssemblerCodeRef::createSelfManagedCodeRef(rawCodePointer)));
}
virtual ~JITStubRoutine();
+ virtual void aboutToDie() { }
// MacroAssemblerCodeRef is copyable, but at the cost of reference
// counting churn. Returning a reference is a good way of reducing
@@ -141,6 +140,11 @@ public:
return true;
}
+
+ // Return true if you are still valid after. Return false if you are now invalid. If you return
+ // false, you will usually not do any clearing because the idea is that you will simply be
+ // destroyed.
+ virtual bool visitWeak(VM&);
protected:
virtual void observeZeroRefCount();
@@ -150,11 +154,8 @@ protected:
};
// Helper for the creation of simple stub routines that need no help from the GC.
-#define FINALIZE_CODE_FOR_STUB(patchBuffer, dataLogFArguments) \
- (adoptRef(new JITStubRoutine(FINALIZE_CODE((patchBuffer), dataLogFArguments))))
-
-#define FINALIZE_CODE_FOR_DFG_STUB(patchBuffer, dataLogFArguments) \
- (adoptRef(new JITStubRoutine(FINALIZE_DFG_CODE((patchBuffer), dataLogFArguments))))
+#define FINALIZE_CODE_FOR_STUB(codeBlock, patchBuffer, dataLogFArguments) \
+ (adoptRef(new JITStubRoutine(FINALIZE_CODE_FOR((codeBlock), (patchBuffer), dataLogFArguments))))
} // namespace JSC