Other |
---|
tbdUnresolved |
Relates :
|
|
Relates :
|
Although type profiling only applies to references, in some cases it would be profitable to profile primitive values, especially ints. Any primitive can be summarized in two words as accumulated min and max, and/or as two words of bitwise logical and and bitwise logical or. A few statistical moments (at least order 0 and 1, maybe 2 if multiplies can be tolerated) can also be captured. Certain bytecodes that interact with loops can be instrumented this way to allow optimistic range reduction at compile time. Candidates would be *aload, if*, *cmp*, get*, *newarray, and arraylength. If references that are non-receiver method arguments or return values are profiled, the profiling could be extended to primitives. (See JDK-6919064.) If the cost (space or time) of gathering this data is prohibitive, consider doing it only in tier one compiled code. (See JDK-8015416.)