intrinsic that makes runtime choice whether to revert to java
Deneau, Tom
tom.deneau at amd.com
Fri Jun 29 18:22:04 PDT 2012
Hi all --
I am writing a hotspot intrinsic but I want it to make a runtime
choice whether to execute the intrinsic code or to execute the regular
java code.
I got the suggestion below from Vladimir but I am not experienced
enough with the graphkit functionality to see how to do this. Would
someone be able to provide the code skeleton for this? I can generate
the region to actually do my intrinsic and I believe I can generate the
BoolNode which determines which path to take.
The other choice would be to modify the actual JDK library routine to
do the runtime tests and call a new routine which the intrinsic would
hook into. I have done this for testing but I am assuming this is more
intrusive since on some architectures the intrinsic will not even be generated.
-- Tom Deneau
>We don't have such mechanism currently. But it is not difficult to implement.
>Look on the code in doCall.cpp and callGenerator files. Instead of calling
>find_intrinsic() you need to do something special for your case. Like code for
>CallGenerator::for_method_handle_call() where you will generate class check and
>on one path you will get intrinsic (by calling find_intrinsic()) and on other
>path is regular CallGenerator::for_inline().
More information about the hotspot-compiler-dev
mailing list