@@ -145,24 +145,6 @@ void Compiler::impPushOnStack(GenTreePtr tree, typeInfo ti)
145
145
}
146
146
}
147
147
148
- /******************************************************************************/
149
- // used in the inliner, where we can assume typesafe code. please don't use in the importer!!
150
- inline void Compiler::impPushOnStackNoType(GenTreePtr tree)
151
- {
152
- assert(verCurrentState.esStackDepth < impStkSize);
153
- INDEBUG(verCurrentState.esStack[verCurrentState.esStackDepth].seTypeInfo = typeInfo());
154
- verCurrentState.esStack[verCurrentState.esStackDepth++].val = tree;
155
-
156
- if ((tree->gtType == TYP_LONG) && (compLongUsed == false))
157
- {
158
- compLongUsed = true;
159
- }
160
- else if (((tree->gtType == TYP_FLOAT) || (tree->gtType == TYP_DOUBLE)) && (compFloatingPointUsed == false))
161
- {
162
- compFloatingPointUsed = true;
163
- }
164
- }
165
-
166
148
inline void Compiler::impPushNullObjRefOnStack()
167
149
{
168
150
impPushOnStack(gtNewIconNode(0, TYP_REF), typeInfo(TI_NULL));
@@ -322,20 +304,6 @@ StackEntry Compiler::impPopStack()
322
304
return verCurrentState.esStack[--verCurrentState.esStackDepth];
323
305
}
324
306
325
- StackEntry Compiler::impPopStack(CORINFO_CLASS_HANDLE& structType)
326
- {
327
- StackEntry ret = impPopStack();
328
- structType = verCurrentState.esStack[verCurrentState.esStackDepth].seTypeInfo.GetClassHandle();
329
- return (ret);
330
- }
331
-
332
- GenTreePtr Compiler::impPopStack(typeInfo& ti)
333
- {
334
- StackEntry ret = impPopStack();
335
- ti = ret.seTypeInfo;
336
- return (ret.val);
337
- }
338
-
339
307
/*****************************************************************************
340
308
*
341
309
* Peep at n'th (0-based) tree on the top of the stack.
@@ -5093,8 +5061,9 @@ void Compiler::impImportAndPushBox(CORINFO_RESOLVED_TOKEN* pResolvedToken)
5093
5061
impSpillSpecialSideEff();
5094
5062
5095
5063
// Now get the expression to box from the stack.
5096
- CORINFO_CLASS_HANDLE operCls;
5097
- GenTreePtr exprToBox = impPopStack(operCls).val;
5064
+ StackEntry se = impPopStack();
5065
+ CORINFO_CLASS_HANDLE operCls = se.seTypeInfo.GetClassHandle();
5066
+ GenTreePtr exprToBox = se.val;
5098
5067
5099
5068
CorInfoHelpFunc boxHelper = info.compCompHnd->getBoxHelper(pResolvedToken->hClass);
5100
5069
if (boxHelper == CORINFO_HELP_BOX)
@@ -10052,7 +10021,8 @@ void Compiler::impImportBlockCode(BasicBlock* block)
10052
10021
/* Pop the value being assigned */
10053
10022
10054
10023
{
10055
- StackEntry se = impPopStack(clsHnd);
10024
+ StackEntry se = impPopStack();
10025
+ clsHnd = se.seTypeInfo.GetClassHandle();
10056
10026
op1 = se.val;
10057
10027
tiRetVal = se.seTypeInfo;
10058
10028
}
@@ -11916,14 +11886,12 @@ void Compiler::impImportBlockCode(BasicBlock* block)
11916
11886
break;
11917
11887
11918
11888
case CEE_POP:
11919
- if (tiVerificationNeeded)
11920
- {
11921
- impStackTop(0);
11922
- }
11923
-
11889
+ {
11924
11890
/* Pull the top value from the stack */
11925
11891
11926
- op1 = impPopStack(clsHnd).val;
11892
+ StackEntry se = impPopStack();
11893
+ clsHnd = se.seTypeInfo.GetClassHandle();
11894
+ op1 = se.val;
11927
11895
11928
11896
/* Get hold of the type of the value being duplicated */
11929
11897
@@ -11974,10 +11942,11 @@ void Compiler::impImportBlockCode(BasicBlock* block)
11974
11942
}
11975
11943
11976
11944
/* No side effects - just throw the <BEEP> thing away */
11977
- break;
11945
+ }
11946
+ break;
11978
11947
11979
11948
case CEE_DUP:
11980
-
11949
+ {
11981
11950
if (tiVerificationNeeded)
11982
11951
{
11983
11952
// Dup could start the begining of delegate creation sequence, remember that
@@ -11988,7 +11957,9 @@ void Compiler::impImportBlockCode(BasicBlock* block)
11988
11957
// If the expression to dup is simple, just clone it.
11989
11958
// Otherwise spill it to a temp, and reload the temp
11990
11959
// twice.
11991
- op1 = impPopStack(tiRetVal);
11960
+ StackEntry se = impPopStack();
11961
+ tiRetVal = se.seTypeInfo;
11962
+ op1 = se.val;
11992
11963
11993
11964
if (!opts.compDbgCode && !op1->IsIntegralConst(0) && !op1->IsFPZero() && !op1->IsLocal())
11994
11965
{
@@ -12010,8 +11981,8 @@ void Compiler::impImportBlockCode(BasicBlock* block)
12010
11981
assert(!(op1->gtFlags & GTF_GLOB_EFFECT) && !(op2->gtFlags & GTF_GLOB_EFFECT));
12011
11982
impPushOnStack(op1, tiRetVal);
12012
11983
impPushOnStack(op2, tiRetVal);
12013
-
12014
- break;
11984
+ }
11985
+ break;
12015
11986
12016
11987
case CEE_STIND_I1:
12017
11988
lclTyp = TYP_BYTE;
@@ -12928,8 +12899,10 @@ void Compiler::impImportBlockCode(BasicBlock* block)
12928
12899
12929
12900
if (opcode == CEE_LDFLD || opcode == CEE_LDFLDA)
12930
12901
{
12931
- tiObj = &impStackTop().seTypeInfo;
12932
- obj = impPopStack(objType).val;
12902
+ tiObj = &impStackTop().seTypeInfo;
12903
+ StackEntry se = impPopStack();
12904
+ objType = se.seTypeInfo.GetClassHandle();
12905
+ obj = se.val;
12933
12906
12934
12907
if (impIsThis(obj))
12935
12908
{
@@ -13311,8 +13284,10 @@ void Compiler::impImportBlockCode(BasicBlock* block)
13311
13284
typeInfo tiVal;
13312
13285
13313
13286
/* Pull the value from the stack */
13314
- op2 = impPopStack(tiVal);
13315
- clsHnd = tiVal.GetClassHandle();
13287
+ StackEntry se = impPopStack();
13288
+ op2 = se.val;
13289
+ tiVal = se.seTypeInfo;
13290
+ clsHnd = tiVal.GetClassHandle();
13316
13291
13317
13292
if (opcode == CEE_STFLD)
13318
13293
{
@@ -14552,7 +14527,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
14552
14527
op1 = gtNewOperNode(GT_IND, TYP_REF, op1);
14553
14528
op1->gtFlags |= GTF_EXCEPT | GTF_GLOB_REF;
14554
14529
14555
- impPushOnStackNoType (op1);
14530
+ impPushOnStack (op1, typeInfo() );
14556
14531
opcode = CEE_STIND_REF;
14557
14532
lclTyp = TYP_REF;
14558
14533
goto STIND_POST_VERIFY;
@@ -15050,7 +15025,8 @@ bool Compiler::impReturnInstruction(BasicBlock* block, int prefixFlags, OPCODE&
15050
15025
15051
15026
if (info.compRetType != TYP_VOID)
15052
15027
{
15053
- StackEntry se = impPopStack(retClsHnd);
15028
+ StackEntry se = impPopStack();
15029
+ retClsHnd = se.seTypeInfo.GetClassHandle();
15054
15030
op2 = se.val;
15055
15031
15056
15032
if (!compIsForInlining())
0 commit comments