From: Hezi A. <he...@cs...> - 2002-02-18 10:27:46
|
Hi Perry, Thanks for your quick clarification. Still, I've problem with the fact that the "size" in the original expression is the total size (including header) but!!! *without* the 4 bytes at the beginning (denoted in the diagram below as "xxxx"). Maybe the xxxx is not part of this object? thus we don't need to allocate space for it? i.e. the allocator allocates space only for: "size" bytes no more. "size" = datafield_size + scalar_header_size = datafield_size + length(.tib) + length(.status) +------+------+------+------+------+------+ - -+ - - + |fldN-1| fldx | fld1 | fld0 | tib |status|xxxx| +------+------+------+------+------+------+ - -+ - - + ^rawaddr ^objaddr <--------------datafield_size------------><----object_hdr_offset----> --Hezi. On Sun, 17 Feb 2002, Perry Cheng wrote: > > Hezi, > > With respect to your statement "int objaddr = rawaddr + size - > OBJECT_ADDR_POSITION;", > first note that > > (1) static final int OBJECT_ADDR_POSITION = SCALAR_HEADER_SIZE + > OBJECT_HEADER_OFFSET; > (2) the "size" in the original expression is the total size of the > object (including header). > > With that, the original statement can be made more unstandable by > considering the equivalent expressions and diagram below. > Also, you should look at the VM_ObjectLayouts.java file for more related > information. > > objaddr = rawaddr + total_size - scalar_header_size - > object_header_offset > objaddr = (rawaddr + datafield_size) - object_header_offset > objaddr + object_header_offset = rawaddr + datafield_size > > +------+------+------+------+------+------+ - -+ - - + > |fldN-1| fldx | fld1 | fld0 | tib|status| > +------+------+------+------+------+------+ - -+ - - + > ^rawaddr ^objaddr > <--------------datafield_size------------><----object_hdr_offset----> > > > Perry > > > Hezi Azatchi <he...@cs...>@www-124.southbury.usf.ibm.com on > 02/17/2002 12:34:46 PM > > Please respond to jik...@ww... > > Sent by: jik...@ww... > > > To: <jik...@ww...> > cc: > Subject: [Jikesrvm-researchers] OBJECT_ADDR_POSITION > > > > > My question refers to the Allocator of the markAndSweep > collector/Concurrent collector. > > The object address is calculated from the raw address by the following > simple equation: > > int objaddr = rawaddr + size - OBJECT_ADDR_POSITION; > > My problem: The object which is allocated is associated with > VM_SizeControl of `size` whereas the object allocation can take more than > `size` (because the OBJECT_ADDR_POSITION is negative number, for instance). > Is it ok? > Why? > > What is the duty of the OBJECT_ADDR_POSITION, is it used just to cause the > offsets of the status fields of array/scalar to be the same. > > Thanks, > --Hezi. > > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@ww... > http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jikesrvm-researchers > > > > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@ww... > http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jikesrvm-researchers > |