Is the source code of native methods available?

后端 未结 2 1748
萌比男神i
萌比男神i 2020-12-15 09:38

At first I want to let you know that this question is not related with What is native implementation in Java. I got many useful information from that thread.

I want

相关标签:
2条回答
  • 2020-12-15 09:40

    Yes, see os::javaTimeMillis in /src/os/solaris/vm/os_solaris.cpp to see the Solaris implementation for instance.

    There are a few layers of wrappers to get there though, see JVM_CurrentTimeMillis in /src/share/vm/prims/jvm.cpp

    0 讨论(0)
  • 2020-12-15 09:59

    Because the underlying methods are intrinsic to the OS you are running Java on, you will not find their source code in the JDK documentation. I suppose you'd need to find out exactly which procedures are called on your platform, and if source code is available for those (which strongly depends on your OS).

    0 讨论(0)
提交回复
热议问题