Call replacement

David Wong chi.david.wong at gmail.com
Tue Oct 28 17:10:38 PDT 2008


Hello,

I am modifying the HotSpot compiler to replace some of the calls by simply
sequence of machine instructions.  An example would be like:

Replacing:
=== ORIGINAL CODE ===
v=foo();
if (v) {...}
=== ORIGINAL CODE ===

By:
=== TRANSFORMED CODE ===
<NEW MACHINE INSTR>
v=true;
if(v) {...}
=== TRANSFORMED CODE ===

To do this, I think I need to update the architecture description file to
define <NEW MACHINE INSTR> and then it seems I have two choices:

   1. Before emitting machine code, replace the MachCallJavaNode for foo()
   by two nodes corresponding to <NEW MACHINE INSTR> and "v=true".
   2. Change code emit function for the Java static call code to emit code
   for <NEW MACHINE INSTR> and "v=true" instead of emitting Java static call
   instructions.

Since I am new to the HotSpot compiler, I would like to seek advice from you
all which is a better way to do the job and what are the issues involved
(e.g. making sure the change does not break garbage map, etc).

Any helps and suggestions are appreciated.

Thanks.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20081028/85af411c/attachment.html 


More information about the hotspot-compiler-dev mailing list