9

I am doing some performance tests on the JVM, and I would like to measure the impact of intrinsics usage.

I would like to disable the JIT use of intrinsics for some methods without going into the interpreted mode. Is there a way to do that ? Thank you

1 Answer 1

10

Use

java -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_<method_name>[,...]

For example

java -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_equals,_hashCode

As @apangin noticed, you may use -XX:+PrintIntrinsics first to see which methods are actually intrinsified in your test and disable them.

11
  • 3
    It may be even easier to build a custom HotSpot where Compile::make_vm_intrinsic always returns NULL to disable all intrinsics at once.
    – apangin
    May 21, 2015 at 10:56
  • 5
    Oh, I think there is a simple solution: first use -XX:+PrintIntrinsics to print all compiled intrinsics, then -XX:DisableIntrinsic= to disable them.
    – apangin
    May 21, 2015 at 11:01
  • 5
    BTW, I've created a table of all JVM intrinsics
    – apangin
    May 21, 2015 at 11:29
  • 3
    That were JDK 7u80 intrinsics. Now JDK 8u45 intrinsics.
    – apangin
    May 21, 2015 at 11:46
  • 2
    @Bionix1441 Unfortunately there is no such switch in stock JVM. So, you have to either patch JVM or disable them one by one.
    – apangin
    May 21, 2015 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.