Skip to content

Commit 548eb96

Browse files
author
Fadi Hanna
committed
Revert "Dynamic generic dictionary expansion feature (dotnet#32270)" (dotnet#33310)
This reverts commit 7182559. (cherry picked from commit dca3429)
1 parent ac219a0 commit 548eb96

27 files changed

Lines changed: 413 additions & 1440 deletions

File tree

docs/design/coreclr/botr/shared-generics.md

Lines changed: 0 additions & 191 deletions
This file was deleted.

src/coreclr/src/debug/daccess/nidump.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6957,7 +6957,7 @@ NativeImageDumper::DumpMethodTable( PTR_MethodTable mt, const char * name,
69576957
//if there is a layout, use it to compute
69586958
//the size, otherwise there is just the one
69596959
//entry.
6960-
DictionaryLayout::GetDictionarySizeFromLayout(mt->GetNumGenericArgs(), layout),
6960+
DictionaryLayout::GetFirstDictionaryBucketSize(mt->GetNumGenericArgs(), layout),
69616961
METHODTABLES );
69626962

69636963
DisplayStartArrayWithOffset( m_pEntries, NULL, Dictionary,
@@ -7983,7 +7983,7 @@ void NativeImageDumper::DumpMethodDesc( PTR_MethodDesc md, PTR_Module module )
79837983
{
79847984
PTR_DictionaryLayout layout(wrapped->IsSharedByGenericMethodInstantiations()
79857985
? dac_cast<TADDR>(wrapped->GetDictLayoutRaw()) : NULL );
7986-
dictSize = DictionaryLayout::GetDictionarySizeFromLayout(imd->GetNumGenericMethodArgs(),
7986+
dictSize = DictionaryLayout::GetFirstDictionaryBucketSize(imd->GetNumGenericMethodArgs(),
79877987
layout);
79887988
}
79897989
}

src/coreclr/src/inc/corinfo.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ TODO: Talk about initializing strutures before use
217217
#endif
218218
#endif
219219

220-
SELECTANY const GUID JITEEVersionIdentifier = { /* b2e40020-6125-41e4-a0fc-821127ec192a */
221-
0xb2e40020,
222-
0x6125,
223-
0x41e4,
224-
{0xa0, 0xfc, 0x82, 0x11, 0x27, 0xec, 0x19, 0x2a}
220+
SELECTANY const GUID JITEEVersionIdentifier = { /* 9C412381-94A6-4F35-B2B6-60AFB2495B72 */
221+
0x9c412381,
222+
0x94a6,
223+
0x4f35,
224+
{ 0xb2, 0xb6, 0x60, 0xaf, 0xb2, 0x49, 0x5b, 0x72 }
225225
};
226226

227227
//////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1275,7 +1275,6 @@ struct CORINFO_LOOKUP_KIND
12751275
//
12761276
#define CORINFO_MAXINDIRECTIONS 4
12771277
#define CORINFO_USEHELPER ((WORD) 0xffff)
1278-
#define CORINFO_NO_SIZE_CHECK ((WORD) 0xffff)
12791278

12801279
struct CORINFO_RUNTIME_LOOKUP
12811280
{
@@ -1298,7 +1297,6 @@ struct CORINFO_RUNTIME_LOOKUP
12981297
// If set, test the lowest bit and dereference if set (see code:FixupPointer)
12991298
bool testForFixup;
13001299

1301-
WORD sizeOffset;
13021300
SIZE_T offsets[CORINFO_MAXINDIRECTIONS];
13031301

13041302
// If set, first offset is indirect.

src/coreclr/src/jit/importer.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,12 +2082,14 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken
20822082

20832083
if (pRuntimeLookup->offsets[i] != 0)
20842084
{
2085-
// The last indirection could be subject to a size check (dynamic dictionary expansion)
2086-
if (i == pRuntimeLookup->indirections - 1 && pRuntimeLookup->sizeOffset != CORINFO_NO_SIZE_CHECK)
2085+
// The last indirection could be subject to a size check (dynamic dictionary expansion feature)
2086+
#if 0 // Uncomment that block when you add sizeOffset field to pRuntimeLookup.
2087+
if (i == pRuntimeLookup->indirections - 1 && pRuntimeLookup->sizeOffset != 0xFFFF)
20872088
{
20882089
lastIndOfTree = impCloneExpr(slotPtrTree, &slotPtrTree, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL,
20892090
nullptr DEBUGARG("impRuntimeLookup indirectOffset"));
20902091
}
2092+
#endif // 0
20912093

20922094
slotPtrTree =
20932095
gtNewOperNode(GT_ADD, TYP_I_IMPL, slotPtrTree, gtNewIconNode(pRuntimeLookup->offsets[i], TYP_I_IMPL));
@@ -2158,10 +2160,9 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken
21582160

21592161
GenTree* result = nullptr;
21602162

2161-
if (pRuntimeLookup->sizeOffset != CORINFO_NO_SIZE_CHECK)
2163+
#if 0 // Uncomment that block when you add sizeOffset field to pRuntimeLookup.
2164+
if (pRuntimeLookup->sizeOffset != 0xFFFF) // dynamic dictionary expansion feature
21622165
{
2163-
// Dynamic dictionary expansion support
2164-
21652166
assert((lastIndOfTree != nullptr) && (pRuntimeLookup->indirections > 0));
21662167

21672168
// sizeValue = dictionary[pRuntimeLookup->sizeOffset]
@@ -2185,6 +2186,7 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken
21852186
addExpRuntimeLookupCandidate(helperCall);
21862187
}
21872188
else
2189+
#endif // 0
21882190
{
21892191
GenTreeColon* colonNullCheck = new (this, GT_COLON) GenTreeColon(TYP_I_IMPL, handleForResult, helperCall);
21902192
result = gtNewQmarkNode(TYP_I_IMPL, nullCheck, colonNullCheck);

0 commit comments

Comments
 (0)