diff --git a/runtime/compiler/x/runtime/X86Unresolveds.nasm b/runtime/compiler/x/runtime/X86Unresolveds.nasm index 8f17ad88b70..b064cbf6fd2 100644 --- a/runtime/compiler/x/runtime/X86Unresolveds.nasm +++ b/runtime/compiler/x/runtime/X86Unresolveds.nasm @@ -185,9 +185,12 @@ interpreterUnresolvedStaticGlue: push edi ; The RET will mispredict anyway so we can get away with pushing ; the adjusted RA back on the stack. - ; The interpreter may low-tag the result to avoid populating the constant pool--whack it. + ; The interpreter may low-tag the result to avoid populating the constant pool -- whack it and record in CF. ; - and eax, -2 + btr eax, 0 + + ; Skip code patching if the interpreter low-tag the RAM mathod + jc .fin ; Patch the call that brought us here into a load of the resolved RAM method into EDI. ; @@ -201,6 +204,7 @@ interpreterUnresolvedStaticGlue: movdqu xmm0, [esp+8] add esp, 24 ; 24 = 16 + 4*2 (for two pushes) + .fin: ; Load the resolved RAM method into EDI so that the caller doesn't have to re-run patched code mov edi, eax ret diff --git a/runtime/compiler/x/runtime/X86Unresolveds.pasm b/runtime/compiler/x/runtime/X86Unresolveds.pasm index ac7f023478e..69c72270be8 100644 --- a/runtime/compiler/x/runtime/X86Unresolveds.pasm +++ b/runtime/compiler/x/runtime/X86Unresolveds.pasm @@ -193,9 +193,16 @@ interpreterUnresolvedStaticGlue proc near push edi ; The RET will mispredict anyway so we can get away with pushing ; the adjusted RA back on the stack. - ; The interpreter may low-tag the result to avoid populating the constant pool--whack it. + ; The interpreter may low-tag the result to avoid populating the constant pool -- whack it and record in CF. ; - and eax, -2 + btr eax, 0 + + ; Skip code patching if the interpreter low-tag the RAM mathod +ifdef WINDOWS + jc @@fin +else + jc 0f +endif ; Patch the call that brought us here into a load of the resolved RAM method into EDI. ; @@ -209,6 +216,11 @@ interpreterUnresolvedStaticGlue proc near movdqu xmm0, [esp+8] add esp, 24 ; 24 = 16 + 4*2 (for two pushes) +ifdef WINDOWS + @@fin: +else + 0: +endif ; Load the resolved RAM method into EDI so that the caller doesn't have to re-run patched code mov edi, eax ret