Commit 8e0e07c6 authored by Marius Wachtler's avatar Marius Wachtler

move ICSetupInfo before PatchpointInfo in anticipation for accessing...

move ICSetupInfo before PatchpointInfo in anticipation for accessing ICSetupInfo inside the PatchpointInfo
parent 433d0bfb
......@@ -29,7 +29,6 @@ struct CompiledFunction;
class CompilerType;
struct StackMap;
class TypeRecorder;
class ICSetupInfo;
static const int MAX_FRAME_SPILLS = 9; // TODO this shouldn't have to be larger than the set of non-callee-save args (9)
// except that will we currently spill the same reg multiple times
......@@ -39,6 +38,58 @@ static const int CALL_ONLY_SIZE
void processStackmap(CompiledFunction* cf, StackMap* stackmap);
class ICSetupInfo {
public:
enum ICType {
Generic,
Callsite,
GetGlobal,
Getattr,
Setattr,
Delattr,
Getitem,
Setitem,
Delitem,
Binexp,
Nonzero,
Hasnext,
};
private:
ICSetupInfo(ICType type, int num_slots, int slot_size, bool has_return_value, TypeRecorder* type_recorder)
: type(type),
num_slots(num_slots),
slot_size(slot_size),
has_return_value(has_return_value),
type_recorder(type_recorder) {}
public:
const ICType type;
const int num_slots, slot_size;
const bool has_return_value;
TypeRecorder* const type_recorder;
int totalSize() const;
bool hasReturnValue() const { return has_return_value; }
llvm::CallingConv::ID getCallingConvention() const {
// FIXME: we currently have some issues with using PreserveAll (the rewriter currently
// does not completely preserve live outs), so disable it temporarily.
#if 0
// The plan is to switch probably everything over to PreseveAll (and potentially AnyReg),
// but for only switch Getattr so the testing can be localized:
if (type == Getattr || type == Setattr)
return llvm::CallingConv::PreserveAll;
#endif
return llvm::CallingConv::C;
}
static ICSetupInfo* initialize(bool has_return_value, int num_slots, int slot_size, ICType type,
TypeRecorder* type_recorder);
};
struct PatchpointInfo {
public:
struct FrameVarInfo {
......@@ -100,58 +151,6 @@ public:
static void* getSlowpathAddr(unsigned int pp_id);
};
class ICSetupInfo {
public:
enum ICType {
Generic,
Callsite,
GetGlobal,
Getattr,
Setattr,
Delattr,
Getitem,
Setitem,
Delitem,
Binexp,
Nonzero,
Hasnext,
};
private:
ICSetupInfo(ICType type, int num_slots, int slot_size, bool has_return_value, TypeRecorder* type_recorder)
: type(type),
num_slots(num_slots),
slot_size(slot_size),
has_return_value(has_return_value),
type_recorder(type_recorder) {}
public:
const ICType type;
const int num_slots, slot_size;
const bool has_return_value;
TypeRecorder* const type_recorder;
int totalSize() const;
bool hasReturnValue() const { return has_return_value; }
llvm::CallingConv::ID getCallingConvention() const {
// FIXME: we currently have some issues with using PreserveAll (the rewriter currently
// does not completely preserve live outs), so disable it temporarily.
#if 0
// The plan is to switch probably everything over to PreseveAll (and potentially AnyReg),
// but for only switch Getattr so the testing can be localized:
if (type == Getattr || type == Setattr)
return llvm::CallingConv::PreserveAll;
#endif
return llvm::CallingConv::C;
}
static ICSetupInfo* initialize(bool has_return_value, int num_slots, int slot_size, ICType type,
TypeRecorder* type_recorder);
};
class ICInfo;
ICSetupInfo* createGenericIC(TypeRecorder* type_recorder, bool has_return_value, int size);
ICSetupInfo* createCallsiteIC(TypeRecorder* type_recorder, int num_args, ICInfo* bjit_ic_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment