JDK-4248826 : Method entry/exit events are not created for empty methods in Hotspot VM
  • Type: Bug
  • Component: vm-legacy
  • Sub-Component: jvmdi
  • Affected Version: 1.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 1999-06-23
  • Updated: 2002-09-06
  • Resolved: 2002-09-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.0.1 1.0.1Fixed 1.3.0Fixed
Related Reports
Relates :  
Relates :  
Description

Name: rrC79099			Date: 06/23/99



In Classic VM the method entry and exit events are created for both methods with and without any statements.
But in Hotspot VM method entry and exit events are not created for empty methods .
The details of testing in Hotspot VM with and without any statements inside a method are given below.

Hotspot VM:  Method with statements
-------------------------------------

[C:/Reports/Bugs/MeMxbug/classes] jdb Test
Initializing jdb...
> stop at Test:9
Deferring breakpoint Test:9.
It will be set after the class is loaded.
> run
run Test
HotSpot VM warning: Setting of property "java.compiler" is ignored
>
VM Started: Set deferred breakpoint request Test:9

Breakpoint hit: thread="main", Test.main(), line=9, bci=5

main[1] trace methods
main[1] cont
main[1]
Breakpoint hit: thread="main", Test.main(), line=9, bci=5

main[1] cont
main[1]  In the loop

Method Entered: Test.entryMethod thread="main", Test.entryMethod(), line=16, bci
=0

main[1] cont
main[1]  method entered

Method Exited: Test.entryMethod thread="main", Test.entryMethod(), line=15, bci=
8

main[1] cont
main[1]
Breakpoint hit: thread="main", Test.main(), line=9, bci=5
...

Hotspot VM:    Empty method:
-------------------------------

[C:/Reports/Bugs/MeMxbug/classes] jdb Test
Initializing jdb...
> stop at Test:9
Deferring breakpoint Test:9.
It will be set after the class is loaded.
> run
run Test
HotSpot VM warning: Setting of property "java.compiler" is ignored
>
VM Started: Set deferred breakpoint request Test:9

Breakpoint hit: thread="main", Test.main(), line=9, bci=5

main[1] trace methods
main[1] cont
main[1]
Breakpoint hit: thread="main", Test.main(), line=9, bci=5

main[1] cont
main[1]  In the loop

Breakpoint hit: thread="main", Test.main(), line=9, bci=5

main[1] cont
main[1]  In the loop

Breakpoint hit: thread="main", Test.main(), line=9, bci=5

main[1] cont
main[1]  In the loop

Breakpoint hit: thread="main", Test.main(), line=9, bci=5
...

Steps to reproduce the bug:
---------------------------
1. Set path to the bin directory in JPDA rc1 build.
2. Compile the attached Test.java
3. Start jdb - (jdb Test)
4. Set breakpoint for the println statement in for loop.
5. Trace methods.


Test.java
------------
public class Test
{
    public static void main(String args[])
    {

      for(int i=0;i<100;i++)
      {
          System.out.println(" In the loop");
          entryMethod();
      }
    }


    public static void entryMethod(){}

}


======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.0.1 kestrel-beta INTEGRATED IN: 1.0.1 kestrel-beta
14-06-2004

PUBLIC COMMENTS Method entry/exit events are not created for empty methods in Hotspot VM
10-06-2004

EVALUATION The interpreter does not call empty methods. This can be turned off wit -XX:-UseFastEmptyMethods rene.schmidt@eng 1999-06-23 Fixed by turing off this optimization when the debugger is turned off rene.schmidt@eng 1999-07-22
23-06-1999