summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h')
-rw-r--r--Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h57
1 files changed, 32 insertions, 25 deletions
diff --git a/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h b/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h
index 03045c5d1..5ee36ca46 100644
--- a/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h
+++ b/Source/JavaScriptCore/jit/GCAwareJITStubRoutine.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2014, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,10 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GCAwareJITStubRoutine_h
-#define GCAwareJITStubRoutine_h
-
-#include <wtf/Platform.h>
+#pragma once
#if ENABLE(JIT)
@@ -34,7 +31,6 @@
#include "JSObject.h"
#include "JSString.h"
#include "WriteBarrier.h"
-#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
namespace JSC {
@@ -54,7 +50,7 @@ class JITStubRoutineSet;
// list which does not get reclaimed all at once).
class GCAwareJITStubRoutine : public JITStubRoutine {
public:
- GCAwareJITStubRoutine(const MacroAssemblerCodeRef&, VM&, bool isClosureCall = false);
+ GCAwareJITStubRoutine(const MacroAssemblerCodeRef&, VM&);
virtual ~GCAwareJITStubRoutine();
void markRequiredObjects(SlotVisitor& visitor)
@@ -64,10 +60,8 @@ public:
void deleteFromGC();
- bool isClosureCall() const { return m_isClosureCall; }
-
protected:
- virtual void observeZeroRefCount() override;
+ void observeZeroRefCount() override;
virtual void markRequiredObjectsInternal(SlotVisitor&);
@@ -76,22 +70,39 @@ private:
bool m_mayBeExecuting;
bool m_isJettisoned;
- bool m_isClosureCall;
};
// Use this if you want to mark one additional object during GC if your stub
// routine is known to be executing.
-class MarkingGCAwareJITStubRoutineWithOneObject : public GCAwareJITStubRoutine {
+class MarkingGCAwareJITStubRoutine : public GCAwareJITStubRoutine {
public:
- MarkingGCAwareJITStubRoutineWithOneObject(
- const MacroAssemblerCodeRef&, VM&, const JSCell* owner, JSCell*);
- virtual ~MarkingGCAwareJITStubRoutineWithOneObject();
+ MarkingGCAwareJITStubRoutine(
+ const MacroAssemblerCodeRef&, VM&, const JSCell* owner, const Vector<JSCell*>&);
+ virtual ~MarkingGCAwareJITStubRoutine();
protected:
- virtual void markRequiredObjectsInternal(SlotVisitor&) override;
+ void markRequiredObjectsInternal(SlotVisitor&) override;
+
+private:
+ Vector<WriteBarrier<JSCell>> m_cells;
+};
+
+
+// The stub has exception handlers in it. So it clears itself from exception
+// handling table when it dies. It also frees space in CodeOrigin table
+// for new exception handlers to use the same CallSiteIndex.
+class GCAwareJITStubRoutineWithExceptionHandler : public MarkingGCAwareJITStubRoutine {
+public:
+ typedef GCAwareJITStubRoutine Base;
+
+ GCAwareJITStubRoutineWithExceptionHandler(const MacroAssemblerCodeRef&, VM&, const JSCell* owner, const Vector<JSCell*>&, CodeBlock*, CallSiteIndex);
+
+ void aboutToDie() override;
+ void observeZeroRefCount() override;
private:
- WriteBarrier<JSCell> m_object;
+ CodeBlock* m_codeBlockWithExceptionHandler;
+ CallSiteIndex m_exceptionHandlerCallSiteIndex;
};
// Helper for easily creating a GC-aware JIT stub routine. For the varargs,
@@ -100,7 +111,7 @@ private:
// appropriate. Generally you only need to pass pointers that will be used
// after the first call to C++ or JS.
//
-// PassRefPtr<JITStubRoutine> createJITStubRoutine(
+// Ref<JITStubRoutine> createJITStubRoutine(
// const MacroAssemblerCodeRef& code,
// VM& vm,
// const JSCell* owner,
@@ -113,15 +124,11 @@ private:
// this function using varargs, I ended up with more code than this simple
// way.
-PassRefPtr<JITStubRoutine> createJITStubRoutine(
- const MacroAssemblerCodeRef&, VM&, const JSCell* owner, bool makesCalls);
-PassRefPtr<JITStubRoutine> createJITStubRoutine(
+Ref<JITStubRoutine> createJITStubRoutine(
const MacroAssemblerCodeRef&, VM&, const JSCell* owner, bool makesCalls,
- JSCell*);
+ const Vector<JSCell*>& = { },
+ CodeBlock* codeBlockForExceptionHandlers = nullptr, CallSiteIndex exceptionHandlingCallSiteIndex = CallSiteIndex(std::numeric_limits<unsigned>::max()));
} // namespace JSC
#endif // ENABLE(JIT)
-
-#endif // GCAwareJITStubRoutine_h
-