Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Commit abb4eef

Browse files
MichalStrehovskyjkotas
authored andcommitted
Update RyuJIT (#4314)
Picks up dotnet/coreclr#13016.
1 parent fc4a9c2 commit abb4eef

File tree

9 files changed

+38
-21
lines changed

9 files changed

+38
-21
lines changed

dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
3-
<RyuJITVersion>2.1.0-preview2-25509-03</RyuJITVersion>
3+
<RyuJITVersion>2.1.0-preview2-25613-02</RyuJITVersion>
44
<ObjectWriterVersion>1.0.19-prerelease-00001</ObjectWriterVersion>
55
<CoreFXVersion>4.5.0-preview2-25510-01</CoreFXVersion>
66
<MicrosoftNETCoreNativeVersion>2.0.0-beta-25021-03</MicrosoftNETCoreNativeVersion>

src/JitInterface/src/CorInfoBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ unsafe partial class CorInfoImpl
3434
[UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)]
3535
delegate CORINFO_MODULE_STRUCT_* __getMethodModule(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method);
3636
[UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)]
37-
delegate void __getMethodVTableOffset(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection);
37+
delegate void __getMethodVTableOffset(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, [MarshalAs(UnmanagedType.U1)] ref bool isRelative);
3838
[UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)]
3939
delegate CORINFO_METHOD_STRUCT_* __resolveVirtualMethod(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* virtualMethod, CORINFO_CLASS_STRUCT_* implementingClass, CORINFO_CONTEXT_STRUCT* ownerType);
4040
[UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)]
@@ -491,12 +491,12 @@ static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_ST
491491
}
492492
}
493493

494-
static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection)
494+
static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, [MarshalAs(UnmanagedType.U1)] ref bool isRelative)
495495
{
496496
var _this = GetThis(thisHandle);
497497
try
498498
{
499-
_this.getMethodVTableOffset(method, ref offsetOfIndirection, ref offsetAfterIndirection);
499+
_this.getMethodVTableOffset(method, ref offsetOfIndirection, ref offsetAfterIndirection, ref isRelative);
500500
}
501501
catch (Exception ex)
502502
{

src/JitInterface/src/CorInfoImpl.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,12 @@ private void getEHinfo(CORINFO_METHOD_STRUCT_* ftn, uint EHnumber, ref CORINFO_E
803803
private CORINFO_MODULE_STRUCT_* getMethodModule(CORINFO_METHOD_STRUCT_* method)
804804
{ throw new NotImplementedException("getMethodModule"); }
805805

806-
private void getMethodVTableOffset(CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection)
806+
private void getMethodVTableOffset(CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, ref bool isRelative)
807807
{
808808
MethodDesc methodDesc = HandleToObject(method);
809809
int pointerSize = _compilation.TypeSystemContext.Target.PointerSize;
810810
offsetOfIndirection = (uint)CORINFO_VIRTUALCALL_NO_CHUNK.Value;
811+
isRelative = false;
811812

812813
// Normalize to the slot defining method. We don't have slot information for the overrides.
813814
methodDesc = MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(methodDesc);
@@ -912,6 +913,7 @@ private void ComputeLookup(CORINFO_CONTEXT_STRUCT* pContextMethod, object entity
912913
lookup.runtimeLookup.testForFixup = false; // TODO: this will be needed in true multifile
913914
lookup.runtimeLookup.testForNull = false;
914915
lookup.runtimeLookup.indirectFirstOffset = false;
916+
lookup.runtimeLookup.indirectSecondOffset = false;
915917
lookup.lookupKind.runtimeLookupFlags = 0;
916918
lookup.lookupKind.runtimeLookupArgs = null;
917919
}

src/JitInterface/src/CorInfoTypes.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ public unsafe struct CORINFO_RUNTIME_LOOKUP
283283

284284
public byte _indirectFirstOffset;
285285
public bool indirectFirstOffset { get { return _indirectFirstOffset != 0; } set { _indirectFirstOffset = value ? (byte)1 : (byte)0; } }
286+
287+
public byte _indirectSecondOffset;
288+
public bool indirectSecondOffset { get { return _indirectSecondOffset != 0; } set { _indirectSecondOffset = value ? (byte)1 : (byte)0; } }
289+
286290
}
287291

288292
// Result of calling embedGenericHandle
@@ -1478,6 +1482,7 @@ public enum CorJitFlag : uint
14781482
CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible
14791483
CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code
14801484
CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records
1485+
CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method
14811486
}
14821487

14831488
public struct CORJIT_FLAGS

src/JitInterface/src/ThunkGenerator/ThunkInput.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ FUNCTIONS
169169
void getEHinfo( CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE* clause );
170170
CORINFO_CLASS_HANDLE getMethodClass( CORINFO_METHOD_HANDLE method );
171171
CORINFO_MODULE_HANDLE getMethodModule( CORINFO_METHOD_HANDLE method );
172-
void getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection );
172+
void getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative);
173173
CORINFO_METHOD_HANDLE resolveVirtualMethod( CORINFO_METHOD_HANDLE virtualMethod, CORINFO_CLASS_HANDLE implementingClass, CORINFO_CONTEXT_HANDLE ownerType);
174174
void expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_GENERICHANDLE_RESULT * pResult);
175175
CorInfoIntrinsics getIntrinsicID( CORINFO_METHOD_HANDLE method , bool * pMustExpand);

