RFR(S): 8209702: [lworld] C2 compilation fails with "assert(argument(0)->bottom_type()->isa_ptr()) failed: must be"

Tobias Hartmann tobias.hartmann at oracle.com
Mon Aug 27 12:48:11 UTC 2018


Hi Roland,

as we've discussed off-thread, here's a version that does not cast to a value type and bails out if
the receiver is statically known to be a value type:
http://cr.openjdk.java.net/~thartmann/8209702/webrev.02/

Best regards,
Tobias

On 23.08.2018 08:51, Tobias Hartmann wrote:
> Hi Roland,
> 
> On 22.08.2018 17:41, Roland Westrelin wrote:
>>> However, we can call Object.clone() on a value type receiver by making it accessible through
>>> reflection. C2 will still try to predict the call and speculate on the receiver type but we can
>>> disable that via -XX:-UseTypeProfile.
>>
>> I'm confused by this. You're saying it's possible to call Object.clone()
>> with a value receiver?
> 
> Yes, via reflection.
> 
>> In that case, don't we need a runtime check that
>> clone is not called on value receiver?
> 
> Yes but the check for JVM_ACC_IS_CLONEABLE_FAST [1] is sufficient because value types can never
> implement the Cloneable interface [2] and we'll therefore always go to the slow path.
> 
> Best regards,
> Tobias
> 
> [1]
> http://hg.openjdk.java.net/valhalla/valhalla/file/bc48956c7832/src/hotspot/share/opto/library_call.cpp#l4478
> [2]
> http://hg.openjdk.java.net/valhalla/valhalla/file/bc48956c7832/src/hotspot/share/classfile/classFileParser.cpp#l4753
> 



More information about the valhalla-dev mailing list