diff --git a/src/coreclr/tools/Common/JitInterface/WasmLowering.cs b/src/coreclr/tools/Common/JitInterface/WasmLowering.cs index 7f26a8ea3fc039..1a4dabed299edd 100644 --- a/src/coreclr/tools/Common/JitInterface/WasmLowering.cs +++ b/src/coreclr/tools/Common/JitInterface/WasmLowering.cs @@ -589,7 +589,7 @@ public static unsafe WasmSignature GetSignature(MethodSignature signature, CORIN public static LoweringFlags GetLoweringFlags(MethodDesc method) { LoweringFlags flags = 0; - if (method.RequiresInstMethodDescArg() || method.RequiresInstMethodTableArg()) + if (method.RequiresInstMethodDescArg() || method.RequiresInstMethodTableArg() || method.IsArrayAddressMethod()) { flags |= LoweringFlags.HasGenericContextArg; } diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs index f2eac9476139e5..d51a52421d55fd 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs @@ -92,14 +92,7 @@ internal static (ArgIterator, TransitionBlock) BuildArgIterator(Meth parameterTypes[parameterIndex] = new TypeHandle(signature[parameterIndex]); } CallingConventions callingConventions = (hasThis ? CallingConventions.ManagedInstance : CallingConventions.ManagedStatic); - bool hasParamType = methodRequiresInstArg && !isUnboxingStub; - - // On X86 the Array address method doesn't use IL stubs, and instead has a custom calling convention - if ((context.Target.Architecture == TargetArchitecture.X86) && - methodIsArrayAddressMethod) - { - hasParamType = true; - } + bool hasParamType = (methodRequiresInstArg && !isUnboxingStub) || methodIsArrayAddressMethod; bool hasAsyncContinuation = methodIsAsyncCall; // We shouldn't be compiling unboxing stubs for async methods yet. diff --git a/src/tests/readytorun/crossgen2/Program.cs b/src/tests/readytorun/crossgen2/Program.cs index 09a6ff8c336997..38a5321f4d020d 100644 --- a/src/tests/readytorun/crossgen2/Program.cs +++ b/src/tests/readytorun/crossgen2/Program.cs @@ -2272,11 +2272,7 @@ public static int Main() RunTest("ExplicitlySizedClassTest", ExplicitlySizedClassTest()); RunTest("GenericLdtokenTest", GenericLdtokenTest()); RunTest("ArrayLdtokenTests", ArrayLdtokenTests()); - // ActiveIssue https://github.com/dotnet/runtime/issues/133307 - if (!PlatformDetection.IsWasm || !PlatformDetection.IsReadyToRunCompiled) - { - RunTest("TestGenericMDArrayBehavior", TestGenericMDArrayBehavior()); - } + RunTest("TestGenericMDArrayBehavior", TestGenericMDArrayBehavior()); RunTest("TestWithStructureNonBlittableFieldDueToGenerics", TestWithStructureNonBlittableFieldDueToGenerics()); RunTest("TestSingleElementStructABI", TestSingleElementStructABI()); RunTest("TestEnumLayoutAlignments", TestEnumLayoutAlignments());