Compiled methods: keep the source#13359
Conversation
…ot setup its default)
… because we hae the source
…#source (it makes more sense)
This reverts commit 5880d9b.
|
Hum, disassembler is required at bootstrap. This is weird, but out of scope of the PR. |
…onstants because we hae the source" This reverts commit 55d72ef.
|
Nice! The properties implementation for CompiledMethod is very arcane, it allocates an AdditionalMethodState Object, we should check if removing the last propery removes this. (memory use seems to imply that this is done ?) |
|
Yes, I looked at |
|
So I guess that all compiledMethods then have an empty AdditionalMethodState. I am travelling so and internet is so bad that I can not download the build artefact. |
Good remark. |
Losing source on uninstalled methods causes a lot of problems.
When the source code of a method is absent but required (for a lot of things, including transformation or debugging), the disassembler is invoked, and it has the following (anti)-features: 1. lose information (names of temps, for instance), 2. do not always give a source with equivalent AST (causing issue when associating AST node with pc), 3. Sometimes it just gives garbage.
Despite these issues, the lack of source also causes potential different behaviors on installed and uninstalled methods.
Moreover, most tests that rely on compiled methods never install them (because installing has system-wide implications).
There is a compiler option
optionEmbeddSourcesthat is automatically used it on faulty source code and scripts. If present, the compiler encodes the source code at the end of the compiled method (quite ugly, but is works). This was done because the decompiler cannot work on scripts or on faulty methods. But has the drawback of increasing the size of the method object by A LOT. It was considered acceptable because scripts and faulty methods are expected to be short living and garbage collected soon enough.Anyway, this added another hack in the presence or not of source code, and a lot of confusion.
The situation what painful enough when working on the AST translators (cf #13352) that I propose the current PR:
#source.#sourceis dropped (and will eventually be garbage collected).optionEmbeddSourcesare removed, because it is now unneeded.The option
optionEmbeddSourcesis still present. Maybe we can deprecate it.Note: The commit 'TOREMOVE' is intended to FAIL on tests that still need source but cannot find it. I want to see the result of the CI. I will remove it after.