From 7d17af2deeca2af47bec4fab01f8c7e23ae3f5a8 Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Fri, 9 Dec 2016 21:27:03 +0900 Subject: [PATCH] [x86/Linux] Port ResolveWorkerAsmStub (#8557) --- src/vm/i386/asmhelpers.S | 49 +++++++++++++++++++++++++++++++++++++++ src/vm/i386/unixstubs.cpp | 5 ---- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/vm/i386/asmhelpers.S b/src/vm/i386/asmhelpers.S index 4b08698297fb..4a44c2c84ff9 100644 --- a/src/vm/i386/asmhelpers.S +++ b/src/vm/i386/asmhelpers.S @@ -1066,3 +1066,52 @@ DYNAMICHELPER DynamicHelperFrameFlags_ObjectArg, _Obj DYNAMICHELPER (DynamicHelperFrameFlags_ObjectArg | DynamicHelperFrameFlags_ObjectArg2), _ObjObj #endif // FEATURE_READYTORUN + +NESTED_ENTRY ResolveWorkerAsmStub, _TEXT, NoHandler + // + // The stub arguments are where we want to setup the TransitionBlock. We will + // setup the TransitionBlock later once we can trash them + // + // push ebp-frame + // push ebp + // mov ebp,esp + + // save CalleeSavedRegisters + // push ebx + + push esi + push edi + + // push ArgumentRegisters + push ecx + push edx + + mov esi, esp + + push [esi + 4*4] // dispatch token + push [esi + 5*4] // siteAddrForRegisterIndirect + push esi // pTransitionBlock + + // Setup up proper EBP frame now that the stub arguments can be trashed + mov [esi + 4*4],ebx + mov [esi + 5*4],ebp + lea ebp, [esi + 5*4] + + // Make the call + call C_FUNC(VSD_ResolveWorker) + + // From here on, mustn't trash eax + + // pop ArgumentRegisters + pop edx + pop ecx + + // pop CalleeSavedRegisters + pop edi + pop esi + pop ebx + pop ebp + + // Now jump to the target + jmp eax // continue on into the method +NESTED_END ResolveWorkerAsmStub, _TEXT diff --git a/src/vm/i386/unixstubs.cpp b/src/vm/i386/unixstubs.cpp index 6c04d2048cfe..5f098c18145b 100644 --- a/src/vm/i386/unixstubs.cpp +++ b/src/vm/i386/unixstubs.cpp @@ -80,11 +80,6 @@ EXTERN_C VOID ResolveWorkerChainLookupAsmStub() PORTABILITY_ASSERT("ResolveWorkerChainLookupAsmStub"); } -EXTERN_C VOID ResolveWorkerAsmStub() -{ - PORTABILITY_ASSERT("ResolveWorkerAsmStub"); -} - EXTERN_C VOID BackPatchWorkerAsmStub() { PORTABILITY_ASSERT("BackPatchWorkerAsmStub");