dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] System.Reflection.Emit, My humble oppinion


From: Gopal V
Subject: Re: [Pnet-developers] System.Reflection.Emit, My humble oppinion
Date: Mon, 10 May 2004 08:32:05 -0700 (PDT)

Hi,

I think first off we need to be able to run a
re.emit oriented program like for example Mono's 
VB compiler or JScript compiler ...

That would form a strong basis for further changes..
and a nice test case in itself too ..

> As far as I can see the current implementation of
> Emit
> is so hard-wired towards saving the module, that
> fixing
> this require quite some "shotgun surgery". This
> mainly
> because the Emit-implementation is a mix of ILImage
> manipulation and stream-writing.

more like "hatchet surgery" ... :)

> Doing it right would involve at least three steps.
> 
> 1)  Unit-testing.

replace with running something like mcs ... 
(which is a very very good test case in this scenario)

> 2) Improved Image encapsulation
> 3) Partial rewrite under the new hood.

Will probably be needed for step #1 to pass :)

> 
> The goal should be that the way an image is built
> from
> the pecoff_loader is identical to the way Emit
> builds the image.

It needn't be ... some of the hacks in the pecoff
loader is aimed at reducing the load times and late
resolution of types , which are not necessary for
a dynamic assembly ..

> The IL-code is written into a writer buffer. It
> appears that this is a
> linked list of fragments not accessible by the
> converter. (engine/convert.c)

Yes, this is because ILMethodGetCode and GetExceptions
picks it up from the RVA (God know what that is )..
We should pick it up from a buffer instead ..

> The ILWriter appears to duplicate stuff from the
> ILImage. I think removing
> the duplicated logic/code would be a great win.

I think the ILWriter is in ILImage in pecoff_writer.

Gopal


        
                
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]