[Newcompiler] Compiling the decompilable

Klaus D. Witzel klaus.witzel at cobss.com
Sat Oct 14 12:40:01 UTC 2006


On Fri, 13 Oct 2006 16:42:03 +0200, Mathieu Suen wrote:
> Klaus D. Witzel a écrit :
...
>> By reverting the testcases (from bytecode to source code) I plan to
>> arrive at a specification which covers "all possible" cases for the
>> decompiler.
>>
>
> Cool thanks

Attached is SourceCode2BytecodeTest.st which tests bytecode resulting from  
source code.

With the new compiler there are two cases red (store followed by pop does  
not combine to popAndStore).

...
>> 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.
>
> you mean MessageNode class>>#initialize.

Sure, thanks (oops :)

>
> All is done in the visitor see in Semantics category

Ah, ASTTranslator of RBProgramNodeVisitor, method #acceptMessageNode:,  
thank you.

Next is bytecode generated from #emitIfNode: ... #emitCaseNode: (formerly  
macros), then SourceCode2BytecodeTest is about to be complete.

>>
>> 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.

Note that SourceCode2BytecodeTest now does ClosureCompiler only, but  
message organization stuff is no longer called.

>> Thank you in advance, also for any comments/suggestions on my approach.

/Klaus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SourceCode2BytecodeTest.st
Type: application/octet-stream
Size: 30191 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20061014/f3f0b798/SourceCode2BytecodeTest-0001.obj


More information about the Newcompiler mailing list