We have 2 options:
1/ parse and share.
2/ index and (share or parse+register).
Currently the first one is already implemented as a memory saving approach, as it used to be done in the past to save memory after loading the same script in a different runtime, such as for workers.
However, I think this approach is not sufficient, as the intent is also to remove the parse-time. While this might not be important on desktop, this apparently matters a lot on mobile, and especially with JSM.
Thus I think we should probably increase the amount of information stored in
ImmutableScriptData, or add an additional structure to reference source atoms locations, such that we can fully recover a
JSScript given only the
ScriptSource and immutable non-GC data.
(or this is just me not fully understanding what we currently have)