GLOBAL_VARIABLE
Content copied to clipboard
A global variable. It's serialized as the type, the module that defined it, the variable's name within that module, and a flag byte.
The flag byte has these fields:
Whether this is a write-once variable.
Whether the write-once variable's value was computed by a stable computation.
A global variable is marked as such when constructed by the compiler. The write-once flag is also specified at that time as well. To reconstruct a global variable, it's simply looked up by name in its defining module. The variable must exist (or the serialization is malformed), so modules must ensure all their global variables and constants are reconstructed when loading from serialized form.