/*
- * 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
#ifndef GCAwareJITStubRoutine_h
#define GCAwareJITStubRoutine_h
-#include <wtf/Platform.h>
-
#if ENABLE(JIT)
#include "JITStubRoutine.h"
// 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)
void deleteFromGC();
- bool isClosureCall() const { return m_isClosureCall; }
-
protected:
- virtual void observeZeroRefCount();
+ virtual void observeZeroRefCount() override;
virtual void markRequiredObjectsInternal(SlotVisitor&);
bool m_mayBeExecuting;
bool m_isJettisoned;
- bool m_isClosureCall;
};
// Use this if you want to mark one additional object during GC if your stub
virtual ~MarkingGCAwareJITStubRoutineWithOneObject();
protected:
- virtual void markRequiredObjectsInternal(SlotVisitor&);
+ virtual void markRequiredObjectsInternal(SlotVisitor&) override;
private:
WriteBarrier<JSCell> m_object;
// 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(
const MacroAssemblerCodeRef&, VM&, const JSCell* owner, bool makesCalls,
- JSCell*);
+ JSCell* = nullptr);
+
+// Helper for the creation of simple stub routines that need no help from the GC. Note
+// that codeBlock gets "executed" more than once.
+#define FINALIZE_CODE_FOR_GC_AWARE_STUB(codeBlock, patchBuffer, makesCalls, cell, dataLogFArguments) \
+ (createJITStubRoutine(FINALIZE_CODE_FOR((codeBlock), (patchBuffer), dataLogFArguments), *(codeBlock)->vm(), (codeBlock)->ownerExecutable(), (makesCalls), (cell)))
} // namespace JSC