On 17 Jan 2012, at 22:40, Mariano Martinez Peck wrote:
1) From a design point of view, I think that CompiledMethodTrailer is the correct place where source code should be stored.
Why?
From my point of view, the source fits into the image, but does not belong into the CompiledMethod. CompiledMethod is the representation for execution purpose. Encoding it into the bytearray along the the bytecode just asks for trouble.
CompiledMethod should have a counter part, which can also carry all kind of other meta data. I bet there is something in the ring framework to represent methods that is not based on CompiledMethod. That is where I would put the code.
3) I think (I should measure it) that having source code in the image is faster, even thought that's the least I care about.
The finder is obviously faster... Other tools wont benefit as much, because the cost of reading a single method is insignificant. Refactorings which might need to read code, or recompile everything might benefit.
4) Ease the logic of pointers in the trailer... 5) Easy of versioning for a binary serializer ;) so for example in Fuel we can now be able to serialize compiled methods with trailer that have the source code. Hence, versioning it (Monticello) is easier.
I still do not see why you would want the extra complexity (with encoding and all) to put it into the ByteArray of compiled method. That makes everything harder, and one argument you might want to use, no, it does not guarantee consistency between the two parts. Putting the code into the image, yes, but not into the compiled method. At least I do not see any clear benefits. Best regards Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525