According to the wiki, the definition of an Intrinsic Function is as follows:
In compiler theory, an internal function is a function available for use in a given programming language, the implementation of which is specially processed by the compiler. Typically, it replaces a sequence of automatically generated instructions to call a function, similar to a built-in function. However, unlike a built-in function, the compiler has an intimate knowledge of the internal function and may therefore better integrate it and optimize it for the situation. This is also called a built-in function in many languages.
He goes on to say, important and relevant to your question:
Compilers that implement internal functions usually only allow them when the user has requested optimization, returning to the default implementation provided otherwise by the language runtime.
So, this means that the default implementation is used most of the time until optimization is requested or possible (it depends on which machine / configuration the JVM is running on). The JVM can replace all Integer.bitCount() code with an optimized machine code instruction.
Also, check out this discussion , which perfectly explains the example using the sample code.
sakura
source share