Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-PGO calli/delegate call transformation #109679

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
8 changes: 7 additions & 1 deletion src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2326,7 +2326,7 @@ class ICorStaticInfo
CORINFO_CLASS_HANDLE cls
) = 0;

// Returns the assembly name of the class "cls", or nullptr if there is none.
// Returns the assembly name of the class "cls", or nullptr if there is none.
virtual const char* getClassAssemblyName (
CORINFO_CLASS_HANDLE cls
) = 0;
Expand Down Expand Up @@ -2611,6 +2611,12 @@ class ICorStaticInfo
CorInfoClassId classId
) = 0;

// returns the class handle for the special builtin classes
virtual CORINFO_METHOD_HANDLE getMethodFromDelegate (
void* address,
bool indirect
) = 0;

// "System.Int32" ==> CORINFO_TYPE_INT..
virtual CorInfoType getTypeForPrimitiveValueClass(
CORINFO_CLASS_HANDLE cls
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/inc/icorjitinfoimpl_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ void classMustBeLoadedBeforeCodeIsRun(
CORINFO_CLASS_HANDLE getBuiltinClass(
CorInfoClassId classId) override;

CORINFO_METHOD_HANDLE getMethodFromDelegate(
void* address,
bool indirect) override;

CorInfoType getTypeForPrimitiveValueClass(
CORINFO_CLASS_HANDLE cls) override;

Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID;
#define GUID_DEFINED
#endif // !GUID_DEFINED

constexpr GUID JITEEVersionIdentifier = { /* 04021b93-e969-41ed-96cd-4c583673b9ab */
0x04021b93,
0xe969,
0x41ed,
{0x96, 0xcd, 0x4c, 0x58, 0x36, 0x73, 0xb9, 0xab}
constexpr GUID JITEEVersionIdentifier = { /* 6ae7037f-e94a-4d63-ba3e-869778a1197b */
0x6ae7037f,
0xe94a,
0x4d63,
{0xba, 0x3e, 0x86, 0x97, 0x78, 0xa1, 0x19, 0x7b}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/ICorJitInfo_names_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ DEF_CLR_API(getReadyToRunDelegateCtorHelper)
DEF_CLR_API(initClass)
DEF_CLR_API(classMustBeLoadedBeforeCodeIsRun)
DEF_CLR_API(getBuiltinClass)
DEF_CLR_API(getMethodFromDelegate)
DEF_CLR_API(getTypeForPrimitiveValueClass)
DEF_CLR_API(getTypeForPrimitiveNumericClass)
DEF_CLR_API(canCast)
Expand Down
10 changes: 10 additions & 0 deletions src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,16 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getBuiltinClass(
return temp;
}

CORINFO_METHOD_HANDLE WrapICorJitInfo::getMethodFromDelegate(
void* address,
bool indirect)
{
API_ENTER(getMethodFromDelegate);
CORINFO_METHOD_HANDLE temp = wrapHnd->getMethodFromDelegate(address, indirect);
API_LEAVE(getMethodFromDelegate);
return temp;
}

CorInfoType WrapICorJitInfo::getTypeForPrimitiveValueClass(
CORINFO_CLASS_HANDLE cls)
{
Expand Down
7 changes: 4 additions & 3 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3919,7 +3919,7 @@ class Compiler

// false: we can add new tracked variables.
// true: We cannot add new 'tracked' variable
bool lvaTrackedFixed = false;
bool lvaTrackedFixed = false;

unsigned lvaCount; // total number of locals, which includes function arguments,
// special arguments, IL local variables, and JIT temporary variables
Expand Down Expand Up @@ -4559,6 +4559,7 @@ class Compiler
void impPopArgsForUnmanagedCall(GenTreeCall* call, CORINFO_SIG_INFO* sig, GenTree** swiftErrorNode);
void impPopArgsForSwiftCall(GenTreeCall* call, CORINFO_SIG_INFO* sig, GenTree** swiftErrorNode);
void impRetypeUnmanagedCallArgs(GenTreeCall* call);
bool impCanSubstituteSig(CORINFO_SIG_INFO* sourceSig, CORINFO_SIG_INFO* targetSig, bool* removeInstance);

#ifdef SWIFT_SUPPORT
void impAppendSwiftErrorStore(GenTree* const swiftErrorNode);
Expand Down Expand Up @@ -6869,15 +6870,15 @@ class Compiler
unsigned acdCount = 0;

// Get the index to use as part of the AddCodeDsc key for sharing throw blocks
unsigned bbThrowIndex(BasicBlock* blk, AcdKeyDesignator* dsg);
unsigned bbThrowIndex(BasicBlock* blk, AcdKeyDesignator* dsg);

struct AddCodeDscKey
{
public:
AddCodeDscKey(): acdKind(SCK_NONE), acdData(0) {}
AddCodeDscKey(SpecialCodeKind kind, BasicBlock* block, Compiler* comp);
AddCodeDscKey(AddCodeDsc* add);

static bool Equals(const AddCodeDscKey& x, const AddCodeDscKey& y)
{
return (x.acdData == y.acdData) && (x.acdKind == y.acdKind);
Expand Down
Loading
Loading