RFR: 8324433: Introduce a way to determine if an expression is evaluated as a constant by the Jit compiler [v6]

Aleksey Shipilev shade at openjdk.org
Wed Jan 24 18:51:32 UTC 2024


On Wed, 24 Jan 2024 10:33:05 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Hi,
>> 
>> This patch introduces `JitCompiler::isConstantExpression` which can be used to statically determine whether an expression has been constant-folded by the Jit compiler, leading to more constant-folding opportunities. For example, it can be used in `MemorySessionImpl::checkValidStateRaw` to eliminate the lifetime check on global sessions without imposing additional branches on other non-global sessions. This is similar to `__builtin_constant_p` in GCC and clang.
>> 
>> Please kindly give your opinion as well as your reviews, thanks very much.
>
> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
> 
>   address reviews

src/java.base/share/classes/jdk/internal/vm/ConstantSupport.java line 32:

> 30: /**
> 31:  * Just-in-time-compiler-related queries
> 32:  */

This looks like a stale comment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17527#discussion_r1465397036


More information about the core-libs-dev mailing list