[9] RFR (S): 8148994: Replacing MH::invokeBasic with a direct call breaks LF customization

Christian Thalinger christian.thalinger at oracle.com
Thu Feb 4 17:25:59 UTC 2016


While you are in there can you remove this line a few lines above:

 828         guarantee(!target->is_method_handle_intrinsic(), "should not happen");  // XXX remove

I think it’s proven that it doesn’t trigger (I’ve added that guarantee a looooong time ago).

> On Feb 4, 2016, at 7:51 AM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
> 
> http://cr.openjdk.java.net/~vlivanov/8148994/webrev.00
> https://bugs.openjdk.java.net/browse/JDK-8148994
> 
> JDK-8072008 [1] introduced an optimization to bypass linker calls in generated code when target method can't be inlined.
> 
> Unfortunately, it doesn't work well with MH::invokeBasic(), because it clashes with LambdaForm customization: if a call is not inlined, it is important for performance to update (customize) corresponding LambdaForm on-the-fly. MH::invokeBasic() linker does MH -> LF -> Method* -> _from_compiled_entry traversal on every invocation, while direct call points right to the _from_compiled_entry. So, any LambdaForm updates aren't visible until recompilation.
> 
> The fix is to keep MH::invokeBasic linker, so up-to-date LambdaForm instance is used on every invocation.
> 
> Also, cleaned up relevant tests a bit.
> 
> Testing: octane, JPRT.
> 
> Best regards,
> Vladimir Ivanov
> 
> [1] https://bugs.openjdk.java.net/browse/JDK-8072008
>    "Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls"



More information about the hotspot-compiler-dev mailing list