RFR(M): 6700100: optimize inline_native_clone() for small objects with exact klass
vladimir.kozlov at oracle.com
Fri Oct 10 17:18:04 UTC 2014
On 10/10/14 5:07 AM, Roland Westrelin wrote:
>>>> Why you skip klasses with injected fields? I thought nof_nonstatic_fields() includes them. Add comment.
>>> I skip them because they are rare and it seems simpler to simply skip them.
>> But you do the check (scanning all fields) for all classes. That is what I am concern about. May be it is better to add a flag to InstanceKlass during class parsing when fields are injected?
> The computation is done lazily when we actually need it and it’s only needed when there’s a clone so is it really such a big deal?
Okay, at least swap ik->has_injected_fields() check in the condition to execute it last.
>>>> How we benefit from doing this optimization during parsing? Why you need StressArrayCopyMacroNode?
>>> It’s a stress option. The Ideal transformation is often applied at parse time and I wanted to make sure I could stress test the Ideal transformation during IGVN because it performs somewhat trickier graph transformations. Why would I need to make it diagnostic?
>> My question was why not to do that always after parse, during IGVN? You expand arraycopy node to several memory nodes which increase nodes count and complicate the graph. It may be premature to do that during parsing. On other hand ClearArrayNode::Ideal() is executed during parsing too.
> If we wanted to delay that transformation, wouldn’t we also want a few passes of IGVN to happen before we do the transformation?
The thing which can be improved is klass exactness. Which will allow to skip adding dependency. That is what I was
thinking. But it may only happen after CCP phase. But I really want to do this optimization before EA which will greatly
benefit from it. Also if klass is exact during parsing we may do optimization during parsing too.
More information about the hotspot-compiler-dev