StructureStubInfo.h [plain text]
#ifndef StructureStubInfo_h
#define StructureStubInfo_h
#if ENABLE(JIT)
#include "Instruction.h"
#include "MacroAssembler.h"
#include "Opcode.h"
#include "Structure.h"
namespace JSC {
struct StructureStubInfo {
StructureStubInfo(OpcodeID opcodeID)
: opcodeID(opcodeID)
{
}
void initGetByIdSelf(Structure* baseObjectStructure)
{
opcodeID = op_get_by_id_self;
u.getByIdSelf.baseObjectStructure = baseObjectStructure;
baseObjectStructure->ref();
}
void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure)
{
opcodeID = op_get_by_id_proto;
u.getByIdProto.baseObjectStructure = baseObjectStructure;
baseObjectStructure->ref();
u.getByIdProto.prototypeStructure = prototypeStructure;
prototypeStructure->ref();
}
void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain)
{
opcodeID = op_get_by_id_chain;
u.getByIdChain.baseObjectStructure = baseObjectStructure;
baseObjectStructure->ref();
u.getByIdChain.chain = chain;
chain->ref();
}
void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize)
{
opcodeID = op_get_by_id_self_list;
u.getByIdProtoList.structureList = structureList;
u.getByIdProtoList.listSize = listSize;
}
void initGetByIdProtoList(PolymorphicAccessStructureList* structureList, int listSize)
{
opcodeID = op_get_by_id_proto_list;
u.getByIdProtoList.structureList = structureList;
u.getByIdProtoList.listSize = listSize;
}
void initPutByIdTransition(Structure* previousStructure, Structure* structure, StructureChain* chain)
{
opcodeID = op_put_by_id_transition;
u.putByIdTransition.previousStructure = previousStructure;
previousStructure->ref();
u.putByIdTransition.structure = structure;
structure->ref();
u.putByIdTransition.chain = chain;
chain->ref();
}
void initPutByIdReplace(Structure* baseObjectStructure)
{
opcodeID = op_put_by_id_replace;
u.putByIdReplace.baseObjectStructure = baseObjectStructure;
baseObjectStructure->ref();
}
void deref();
OpcodeID opcodeID;
union {
struct {
Structure* baseObjectStructure;
} getByIdSelf;
struct {
Structure* baseObjectStructure;
Structure* prototypeStructure;
} getByIdProto;
struct {
Structure* baseObjectStructure;
StructureChain* chain;
} getByIdChain;
struct {
PolymorphicAccessStructureList* structureList;
int listSize;
} getByIdSelfList;
struct {
PolymorphicAccessStructureList* structureList;
int listSize;
} getByIdProtoList;
struct {
Structure* previousStructure;
Structure* structure;
StructureChain* chain;
} putByIdTransition;
struct {
Structure* baseObjectStructure;
} putByIdReplace;
} u;
MacroAssembler::CodeLocationLabel stubRoutine;
MacroAssembler::CodeLocationCall callReturnLocation;
MacroAssembler::CodeLocationLabel hotPathBegin;
};
}
#endif
#endif // StructureStubInfo_h