* [x86/Linux] Revise VirtualMethodFixupStub
// to optionally patch the target of the jump so that we do not take this slow path again.
//
NESTED_ENTRY VirtualMethodFixupStub, _TEXT, NoHandler
- // Pop the return address. It points right after the call instruction in the thunk.
- pop eax
+ // Get the return address. It points right after the call instruction in the thunk.
+ mov eax, [esp]
// Calculate the address of the thunk
sub eax, 5
// Set frame pointer
PROLOG_END
+ sub esp, 8
push eax // address of the thunk
push ecx // this ptr
+ CHECK_STACK_ALIGNMENT
call C_FUNC(VirtualMethodFixupWorker)
+ add esp, 8
// Restore stack pointer
EPILOG_BEG
// Pop ebp frame
EPILOG_END
+ // Pop return address
+ add esp, 4
+
PATCH_LABEL VirtualMethodFixupPatchLabel
// Proceed to execute the actual method.
jmp eax