eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.27k stars 721 forks source link

DDR JIT stack walker takes insufficient parameters #5966

Open gacholio opened 5 years ago

gacholio commented 5 years ago

The !jitstack and !jitstackslots command in DDR are used to start the stack walk at a JIT frame by providing sufficient root values to walk the stack.

Currently, the root values are vmThread, SP, PC and (optionally) ELS. For a complete walk, values for j2iFrame and i2jState must also be provided (like ELS, they are currently inferred from the vmThread). The two new args should be added as optional.

j2iFrame is either NULL (if no jit->interp transition has ever taken place) or the BP value of the j2i frame.

i2jState starts off pointing to the ELS i2jState, but is updated to point into the j2i frame each time one is seen.

Almost all real-world uses of these extensions target a JIT frame very near the top of the stack, so this has not been an issue.

gacholio commented 5 years ago

Discovered while debugging #5449

gacholio commented 5 years ago

While we're at it, both the C and DDR walkers should output the j2iFrame and i2jState values at the start of the walk and when they get updated.

gacholio commented 5 years ago

In fact, all of the stack commands should take the new optional parameters.

gacholio commented 5 years ago

We will want the initial decompilation stack as an extra parameter as well.

gacholio commented 4 years ago

Suggest the new parm order be:

thread,pc,sp,a0,pc,literals,decomp,j2iframe,i2jstate

with the last three being optional