From 21baf31b19ebdc79ee400e44c212b983add00501 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 5 Jan 2021 01:33:32 -0800 Subject: [PATCH] Delete stale x86 TODOs from crossgen2 (#46562) --- .../Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs | 15 ++++----------- .../Compiler/ReadyToRunCompilationModuleGroupBase.cs | 6 ------ .../JitInterface/CorInfoImpl.ReadyToRun.cs | 6 ------ 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs index 331895d..cd95c3c 100644 --- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs +++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X86/X86Emitter.cs @@ -64,23 +64,16 @@ namespace ILCompiler.DependencyAnalysis.X86 { if (node.RepresentsIndirectionCell) { - // push eax (arbitrary value) - Builder.EmitByte(0x50); - // mov eax, [node address] - Builder.EmitByte(0x8B); - Builder.EmitByte(0x00 | ((byte)Register.EAX << 3) | 0x5); - Builder.EmitReloc(node, RelocType.IMAGE_REL_BASED_HIGHLOW); - // xchg [esp], eax; this also restores the previous value of eax - Builder.EmitByte(0x87); - Builder.EmitByte(0x04); - Builder.EmitByte(0x24); + // push [node address] + Builder.EmitByte(0xFF); + Builder.EmitByte(0x35); } else { // push Builder.EmitByte(0x68); - Builder.EmitReloc(node, RelocType.IMAGE_REL_BASED_HIGHLOW); } + Builder.EmitReloc(node, RelocType.IMAGE_REL_BASED_HIGHLOW); } public void EmitMOV(Register regDst, Register regSrc) diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs index 2106e15..2e0a760 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs @@ -333,12 +333,6 @@ namespace ILCompiler Debug.Assert(method is EcmaMethod); - if (method.Context.Target.Architecture == TargetArchitecture.X86) - { - // X86 architecture does not yet support inline pinvokes - return false; - } - // If the PInvoke is declared on an external module, we can only compile it if // that module is part of the version bubble. if (!_versionBubbleModuleSet.Contains(((EcmaMethod)method).Module)) diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index 51a1ef1..355514a 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -2368,12 +2368,6 @@ namespace Internal.JitInterface private bool pInvokeMarshalingRequired(CORINFO_METHOD_STRUCT_* handle, CORINFO_SIG_INFO* callSiteSig) { - if (_compilation.NodeFactory.Target.Architecture == TargetArchitecture.X86) - { - // TODO-PERF: x86 pinvoke stubs on Unix platforms - return true; - } - if (handle != null) { var method = HandleToObject(handle); -- 2.7.4