Skip to content

Commit 9ac91be

Browse files
committed
Fix some contracts and a bug in args by ref introduced in a previous commit
1 parent d599d7c commit 9ac91be

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

src/coreclr/vm/callstubgenerator.cpp

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -543,15 +543,9 @@ extern "C" void CallJittedMethodRet4Float(PCODE *routines, int8_t*pArgs, int8_t*
543543
// The returned call stub header must be freed by the caller using FreeCallStub.
544544
CallStubHeader *CallStubGenerator::GenerateCallStub(MethodDesc *pMD)
545545
{
546-
CONTRACTL
547-
{
548-
NOTHROW;
549-
MODE_ANY;
550-
GC_NOTRIGGER;
551-
FORBID_FAULT;
552-
PRECONDITION(CheckPointer(pMD));
553-
}
554-
CONTRACTL_END
546+
STANDARD_VM_CONTRACT;
547+
548+
_ASSERTE(pMD != NULL);
555549

556550
MetaSig sig(pMD);
557551
ArgIterator argIt(&sig);
@@ -984,20 +978,20 @@ void CallStubGenerator::ProcessArgument(ArgIterator& argIt, ArgLocDesc& argLocDe
984978
m_s1 = NoRange;
985979
}
986980
#endif // TARGET_APPLE && TARGET_ARM64
981+
}
987982

988983
#ifndef UNIX_AMD64_ABI
989-
// Arguments passed by reference are handled separately, because the interpreter stores the value types on its stack by value.
990-
// So the argument loading routine needs to load the address of the argument. To avoid explosion of number of the routines,
991-
// we always process single argument passed by reference using single routine.
992-
if (argIt.IsArgPassedByRef())
993-
{
994-
_ASSERTE(argLocDesc.m_cGenReg == 1);
995-
routines[m_routineIndex++] = GetGPRegRefLoadRoutine(argLocDesc.m_idxGenReg);
996-
routines[m_routineIndex++] = argIt.GetArgSize();
997-
m_r1 = NoRange;
998-
}
999-
#endif // UNIX_AMD64_ABI
984+
// Arguments passed by reference are handled separately, because the interpreter stores the value types on its stack by value.
985+
// So the argument loading routine needs to load the address of the argument. To avoid explosion of number of the routines,
986+
// we always process single argument passed by reference using single routine.
987+
if (argIt.IsArgPassedByRef())
988+
{
989+
_ASSERTE(argLocDesc.m_cGenReg == 1);
990+
routines[m_routineIndex++] = GetGPRegRefLoadRoutine(argLocDesc.m_idxGenReg);
991+
routines[m_routineIndex++] = argIt.GetArgSize();
992+
m_r1 = NoRange;
1000993
}
994+
#endif // UNIX_AMD64_ABI
1001995
}
1002996

1003997
// Free the call stub header generated by GenerateCallStub.

src/coreclr/vm/interpexec.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ void InvokeCompiledMethod(MethodDesc *pMD, int8_t *pArgs, int8_t *pRet)
1313
CONTRACTL
1414
{
1515
THROWS;
16-
MODE_COOPERATIVE;
17-
GC_NOTRIGGER;
18-
FORBID_FAULT;
16+
MODE_ANY;
1917
PRECONDITION(CheckPointer(pMD));
2018
PRECONDITION(CheckPointer(pArgs));
2119
PRECONDITION(CheckPointer(pRet));

0 commit comments

Comments
 (0)