RFR: JDK-8304884: Update Bytecodes data to be mostly compile time constants [v3]

David Holmes dholmes at openjdk.org
Mon Mar 27 01:58:30 UTC 2023


On Fri, 24 Mar 2023 23:04:12 GMT, Justin King <jcking at openjdk.org> wrote:

>> Change uses a few tricks to make most of the data in Bytecodes compile time constant, avoiding the overhead during VM initialization. `Bytecodes:_flags` likely can be made compile time constant as well using `constexpr` tricks, but that is out of scope for this specific PR.
>
> Justin King has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Replace XX with def and add _DO suffix
>    
>    Signed-off-by: Justin King <jcking at google.com>
>  - Fix compiler warnings
>    
>    Signed-off-by: Justin King <jcking at google.com>

Changes seem okay - unfortunately a lot of noise in the PR diff that obscures actual changes.

A couple of queries.

Thanks.

src/hotspot/share/interpreter/bytecodes.cpp line 320:

> 318: };
> 319: 
> 320: #define STRING_SIZE(string) StringLiteralSize::invoke(string)

Can't you simply use:

#define STRING_SIZE(string) (sizeof(string) - 1)

?

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13179#pullrequestreview-1358211876
PR Review Comment: https://git.openjdk.org/jdk/pull/13179#discussion_r1148710333


More information about the hotspot-runtime-dev mailing list