The Trunk: Compiler-eem.280.mcz

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

The Trunk: Compiler-eem.280.mcz

commits-2
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.280.mcz

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

Name: Compiler-eem.280
Author: eem
Time: 12 May 2014, 11:29:30.127 am
UUID: f8e06e2d-2a56-40e8-9783-6b17b6ca0e2e
Ancestors: Compiler-nice.279

Get rid of the old
        ([:a :b|] value: #first value: #last) == #last
anachronism.  Now all empty blocks answer nil.

=============== Diff against Compiler-nice.279 ===============

Item was changed:
  ----- Method: BlockNode>>arguments:statements:returns:from: (in category 'initialize-release') -----
  arguments: argNodes statements: statementsCollection returns: returnBool from: encoder
  "Compile."
 
  arguments := argNodes.
  statements := statementsCollection size > 0
+ ifTrue: [statementsCollection]
+ ifFalse: [Array with: NodeNil].
- ifTrue: [statementsCollection]
- ifFalse: [argNodes size > 0
- ifTrue: [statementsCollection copyWith: arguments last]
- ifFalse: [Array with: NodeNil]].
  optimized := false.
  returns := returnBool!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-eem.280.mcz

Nicolas Cellier

2014-05-12 20:30 GMT+02:00 <[hidden email]>:
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.280.mcz

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

Name: Compiler-eem.280
Author: eem
Time: 12 May 2014, 11:29:30.127 am
UUID: f8e06e2d-2a56-40e8-9783-6b17b6ca0e2e
Ancestors: Compiler-nice.279

Get rid of the old
        ([:a :b|] value: #first value: #last) == #last
anachronism.  Now all empty blocks answer nil.

=============== Diff against Compiler-nice.279 ===============

Item was changed:
  ----- Method: BlockNode>>arguments:statements:returns:from: (in category 'initialize-release') -----
  arguments: argNodes statements: statementsCollection returns: returnBool from: encoder
        "Compile."

        arguments := argNodes.
        statements := statementsCollection size > 0
+                                       ifTrue: [statementsCollection]
+                                       ifFalse: [Array with: NodeNil].
-                               ifTrue: [statementsCollection]
-                               ifFalse: [argNodes size > 0
-                                               ifTrue: [statementsCollection copyWith: arguments last]
-                                               ifFalse: [Array with: NodeNil]].
        optimized := false.
        returns := returnBool!



Yeah, it even simplifies the code, so there is really no reason not to do it.
If ever someone complains that we dropped backward compatibility, we can now tell: you should not rely on undefined behavior
(a very popular sentence in {} world)