VM Maker: VMMaker.oscog-eem.2308.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2308.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2308.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2308
Author: eem
Time: 5 January 2018, 12:19:53.562181 am
UUID: 6c41bece-0d81-4a69-a677-bf6e8f275674
Ancestors: VMMaker.oscog-eem.2307

Slang:  Make TParseNode>>comment; do what it implies and accept a string argument, instead of insistign clients know the internal contract is a sequence of comment strings.

Tweak the recent inlining comment change; no need to comment if what's being inlined is a named constant.

=============== Diff against VMMaker.oscog-eem.2307 ===============

Item was changed:
  ----- Method: TMethod>>tryToInlineMethodExpressionsIn: (in category 'inlining') -----
  tryToInlineMethodExpressionsIn: aCodeGen
  "Expand any (complete) inline methods sent by this method as receivers or parameters.
  Answer if anything was inlined."
 
  | sendsToInline |
  sendsToInline := Dictionary new: 100.
  aCodeGen
  pushScope: declarations
  while: [parseTree
  nodesDo:
  [:node|
  (self inlineableFunctionCall: node in: aCodeGen) ifTrue:
  [(self inlineFunctionCall: node in: aCodeGen) ifNotNil:
  [:replacement|
+ (replacement isConstant
+  and: [replacement isDefine not
+  and: [replacement value isNumber
+  and: [replacement comment isNil]]]) ifTrue:
- (replacement isConstant and: [replacement value isNumber and: [replacement comment isNil]]) ifTrue:
  [replacement comment: node selector].
  sendsToInline at: node put: replacement]]]
  unless: "Don't inline the arguments to asserts to keep the asserts readable"
  [:node|
  node isSend
  and: [node selector == #cCode:inSmalltalk:
  or: [aCodeGen isAssertSelector: node selector]]]].
 
  sendsToInline isEmpty ifTrue:
  [^false].
  self replaceNodesIn: sendsToInline.
  ^true!

Item was changed:
  ----- Method: TParseNode>>comment: (in category 'accessing') -----
  comment: aComment
+ "Ugh,. comment is a sequence of strings."
+ comment := aComment isString ifTrue: [{aComment}] ifFalse: [aComment]!
-
- comment := aComment !

Reply | Threaded
Open this post in threaded view
|

Re: VM Maker: VMMaker.oscog-eem.2308.mcz

Eliot Miranda-2
 
Hi,

    ignore this one; it's a dud.  I got confused and committed a bogus version of TParseNode>>comment:.  VMMaker.oscog-eem.2309 is good though.  Apologies for the noise.

On Fri, Jan 5, 2018 at 12:20 AM, <[hidden email]> wrote:

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2308.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2308
Author: eem
Time: 5 January 2018, 12:19:53.562181 am
UUID: 6c41bece-0d81-4a69-a677-bf6e8f275674
Ancestors: VMMaker.oscog-eem.2307

Slang:  Make TParseNode>>comment; do what it implies and accept a string argument, instead of insistign clients know the internal contract is a sequence of comment strings.

Tweak the recent inlining comment change; no need to comment if what's being inlined is a named constant.

=============== Diff against VMMaker.oscog-eem.2307 ===============

Item was changed:
  ----- Method: TMethod>>tryToInlineMethodExpressionsIn: (in category 'inlining') -----
  tryToInlineMethodExpressionsIn: aCodeGen
        "Expand any (complete) inline methods sent by this method as receivers or parameters.
         Answer if anything was inlined."

        | sendsToInline |
        sendsToInline := Dictionary new: 100.
        aCodeGen
                pushScope: declarations
                while: [parseTree
                                        nodesDo:
                                                [:node|
                                                (self inlineableFunctionCall: node in: aCodeGen) ifTrue:
                                                        [(self inlineFunctionCall: node in: aCodeGen) ifNotNil:
                                                                [:replacement|
+                                                                (replacement isConstant
+                                                                 and: [replacement isDefine not
+                                                                 and: [replacement value isNumber
+                                                                 and: [replacement comment isNil]]]) ifTrue:
-                                                                (replacement isConstant and: [replacement value isNumber and: [replacement comment isNil]]) ifTrue:
                                                                        [replacement comment: node selector].
                                                                 sendsToInline at: node put: replacement]]]
                                        unless: "Don't inline the arguments to asserts to keep the asserts readable"
                                                [:node|
                                                node isSend
                                                and: [node selector == #cCode:inSmalltalk:
                                                        or: [aCodeGen isAssertSelector: node selector]]]].

        sendsToInline isEmpty ifTrue:
                [^false].
        self replaceNodesIn: sendsToInline.
        ^true!

Item was changed:
  ----- Method: TParseNode>>comment: (in category 'accessing') -----
  comment: aComment
+       "Ugh,. comment is a sequence of strings."
+       comment := aComment isString ifTrue: [{aComment}] ifFalse: [aComment]!
-
-       comment := aComment !




--
_,,,^..^,,,_
best, Eliot