Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0806470

Browse files
authored
Remove unused GETFIELD/SETFIELD helpers (dotnet#105023)
1 parent bec5970 commit 0806470

23 files changed

+204
-1007
lines changed

src/coreclr/inc/corinfo.h

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -145,23 +145,13 @@ The first 4 options are mutually exclusive
145145
also CORINFO_FLG_STATIC_IN_HEAP).
146146
147147
148-
This last field can modify any of the cases above except CORINFO_FLG_HELPER
148+
This last field can modify any of the cases above
149149
150150
CORINFO_FLG_STATIC_IN_HEAP This is currently only used for static fields of value classes. If the field has
151151
this set then after computing what would normally be the field, what you actually get is a object pointer
152152
(that must be reported to the GC) to a boxed version of the value. Thus the actual field address is computed
153153
by addr = (*addr+sizeof(OBJECTREF))
154154
155-
Instance fields
156-
157-
* CORINFO_FLG_HELPER This is used if the class is MarshalByRef, which means that the object might be a
158-
proxy to the real object in some other appdomain or process. If the field has this set, then the JIT
159-
must call getFieldHelper and call the returned helper with the object ref. If the helper returned is
160-
helpers that are for structures the args are as follows
161-
162-
* CORINFO_HELP_GETFIELDSTRUCT - args are: retBuff, object, fieldDesc
163-
* CORINFO_HELP_SETFIELDSTRUCT - args are object fieldDesc value
164-
165155
The other GET helpers take an object fieldDesc and return the value The other SET helpers take an object
166156
fieldDesc and value
167157
@@ -499,28 +489,8 @@ enum CorInfoHelpFunc
499489
CORINFO_HELP_ASSIGN_BYREF,
500490
CORINFO_HELP_BULK_WRITEBARRIER,
501491

502-
503492
/* Accessing fields */
504493

505-
// For COM object support (using COM get/set routines to update object)
506-
// and EnC and cross-context support
507-
CORINFO_HELP_GETFIELD8,
508-
CORINFO_HELP_SETFIELD8,
509-
CORINFO_HELP_GETFIELD16,
510-
CORINFO_HELP_SETFIELD16,
511-
CORINFO_HELP_GETFIELD32,
512-
CORINFO_HELP_SETFIELD32,
513-
CORINFO_HELP_GETFIELD64,
514-
CORINFO_HELP_SETFIELD64,
515-
CORINFO_HELP_GETFIELDOBJ,
516-
CORINFO_HELP_SETFIELDOBJ,
517-
CORINFO_HELP_GETFIELDSTRUCT,
518-
CORINFO_HELP_SETFIELDSTRUCT,
519-
CORINFO_HELP_GETFIELDFLOAT,
520-
CORINFO_HELP_SETFIELDFLOAT,
521-
CORINFO_HELP_GETFIELDDOUBLE,
522-
CORINFO_HELP_SETFIELDDOUBLE,
523-
524494
CORINFO_HELP_GETFIELDADDR,
525495
CORINFO_HELP_GETSTATICFIELDADDR,
526496
CORINFO_HELP_GETSTATICFIELDADDR_TLS, // Helper for PE TLS fields
@@ -2246,10 +2216,6 @@ class ICorStaticInfo
22462216
CORINFO_METHOD_HANDLE method
22472217
) = 0;
22482218

