RFR(S): 8207773: [lworld] C2 should not allocate when returning a value type as Object from an inlined method
John Rose
john.r.rose at oracle.com
Wed Jul 18 20:08:48 UTC 2018
That looks good, but the pre-existing assert may be overly restrictive:
assert(tr->isa_instptr()->klass()->is_java_lang_Object(), "must be java.lang.Object");
The JVM treats all interfaces as untyped pointers, as well as Object.
The verifier allows pervasive unchecked conversions between any interface
and Object. See VerificationType::resolve_and_check_assignability
and note that from_field_is_protected is false almost always.
This odd status of interfaces has often been forgotten in JIT code.
Any C2 TypeInstPtr whose klass is an interface is a general reference,
a value of which may or may not implement the interface in question.
In other words, anywhere an Object is allows, an interface is probably
also valid.
I wonder, do we have to do a round of assert adjustment the first time we
mix values with interfaces? And one of the advantages of L-world is simple
interop between interfaces and values: Are we giving up on this in LW1?
— John
On Jul 18, 2018, at 9:02 AM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:
>
> Thanks Roland!
>
> Best regards,
> Tobias
>
> On 18.07.2018 17:56, Roland Westrelin wrote:
>>
>>> http://cr.openjdk.java.net/~thartmann/8207773/webrev.00/
>>
>> That looks good.
>>
>> Roland.
>>
More information about the valhalla-dev
mailing list