diff options
author | t-mustafin <66252296+t-mustafin@users.noreply.github.com> | 2021-07-09 23:26:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-09 23:26:10 +0300 |
commit | 39d1161c88976dacf8774aa97b5f1a2749fed21d (patch) | |
tree | f50a0bf9c5b5637cdcf4cbb70ac2c55085706103 /src/coreclr/vm | |
parent | c8486b69ceda1b09cf06659869eb0114936619b6 (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.cpp | 11 |
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 |