You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2007/11/06 08:40:50 UTC

[jira] Commented: (HARMONY-4953) [drlvm][jet][jvmti] Wrong order of arguments for rt_helper_ti_method_exit on ia32 architecture

    [ https://issues.apache.org/jira/browse/HARMONY-4953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540364 ] 

Alexey Varlamov commented on HARMONY-4953:
------------------------------------------

Gregory, is it really JET-specific? You see, both JITs have no architecture-specific #ifdefs for calling helpers, and this is the clear indication of messed CCs. This is very funny indeed: most helpers are documented to use STDCALL while majority of LIL implementations have "entry 0:managed:" headers. It works fine for 1-param calls, and some others do extra params swapping (which then happens twice I guess, 1st one should be added by LIL gen). 
OPT uses calling conventions to call helpers as per vm_helper_get_calling_convention(), JET hardcodes these, but anyway - this problem should be generally fixed in helpers.
I suggest to change issue header to like [drlvm][jit_support] and raise its' priority. I'll file another issue for JET hardcoding CCs.

> [drlvm][jet][jvmti] Wrong order of arguments for rt_helper_ti_method_exit on ia32 architecture
> ----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4953
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4953
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Priority: Minor
>
> I've just found a funny place in the code. The stub that calls callback jvmti_method_exit_callback has the following code in jit_runtime_support.cpp:
>         "o0=i1;"
>         "o1=i0;"
> This code swaps input arguments to pass them to jvmti_method_exit_callback function. On ia32 it works correctly, so I assume that JET generated code pushes these arguments in a wrong mode that requires swapping.
> On EM64T arguments are pushed in correct order, 1st one in RDI, 2nd one in RSI, but stub (without modifications) swaps them and this makes jvmti_method_exit_callback receive its arguments in wrong order. I had to make a fix for this problem for EM64T to pass arguments in correct order without swapping, so event now works correctly. My fix is committed at 585194. To fix this bug completely it is necessary to fix JET so that it pass arguments in correct order to the helper stub.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.