[Newcompiler] Compiling the decompilable
Klaus D. Witzel
klaus.witzel at cobss.com
Fri Oct 13 08:59:21 UTC 2006
List,
I have begun to writing tests for the cases which the new decompiler is
"expected" to handle. The tests contain a piece of source code, a request
for compiling that into bytecode and an assertion that the expected
bytecode was indeed generated (as observed by
InstructionStream>>#nextInstruction).
By reverting the testcases (from bytecode to source code) I plan to arrive
at a specification which covers "all possible" cases for the decompiler.
Attached is a first cut (incomplete). The cases where the i-th object is
referenced (i-th tempVar, i-th instVar, i-th literal) could be extended to
not only test a fixed index per bytecode, but all possible indices, if
you'd know of a good reason why this would be necessary.
In order to keep me busy I'd like you to email hints on where I should
look for macro transforms (macros as in the terminology of the old
compiler, see MessageNode>>#initialize). I will also write bytecode
assertion tests for the transforms.
I'm furthermore interested in suggestions for a shortcut for the following
sequence. The shortcut *must* be compatible with the old and the new
compiler and what I want is that the whole implicit & seemingly inevitable
message organization stuff be eliminated.
selector := self class compile:classified: nil withStamp: nil notifying:
nil logSource: false.
method := self class compiledMethodAt: selector.
self class removeSelectorSilently: selector.
Thank you in advance, also for any comments/suggestions on my approach.
/Klaus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Compile2BytecodeTest.st
Type: application/octet-stream
Size: 13237 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20061013/48ca341c/Compile2BytecodeTest.obj
More information about the Newcompiler
mailing list