RFR: 8308984: Relativize last_sp (and top_frame_sp) in interpreter frames

Fredrik Bredberg fbredberg at openjdk.org
Wed Aug 16 08:20:14 UTC 2023


On Fri, 11 Aug 2023 17:01:11 GMT, Andrew Haley <aph at openjdk.org> wrote:

> > I think you need to correct `frame::describe` to make it print the relativized SP in an easy-to-understand form.
> 
> Ping.

I looked into frame::describe and I realized that it already contained code to deal with relativized values (by @AlanBateman and adopted to PowerPC by @reinrich).  It works like this: If a member of the fixed frame is on the heap and has a value between -99 to 99 it's value will be printed as a signed integer instead of a hexadecimal value. 

I think the basic thought is something like this: Members of the fixed frame are pointers and therefore don't hold values [-99..99], but if they do, they are probably relativized values so they should be printed as integers. And they should be interpreted as pointing to a stack index relative to the frame pointer. 

Up until I started to change fixed frame pointers so that they are permanently relativized (JDK-8289296), the relativized pointers only occurred on the heap (after a freeze). Henze the on_heap condition.

      if (on_heap
          && *fv.location != 0 && *fv.location > -100 && *fv.location < 100


I decided to go with the prior art of Alan and Richard, but since the relativized values can now appear both on the stack and on the heap I removed the on_heap condition. I've tested the output on several platforms, and the output seems ok to me.

Does this answer your "Ping" @theRealAph?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14545#issuecomment-1680164503


More information about the hotspot-dev mailing list