[Vm-dev] VM Maker: VMMaker.oscog-eem.3273.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Nov 9 02:35:09 UTC 2022
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3273.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3273
Author: eem
Time: 8 November 2022, 6:34:50.040353 pm
UUID: 30e9f70f-d76a-4d63-810b-6059fd62055e
Ancestors: VMMaker.oscog-eem.3272
Have TSendNode>>hasEffect answer false for sizeof:.
Use sizeof: directly in JPEGReadWriter2Plugin to get less junk code.
=============== Diff against VMMaker.oscog-eem.3272 ===============
Item was removed:
- ----- Method: JPEGReadWriter2Plugin>>compressStructSize (in category 'plugin support') -----
- compressStructSize
- <inline: #always>
- ^self
- cCode: [self sizeof: #'struct jpeg_compress_struct']
- inSmalltalk: [JPEGReadWriter2 new primJPEGCompressStructSize]!
Item was removed:
- ----- Method: JPEGReadWriter2Plugin>>decompressStructSize (in category 'plugin support') -----
- decompressStructSize
- <inline: #always>
- ^self
- cCode: [self sizeof: #'struct jpeg_decompress_struct']
- inSmalltalk: [JPEGReadWriter2 new primJPEGDecompressStructSize]!
Item was removed:
- ----- Method: JPEGReadWriter2Plugin>>errorMgr2StructSize (in category 'plugin support') -----
- errorMgr2StructSize
- <inline: #always>
- ^self
- cCode: [self sizeof: #'struct error_mgr2']
- inSmalltalk: [JPEGReadWriter2 new primJPEGErrorMgr2StructSize]!
Item was changed:
----- Method: JPEGReadWriter2Plugin>>isValidCompressionStruct: (in category 'plugin support') -----
isValidCompressionStruct: aByteArray
<inline: #always>
+ ^(interpreterProxy byteSizeOf: aByteArray cPtrAsOop) >= (self sizeof: #'struct jpeg_compress_struct')!
- ^(interpreterProxy byteSizeOf: aByteArray cPtrAsOop) >= self compressStructSize!
Item was changed:
----- Method: JPEGReadWriter2Plugin>>isValidDecompressionStruct: (in category 'plugin support') -----
isValidDecompressionStruct: aByteArray
<inline: #always>
+ ^(interpreterProxy byteSizeOf: aByteArray cPtrAsOop) >= (self sizeof: #'struct jpeg_decompress_struct')!
- ^(interpreterProxy byteSizeOf: aByteArray cPtrAsOop) >= self decompressStructSize!
Item was changed:
----- Method: JPEGReadWriter2Plugin>>isValidErrorMessageStruct: (in category 'plugin support') -----
isValidErrorMessageStruct: aByteArray
<inline: #always>
+ ^(interpreterProxy byteSizeOf: aByteArray cPtrAsOop) >= (self sizeof: #'struct error_mgr2')!
- ^(interpreterProxy byteSizeOf: aByteArray cPtrAsOop) >= self errorMgr2StructSize!
Item was changed:
----- Method: JPEGReadWriter2Plugin>>primJPEGCompressStructSize (in category 'primitives') -----
primJPEGCompressStructSize
<export: true>
self primitive: #primJPEGCompressStructSize parameters: #().
+ ^(self sizeof: #'struct jpeg_compress_struct') asSmallIntegerObj!
- ^self compressStructSize asOop: SmallInteger!
Item was changed:
----- Method: JPEGReadWriter2Plugin>>primJPEGDecompressStructSize (in category 'primitives') -----
primJPEGDecompressStructSize
<export: true>
self primitive: #primJPEGDecompressStructSize parameters: #().
+ ^(self sizeof: #'struct jpeg_decompress_struct') asSmallIntegerObj!
- ^self decompressStructSize asOop: SmallInteger!
Item was changed:
----- Method: JPEGReadWriter2Plugin>>primJPEGErrorMgr2StructSize (in category 'primitives') -----
primJPEGErrorMgr2StructSize
<export: true>
self primitive: #primJPEGErrorMgr2StructSize parameters: #().
+ ^(self sizeof: #'struct error_mgr2') asSmallIntegerObj!
- ^self errorMgr2StructSize asOop: SmallInteger!
Item was added:
+ ----- Method: JPEGReadWriter2Plugin>>sizeof: (in category 'simulation') -----
+ sizeof: aSymbol
+ <doNotGenerate>
+ ^aSymbol
+ caseOf: {
+ [self sizeof: #'struct jpeg_compress_struct'] -> [JPEGReadWriter2 new primJPEGCompressStructSize].
+ [self sizeof: #'struct jpeg_decompress_struct'] -> [JPEGReadWriter2 new primJPEGDecompressStructSize].
+ [self sizeof: #'struct error_mgr2'] -> [JPEGReadWriter2 new primJPEGErrorMgr2StructSize] }
+ otherwise: [super sizeof: aSymbol]!
Item was changed:
----- Method: TSendNode>>hasEffect (in category 'testing') -----
hasEffect
"Answer if this node has an effect on execution state (does something).
Statements that don't have any effect can be elided if their value is unused."
selector == #not ifTrue:
[^receiver hasEffect].
selector == #cCode:inSmalltalk: ifTrue:
[^(arguments first isConstant and: [arguments first value isString and: [arguments first value notEmpty]])
or: [arguments first hasEffect]].
self isBinaryArithmeticOrConditional ifTrue:
[^receiver hasEffect or: [arguments first hasEffect]].
self isUnaryCast ifTrue:
[^receiver hasEffect].
+ (self isBinaryCast or: [selector == #sizeof:]) ifTrue:
- self isBinaryCast ifTrue:
[^arguments first hasEffect].
^true!
More information about the Vm-dev
mailing list