Question on ADLC's RegClass destructor

Zoltán Majó zoltan.majo at oracle.com
Tue May 26 07:06:52 UTC 2015


Hi Kris,


On 05/23/2015 12:22 AM, Krystal Mok wrote:
> Hi compiler team,
>
> I came across this piece of code in ADLC, and I'm not sure if it's 
> right or not:
>
> http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/ac291bc3ece2/src/share/vm/adlc/formsopt.cpp#l236
>
> RegClass::~RegClass() {
>   delete _classid;
> }
>
> Why do we need to delete the _classid field here? If this is needed, 
> then a bunch of other classes in formsopt.hpp would need the same 
> treatment.

If I remember correctly, I added the destructor because the caller of 
the RegClass constructor allocates memory for _classid, but does not 
free it. But I'd have to check to be sure.

Best regards,


Zoltan

>
> (I know this virtual destructor was added mainly for the two new 
> subclasses, but I'm just wondering about this one...)
>
> Thanks,
> Kris



More information about the hotspot-compiler-dev mailing list