For example for storing a reference in a non-static field the following
code chain occurs:
From:
FJitResult FJit::compileCEE_STFLD( OPCODE opcode)
{
....
case CORINFO_TYPE_CLASS:
emit_STFLD_REF((fieldIsStatic || isEnCField),
UnalignedAccess);
break;
....
}
To:
#define emit_STFLD_REF(isStatic, unaligned) \
{ \
callInfo.reset(); \
emit_tos_arg( 1, INTERNAL_CALL ); \
emit_tos_arg( 2, INTERNAL_CALL ); \
if (!isStatic) \
{ \
LABELSTACK((outPtr-outBuff),0); \
emit_tos_arg( 3, INTERNAL_CALL ); \
emit_callhelper_I4I4I4(STFLD_REF_helper); \
} \
else \
{emit_callhelper_I4I4(STSFLD_REF_helper);} \
}
Goes to:
void HELPER_CALL STFLD_REF_helper(unsigned int offset, unsigned val,
CORINFO_Object* or_obj) {
if(or_obj == NULL) {
THROW_FROM_HELPER(CORINFO_NullReferenceException);
}
FJit_pHlpAssign_Ref((CORINFO_Object**)((char*)(or_obj)+offset),
(CORINFO_Object*)val);
}
The object reference which is the this pointer is the last argument. In
this case the modification is very simple - just remove the field offset
from the calculation of the address.
Vladimir
This posting is provided "AS IS" with no warranties, and confers no
rights.
-----Original Message-----
From: Discussion of the Rotor Shared Source CLI implementation
[mailto:[EMAIL PROTECTED] On Behalf Of Archana
Sent: Tuesday, January 13, 2004 2:07 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET-ROTOR] the write barrier
On Tue, 13 Jan 2004, Vladimir Fedorov wrote:
> You would have to track the 'this'
> pointer from which the pointer to the field is generated and use it
> instead of the field address. For stfld, ldfld instructions it should
be
> quite manageable since they take a 'this' pointer. For stind and
stsfld
> it will be more difficult.
Where/which function should i look into for 'this' ptr?
compileCEE_STFLD(opcode)?
since i am not familiar with /fjit code can you please give me some
starting point so that i can try to figure out the rest.
Thank you so much
archana
>
> Vladimir
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>
> -----Original Message-----
> From: Discussion of the Rotor Shared Source CLI implementation
> [mailto:[EMAIL PROTECTED] On Behalf Of Archana
> Sent: Monday, January 12, 2004 10:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOTNET-ROTOR] the write barrier
>
> On Mon, 12 Jan 2004, Vladimir Fedorov wrote:
>
> > I assume by dirty, you mean flip the bit in the card table
> corresponding
> > to the memory location in which a potential cross-generational
pointer
> > is being stored.
> Correct.
>
> > Also when you refer to base I assume you mean the start
> > of the object containing the memory location.
> Yes. thats exactly what i was referring to
>
> > In this case you don't
> > need to do anything, GC will scan the whole object to update the
> > potential cross generational pointers even if the objects spans
> multiple
> > cards some of which are not flipped. The brick table is used to
found
> > the start of the first object outside the card that has been
flipped.
> The reason i am trying to fit in my own GC that requires the
> writebarrier(objbase, value) due to the algorithm functionality. and
> finding the object base at runtime would be too costly. Is there any
> way to do this in compile time?
>
> >
> > Regards,
> > Archana
> >
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
> NEW! ASP.NET courses you may be interested in:
>
> 2 Days of ASP.NET, 29 Sept 2003, in Redmond
> http://www.develop.com/courses/2daspdotnet
>
> Guerrilla ASP.NET, 13 Oct 2003, in Boston
> http://www.develop.com/courses/gaspdotnet
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
> NEW! ASP.NET courses you may be interested in:
>
> 2 Days of ASP.NET, 29 Sept 2003, in Redmond
> http://www.develop.com/courses/2daspdotnet
>
> Guerrilla ASP.NET, 13 Oct 2003, in Boston
> http://www.develop.com/courses/gaspdotnet
>
> View archives and manage your subscription(s) at
http://discuss.develop.com
>
--
Regards,
Archana
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet
Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet
View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentor� http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet
Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet
View archives and manage your subscription(s) at http://discuss.develop.com