FTLInlineCacheDescriptor.h [plain text]
#ifndef FTLInlineCacheDescriptor_h
#define FTLInlineCacheDescriptor_h
#if ENABLE(FTL_JIT)
#include "CodeOrigin.h"
#include "JITInlineCacheGenerator.h"
#include "MacroAssembler.h"
#include <wtf/text/UniquedStringImpl.h>
namespace JSC { namespace FTL {
class InlineCacheDescriptor {
public:
InlineCacheDescriptor() { }
InlineCacheDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, UniquedStringImpl* uid)
: m_stackmapID(stackmapID)
, m_codeOrigin(codeOrigin)
, m_uid(uid)
{
}
unsigned stackmapID() const { return m_stackmapID; }
CodeOrigin codeOrigin() const { return m_codeOrigin; }
UniquedStringImpl* uid() const { return m_uid; }
private:
unsigned m_stackmapID;
CodeOrigin m_codeOrigin;
UniquedStringImpl* m_uid;
public:
Vector<MacroAssembler::Jump> m_slowPathDone;
};
class GetByIdDescriptor : public InlineCacheDescriptor {
public:
GetByIdDescriptor() { }
GetByIdDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, UniquedStringImpl* uid)
: InlineCacheDescriptor(stackmapID, codeOrigin, uid)
{
}
Vector<JITGetByIdGenerator> m_generators;
};
class PutByIdDescriptor : public InlineCacheDescriptor {
public:
PutByIdDescriptor() { }
PutByIdDescriptor(
unsigned stackmapID, CodeOrigin codeOrigin, UniquedStringImpl* uid,
ECMAMode ecmaMode, PutKind putKind)
: InlineCacheDescriptor(stackmapID, codeOrigin, uid)
, m_ecmaMode(ecmaMode)
, m_putKind(putKind)
{
}
Vector<JITPutByIdGenerator> m_generators;
ECMAMode ecmaMode() const { return m_ecmaMode; }
PutKind putKind() const { return m_putKind; }
private:
ECMAMode m_ecmaMode;
PutKind m_putKind;
};
struct CheckInGenerator {
StructureStubInfo* m_stub;
MacroAssembler::Call m_slowCall;
MacroAssembler::Label m_beginLabel;
CheckInGenerator(StructureStubInfo* stub, MacroAssembler::Call slowCall, MacroAssembler::Label beginLabel)
: m_stub(stub)
, m_slowCall(slowCall)
, m_beginLabel(beginLabel)
{
}
};
class CheckInDescriptor : public InlineCacheDescriptor {
public:
CheckInDescriptor() { }
CheckInDescriptor(unsigned stackmapID, CodeOrigin codeOrigin, const UniquedStringImpl* uid)
: InlineCacheDescriptor(stackmapID, codeOrigin, nullptr)
, m_uid(uid)
{
}
const UniquedStringImpl* m_uid;
Vector<CheckInGenerator> m_generators;
};
} }
#endif // ENABLE(FTL_JIT)
#endif // FTLInlineCacheDescriptor_h