hotspot-compiler-dev Digest, Vol 145, Issue 95
Erik Österlund
erik.osterlund at oracle.com
Thu Jul 18 14:35:19 UTC 2019
Hi,
I thought I should add to this discussion that I am planning on removing
inline caches, by making a faster megamorphic calling mechanism. For
invokeinterface, the solution of choice to ensure the receiver is-a
REFC, required by the spec, is to inject an explicit check cast in the
caller, and relying on the C2 type system to prove away any dynamic
check necessary in most of the cases.
So if we choose the simple solution of just ignoring interfaces, I will
probably have to re-think how monomorphic calls will handle REFC type
checking, and I foresee that will be quite nasty.
So yeah, I thought I'd just mention that there will be usecases where I
will really care about C2 understanding interface types, because I
intend to utilize that more than we previously have. So plus one to
making C2 understand interface types reliably.
Thanks,
/Erik
On 2019-07-11 04:52, John Rose wrote:
> On Jul 10, 2019, at 7:25 AM, Roland Westrelin <rwestrel at redhat.com> wrote:
>>
>> Some optimizations
>> also have to be tuned down because the type system is not trusted. For
>> instance, it happens that c2 IR contains cast node to Object eventhough
>> there are obviously not needed. The primary motivation for the change in
>> the way interfaces are handled is to remove work arounds, make sure we
>> need no new ones, and allow C2 to trust its own type system. So it's a
>> lot more about stability, maintainability than performance.
>
> A principled fix to C2 would be to ignore all interface information, detuning
> (known, loaded) interfaces to java.lang.Object.
>
> (Detuning unknown types to Object would also be a good move.)
>
> All the workarounds you speak of are really attempts to make interfaces
> work-alikes for Object. But that has always been a game of whack-a-mole.
> I’m sad (but not surprised) that there are still moles to whack there.
>
> When we wrote C2 in the early days of HotSpot the meaning of interfaces
> in the JVM verifier was widely misunderstood. Folks thought “Oh, there’s
> a named type here so it must mean something; I’ll just patch around my
> local problem since it’s probably just me.” But it’s not me, it’s them.
>
> — John
>
More information about the hotspot-compiler-dev
mailing list