[Vm-dev] VM Maker: VMMaker.oscog-eem.1450.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Sep 14 21:21:28 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1450.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1450
Author: eem
Time: 14 September 2015, 2:19:15.875 pm
UUID: a7ae1719-23fb-488d-943d-5c5ca08af59c
Ancestors: VMMaker.oscog-eem.1449
Fix a typo in the Matrix2x3Plugin (thanks Nicolai).
Eliminate || (0) and && (1) from generated C.
=============== Diff against VMMaker.oscog-eem.1449 ===============
Item was changed:
----- Method: CCodeGenerator>>generateSequentialAnd:on:indent: (in category 'C translation') -----
generateSequentialAnd: msgNode on: aStream indent: level
"Generate the C code for this message onto the given stream."
(self nilOrBooleanConstantReceiverOf: msgNode receiver)
ifNil:
[self emitCExpression: msgNode receiver on: aStream indent: level.
+ "Don't eliminate the first expression if the second one is false, because of potential side-effects;
+ leave that to the C compiler. But /do/ eliminate the second expression if it is vaccuously true."
+ (self nilOrBooleanConstantReceiverOf: msgNode args first) ifNotNil:
+ [:const| const == true ifTrue: [^self]].
aStream crtab: level; nextPutAll: ' && ('.
self emitCTestBlock: msgNode args first on: aStream indent: level.
aStream nextPut: $)]
ifNotNil:
[:const |
const
ifTrue: [self emitCTestBlock: msgNode args first on: aStream indent: level]
ifFalse: [aStream nextPut: $0]]!
Item was changed:
----- Method: CCodeGenerator>>generateSequentialOr:on:indent: (in category 'C translation') -----
generateSequentialOr: msgNode on: aStream indent: level
"Generate the C code for this message onto the given stream."
"Note: PP 2.3 compiler produces two arguments for or:, presumably
to help with inlining later. Taking the last agument should do the correct
thing even if your compiler is different."
(self nilOrBooleanConstantReceiverOf: msgNode receiver)
ifNil:
[self emitCExpression: msgNode receiver on: aStream indent: level.
+ "Don't eliminate the first expression if the second one is true, because of potential side-effects;
+ leave that to the C compiler. But /do/ eliminate the second expression if it is vaccuously false."
+ (self nilOrBooleanConstantReceiverOf: msgNode args last) ifNotNil:
+ [:const| const == false ifTrue: [^self]].
aStream crtab: level; nextPutAll: ' || ('.
self emitCTestBlock: msgNode args last on: aStream indent: level.
aStream nextPut: $)]
ifNotNil:
[:const |
const
ifTrue: [aStream nextPut: $1]
+ ifFalse: [self emitCTestBlock: msgNode args last on: aStream indent: level]]!
- ifFalse: [self emitCTestBlock: msgNode args first on: aStream indent: level]]!
Item was changed:
----- Method: Matrix2x3Plugin>>okayIntValue: (in category 'private') -----
okayIntValue: value
^(value >= interpreterProxy minSmallInteger asFloat
+ and: [value <= interpreterProxy maxSmallInteger asFloat])!
- and: [m23ResultX <= interpreterProxy maxSmallInteger asFloat])!
More information about the Vm-dev
mailing list