src/JitInterface/src/ThunkGenerator/corinfo.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ TODO: Talk about initializing strutures before use
213213
#define SELECTANY extern __declspec(selectany)
214214
#endif
215215

216-
SELECTANY const GUID JITEEVersionIdentifier = { /* 28eb875f-b6a9-4a04-9ba7-69ba59deed46 */
217-
0x28eb875f,
218-
0xb6a9,
219-
0x4a04,
220-
{ 0x9b, 0xa7, 0x69, 0xba, 0x59, 0xde, 0xed, 0x46 }
216+
SELECTANY const GUID JITEEVersionIdentifier = { /* 5a1cfc89-a84a-4642-b01d-ead88e60c1ee */
217+
0x5a1cfc89,
218+
0xa84a,
219+
0x4642,
220+
{ 0xb0, 0x1d, 0xea, 0xd8, 0x8e, 0x60, 0xc1, 0xee }
221221
};
222222

223223
//////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1332,6 +1332,13 @@ struct CORINFO_RUNTIME_LOOKUP
13321332
// 1 means that value stored at first offset (offsets[0]) from pointer is offset1, and the next pointer is
13331333
// stored at pointer+offsets[0]+offset1.
13341334
bool indirectFirstOffset;
1335+
1336+
// If set, second offset is indirect.
1337+
// 0 means that value stored at second offset (offsets[1]) from pointer is next pointer, to which the next offset
1338+
// (offsets[2]) is added and so on.
1339+
// 1 means that value stored at second offset (offsets[1]) from pointer is offset2, and the next pointer is
1340+
// stored at pointer+offsets[1]+offset2.
1341+
bool indirectSecondOffset;
13351342
} ;
13361343

13371344
// Result of calling embedGenericHandle
@@ -2062,7 +2069,8 @@ class ICorStaticInfo
20622069
virtual void getMethodVTableOffset (
20632070
CORINFO_METHOD_HANDLE method, /* IN */
20642071
unsigned* offsetOfIndirection, /* OUT */
2065-
unsigned* offsetAfterIndirection /* OUT */
2072+
unsigned* offsetAfterIndirection, /* OUT */
2073+
bool* isRelative /* OUT */
20662074
) = 0;
20672075

20682076
// Find the virtual method in implementingClass that overrides virtualMethod,

src/JitInterface/src/ThunkGenerator/corjit.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ class CORJIT_FLAGS
152152
#if defined(_TARGET_ARM_)
153153
CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records
154154
#else // !defined(_TARGET_ARM_)
155-
CORJIT_FLAG_UNUSED11 = 41
155+
CORJIT_FLAG_UNUSED11 = 41,
156156
#endif // !defined(_TARGET_ARM_)
157+
158+
CORJIT_FLAG_NO_INLINING = 42 // JIT should not inline any called method into this method
157159
};
158160

159161
CORJIT_FLAGS()

src/Native/jitinterface/jitinterface.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct JitInterfaceCallbacks
2121
void (__stdcall * getEHinfo)(void * thisHandle, CorInfoException** ppException, void* ftn, unsigned EHnumber, void* clause);
2222
void* (__stdcall * getMethodClass)(void * thisHandle, CorInfoException** ppException, void* method);
2323
void* (__stdcall * getMethodModule)(void * thisHandle, CorInfoException** ppException, void* method);
24-
void (__stdcall * getMethodVTableOffset)(void * thisHandle, CorInfoException** ppException, void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection);
24+
void (__stdcall * getMethodVTableOffset)(void * thisHandle, CorInfoException** ppException, void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative);
2525
void* (__stdcall * resolveVirtualMethod)(void * thisHandle, CorInfoException** ppException, void* virtualMethod, void* implementingClass, void* ownerType);
2626
void (__stdcall * expandRawHandleIntrinsic)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* pResult);
2727
int (__stdcall * getIntrinsicID)(void * thisHandle, CorInfoException** ppException, void* method, bool* pMustExpand);
@@ -283,10 +283,10 @@ class JitInterfaceWrapper
283283
return _ret;
284284
}
285285

286-
virtual void getMethodVTableOffset(void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection)
286+
virtual void getMethodVTableOffset(void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative)
287287
{
288288
CorInfoException* pException = nullptr;
289-
_callbacks->getMethodVTableOffset(_thisHandle, &pException, method, offsetOfIndirection, offsetAfterIndirection);
289+
_callbacks->getMethodVTableOffset(_thisHandle, &pException, method, offsetOfIndirection, offsetAfterIndirection, isRelative);
290290
if (pException != nullptr)
291291
throw pException;
292292
}

src/Native/jitinterface/jitwrapper.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class CORJIT_FLAGS
2727
unsigned __int64 corJitFlags;
2828
};
2929

30-
static const GUID JITEEVersionIdentifier = { /* 28eb875f-b6a9-4a04-9ba7-69ba59deed46 */
31-
0x28eb875f,
32-
0xb6a9,
33-
0x4a04,
34-
{ 0x9b, 0xa7, 0x69, 0xba, 0x59, 0xde, 0xed, 0x46 }
30+
static const GUID JITEEVersionIdentifier = { /* 5a1cfc89-a84a-4642-b01d-ead88e60c1ee */
31+
0x5a1cfc89,
32+
0xa84a,
33+
0x4642,
34+
{ 0xb0, 0x1d, 0xea, 0xd8, 0x8e, 0x60, 0xc1, 0xee }
3535
};
3636

3737
class Jit

0 commit comments

Comments
 (0)