Integrated: 8289925: Shared code shouldn't reference the platform specific method frame::interpreter_frame_last_sp()
Richard Reingruber
rrich at openjdk.org
Wed Oct 5 14:15:30 UTC 2022
On Thu, 7 Jul 2022 16:02:19 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
> 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.
This pull request has now been integrated.
Changeset: ee6c3917
Author: Richard Reingruber <rrich at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/ee6c39175bc47608282c52c575ce908399349e7c
Stats: 31 lines in 7 files changed: 5 ins; 22 del; 4 mod
8289925: Shared code shouldn't reference the platform specific method frame::interpreter_frame_last_sp()
Reviewed-by: eosterlund, dlong
-------------
PR: https://git.openjdk.org/jdk/pull/9411
More information about the hotspot-compiler-dev
mailing list