[Vm-dev] VM Maker: VMMaker.oscog-eem.3272.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Nov 9 02:19:03 UTC 2022
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3272.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3272
Author: eem
Time: 8 November 2022, 6:18:42.856696 pm
UUID: ca692078-9694-4a01-8119-7a560f9060f4
Ancestors: VMMaker.oscog-eem.3271
Fix extreme optimism in resultExpressionCanFail:. The comversion may not fail, but the thing it is applied to can fail. Hence if the receiver hasEffect we have to allow for potential failure. Alas the fixup is done before inlining, which may result in an expression being foind not to have an effect (e.g. JPEGReadWriter2Plugin>>#compressStructSize) but that's the way the cookie crumbles.
Hence write ioHasClipboardData:inFormat: in a more natural form.
=============== Diff against VMMaker.oscog-eem.3271 ===============
Item was changed:
----- Method: ClipboardExtendedPlugin>>ioHasClipboardData:inFormat: (in category 'io') -----
ioHasClipboardData: clipboard inFormat: format
- | hasFormat |
self primitive: 'ioHasClipboardDataInFormat' parameters: #(Unsigned Oop).
(interpreterProxy isIntegerObject: format) ifTrue:
+ [^(self
+ sqPasteboard: clipboard asVoidPointer
+ hasDataInFormat: (interpreterProxy integerValueOf: format)) asBooleanObj].
- [hasFormat := self
- sqPasteboard: clipboard asVoidPointer
- hasDataInFormat: (interpreterProxy integerValueOf: format).
- interpreterProxy failed ifFalse:
- [^hasFormat asBooleanObj]].
(interpreterProxy isBytes: format) ifTrue:
+ [^(self
+ sqPasteboard: clipboard asVoidPointer
+ hasDataInFormat: (interpreterProxy firstIndexableField: format)
+ formatLength: (interpreterProxy byteSizeOf: format)) asBooleanObj].
- [hasFormat := self
- sqPasteboard: clipboard asVoidPointer
- hasDataInFormat: (interpreterProxy firstIndexableField: format)
- formatLength: (interpreterProxy byteSizeOf: format).
- interpreterProxy failed ifFalse:
- [^hasFormat asBooleanObj]].
interpreterProxy primitiveFailFor: PrimErrBadArgument!
Item was changed:
----- Method: SmartSyntaxPluginTMethod>>resultExpressionCanFail: (in category 'private') -----
resultExpressionCanFail: aTParseNode
"Neither asSmallIntegerObj nor asBooleanObj nor asPositiveIntegerObj can fail.
asPositiveIntegerObj maps to positive32BitIntegerFor: which uses
eeInstantiateSmallClassIndex:format:numSlots: which does not GC and does not fail."
aTParseNode isSend ifFalse:
[^true].
(#(asSmallIntegerObj asPositiveIntegerObj asBooleanObj nilObject trueObject falseObject) includes: aTParseNode selector) ifTrue:
+ [^aTParseNode receiver hasEffect].
- [^false].
(aTParseNode selector == #asOop:
and: [aTParseNode args first isVariable
and: [#('SmallInteger' 'Boolean') includes: aTParseNode args first name]]) ifTrue:
+ [^aTParseNode receiver hasEffect].
- [^false].
^true!
More information about the Vm-dev
mailing list