Dave Lewis uploaded a new version of VMMaker to project VM Maker: http://www.squeaksource.com/VMMaker/VMMaker-dtl.194.mcz
==================== Summary ====================
Name: VMMaker-dtl.194 Author: dtl Time: 19 October 2010, 11:52:12 am UUID: 9dd94fba-0da6-49f7-820c-9af777558bb7 Ancestors: VMMaker-dtl.193
VMMaker 4.3.8
Adopt CCodeGenerator improvements from oscog, notably including proper C code generation for ifTrue:ifFalse: constructs as expressions, as well as methods used in Cog code generation. Produces equivalent C code for the traditional interpreter, modulo some cosmetic differences in the output (line breaks, spaces, etc).
Notes:
Added #asExpression to TSendNode>>emitCCodeAsArgumentOn:level:generator: needed for cpp code generation for expressions.
Methods #generateInlineCPreprocessorDirective:on:indent: and #generateCppDirective:on:indent: are redundant, get rid of one (or both) of them. Consider using #isDefined:inSmalltalk:comment:ifTrue:ifFalse: instead in Cog.
On Tue, Oct 19, 2010 at 10:55 PM, < squeak-dev-noreply@lists.squeakfoundation.org> wrote:
Dave Lewis uploaded a new version of VMMaker to project VM Maker: http://www.squeaksource.com/VMMaker/VMMaker-dtl.194.mcz
==================== Summary ====================
Name: VMMaker-dtl.194 Author: dtl Time: 19 October 2010, 11:52:12 am UUID: 9dd94fba-0da6-49f7-820c-9af777558bb7 Ancestors: VMMaker-dtl.193
VMMaker 4.3.8
Adopt CCodeGenerator improvements from oscog, notably including proper C code generation for ifTrue:ifFalse: constructs as expressions, as well as methods used in Cog code generation. Produces equivalent C code for the traditional interpreter, modulo some cosmetic differences in the output (line breaks, spaces, etc).
Notes:
Added #asExpression to TSendNode>>emitCCodeAsArgumentOn:level:generator: needed for cpp code generation for expressions.
Methods #generateInlineCPreprocessorDirective:on:indent: and #generateCppDirective:on:indent: are redundant, get rid of one (or both) of them. Consider using #isDefined:inSmalltalk:comment:ifTrue:ifFalse: instead in Cog.
Ooh! I like it. Why didn't I think of this? Make it so. The cPreprocessorDirective: was my most egregious hack. But I would just use #ifDefined: aPreprocessorMacroName ifTrue: [] ifFalse: [] and then use cCode:inSmalltalk: within each arm as appropriate rather than conflating the two.
best Eliot
On Wed, Oct 20, 2010 at 10:02:31AM -0700, Eliot Miranda wrote:
On Tue, Oct 19, 2010 at 10:55 PM, < squeak-dev-noreply@lists.squeakfoundation.org> wrote:
Added #asExpression to TSendNode>>emitCCodeAsArgumentOn:level:generator: needed for cpp code generation for expressions.
Methods #generateInlineCPreprocessorDirective:on:indent: and #generateCppDirective:on:indent: are redundant, get rid of one (or both) of them. Consider using #isDefined:inSmalltalk:comment:ifTrue:ifFalse: instead in Cog.
Ooh! I like it. Why didn't I think of this? Make it so. The cPreprocessorDirective: was my most egregious hack. But I would just use #ifDefined: aPreprocessorMacroName ifTrue: [] ifFalse: [] and then use cCode:inSmalltalk: within each arm as appropriate rather than conflating the two.
Hi Eliot,
The cCode:inSmalltalk: part actually works pretty well and translates nicely to C, see #isIntegerObject: for the most important example.
The following are already implemented in VMMaker "trunk". The first two are important, the third is unreferenced, and the fourth is both unreferenced and redundant with the oscog implementation. #isDefinedTrueExpression:inSmalltalk:comment:ifTrue:ifFalse: #isDefined:inSmalltalk:comment:ifTrue:ifFalse: #isDefined:inSmalltalk:comment:ifTrue: #preprocessorExpression:
The #cPreprocessorDirective: implementation is important for Cog, and is now implemented in both VMMaker branches (but could be replaced as noted above).
So my suggestion would be to add these into oscog: #isDefinedTrueExpression:inSmalltalk:comment:ifTrue:ifFalse: #isDefined:inSmalltalk:comment:ifTrue:ifFalse: #isDefined:inSmalltalk:comment:ifTrue:
And then get rid of #preprocessorExpression: in favor of your #cPreprocessorDirective:
As a practical matter, I'm not sure the best way to include this in the oscog branch. I can send a change set if that is helpful, or you can pick updates from Montecello. Unless you advise otherwise, I don't think that I should make any commits to the oscog branch, as that is likely to lead to confusion.
Dave
vm-dev@lists.squeakfoundation.org