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

JIT: Support custom ClassLayout instances with GC pointers in them #112064

Merged
merged 15 commits into from
Feb 5, 2025
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8292,7 +8292,7 @@ const StructSegments& Compiler::GetSignificantSegments(ClassLayout* layout)

StructSegments* newSegments = new (this, CMK_Promotion) StructSegments(getAllocator(CMK_Promotion));

if (layout->IsBlockLayout())
if (layout->IsCustomLayout())
{
newSegments->Add(StructSegments::Segment(0, layout->GetSize()));
}
Expand Down
12 changes: 7 additions & 5 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9221,7 +9221,7 @@ class Compiler

bool isOpaqueSIMDType(ClassLayout* layout) const
{
if (layout->IsBlockLayout())
if (layout->IsCustomLayout())
{
return true;
}
Expand Down Expand Up @@ -11079,14 +11079,16 @@ class Compiler
ClassLayout* typGetLayoutByNum(unsigned layoutNum);
// Get the layout number of the specified layout.
unsigned typGetLayoutNum(ClassLayout* layout);
// Get the layout for the specified class handle.
ClassLayout* typGetObjLayout(CORINFO_CLASS_HANDLE classHandle);
// Get the number of a layout for the specified class handle.
unsigned typGetObjLayoutNum(CORINFO_CLASS_HANDLE classHandle);
ClassLayout* typGetCustomLayout(const ClassLayoutBuilder& builder);
unsigned typGetCustomLayoutNum(const ClassLayoutBuilder& builder);
// Get the layout having the specified size but no class handle.
ClassLayout* typGetBlkLayout(unsigned blockSize);
// Get the number of a layout having the specified size but no class handle.
unsigned typGetBlkLayoutNum(unsigned blockSize);
// Get the layout for the specified class handle.
ClassLayout* typGetObjLayout(CORINFO_CLASS_HANDLE classHandle);
// Get the number of a layout for the specified class handle.
unsigned typGetObjLayoutNum(CORINFO_CLASS_HANDLE classHandle);

var_types TypeHandleToVarType(CORINFO_CLASS_HANDLE handle, ClassLayout** pLayout = nullptr);
var_types TypeHandleToVarType(CorInfoType jitType, CORINFO_CLASS_HANDLE handle, ClassLayout** pLayout = nullptr);
Expand Down
Loading
Loading