RFR: 8259228: Zero: rewrite (put|get)field from if-else chains to switches

Aleksey Shipilev shade at openjdk.java.net
Wed Jan 6 15:30:57 UTC 2021


On Wed, 6 Jan 2021 14:52:42 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Current handling for (put|get)field uses if-else chain to select the access type. This can be made more uniform by using switches, like accessor_entry code already does.
>> 
>> Additional testing:
>>   - [x] Ad-hoc Zero performance tests
>
> src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp line 1669:
> 
>> 1667:               }
>> 1668:               default:
>> 1669:                 ShouldNotReachHere();
> 
> Rather than having a 3000 line case statement in BytecodeInterpreter::run(), can you make these into separate functions?  I've always wondered how the C++ optimizer possibly does a good job on this function.  And it would be easier to read.

As far as I understand, in "release", that is not really a switch statement, but the goto-machine dispatched through "labels" table holding goto pointers. So it would be an interesting exercise to see if: a) that machine is even needed; b) can it be reasonably done with separate compilation units. None seem apply to this patch, though?

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

PR: https://git.openjdk.java.net/jdk/pull/1943


More information about the hotspot-runtime-dev mailing list