RFR: 8325859: potential information loss during type inference [v3]
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu May 15 18:08:51 UTC 2025
On Thu, 15 May 2025 17:28:18 GMT, Vicente Romero <vromero at openjdk.org> wrote:
> Another option, but I think it will be more complex, could be for the minimization algo to don't physically reduce the size of a given inference context but to make some variables "inactive" so that they won't participate in the propagation and resolution algos but they can be queried if needed
Yes, that would be another way to do it -- e.g. keep the outer inference context a strict superset of the nested one -- but make incorporation only touch few bits.
Which... leads me to a possible "interim" solution: when we create the min context, we know which variables are NOT going to be propagated out. Is there a way we can somehow save these variables on the outer context -- in separate lists? If we could do that, then `asInstTypes` only needs a small tweak to use the non-minimized variable list instead of the minimized one.
In a way we can decide whether to save a pointer to the original context, or whether to store all the actual vars (but in a separate place, so it won't be used by the other inference machinery). Maybe we should try both approaches and see which one leads to simpler code?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25011#issuecomment-2884664415
More information about the compiler-dev
mailing list