Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort-mustafin <66252296+t-mustafin@users.noreply.github.com>2021-07-09 23:26:10 +0300
committerGitHub <noreply@github.com>2021-07-09 23:26:10 +0300
commit39d1161c88976dacf8774aa97b5f1a2749fed21d (patch)
treef50a0bf9c5b5637cdcf4cbb70ac2c55085706103 /src/coreclr/vm
parentc8486b69ceda1b09cf06659869eb0114936619b6 (diff)
Fix helloworld on x86 Linux (#55095)
Make managed->managed call use of ecx, edx to pass first two arguments. Make stack alignment returning after call.
Diffstat (limited to 'src/coreclr/vm')
-rw-r--r--src/coreclr/vm/i386/jitinterfacex86.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/coreclr/vm/i386/jitinterfacex86.cpp b/src/coreclr/vm/i386/jitinterfacex86.cpp
index cefe7ecadc5..0e366bdbd1a 100644
--- a/src/coreclr/vm/i386/jitinterfacex86.cpp
+++ b/src/coreclr/vm/i386/jitinterfacex86.cpp
@@ -490,6 +490,12 @@ void *JIT_TrialAlloc::GenBox(Flags flags)
// Do call to CopyValueClassUnchecked(object, data, pMT)
+#ifdef UNIX_X86_ABI
+#define STACK_ALIGN_PADDING 12
+ // Make pad to align esp
+ sl.X86EmitSubEsp(STACK_ALIGN_PADDING);
+#endif // UNIX_X86_ABI
+
// Pass pMT (still in ECX)
sl.X86EmitPushReg(kECX);
@@ -507,6 +513,11 @@ void *JIT_TrialAlloc::GenBox(Flags flags)
// call CopyValueClass
sl.X86EmitCall(sl.NewExternalCodeLabel((LPVOID) CopyValueClassUnchecked), 12);
+#ifdef UNIX_X86_ABI
+ // Make pad to align esp
+ sl.X86EmitAddEsp(STACK_ALIGN_PADDING);
+#undef STACK_ALIGN_PADDING
+#endif // UNIX_X86_ABI
// Restore the address of the newly allocated object and return it.
// mov eax,ebx