[Top][All Lists]

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

Re: [DotGNU]Java class loader in pnet

From: Rhys Weatherley
Subject: Re: [DotGNU]Java class loader in pnet
Date: Mon, 11 Feb 2002 22:53:11 +1000

"Gopal.V" wrote:

>         I was looking thru the code when I stumbled on this thing.
> There were 2 things which struck me as strange....
>         * Why are we using ILImage * parameter ?
>         * How do I get an ILClass from the passed ILImage ?

Whoops - the ILClass should be passed into the function
from "ILDAsmDumpJavaMethod" (it can be obtained from
the method).  I cut-and-pasted the code in "ildasm_method.c",
and this just carried across.

I'll fix this tomorrow when I continue the disassembler
implementation.  I'm almost finished.

Getting the class from the image would be incorrect,
as there are multiple classes per image, and each one
has a different constant pool.

>         If that is OK, then it's a short step to dumping the TOKEN
> and NEW args (using the ILClass->ext stuff.....). Also I imagine
> we'll be dumping stuff as it is ie java/lang/System/out style...

The tokens can be constants, fields, or classes.  My plan was
to use the "ILJavaGetXXX" functions to determine what it is,
resolve it, and then use the usual dump functions in "dumpasm"
to dump out the information.  e.g. determine that it is a field
using "ILJavaGetConstType", resolve the field reference using
"ILJavaGetField", and then dump its name and type information
using "ILDumpIdentifier" and "ILDumpType".

The "java/lang/System/out" style will have problems with
name-mangled field and method names.  This name mangling
can occur when compiling C# to the JVM.  There's a section
in "doc/pnettools.texi" that discusses name mangling.

The JL assembler syntax is defined in such a way that IL type
syntax can be used, and the assembler/disassembler pair takes
care of converting to and from JVM conventions.  I decided to
do it this way to simplify the compiler, which can use the same
code to dump field and method signatures for both IL and JL.



reply via email to

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