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
Thu Aug 23 06:51:45 UTC 2018


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