United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7120468 SPARC/x86: use frame::describe to enhance trace_method_handle
JDK-7120468 : SPARC/x86: use frame::describe to enhance trace_method_handle

Details
Type:
Enhancement
Submit Date:
2011-12-12
Status:
Closed
Updated Date:
2012-03-24
Project Name:
JDK
Resolved Date:
2012-03-24
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P5
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs23 (b12)

Related Reports
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
The trace_method_handle dump, activated by -XX:TraceMethodHandles, has been implemented before the frame::describe enhancements.

The implementation might benefit from calling frame::describe instead of implementing
its own dumping mechanism. This has been done for the ARM and PPC ports.

                                    

Comments
EVALUATION

Goal of that RFE was to use the frame::describe debugging output to
enhance the information printed by the "-XX:+TraceMethodHandles -XX:+Verbose" develop options and benefit from future improvements of frame::describe. This RFR does not impact the product build but may help future JSR292 development.

The change in fact fixes a few minor bugs in the current version of trace_method_handle.

Main changes are:
- make frame::describe available in all non-product builds
 (else we could no longer build in "optimized" mode)
- improvements of trace_method_handle for SPARC
* protect FP result register, which was corrupted by traces
* protect all globals (G6 corruption caused an issue)
* walk up to the right frame to dump
* safely build a frame on which to call describe (see below)
- improvements of trace_method_handle for x86
* properly pass r13 (and not rsi) as the saved_sp on LP64
* protect FP result register, which was corrupted by traces
* build a real frame in the stub wrapper to allow stack walking
* walk up to the right frame to dump
* safely build a frame on which to call describe (see below)
 
Note on the "safely build a frame":

trace_method_handle is called from very different call sites. For some of them (mainly ricochet and return adapters), we cannot call the existing frame constructors to build a frame. They fails for various assertions (often because the constructor expects a valid PC at some specified location). Instead of modifying the constructors or remove assertions for this debug only code, we instead switch to a simpler output instead of building a frame and calling frame::describe.

The test is currently very simple (same as has_mh) and seems to work for all the test we ran. If necessary (for instance if new adapters are created), we may have to refine how "walkable" is set or change the constructors to support these special frames.
                                     
2012-01-26
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/5dbed2f542ff
                                     
2012-01-26
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/5dbed2f542ff
                                     
2012-03-22



Hardware and Software, Engineered to Work Together