You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Gregory Shimansky (JIRA)" <ji...@apache.org> on 2007/10/16 18:42:50 UTC

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

[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.


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

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Pavel Afremov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540436 ] 

Pavel Afremov commented on HARMONY-4953:
----------------------------------------

Rotations of helpers parametrs are in two places in VM code oly:
	...\vm\vmcore\src\jit\jit_runtime_support.cpp(208):   "o1=i0;"
	...\vm\vmcore\src\jit\jit_runtime_support.cpp(1670): "o1=i0;"
I think we shoul declare rth_ldc_ref_helper and jvmti_method_exit_callback_ptr as stdcall and use  in2out platform:void; instead "o0=i1;" "o1=i0;" code.


> [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.


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

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4953?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov resolved HARMONY-4953.
--------------------------------------

    Resolution: Fixed
      Assignee: Alexey Varlamov

Should be fixed at revision: 593136.

> [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
>            Assignee: Alexey Varlamov
>            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.


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

Posted by "Evgueni Brevnov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540697 ] 

Evgueni Brevnov commented on HARMONY-4953:
------------------------------------------

Recently I've also encoured that problem and fixed it as a part of HARMONY-4621. So we just need to wait until it is committed.

Thanks
Evgueni

> [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.