@@ -578,11 +578,8 @@ bool InterpCompiler::CheckStackHelper(int n)
578578void InterpCompiler::PushTypeExplicit (StackType stackType, CORINFO_CLASS_HANDLE clsHnd, int size)
579579{
580580 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);
586583 m_pStackPointer++;
587584}
588585
@@ -1286,7 +1283,7 @@ void InterpCompiler::EmitConv(StackInfo *sp, StackType type, InterpOpcode convOp
12861283
12871284 newInst->SetSVar (sp->var );
12881285 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);
12901287 newInst->SetDVar (var);
12911288
12921289 // 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
17041701 // Initialize the filter stack state. It initially contains the exception object.
17051702 pFilterBB->stackHeight = 1 ;
17061703 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 );
17111705
17121706 // Find and mark all basic blocks that are part of the filter region.
17131707 for (uint32_t j = clause.FilterOffset ; j < clause.HandlerOffset ; j++)
@@ -1736,10 +1730,7 @@ bool InterpCompiler::InitializeClauseBuildingBlocks(CORINFO_METHOD_INFO* methodI
17361730 // Initialize the catch / filtered handler stack state. It initially contains the exception object.
17371731 pCatchBB->stackHeight = 1 ;
17381732 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 );
17431734 }
17441735 }
17451736
@@ -2912,7 +2903,7 @@ void InterpCompiler::EmitBox(StackInfo* pStackInfo, CORINFO_CLASS_HANDLE clsHnd,
29122903 m_pLastNewIns->SetSVar (pStackInfo->var );
29132904
29142905 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);
29162907
29172908 m_pLastNewIns->SetDVar (pStackInfo->var );
29182909 m_pLastNewIns->data [0 ] = GetDataItemIndex (clsHnd);
0 commit comments