-
Bug
-
Resolution: Future Project
-
P4
-
None
-
None
-
generic
-
generic
When large array initializers are split, their initializer expressions are not optimistic. It is currently not possible to have such initializers be subjected to deoptimizing recompilation. It is possible to introduce a transformation that will make individual ArrayUnit fragments into separate anonymous functions (similar to how optimistic splitter works), but since then the initializer expressions become part of assignments to array elements in separate statements in separate functions, a deoptimization in an expression won't inform the initial allocated type of the array. The consequence of this is that the array will always be allocated with the narrowest type allowed by its constant elements (the ones in the pre-set), and if any of the calculated (post-set) expressions deoptimize it further then its backing array will be widened on every initialization. If such arrays are only initialized once, then the overhead is insignificant, but for frequently evaluated large array literals, it might be a significant performance issue. (We can still do it that way.)
Longer term, we can try to figure out a way to communicate the optimistic array element type back into the top-level method that allocates the array. One way to do this is to introduce optimism at the array element type level, and have split fragments return underlying arrays, as then widening in the element type in a split fragment would cause deoptimization in the caller (array allocating) function too.
Longer term, we can try to figure out a way to communicate the optimistic array element type back into the top-level method that allocates the array. One way to do this is to introduce optimism at the array element type level, and have split fragments return underlying arrays, as then widening in the element type in a split fragment would cause deoptimization in the caller (array allocating) function too.
- relates to
-
JDK-8058884 Reconcile deoptimizing recompilation with code splitting
- Resolved