Skip to content

Commit

Permalink
fix x86 build
Browse files Browse the repository at this point in the history
  • Loading branch information
VSadov committed Apr 15, 2024
1 parent d35270c commit 435e7d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
10 changes: 7 additions & 3 deletions src/coreclr/jit/codegenlinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,14 @@ void CodeGen::genCodeForBBlist()
// Considering that the throwing code is typically rare, and is not on the common/fast path
// we just add the instruction after all throwing calls.
// We will check that invariant in the most common case - when the throw ends the block.
GenTree* call = block->lastNode();
if ((call != nullptr) && (call->gtOper == GT_CALL))
GenTree* last = block->lastNode();
if ((last != nullptr) && (last->gtOper == GT_CALL))
{
assert(GetEmitter()->emitIsLastInsBreakpoint() || call->AsCall()->IsFastTailCall());
GenTreeCall* call = last->AsCall();
if (call->IsNoReturn())
{
assert(GetEmitter()->emitIsLastInsBreakpoint() || call->IsFastTailCall());
}
}
}
#endif // DEBUG
Expand Down
24 changes: 12 additions & 12 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6043,6 +6043,18 @@ void CodeGen::genCall(GenTreeCall* call)
assert((gcInfo.gcRegByrefSetCur & killMask) == 0);
#endif

unsigned stackAdjustBias = 0;

#if defined(TARGET_X86)
// Is the caller supposed to pop the arguments?
if (call->CallerPop() && (stackArgBytes != 0))
{
stackAdjustBias = stackArgBytes;
}

SubtractStackLevel(stackArgBytes);
#endif // TARGET_X86

if (call->IsNoReturn())
{
// There are several situations when we need to add another instruction
Expand Down Expand Up @@ -6181,18 +6193,6 @@ void CodeGen::genCall(GenTreeCall* call)
}
#endif // FEATURE_EH_WINDOWS_X86

unsigned stackAdjustBias = 0;

#if defined(TARGET_X86)
// Is the caller supposed to pop the arguments?
if (call->CallerPop() && (stackArgBytes != 0))
{
stackAdjustBias = stackArgBytes;
}

SubtractStackLevel(stackArgBytes);
#endif // TARGET_X86

genRemoveAlignmentAfterCall(call, stackAdjustBias);
}

Expand Down

0 comments on commit 435e7d4

Please sign in to comment.