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

Roland Westrelin roland.westrelin at oracle.com
Wed Mar 13 10:03:46 PDT 2013

>> 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:



More information about the hotspot-compiler-dev mailing list