Anyway to hack JITTed code manually?
Tangwei (Euler)
tangwei6 at huawei.com
Tue May 12 06:42:53 UTC 2015
Hi Kris,
Thanks for quick response. Is there any other hacking way in OpenJDK for fast performance measurement?
Or is that possible to invoke other profiling tool such as “perf” instead of hprof in JVM to sampling more PMU events.
Regards!
wei
From: Krystal Mok [mailto:rednaxelafx at gmail.com]
Sent: Tuesday, May 12, 2015 2:34 PM
To: Tangwei (Euler)
Cc: hotspot-compiler-dev at openjdk.java.net
Subject: Re: Anyway to hack JITTed code manually?
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<mailto: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/20150512/69955e39/attachment.html>
More information about the hotspot-compiler-dev
mailing list