RFR (L): 7153771: array bound check elimination for c1

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Mar 13 11:39:25 PDT 2013

Looks good to me.


On 3/13/13 10:03 AM, Roland Westrelin wrote:
>>> In LIR_Assembler::emit_assert() you do "delete[] op->msg();". Is it safe? is it possible that op->msg() could be accessed after the call to emit_assert()? In C2 we emit instructions 2 times: one to get size and second is final emit. Also is it possible that op->msg() == NULL?
>> With c1 there's a single pass for code generation (no sizing pass) so I think the code is ok as it is except it's ugly. Thinking about this a bit more I should resource allocate the strings, this way I wouldn't have to worry about freeing them. I guess it would be true for "8008555: Debugging code in compiled method sometimes leaks memory" as well. What do you think?
> New webrev with the Assert strings allocate in the resource area so there's no need to worry about freeing them:
> http://cr.openjdk.java.net/~roland/7153771/webrev.03/
> Roland.

More information about the hotspot-compiler-dev mailing list