Where is the assembly implementation code of the intrinsic method in Java HotSpot?

不想你离开。 提交于 2020-04-18 06:24:47

问题


from http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/87ee5ee27509/src/share/vm/classfile/vmSymbols.hpp, I can see the intrinsic method declare like:

do_intrinsic(_getByte, sun_misc_Unsafe, getByte_name, getByte_signature, F_RN) \

but how to find the actually implementation(assembly code I think) of the method _getByte?


回答1:


but how to find the actually implementation(assembly code I think) of the method _getByte

By looking for vmIntrinsics::_getByte in your IDE or simply by grepping HotSpot sources.

However, you won't find the assembly code. Calls to intrinsic methods in HotSpot are typically translated to JIT compiler's intermediate representation (IR). Corresponding IR nodes are manually added to the node graph at the parsing stage of compilation.

Since different JIT compilers have different IRs, intrinsics need to be implemented separately for C1 and C2.

For example, as to _getByte,

  • C1 implementation of the intrinsic is in GraphBuilder::append_unsafe_get_obj;
  • C2 implementation of the intrinsic is in LibraryCallKit::inline_unsafe_access.


来源:https://stackoverflow.com/questions/48198982/where-is-the-assembly-implementation-code-of-the-intrinsic-method-in-java-hotspo

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