RFR: 8289925: Shared code shouldn't reference the platform specific method frame::interpreter_frame_last_sp() [v5]

Richard Reingruber rrich at openjdk.org
Wed Oct 5 10:12:21 UTC 2022


> The method `frame::interpreter_frame_last_sp()` is a platform method in the sense that it is not declared in a shared header file. It is declared and defined on some platforms though (x86 and aarch64 I think).
> 
> `frame::interpreter_frame_last_sp()` existed on these platforms before vm continuations (aka loom). Shared code that is part of the vm continuations implementation references it. This breaks the platform abstraction.
> 
> Using unextended_sp is problematic too because there are no guarantees by the platform abstraction layer for it. In fact unextended_sp < sp is possible on ppc64 and aarch64.
> 
> This fix changes the callers of is_sp_in_continuation()
> 
> ```c++
> static inline bool is_sp_in_continuation(const ContinuationEntry* entry, intptr_t* const sp) {
>   return entry->entry_sp() > sp;
> }
> 
> 
> to pass the actual sp. This is correct because the following is true on all platforms:
> 
> ```c++
> a.sp() > E->entry_sp() > b.sp() > c.sp()
> 
> 
> where `a`, `b`, `c` are stack frames in call order and `E` is a ContinuationEntry. `a` is the caller frame of the continuation entry frame that corresponds to `E`.
> 
> is_sp_in_continuation() will then return true for `b.sp()` and `c.sp()` and false for `a.sp()`
> 
> Testing: hotspot_loom and jdk_loom on x86_64 and aarch64.

Richard Reingruber has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:

 - Merge branch 'master'
 - Remove `Unimplemented` definitions of interpreter_frame_last_sp
 - Only pass the actual sp when calling is_sp_in_continuation()
 - Merge branch 'master'
 - Merge branch 'master'
 - Remove platform dependent method interpreter_frame_last_sp() from shared code

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/9411/files
  - new: https://git.openjdk.org/jdk/pull/9411/files/14c97290..f49ecf54

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9411&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9411&range=03-04

  Stats: 41961 lines in 1346 files changed: 21873 ins; 13281 del; 6807 mod
  Patch: https://git.openjdk.org/jdk/pull/9411.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9411/head:pull/9411

PR: https://git.openjdk.org/jdk/pull/9411


More information about the hotspot-compiler-dev mailing list