RFR: JDK-8304884: Update Bytecodes data to be mostly compile time constants [v2]
Justin King
jcking at openjdk.org
Fri Mar 24 23:04:18 UTC 2023
On Fri, 24 Mar 2023 18:47:06 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Justin King has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update definition to match declaration
>>
>> Signed-off-by: Justin King <jcking at google.com>
>
> src/hotspot/share/interpreter/bytecodes.cpp line 32:
>
>> 30: #include "utilities/bytes.hpp"
>> 31:
>> 32: #define JVM_BYTECODES(XX) \
>
> The convention for X macros in the code is usually naming the whole macro {JVM_}BYTECODES_DO and using a lower case argument. "def" would work and look more consistent than XX.
Done.
> src/hotspot/share/interpreter/bytecodes.cpp line 334:
>
>> 332: };
>> 333:
>> 334: jchar Bytecodes::_flags[(1<<BitsPerByte)*2];
>
> Why is this not _flags[Bytecodes::number_of_codes] ?
It should probably be `Bytecodes::number_of_codes * 2`. Two entry per byte-code. One for the normal format and one for wide. Wasn't sure if it was safe or some code was relying on there being exactly 512 entries even if bytecode count is less than 256.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13179#discussion_r1148130171
PR Review Comment: https://git.openjdk.org/jdk/pull/13179#discussion_r1148129268
More information about the hotspot-runtime-dev
mailing list