On 20 Jun 2017, at 14:54, Jérémie Regnault <jeremie.regnault@outlook.com> wrote:
Hi,
I would like to know how to save modifications (e.g creating a class/method ) in the memory.
Classes: - Definitions: Classes are already in memory: the definition you see in the browser are kind of âdecompiledâ (created by the class object). Object definition - in addition it is logged to the .changes, but that is not needed to look at a class, it is just logged to have it in case of a crash before the image is saved. - Comments: they are in the .changes or .sources, classes point to them (via the organiser) using a RemoteString. (this is done by the class ClassOrganization ) Methods. - When you compile they point to the .changes or .sources via an offset that is at the end of the bytecode (the so called trailer). - there is code in the system to store instead of that pointer the whole code in the trailer. - methods can be created with embedded sources (not needing to store in .changes) by calling #generateWithSource instead of #generate on the AST root node. (this is used for Doit compilation right now). Methods that use a source pointer can be converted by calling #embeddSourceInTrailer on them. Marcus