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

Implement Swift lowering algorithm in the CoreCLR type system #99438

Merged
merged 14 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ enum CorInfoHelpFunc
CORINFO_HELP_MEMSET, // Init block of memory
CORINFO_HELP_MEMZERO, // Init block of memory with zeroes
CORINFO_HELP_MEMCPY, // Copy block of memory
CORINFO_HELP_NATIVE_MEMSET, // Init block of memory using native memset (not safe for pDst being null,
CORINFO_HELP_NATIVE_MEMSET, // Init block of memory using native memset (not safe for pDst being null,
// not safe for unbounded size, does not trigger GC)

CORINFO_HELP_RUNTIMEHANDLE_METHOD, // determine a type/field/method handle at run-time
Expand Down Expand Up @@ -1982,6 +1982,14 @@ enum class GetTypeLayoutResult
Failure,
};

struct CORINFO_SWIFT_LOWERING
{
bool byReference;
CorInfoType loweredElements[4];
uint32_t offsets[4];
size_t numLoweredElements;
};
AaronRobinsonMSFT marked this conversation as resolved.
Show resolved Hide resolved

#define SIZEOF__CORINFO_Object TARGET_POINTER_SIZE /* methTable */

#define CORINFO_Array_MaxLength 0x7FFFFFC7
Expand Down Expand Up @@ -2061,7 +2069,7 @@ class ICorStaticInfo
// Example of a scenario addressed by notifyMethodInfoUsage:
// 1) Crossgen (with --opt-cross-module=MyLib) attempts to inline a call from MyLib.dll into MyApp.dll
// and realizes that the call always throws.
// 2) JIT aborts the inlining attempt and marks the call as no-return instead. The code that follows the call is
// 2) JIT aborts the inlining attempt and marks the call as no-return instead. The code that follows the call is
// replaced with a breakpoint instruction that is expected to be unreachable.
// 3) MyLib is updated to a new version so it's no longer within the same version bubble with MyApp.dll
// and the new version of the call no longer throws and does some work.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ private List<FieldLayoutInterval> CreateConsolidatedIntervals()
}
else
{
loweredTypes.Add((CorInfoType.CORINFO_TYPE_BYTE, opaqueIntervalStart));
opaqueIntervalStart++;
remainingIntervalSize--;
loweredTypes.Add((CorInfoType.CORINFO_TYPE_BYTE, opaqueIntervalStart));
}
}
}
Expand Down
Loading