RFR: 8266252: Streamline AbstractInterpreter::method_kind [v2]

Coleen Phillimore coleenp at openjdk.java.net
Thu May 6 22:57:01 UTC 2021


On Wed, 5 May 2021 10:18:16 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> This patch refactors AbstractInterpreter::method_kind to reduce branches on average while better compartmentalizing the exceptional cases.
>> 
>> Additionally Method::is_empty_method is trivial enough that making it inlineable helps reduce cost while reducing size of the libjvm.
>> 
>> Result is a 40% speed-up, or a reduction of .25% of instructions on Hello World that scales to larger applications.
>
> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
> 
>   assert that vmIntrinsics::_dsqrt are only selected for Math/StrictMath::sqrt

Ok with some minor nits and questions.

src/hotspot/share/interpreter/abstractInterpreter.cpp line 125:

> 123: 
> 124: #ifndef ZERO
> 125:     switch (m->intrinsic_id()) {

Can this just be switch (id) since you fetched m->intrinsic_id() above?

src/hotspot/share/interpreter/abstractInterpreter.cpp line 136:

> 134:       case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits;
> 135:       case vmIntrinsics::_longBitsToDouble: return java_lang_Double_longBitsToDouble;
> 136:       case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits;

Could you align these return statements?

src/hotspot/share/interpreter/abstractInterpreter.cpp line 137:

> 135:       case vmIntrinsics::_longBitsToDouble: return java_lang_Double_longBitsToDouble;
> 136:       case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits;
> 137:       case vmIntrinsics::_dsin: return java_lang_math_sin;

So ZERO doesn't have these?

src/hotspot/share/interpreter/abstractInterpreter.cpp line 142:

> 140:   // Native method?
> 141:   // Note: This test must come _before_ the test for intrinsic
> 142:   //       methods. See also comments below.

So apparently this is no longer true?

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

Marked as reviewed by coleenp (Reviewer).

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


More information about the hotspot-runtime-dev mailing list