This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +26
-12
lines changed
System.Private.CoreLib/src/System Expand file tree Collapse file tree 5 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ public ref struct ArgIterator
2727 private IntPtr ArgPtr ; // Pointer to remaining args.
2828 private int RemainingArgs ; // # of remaining args.
2929
30- #if VARARGS_ENABLED //The JIT doesn't support Varargs calling convention.
3130 [ MethodImplAttribute ( MethodImplOptions . InternalCall ) ]
3231 private extern ArgIterator ( IntPtr arglist ) ;
3332
@@ -180,6 +179,5 @@ public int GetRemainingCount()
180179 {
181180 throw new PlatformNotSupportedException ( SR . PlatformNotSupported_ArgIterator ) ; // https://github.com/dotnet/coreclr/issues/9204
182181 }
183- #endif //VARARGS_ENABLED
184182 }
185183}
Original file line number Diff line number Diff line change @@ -598,6 +598,18 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo)
598598 isHfaArg = varTypeIsFloating (hfaType);
599599 }
600600 }
601+ else if (info.compIsVarArgs )
602+ {
603+ #ifdef _TARGET_UNIX_
604+ // Currently native varargs is not implemented on non windows targets.
605+ //
606+ // Note that some targets like Arm64 Unix should not need much work as
607+ // the ABI is the same. While other targets may only need small changes
608+ // such as amd64 Unix, which just expects RAX to pass numFPArguments.
609+ NYI (" InitUserArgs for Vararg callee is not yet implemented on non Windows targets." );
610+ #endif
611+ }
612+
601613 if (isHfaArg)
602614 {
603615 // We have an HFA argument, so from here on out treat the type as a float or double.
Original file line number Diff line number Diff line change @@ -2742,6 +2742,18 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
27422742 bool callIsVararg = call->IsVarargs();
27432743#endif
27442744
2745+ #ifdef _TARGET_UNIX_
2746+ if (callIsVararg)
2747+ {
2748+ // Currently native varargs is not implemented on non windows targets.
2749+ //
2750+ // Note that some targets like Arm64 Unix should not need much work as
2751+ // the ABI is the same. While other targets may only need small changes
2752+ // such as amd64 Unix, which just expects RAX to pass numFPArguments.
2753+ NYI("Morhing Vararg call not yet implemented on non Windows targets.");
2754+ }
2755+ #endif
2756+
27452757#ifdef UNIX_AMD64_ABI
27462758 // If fgMakeOutgoingStructArgCopy is called and copies are generated, hasStackArgCopy is set
27472759 // to make sure to call EvalArgsToTemp. fgMakeOutgoingStructArgCopy just marks the argument
Original file line number Diff line number Diff line change @@ -417,11 +417,10 @@ class ArgIteratorTemplate : public ARGITERATOR_BASE
417417
418418#ifdef _TARGET_AMD64_
419419#ifdef UNIX_AMD64_ABI
420- PORTABILITY_ASSERT (" ArgIteratorTemplate::IsVarArgPassedByRef" );
421420 return FALSE ;
422- #else // UNIX_AMD64_ABI
421+ #else // ! UNIX_AMD64_ABI
423422 return IsArgPassedByRef (size);
424- #endif // UNIX_AMD64_ABI
423+ #endif // ! UNIX_AMD64_ABI
425424
426425#else
427426 return (size > ENREGISTERED_PARAMTYPE_MAXSIZE);
Original file line number Diff line number Diff line change @@ -489,13 +489,6 @@ CEEInfo::ConvToJitSig(
489489 IfFailThrow (sig.GetCallingConvInfo (&data));
490490 sigRet->callConv = (CorInfoCallConv) data;
491491
492- if ((isCallConv (sigRet->callConv , IMAGE_CEE_CS_CALLCONV_VARARG)) ||
493- (isCallConv (sigRet->callConv , IMAGE_CEE_CS_CALLCONV_NATIVEVARARG)))
494- {
495- // This signature corresponds to a method that uses varargs, which are not supported.
496- COMPlusThrow (kInvalidProgramException , IDS_EE_VARARG_NOT_SUPPORTED);
497- }
498-
499492 // Skip number of type arguments
500493 if (sigRet->callConv & IMAGE_CEE_CS_CALLCONV_GENERIC)
501494 IfFailThrow (sig.GetData (NULL ));
You can’t perform that action at this time.
0 commit comments