[code-reflection] Withdrawn: Model uninitialized variables

Paul Sandoz psandoz at openjdk.org
Thu Oct 24 23:03:19 UTC 2024


On Wed, 23 Oct 2024 22:45:52 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> Uninitialized variables are currently modeled as if they are variables initialized with a default value.
> 
> To directly model uninitialized variables we introduce the undefined value operation. This operation has a result that is an undefined value whose type is the undefined type. Such a value can be used as the init operand of a var operation. Thereby we can distinguish between the modeling of uninitialized variables and variables initialized with a default value.
> 
> The approach of using a special value means there are very little changes to code operating on models, and undefined values can be tracked. For example, there were no changes required to the SSA transformation. Although, we should update that transformation to check if a value being used is an unitialized value, and if so throw an exception that the variable is not definitely assigned.
> 
> A value of the undefined type holds another value of the undefined type's value type, but we don't know what the actual value is and nor can we obtain it.

This pull request has been closed without being integrated.

-------------

PR: https://git.openjdk.org/babylon/pull/263


More information about the babylon-dev mailing list