review request (S): 7116050 C2/ARM: memory stomping error with DivideMcTests

Tom Rodriguez tom.rodriguez at oracle.com
Tue Jan 17 12:51:22 PST 2012


On Jan 17, 2012, at 8:43 AM, Roland Westrelin wrote:

> http://cr.openjdk.java.net/~roland/7116050/webrev.00/
> 
> Block::schedule_local() creates new nodes and they need to be skipped so that the VM doesn't write beyond the end of the ready_cnt array (following 7077312). The current code has a test to prevent it:
> 
> if (m->_idx > max_idx) {
> 
> max_idx is set to matcher.C->unique() in Block::schedule_local() so it may change with every block and it doesn't fully prevent a write beyond the end of the array. Also the test should be a >= rather than a > because max_idx is the size of the ready_cnt array.
> 
> Also isn't it better to use an intArray rather than int[] array so that similar issues are not missed in the future?

intArray is a C1'ism that should be replaced with something nicer longer term, so I'd recommend GrowableArray<int> instead.  They are largely functionally equivalent, other than the fact that intArray is always resource allocated but GrowableArray does either resource or C heap.  Otherwise it looks ok.

tom

> 
> Roland.



More information about the hotspot-compiler-dev mailing list