2249-
virtual CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl(
2250-
CORINFO_METHOD_HANDLE method
2251-
) = 0;
2252-
22532219
// Returns the global cookie for the /GS unsafe buffer checks
22542220
// The cookie might be a constant value (JIT), or a handle to memory location (Ngen)
22552221
virtual void getGSCookie(

src/coreclr/inc/icorjitinfoimpl_generated.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ bool satisfiesMethodConstraints(
126126
void methodMustBeLoadedBeforeCodeIsRun(
127127
CORINFO_METHOD_HANDLE method) override;
128128

129-
CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl(
130-
CORINFO_METHOD_HANDLE method) override;
131-
132129
void getGSCookie(
133130
GSCookie* pCookieVal,
134131
GSCookie** ppCookieVal) override;

src/coreclr/inc/jiteeversionguid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ typedef const GUID *LPCGUID;
4343
#define GUID_DEFINED
4444
#endif // !GUID_DEFINED
4545

46-
constexpr GUID JITEEVersionIdentifier = { /* e6c7a441-8d3c-4135-abc2-bc4dd7c6a4d7 */
47-
0xe6c7a441,
48-
0x8d3c,
49-
0x4135,
50-
{0xab, 0xc2, 0xbc, 0x4d, 0xd7, 0xc6, 0xa4, 0xd7}
46+
constexpr GUID JITEEVersionIdentifier = { /* 64fe30fb-0a27-4b1d-b89e-306e552ac848 */
47+
0x64fe30fb,
48+
0x0a27,
49+
0x4b1d,
50+
{0xb8, 0x9e, 0x30, 0x6e, 0x55, 0x2a, 0xc8, 0x48}
5151
};
5252

5353
//////////////////////////////////////////////////////////////////////////////////////////////////////////

src/coreclr/inc/jithelpers.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,6 @@
157157
DYNAMICJITHELPER(CORINFO_HELP_BULK_WRITEBARRIER, NULL, CORINFO_HELP_SIG_REG_ONLY)
158158

159159
// Accessing fields
160-
JITHELPER(CORINFO_HELP_GETFIELD8, JIT_GetField8,CORINFO_HELP_SIG_REG_ONLY)
161-
JITHELPER(CORINFO_HELP_SETFIELD8, JIT_SetField8,CORINFO_HELP_SIG_4_STACK)
162-
JITHELPER(CORINFO_HELP_GETFIELD16, JIT_GetField16,CORINFO_HELP_SIG_REG_ONLY)
163-
JITHELPER(CORINFO_HELP_SETFIELD16, JIT_SetField16,CORINFO_HELP_SIG_4_STACK)
164-
JITHELPER(CORINFO_HELP_GETFIELD32, JIT_GetField32,CORINFO_HELP_SIG_REG_ONLY)
165-
JITHELPER(CORINFO_HELP_SETFIELD32, JIT_SetField32,CORINFO_HELP_SIG_4_STACK)
166-
JITHELPER(CORINFO_HELP_GETFIELD64, JIT_GetField64,CORINFO_HELP_SIG_REG_ONLY)
167-
JITHELPER(CORINFO_HELP_SETFIELD64, JIT_SetField64,CORINFO_HELP_SIG_8_STACK)
168-
JITHELPER(CORINFO_HELP_GETFIELDOBJ, JIT_GetFieldObj,CORINFO_HELP_SIG_REG_ONLY)
169-
JITHELPER(CORINFO_HELP_SETFIELDOBJ, JIT_SetFieldObj,CORINFO_HELP_SIG_4_STACK)
170-
JITHELPER(CORINFO_HELP_GETFIELDSTRUCT, JIT_GetFieldStruct,CORINFO_HELP_SIG_8_STACK)
171-
JITHELPER(CORINFO_HELP_SETFIELDSTRUCT, JIT_SetFieldStruct,CORINFO_HELP_SIG_8_STACK)
172-
JITHELPER(CORINFO_HELP_GETFIELDFLOAT, JIT_GetFieldFloat,CORINFO_HELP_SIG_REG_ONLY)
173-
JITHELPER(CORINFO_HELP_SETFIELDFLOAT, JIT_SetFieldFloat,CORINFO_HELP_SIG_4_STACK)
174-
JITHELPER(CORINFO_HELP_GETFIELDDOUBLE, JIT_GetFieldDouble,CORINFO_HELP_SIG_REG_ONLY)
175-
JITHELPER(CORINFO_HELP_SETFIELDDOUBLE, JIT_SetFieldDouble,CORINFO_HELP_SIG_8_STACK)
176160

177161
JITHELPER(CORINFO_HELP_GETFIELDADDR, JIT_GetFieldAddr,CORINFO_HELP_SIG_REG_ONLY)
178162
JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR, JIT_GetStaticFieldAddr,CORINFO_HELP_SIG_REG_ONLY)

src/coreclr/jit/ICorJitInfo_names_generated.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ DEF_CLR_API(getUnmanagedCallConv)
2929
DEF_CLR_API(pInvokeMarshalingRequired)
3030
DEF_CLR_API(satisfiesMethodConstraints)
3131
DEF_CLR_API(methodMustBeLoadedBeforeCodeIsRun)
32-
DEF_CLR_API(mapMethodDeclToMethodImpl)
3332
DEF_CLR_API(getGSCookie)
3433
DEF_CLR_API(setPatchpointInfo)
3534
DEF_CLR_API(getOSRInfo)

src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,6 @@ void WrapICorJitInfo::methodMustBeLoadedBeforeCodeIsRun(
258258
API_LEAVE(methodMustBeLoadedBeforeCodeIsRun);
259259
}
260260

261-
CORINFO_METHOD_HANDLE WrapICorJitInfo::mapMethodDeclToMethodImpl(
262-
CORINFO_METHOD_HANDLE method)
263-
{
264-
API_ENTER(mapMethodDeclToMethodImpl);
265-
CORINFO_METHOD_HANDLE temp = wrapHnd->mapMethodDeclToMethodImpl(method);
266-
API_LEAVE(mapMethodDeclToMethodImpl);
267-
return temp;
268-
}
269-
270261
void WrapICorJitInfo::getGSCookie(
271262
GSCookie* pCookieVal,
272263
GSCookie** ppCookieVal)

src/coreclr/jit/compiler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2002,7 +2002,6 @@ void Compiler::compInit(ArenaAllocator* pAlloc,
20022002
// check that HelperCallProperties are initialized
20032003

20042004
assert(s_helperCallProperties.IsPure(CORINFO_HELP_GET_GCSTATIC_BASE));
2005-
assert(!s_helperCallProperties.IsPure(CORINFO_HELP_GETFIELDOBJ)); // quick sanity check
20062005

20072006
// We start with the flow graph in tree-order
20082007
fgOrder = FGOrderTree;

src/coreclr/jit/gentree.cpp

Lines changed: 4 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,11 +1485,6 @@ CallArg* CallArgs::GetThisArg()
14851485
// convention it is passed in x8 (see `CallArgs::GetCustomRegister` for the
14861486
// exact conditions).
14871487
//
1488-
// Some jit helpers may have "out buffers" that are _not_ classified as the
1489-
// ret buffer. These are normal arguments that function similarly to ret
1490-
// buffers, but they do not have the special ABI treatment of ret buffers.
1491-
// See `GenTreeCall::TreatAsShouldHaveRetBufArg` for more details.
1492-
//
14931488
CallArg* CallArgs::GetRetBufferArg()
14941489
{
14951490
if (!HasRetBuffer())
@@ -2402,56 +2397,6 @@ int GenTreeCall::GetNonStandardAddedArgCount(Compiler* compiler) const
24022397
return 0;
24032398
}
24042399

2405-
//-------------------------------------------------------------------------
2406-
// TreatAsShouldHaveRetBufArg:
2407-
//
2408-
// Return Value:
2409-
// Returns true if we treat the call as if it has a retBuf argument
2410-
// This method may actually have a retBuf argument
2411-
// or it could be a JIT helper that we are still transforming during
2412-
// the importer phase.
2413-
//
2414-
// Notes:
2415-
// On ARM64 marking the method with the GTF_CALL_M_RETBUFFARG flag
2416-
// will make HasRetBufArg() return true, but will also force the
2417-
// use of register x8 to pass the RetBuf argument.
2418-
//
2419-
// These two Jit Helpers that we handle here by returning true
2420-
// aren't actually defined to return a struct, so they don't expect
2421-
// their RetBuf to be passed in x8, instead they expect it in x0.
2422-
//
2423-
bool GenTreeCall::TreatAsShouldHaveRetBufArg() const
2424-
{
2425-
if (ShouldHaveRetBufArg())
2426-
{
2427-
return true;
2428-
}
2429-
2430-
// If we see a Jit helper call that returns a TYP_STRUCT we may
2431-
// transform it as if it has a Return Buffer Argument
2432-
//
2433-
if (IsHelperCall() && (gtReturnType == TYP_STRUCT))
2434-
{
2435-
// There are two helpers that return structs through an argument,
2436-
// ignoring the ABI, but where we want to handle them during import as
2437-
// if they have return buffers:
2438-
// - CORINFO_HELP_GETFIELDSTRUCT
2439-
// - CORINFO_HELP_UNBOX_NULLABLE
2440-
//
2441-
// Other TYP_STRUCT returning helpers follow the ABI normally and
2442-
// should return true for `ShouldHaveRetBufArg` if they need a retbuf
2443-
// arg, so when we get here, those cases never need retbufs. They
2444-
// include:
2445-
// - CORINFO_HELP_PINVOKE_CALLI
2446-
// - CORINFO_HELP_DISPATCH_INDIRECT_CALL
2447-
//
2448-
CorInfoHelpFunc helpFunc = Compiler::eeGetHelperNum(gtCallMethHnd);
2449-
2450-
return (helpFunc == CORINFO_HELP_GETFIELDSTRUCT) || (helpFunc == CORINFO_HELP_UNBOX_NULLABLE);
2451-
}
2452-
return false;
2453-
}
2454-
24552400
//-------------------------------------------------------------------------
24562401
// IsHelperCall: Determine if this GT_CALL node is a specific helper call.
24572402
//
@@ -16548,14 +16493,7 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr,
1654816493
if (access & CORINFO_ACCESS_SET)
1654916494
{
1655016495
assert(value != nullptr);
16551-
// helper needs pointer to struct, not struct itself
16552-
if (pFieldInfo->helper == CORINFO_HELP_SETFIELDSTRUCT)
16553-
{
16554-
// TODO-Bug?: verify if flags matter here
16555-
GenTreeFlags indirFlags = GTF_EMPTY;
16556-
value = impGetNodeAddr(value, CHECK_SPILL_ALL, &indirFlags);
16557-
}
16558-
else if (lclTyp == TYP_DOUBLE && value->TypeGet() == TYP_FLOAT)
16496+
if ((lclTyp == TYP_DOUBLE) && (value->TypeGet() == TYP_FLOAT))
1655916497
{
1656016498
value = gtNewCastNode(TYP_DOUBLE, value, false, TYP_DOUBLE);
1656116499
}
@@ -16570,22 +16508,9 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr,
1657016508
else if (access & CORINFO_ACCESS_GET)
1657116509
{
1657216510
helperType = lclTyp;
16573-
16574-
// The calling convention for the helper does not take into
16575-
// account optimization of primitive structs.
16576-
if ((pFieldInfo->helper == CORINFO_HELP_GETFIELDSTRUCT) && !varTypeIsStruct(lclTyp))
16577-
{
16578-
helperType = TYP_STRUCT;
16579-
}
1658016511
}
1658116512
}
1658216513

16583-
if (pFieldInfo->helper == CORINFO_HELP_GETFIELDSTRUCT || pFieldInfo->helper == CORINFO_HELP_SETFIELDSTRUCT)
16584-
{
16585-
assert(pFieldInfo->structType != nullptr);
16586-
args[nArgs++] = gtNewIconEmbClsHndNode(pFieldInfo->structType);
16587-
}
16588-
1658916514
GenTree* fieldHnd = impTokenToHandle(pResolvedToken);
1659016515
if (fieldHnd == nullptr)
1659116516
{ // compDonotInline()
@@ -16622,23 +16547,10 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr,
1662216547

1662316548
if (pFieldInfo->fieldAccessor == CORINFO_FIELD_INSTANCE_HELPER)
1662416549
{
16625-
if (access & CORINFO_ACCESS_GET)
16550+
if (((access & CORINFO_ACCESS_GET) != 0) && varTypeIsSmall(lclTyp))
1662616551
{
16627-
if (pFieldInfo->helper == CORINFO_HELP_GETFIELDSTRUCT)
16628-
{
16629-
if (!varTypeIsStruct(lclTyp))
16630-
{
16631-
// get the result as primitive type
16632-
GenTreeFlags indirFlags = GTF_EMPTY;
16633-
result = impGetNodeAddr(result, CHECK_SPILL_ALL, &indirFlags);
16634-
result = gtNewIndir(lclTyp, result, indirFlags);
16635-
}
16636-
}
16637-
else if (varTypeIsSmall(lclTyp))
16638-
{
16639-
// The helper does not extend the small return types.
16640-
result = gtNewCastNode(genActualType(lclTyp), result, false, lclTyp);
16641-
}
16552+
// The helper does not extend the small return types.
16553+
result = gtNewCastNode(genActualType(lclTyp), result, false, lclTyp);
1664216554
}
1664316555
}
1664416556
else if ((access & CORINFO_ACCESS_ADDRESS) == 0) // OK, now do the indirection

src/coreclr/jit/gentree.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5305,8 +5305,6 @@ struct GenTreeCall final : public GenTree
53055305
return (gtCallMoreFlags & GTF_CALL_M_RETBUFFARG) != 0;
53065306
}
53075307

5308-
bool TreatAsShouldHaveRetBufArg() const;
5309-
53105308
//-----------------------------------------------------------------------------------------
53115309
// HasMultiRegRetVal: whether the call node returns its value in multiple return registers.
53125310
//
@@ -5330,7 +5328,7 @@ struct GenTreeCall final : public GenTree
53305328
}
53315329
#endif
53325330

5333-
if (!varTypeIsStruct(gtType) || TreatAsShouldHaveRetBufArg())
5331+
if (!varTypeIsStruct(gtType) || ShouldHaveRetBufArg())
53345332
{
53355333
return false;
53365334
}

0 commit comments

Comments
 (0)