You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by 史成荣 <ic...@gmail.com> on 2007/12/21 09:22:45 UTC

[drlvm][object]

hi, all
   I want to know the structure of the java objcet. Where can I find the
exact class describing java object in the source code of Harmony?

Thanks,
Chengrong

Re: [drlvm][object]

Posted by Xiao-Feng Li <xi...@gmail.com>.
On Dec 22, 2007 2:57 PM, Simon Chow <si...@gmail.com> wrote:
> On 21/12/2007, Xiao-Feng Li <xi...@gmail.com> wrote:
> >
> > On Dec 21, 2007 4:58 PM, Simon Chow <si...@gmail.com> wrote:
> > > In my view, java object structure is defined as managedObject in
> > > object_layout.h
> >
> > Right, that's the VM side of the definition. In GC, it has another
> > type for the same thing: Patial_Reveal_Object. They both only
> > partially reveals the object header definition.
> >
> > The object fields are laid out in Class::assign_offsets_to_fields()
> > and related methods.
> > Basically you can find the info in
> > vm/vmcore/src/class_support/prepare.cpp.
>
>
> I found the offset of fields is aligned to its own size when calculating the
> object layout in Class::assign_offsets_to_fields().
> Why is that?

It's to save some bytes. See Global_Env:compact_fields. It can be
specified in command line option. It's turned off in 32-bit machine
and on in wider bus platforms.

I think it's a tradeoff between memory requirement and access
efficiency, because data not aligning at architectural width could
result in extra operation for access. Well, smaller object requires
less memory and possibly leads to better cache effects.

Thanks,
xiaofeng

> Array has its own counterpart definitions.
> >
> > Thanks,
> > xiaofeng
> >
> > >
> > > On 21/12/2007, 史成荣 <ic...@gmail.com> wrote:
> > > >
> > > > hi, all
> > > >    I want to know the structure of the java objcet. Where can I find
> > the
> > > > exact class describing java object in the source code of Harmony?
> > > >
> > > > Thanks,
> > > > Chengrong
> > > >
> > >
> > >
> > >
> > > --
> > > From : Simon.Chow@Software School of Fudan University
> > >
> >
> >
> >
> > --
> > http://xiao-feng.blogspot.com
> >
>
>
>
> --
>
> From : Simon.Chow@Software School of Fudan University
>



-- 
http://xiao-feng.blogspot.com

Re: [drlvm][object]

Posted by Simon Chow <si...@gmail.com>.
On 21/12/2007, Xiao-Feng Li <xi...@gmail.com> wrote:
>
> On Dec 21, 2007 4:58 PM, Simon Chow <si...@gmail.com> wrote:
> > In my view, java object structure is defined as managedObject in
> > object_layout.h
>
> Right, that's the VM side of the definition. In GC, it has another
> type for the same thing: Patial_Reveal_Object. They both only
> partially reveals the object header definition.
>
> The object fields are laid out in Class::assign_offsets_to_fields()
> and related methods.
> Basically you can find the info in
> vm/vmcore/src/class_support/prepare.cpp.


I found the offset of fields is aligned to its own size when calculating the
object layout in Class::assign_offsets_to_fields().
Why is that?

Array has its own counterpart definitions.
>
> Thanks,
> xiaofeng
>
> >
> > On 21/12/2007, 史成荣 <ic...@gmail.com> wrote:
> > >
> > > hi, all
> > >    I want to know the structure of the java objcet. Where can I find
> the
> > > exact class describing java object in the source code of Harmony?
> > >
> > > Thanks,
> > > Chengrong
> > >
> >
> >
> >
> > --
> > From : Simon.Chow@Software School of Fudan University
> >
>
>
>
> --
> http://xiao-feng.blogspot.com
>



-- 
From : Simon.Chow@Software School of Fudan University

Re: [drlvm][object]

Posted by Xiao-Feng Li <xi...@gmail.com>.
On Dec 21, 2007 4:58 PM, Simon Chow <si...@gmail.com> wrote:
> In my view, java object structure is defined as managedObject in
> object_layout.h

Right, that's the VM side of the definition. In GC, it has another
type for the same thing: Patial_Reveal_Object. They both only
partially reveals the object header definition.

The object fields are laid out in Class::assign_offsets_to_fields()
and related methods.
Basically you can find the info in vm/vmcore/src/class_support/prepare.cpp.

Array has its own counterpart definitions.

Thanks,
xiaofeng

>
> On 21/12/2007, 史成荣 <ic...@gmail.com> wrote:
> >
> > hi, all
> >    I want to know the structure of the java objcet. Where can I find the
> > exact class describing java object in the source code of Harmony?
> >
> > Thanks,
> > Chengrong
> >
>
>
>
> --
> From : Simon.Chow@Software School of Fudan University
>



-- 
http://xiao-feng.blogspot.com

Re: [drlvm][object]

Posted by Simon Chow <si...@gmail.com>.
In my view, java object structure is defined as managedObject in
object_layout.h

On 21/12/2007, 史成荣 <ic...@gmail.com> wrote:
>
> hi, all
>    I want to know the structure of the java objcet. Where can I find the
> exact class describing java object in the source code of Harmony?
>
> Thanks,
> Chengrong
>



-- 
From : Simon.Chow@Software School of Fudan University