serialize.cpp uses objArrayOopDesc::base_offset_in_bytes(T_BYTE)

Keith McGuigan Keith.McGuigan at Sun.COM
Mon Jul 6 08:39:54 PDT 2009


I suspect that's a bug that should be able to be safely converted to a 
T_OBJECT.

The code you reference in serialize.cpp is used to write out and read in 
data to/from the shared class archive file for class data sharing (CDS). 
  It writes out a number of constants in the header of the file and then 
verifies that these constants haven't changed when the archive file is 
read back in.  If you change this from T_BYTE to T_OBJECT, it will 
likely change that value (unless we're real lucky with the alignments), 
and this may prevent archive files created before your change from being 
loaded into VMs after your change.  I think that's ok, though, since 
deployments run -Xshare:dump (creating a new archive) whenever a new JDK 
is installed.

--
- Keith

Christian Thalinger wrote:
> Hi!
> 
> Yesterday I wanted to add:
> 
>   objArrayOopDesc::base_offset_in_bytes() (note: with no argument)
> 
> because an objArrayOopDesc holds only oops anyway, so always using 
> T_OBJECT seems correct to me.
> 
> After adding the method and doing a compile, I noticed that 
> serialize.cpp:54 uses it like this:
> 
>   soc->do_tag(objArrayOopDesc::base_offset_in_bytes(T_BYTE));
> 
> That looks very odd and, unfortunately, does not have a comment that 
> explains why it is done that way.  Can someone explain to me why T_BYTE 
> is used in that case and if it could be changed to T_OBJECT?
> 
> -- Christian




More information about the hotspot-dev mailing list