Some call sites, especially in dynamic languages or delegation-based systems, are not only monomorphic in type, but also have stable receiver values. In other words, the same receiver ('this') is always used at the call site. If this condition can be detected, the JIT can optimistically compile code which knows not only the type of the receiver (as with monomorphic call sites) but also the identity of the receiver, including all final (or otherwise stable) fields.
This may be especially useful with method handles, where the JIT is able to inline the entire behavior of a method handle graph, once it is given a constant root of the graph.
It may also be useful for programs which use "golden objects", i.e., a class with a single instance. (There are simpler ways of detecting and optimizing golden objects, however.)
This may be especially useful with method handles, where the JIT is able to inline the entire behavior of a method handle graph, once it is given a constant root of the graph.
It may also be useful for programs which use "golden objects", i.e., a class with a single instance. (There are simpler ways of detecting and optimizing golden objects, however.)
- duplicates
-
JDK-8058319 No value profile for receivers: constructor MethodHandle invocation is very slow
- Closed
- relates to
-
JDK-8016581 JSR 292: invokeExact (invokehandle) operations should profile method handle behavior forms
- Open
-
JDK-6919064 Type profiles need to be extended to capture some static arguments
- Open