RFR: 8150720: Cleanup code around PrintOptoStatistics

Claes Redestad claes.redestad at oracle.com
Fri Feb 26 12:22:00 UTC 2016


Hi,

On 2016-02-26 12:57, Aleksey Shipilev wrote:
> On 02/26/2016 02:40 PM, Claes Redestad wrote:
>> webrev: http://cr.openjdk.java.net/~redestad/8150720/webrev.00/
> Wait, I don't get these parts in the original code:
>
> src/share/vm/opto/node.cpp:
>   621 #ifdef ASSERT
>   622     if( edge_end+node_size == compile->node_arena()->hwm() ) {
>   623       reclaim_in  += edge_size;
>   624       reclaim_node+= node_size;
>   625     }
>   626 #else
>   627     // It was; free the input array and object all in one hit
>   628     compile->node_arena()->Afree(_in,edge_size+node_size);
>   629 #endif
>
> ...
>
>   639     // Free just the object
>   640 #ifdef ASSERT
>   641     if( ((char*)this) + node_size == compile->node_arena()->hwm() )
>   642       reclaim_node+= node_size;
>   643 #else
>   644     compile->node_arena()->Afree(this,node_size);
>   645 #endif
>
> We are not freeing when ASSERT is not defined? O_o The patch that
> apparently does an equivalent transformation of the original code makes
> it even creepier.

yes, this is a weirdness in the original code, and not preserving this 
pattern makes the VM crash early in fastdebug mode.

There is also a small "leak" in the corner case where "edge_end == 
(char*)this" since we're not freeing the input array in this case.

Either way I think diving into this is out of scope for this cleanup, 
though.

/Claes

>
> -Aleksey
>



More information about the hotspot-compiler-dev mailing list