dotgnu-general
[Top][All Lists]
Advanced

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

[DotGNU]Morphing java code to IL


From: Gopal V
Subject: [DotGNU]Morphing java code to IL
Date: Sat, 22 Sep 2001 15:37:44 +0530
User-agent: Mutt/1.0.1i

Hi,
  I am thinking about morphing Java Code into IL , so that we can just convert
  .class files into ILASM files. I have been working for this using my own
  code when I realized that the ILImage can load a java class. When I went 
  through the ILDAsm code I also found out that java class names and methods
  can be dumped (not code) in the IL style. I also noticed that all methods 
  are using the ILImage for disassembly. When I inspected the java_loader.c 
  I saw the following code
  
line 679:
        JAVA_READ_UINT16(reader, numAttrs);
        while(numAttrs > 0)
        {
                JAVA_READ_UINT16(reader, value);
                JAVA_READ_UINT32(reader, value);
                JAVA_SKIP_BYTES(reader, value);//skip code & exception blocks
                --numAttrs;
        }
  This code is for bypassing the actual bytecode of the method. I think I may
  be able to hack this and generate an IL code for each Bytecode . I got stuck
  there . 
  so how do you add an ILMethodCode attribute to an ILMethod ?.
  and how do you create a new ILMethodCode ?
  ( pnet hasn't got an API for making new ILMethodCodes as far as I know )
  
  lastly I am stuck at how to efficently convert Bytecode -> IL and insert it
  into the Method (If I can do that ILDAsm can fully dissasemble Java to IL )
  
  If anybody can help me with this , please do ASAP.
  
  
  Gopal.V


reply via email to

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