@@ -578,11 +578,8 @@ bool InterpCompiler::CheckStackHelper(int n)
578
578
void InterpCompiler::PushTypeExplicit (StackType stackType, CORINFO_CLASS_HANDLE clsHnd, int size)
579
579
{
580
580
EnsureStack (1 );
581
- m_pStackPointer->type = stackType;
582
- m_pStackPointer->clsHnd = clsHnd;
583
- m_pStackPointer->size = ALIGN_UP_TO (size, INTERP_STACK_SLOT_SIZE);
584
- int var = CreateVarExplicit (g_interpTypeFromStackType[stackType], clsHnd, size);
585
- m_pStackPointer->var = var;
581
+ int32_t var = CreateVarExplicit (g_interpTypeFromStackType[stackType], clsHnd, size);
582
+ new (m_pStackPointer) StackInfo (stackType, clsHnd, var);
586
583
m_pStackPointer++;
587
584
}
588
585
@@ -1286,7 +1283,7 @@ void InterpCompiler::EmitConv(StackInfo *sp, StackType type, InterpOpcode convOp
1286
1283
1287
1284
newInst->SetSVar (sp->var );
1288
1285
int32_t var = CreateVarExplicit (g_interpTypeFromStackType[type], NULL , INTERP_STACK_SLOT_SIZE);
1289
- new (sp) StackInfo (type, NULL , INTERP_STACK_SLOT_SIZE, var);
1286
+ new (sp) StackInfo (type, NULL , var);
1290
1287
newInst->SetDVar (var);
1291
1288
1292
1289
// NOTE: We rely on m_pLastNewIns == newInst upon return from this function. Make sure you preserve that if you change anything.
@@ -1704,10 +1701,7 @@ bool InterpCompiler::InitializeClauseBuildingBlocks(CORINFO_METHOD_INFO* methodI
1704
1701
// Initialize the filter stack state. It initially contains the exception object.
1705
1702
pFilterBB->stackHeight = 1 ;
1706
1703
pFilterBB->pStackState = (StackInfo*)AllocMemPool (sizeof (StackInfo));
1707
- pFilterBB->pStackState [0 ].type = StackTypeO;
1708
- pFilterBB->pStackState [0 ].size = INTERP_STACK_SLOT_SIZE;
1709
- pFilterBB->pStackState [0 ].clsHnd = NULL ;
1710
- pFilterBB->pStackState [0 ].var = pFilterBB->clauseVarIndex ;
1704
+ new (pFilterBB->pStackState ) StackInfo (StackTypeO, NULL , pFilterBB->clauseVarIndex );
1711
1705
1712
1706
// Find and mark all basic blocks that are part of the filter region.
1713
1707
for (uint32_t j = clause.FilterOffset ; j < clause.HandlerOffset ; j++)
@@ -1736,10 +1730,7 @@ bool InterpCompiler::InitializeClauseBuildingBlocks(CORINFO_METHOD_INFO* methodI
1736
1730
// Initialize the catch / filtered handler stack state. It initially contains the exception object.
1737
1731
pCatchBB->stackHeight = 1 ;
1738
1732
pCatchBB->pStackState = (StackInfo*)AllocMemPool (sizeof (StackInfo));
1739
- pCatchBB->pStackState [0 ].type = StackTypeO;
1740
- pCatchBB->pStackState [0 ].size = INTERP_STACK_SLOT_SIZE;
1741
- pCatchBB->pStackState [0 ].var = pCatchBB->clauseVarIndex ;
1742
- pCatchBB->pStackState [0 ].clsHnd = NULL ;
1733
+ new (pCatchBB->pStackState ) StackInfo (StackTypeO, NULL , pCatchBB->clauseVarIndex );
1743
1734
}
1744
1735
}
1745
1736
@@ -2912,7 +2903,7 @@ void InterpCompiler::EmitBox(StackInfo* pStackInfo, CORINFO_CLASS_HANDLE clsHnd,
2912
2903
m_pLastNewIns->SetSVar (pStackInfo->var );
2913
2904
2914
2905
int32_t var = CreateVarExplicit (InterpTypeO, NULL , INTERP_STACK_SLOT_SIZE);
2915
- new (pStackInfo) StackInfo (StackTypeO, boxedClsHnd, INTERP_STACK_SLOT_SIZE, var);
2906
+ new (pStackInfo) StackInfo (StackTypeO, boxedClsHnd, var);
2916
2907
2917
2908
m_pLastNewIns->SetDVar (pStackInfo->var );
2918
2909
m_pLastNewIns->data [0 ] = GetDataItemIndex (clsHnd);
0 commit comments