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/08/21 18:06:30 UTC

[jira] Created: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

[drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
------------------------------------------------------------------------------------------

                 Key: HARMONY-4661
                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
             Project: Harmony
          Issue Type: Improvement
          Components: DRLVM
            Reporter: Gregory Shimansky
            Assignee: Gregory Shimansky


Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.

We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.

I suggest adding the following methods to VM interface

void get_method_entry_flag_address(char **flag_address);
void get_method_exit_flag_address(char **flag_address);

which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.

VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Updated: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

George Timoshenko updated HARMONY-4661:
---------------------------------------

    Attachment: HARMONY-4661-JIT.patch

JIT (JET) - part changes.

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Commented: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

Gregory Shimansky commented on HARMONY-4661:
--------------------------------------------

George, thanks a lot for your help. I tried the updated patch and all tests passed for me on 32-bit platforms. Performance on simple debug scenarios in eclipse show over 3 times!!

Unfortunately on 64-bit platforms your patch breaks compilation. Please try to fix these two errors:

       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/cg_meth.cpp: In member function `void Jitrino::Jet::Compiler::gen_prolog()':
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/cg_meth.cpp:516: error: conversion from `int_ptr' to `const Jitrino::Jet::Opnd' is ambiguous
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:594: error: candidates are: Jitrino::Jet::Opnd::Opnd(long unsigned int)
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:584: error:                 Jitrino::Jet::Opnd::Opnd(long int)
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:574: error:                 Jitrino::Jet::Opnd::Opnd(unsigned int)
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:566: error:                 Jitrino::Jet::Opnd::Opnd(int)
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/cg_meth.cpp: In member function `void Jitrino::Jet::Compiler::gen_return(Jitrino::Jet::jtype)':
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/cg_meth.cpp:634: error: conversion from `int_ptr' to `const Jitrino::Jet::Opnd' is ambiguous
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:594: error: candidates are: Jitrino::Jet::Opnd::Opnd(long unsigned int)
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:584: error:                 Jitrino::Jet::Opnd::Opnd(long int)
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:574: error:                 Jitrino::Jet::Opnd::Opnd(unsigned int)
       [cc] /nfs/ims/proj/drl/mrt2/users/gregory/em64t/trunk/working_vm/vm/jitrino/src/jet/enc.h:566: error:                 Jitrino::Jet::Opnd::Opnd(int)


> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Updated: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

George Timoshenko updated HARMONY-4661:
---------------------------------------

    Attachment: HARMONY-4661-JIT.patch

I have missed with the branch for method_exit_event_notification.
It should be done a bit later.

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Commented: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

Gregory Shimansky commented on HARMONY-4661:
--------------------------------------------

BTW I forgot to write that there is a mistake in the VM patch. Functions added in C_interface.cpp should be marked as VMEXPORT, just like all other in this file. Otherwise Jitrino fails to link on windows.

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Updated: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

George Timoshenko updated HARMONY-4661:
---------------------------------------

    Attachment: HARMONY-4661-JIT.patch

EM64T build fixed

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661-JIT.patch, HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Closed: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

Gregory Shimansky closed HARMONY-4661.
--------------------------------------

    Resolution: Fixed

Patches applied at 570541.

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661-JIT.patch, HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Commented: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

Gregory Shimansky commented on HARMONY-4661:
--------------------------------------------

I've tried to run VM with two patches. I get crash in VMInit1 test on Linux (for some reason on windows it works ok).

The crash analysis shows that JITted code calls a function on EIP 0. The code looks like this:

0xa5cbf70a:     incl   (%eax)
0xa5cbf70c:     add    %al,(%eax)
0xa5cbf70e:     add    %bh,0x80924ee(%ecx)
0xa5cbf714:     cmpw   $0x0,(%ecx)
0xa5cbf718:     je,pt  0xa5cbf730
0xa5cbf71f:     sub    $0x4,%esp
0xa5cbf722:     movl   $0x831e838,(%esp)
0xa5cbf729:     mov    $0xb6749a00,%edx
0xa5cbf72e:     call   *%edx
0xa5cbf730:     nop
0xa5cbf731:     nop
0xa5cbf732:     mov    0xffffff18(%ebp),%ecx
0xa5cbf738:     sub    $0x8,%esp
0xa5cbf73b:     movl   $0x2e,(%esp)
0xa5cbf742:     mov    %ecx,0x4(%esp)
0xa5cbf746:     movl   $0x0,0xffffff2c(%ebp)
0xa5cbf750:     mov    (%ecx),%edx
0xa5cbf752:     call   *0xbc(%edx)                    <------------- here is call on 0x0
0xa5cbf758:     mov    %eax,0xffffff14(%ebp)
0xa5cbf75e:     mov    0xffffff14(%ebp),%eax
0xa5cbf764:     mov    %eax,0xffffff1c(%ebp)

Here looking at EDX + 0xbc I see 0x0 indeed. The Java call stack is reported to look like this

  [0x80b77c8] 0xa5cb9378(m): org/apache/harmony/nio/FileChannelFactory.getFileChannel(Ljava/lang/Object;JI)Ljava/nio/channels/FileChannel;
  [0x80b77c8] 0xa5cb402b(m): java/io/FileOutputStream.<init>(Ljava/io/FileDescriptor;)V
  [0x80b77c8] 0xa5cb2eb0(m): java/lang/System.createErr()Ljava/io/PrintStream;
  [0x80b77c8] 0xa5cb2950(m): java/lang/System.<clinit>()V
  [0x80b77c8] 0xa5cb2785(m): java/lang/ThreadGroup.checkAccess()V
  [0x80b77c8] 0xa5cb2396(m): java/lang/ThreadGroup.<init>(Ljava/lang/ThreadGroup;Ljava/lang/String;)V
  [0x80b77c8] 0xa5cae91f(m): java/lang/Thread.<init>(Ljava/lang/ThreadGroup;Ljava/lang/String;JJIZ)V

bug the failing method at address 0xa5cbf752 is actually java/lang/Class.getParentName(Ljava/lang/String;)Ljava/lang/String;. I wonder if it is a part of lazy resolution code that calls Java to resolve some method from org/apache/harmony/nio/FileChannelFactory.getFileChannel(Ljava/lang/Object;JI)Ljava/nio/channels/FileChannel?

I cannot figure out what it all means other than there is some bad call somewhere in JITted code.

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Commented: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

George Timoshenko commented on HARMONY-4661:
--------------------------------------------

warning

my patch is not completely tested

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661-JIT.patch, HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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


[jira] Updated: (HARMONY-4661) [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed

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

Gregory Shimansky updated HARMONY-4661:
---------------------------------------

    Attachment: HARMONY-4661.patch

Here is the patch from the VM side that sets and clears method entry/exit flags on request from the agent(s).

> [drlvm][jvmti] MethodEntry and MethodExit event callbacks could be called only when needed
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4661
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4661
>             Project: Harmony
>          Issue Type: Improvement
>          Components: DRLVM
>            Reporter: Gregory Shimansky
>            Assignee: Gregory Shimansky
>         Attachments: HARMONY-4661.patch
>
>
> Currently when JIT compiles a method with flags exe_notify_method_entry or exe_notify_method_exit it hardcodes a call to VM helper at the beginning or end of method. This VM helper tries to determine whether there is some JVMTI environment that is subscribed to receiving such event at the moment. When there is no such environment nothing is done and the call to VM helper is not needed.
> We could create global flags for MethodEntry and MethodExit events that would be checked in JITted code whether or not it is necessary to call VM helper, so that it would be called only when a flag is set. This would eliminate redundant calls to VM from JITted code when no JVMTI environment is registered to receiving an event and speed up debugging.
> I suggest adding the following methods to VM interface
> void get_method_entry_flag_address(char **flag_address);
> void get_method_exit_flag_address(char **flag_address);
> which JIT would call when a method is compiled with exe_notify_method_entry or exe_notify_method_exit flags, and hardcode a check for the flag inside of the method before calling VM helper.
> VM would set these flags when some environment calls jvmtiSetEventNotificationMode enabling MethodEntry or MethodExit events and clear these flags when events are disabled.

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