Anyway to hack JITTed code manually?

Krystal Mok rednaxelafx at gmail.com
Tue May 12 06:33:49 UTC 2015


Hi Wei,

For HotSpot VM as it is now, the answer is no, there isn't a simple way to
do that.

One of the various problem that you'd have with trying to do something like
this is relocation: there are a lot of addresses embedded into JIT compiled
code as constants -- some could be Klass*, some could be compiled entry
points to other compiled methods or stubs.

The kind of feature you're asking for is more likely to be present in a VM
that supports some certain form of AOT compilation, where the system has to
deal with relocation of code anyway. The HotSpot VM we can see in OpenJDK
doesn't do that right now.

- Kris

On Mon, May 11, 2015 at 11:24 PM, Tangwei (Euler) <tangwei6 at huawei.com>
wrote:

>  Hi All,
>
>   Is there any simple way to hack JITTed code and relocate at runtime?
> Following steps are expected.
>
>
>
> 1.       Dump JITTed code (c1/c2) to file or some cached directory.
>
> 2.       Hack assembly code
>
> 3.       Run JVM to load the hacked assembly code and relocating in memory
>
>
>
>
>
> Regards!
>
> wei
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150511/bd838dcf/attachment.html>


More information about the hotspot-compiler-dev mailing list