Determining whether a particular JDK Method typically has an intrinsic implementation

拜拜、爱过 提交于 2019-12-04 19:25:36

问题


Short of the reading the OpenJDK source code (which I'm not averse to) is there a reasonably comprehensive (or 'official') list of intrinsic operations within the Hotspot JVM (say for Intel)?

For example, what's the quickest way to determine whether Math.abs() will generally be converted directly to a few native instructions wherever it is used?


回答1:


The relevant part of the OpenJDK source code states:

http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/87ee5ee27509/src/share/vm/classfile/vmSymbols.hpp#l581

"Here are all the intrinsics known to the runtime and the CI."

So I suppose that's comprehensive enough!




回答2:


Java 9 adds the @HotSpotIntrinsicCandidate annotation. Methods annotated with that annotation will have intrinsics for them.

Unfortunately this annotation does not show up in the online javadoc, but I can still see it using my IDE (Eclipse), and I assume that other IDEs provide a similar mechanism, so that is a fast way to check:



来源:https://stackoverflow.com/questions/29721545/determining-whether-a-particular-jdk-method-typically-has-an-intrinsic-implement

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!