Marcel Taeumel uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-mt.406.mcz
==================== Summary ====================
Name: Compiler-mt.406
Author: mt
Time: 24 July 2019, 5:10:22.611145 pm
UUID: 6d65ea45-4488-471b-a9cf-b4a16cac35f3
Ancestors: Compiler-mt.405
Minor performance improvement for has-literal checks. Thanks to Levente for the ideas!
Still not sure about putting true/false/nil-checks to the top. Also not sure the complex return blocks for symbol/character/integer.
=============== Diff against Compiler-mt.405 ===============
Item was changed:
----- Method: BytecodeEncoder class>>canBeSpecialLiteral: (in category 'testing') -----
canBeSpecialLiteral: aLiteral
+ "This check can be used to prevent unnecessary use of #scanBlockOrNilForLiteral:. For performance, this method summarizes specializations from all known bytecode encoders. It is not meant to be refined per bytecode encoder."
- "This check can be used to prevent unnecessary use of #scanBlockOrNilForLiteral:. For performance, this method summarizes specializations from all known bytecode encoders. It is not meant to be refined per encoder."
+ aLiteral isSymbol ifTrue: [^ Smalltalk specialSelectors identityIncludes: aLiteral].
+ aLiteral isCharacter ifTrue: [^ aLiteral asInteger <= 65535].
+ aLiteral isInteger ifTrue: [^ aLiteral between: -32768 and: 32767].
+
+ aLiteral == true ifTrue: [^ true].
+ aLiteral == false ifTrue: [^ true].
+ aLiteral == nil ifTrue: [^ true].
+
+ ^ false!
- ^ ((((((aLiteral isSymbol and: [Smalltalk specialSelectors includes: aLiteral])
- or: [aLiteral isInteger and: [aLiteral between: -32768 and: 32767]])
- or: [aLiteral isCharacter and: [aLiteral asInteger <= 65535]])
- or: [aLiteral == true])
- or: [aLiteral == false])
- or: [aLiteral == nil])!
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1250.mcz
==================== Summary ====================
Name: Kernel-mt.1250
Author: mt
Time: 24 July 2019, 11:44:15.067109 am
UUID: 00753086-db4b-4706-bde7-c6d5ea190c04
Ancestors: Kernel-mt.1249
Speeds up deletion of class variables or shared pools.
=============== Diff against Kernel-mt.1249 ===============
Item was changed:
----- Method: Behavior>>whichSelectorsReferTo: (in category 'testing method dictionary') -----
whichSelectorsReferTo: literal
+ "Answer a Set of selectors whose methods access the argument as a literal. Note that we cannot use #systemNavigation because this method should not depend on the 'System' package."
- "Answer a Set of selectors whose methods access the argument as a literal."
+ | who canBeSpecial |
+ canBeSpecial := BytecodeEncoder canBeSpecialLiteral: literal.
- | who |
who := IdentitySet new.
self selectorsAndMethodsDo: [:selector :method |
+ (method hasLiteral: literal scanForSpecial: canBeSpecial)
- (method hasLiteral: literal)
ifTrue: [who add: selector]].
^ who
"Rectangle whichSelectorsReferTo: #+."!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1075.mcz
==================== Summary ====================
Name: System-mt.1075
Author: mt
Time: 24 July 2019, 11:18:57.127109 am
UUID: 6b2a8705-b2bc-46c3-8dea-34873ae97d6e
Ancestors: System-mt.1074
Speed up search for senders based on Compiler-mt.405 and Kernel-mt.1249.
=============== Diff against System-mt.1074 ===============
Item was changed:
----- Method: SystemNavigation>>allCallsOn:fromBehaviors:sorted: (in category 'query') -----
allCallsOn: aLiteral fromBehaviors: behaviors sorted: sorted
"Answer a collection of all the methods implemented by behaviors that call on aLiteral even deeply embedded in literal arrays."
+ | result canBeSpecial |
- | result |
result := OrderedCollection new.
+ canBeSpecial := BytecodeEncoder canBeSpecialLiteral: aLiteral.
behaviors do: [:behavior |
behavior selectorsAndMethodsDo: [:selector :method |
+ (method hasLiteral: aLiteral scanForSpecial: canBeSpecial)
- (method hasLiteral: aLiteral)
ifTrue: [result addLast: method methodReference]]].
sorted ifTrue: [result sort].
^result!
Item was changed:
----- Method: SystemNavigation>>allCallsOn:fromMethodReferences:sorted: (in category 'query') -----
allCallsOn: aLiteral fromMethodReferences: methodReferences sorted: sorted
"Answer a collection of all the methods implemented by behaviors that call on aLiteral even deeply embedded in literal arrays."
+ | result canBeSpecial |
+ canBeSpecial := BytecodeEncoder canBeSpecialLiteral: aLiteral.
- | result |
result := methodReferences select: [:reference |
reference compiledMethod
ifNil: [false]
+ ifNotNil: [:method | method hasLiteral: aLiteral scanForSpecial: canBeSpecial]].
- ifNotNil: [:method | method hasLiteral: aLiteral]].
sorted ifTrue: [result sort].
^result!
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1249.mcz
==================== Summary ====================
Name: Kernel-mt.1249
Author: mt
Time: 24 July 2019, 11:17:56.945109 am
UUID: 5eb63b7e-5e78-45cf-a338-98326b5f26a4
Ancestors: Kernel-fn.1248
Uses special-literal check from Compiler-mt.405 to speed up #hasLiteral:.
=============== Diff against Kernel-fn.1248 ===============
Item was changed:
----- Method: CompiledCode>>hasLiteral: (in category 'literals') -----
hasLiteral: aLiteral
+ "Overwrite this method to invoke the bytecode encoder scanner explicitely. This might be removed if there would be a way to enumerate special literals in a compiled-code object. See #allLiteralsDo:."
- "Since we cannot enumerate this code's special literals, we have to overwrite this method to invoke the encoder scanner explicitely."
+ ^ self
+ hasLiteral: aLiteral
+ scanForSpecial: (BytecodeEncoder canBeSpecialLiteral: aLiteral)!
- | scanBlock |
- (super hasLiteral: aLiteral) ifTrue: [^ true].
-
- scanBlock := self class
- scanBlocksForLiteral: aLiteral
- do: [:primaryScanner :secondaryScanner |
- "E.g., scanner for SistaV1 or scanner for V3PlusClosures"
- self signFlag ifTrue: [secondaryScanner] ifFalse: [primaryScanner]].
-
- self codeLiteralsDo: [:compiledCode |
- (compiledCode scanFor: scanBlock) ifTrue: [^ true]].
-
- ^ false!
Item was added:
+ ----- Method: CompiledCode>>hasLiteral:scanForSpecial: (in category 'literals') -----
+ hasLiteral: aLiteral scanForSpecial: aBoolean
+ "Like #hasLiteral: but can scan for encoder-specific special literals. Not that scanning has a noticeable performance impact."
+
+ | scanBlock |
+ (super hasLiteral: aLiteral) ifTrue: [^ true].
+
+ aBoolean ifFalse: [^ false].
+
+ scanBlock := self class
+ scanBlocksForLiteral: aLiteral
+ do: [:primaryScanner :secondaryScanner |
+ "E.g., scanner for SistaV1 or scanner for V3PlusClosures"
+ self signFlag ifTrue: [secondaryScanner] ifFalse: [primaryScanner]].
+
+ self codeLiteralsDo: [:compiledCode |
+ (compiledCode scanFor: scanBlock) ifTrue: [^ true]].
+
+ ^ false!
Marcel Taeumel uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-mt.405.mcz
==================== Summary ====================
Name: Compiler-mt.405
Author: mt
Time: 24 July 2019, 11:17:04.167109 am
UUID: 7354b36e-2509-4f23-b110-1b9cfe0310d2
Ancestors: Compiler-mt.404
Adds message to avoid costly byte-code scanning for has-literal checks.
Note that ((... or: [...]) or: [...] ...) is a little bit faster to evaluate to false than (... or: [ ... or: [ ... ] ] ). I would suspect not but deeply nested blocks seem to have an interesting effect here.
=============== Diff against Compiler-mt.404 ===============
Item was added:
+ ----- Method: BytecodeEncoder class>>canBeSpecialLiteral: (in category 'testing') -----
+ canBeSpecialLiteral: aLiteral
+ "This check can be used to prevent unnecessary use of #scanBlockOrNilForLiteral:. For performance, this method summarizes specializations from all known bytecode encoders. It is not meant to be refined per encoder."
+
+ ^ ((((((aLiteral isSymbol and: [Smalltalk specialSelectors includes: aLiteral])
+ or: [aLiteral isInteger and: [aLiteral between: -32768 and: 32767]])
+ or: [aLiteral isCharacter and: [aLiteral asInteger <= 65535]])
+ or: [aLiteral == true])
+ or: [aLiteral == false])
+ or: [aLiteral == nil])!
Fabio Niephaus uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-fn.847.mcz
==================== Summary ====================
Name: Collections-fn.847
Author: fn
Time: 24 July 2019, 9:23:16.683899 am
UUID: 22fbf3f6-8234-41df-9de5-a38187e659c6
Ancestors: Collections-mt.846
Remove redundant methods for copying from Character (following Chris' suggestion at http://forum.world.st/The-Trunk-Kernel-fn-1223-mcz-tp5098738p5098777.html).
=============== Diff against Collections-mt.846 ===============
Item was removed:
- ----- Method: Character>>copy (in category 'copying') -----
- copy
- "Answer the receiver, because Characters are unique."
- ^self!
Item was removed:
- ----- Method: Character>>postCopy (in category 'copying') -----
- postCopy
- "I will never be copied"
- ^self shouldNotImplement!
Fabio Niephaus uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-fn.1248.mcz
==================== Summary ====================
Name: Kernel-fn.1248
Author: fn
Time: 24 July 2019, 9:22:31.501089 am
UUID: 47f4c2b8-f623-4973-bcb3-655d27fbc0dc
Ancestors: Kernel-ul.1247
Remove redundant methods for copying from SmallFloat64 and SmallInteger (following Chris' suggestion at http://forum.world.st/The-Trunk-Kernel-fn-1223-mcz-tp5098738p5098777.html).
=============== Diff against Kernel-ul.1247 ===============
Item was removed:
- ----- Method: SmallFloat64>>copy (in category 'copying') -----
- copy
- "Answer the receiver, because SmallFloat64s are unique."
- ^self!
Item was removed:
- ----- Method: SmallFloat64>>postCopy (in category 'copying') -----
- postCopy
- "I will never be copied"
- ^self shouldNotImplement!
Item was removed:
- ----- Method: SmallInteger>>copy (in category 'copying') -----
- copy
- "Answer the receiver, because SmallIntegers are unique."
- ^self!
Item was removed:
- ----- Method: SmallInteger>>postCopy (in category 'copying') -----
- postCopy
- "I will never be copied"
- ^self shouldNotImplement!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.846.mcz
==================== Summary ====================
Name: Collections-mt.846
Author: mt
Time: 23 July 2019, 9:33:10.753815 am
UUID: 0e0c1523-750b-9148-80c2-8730995b997d
Ancestors: Collections-mt.845
Fixes #collect:as: for Set into Dictionary. See CollectionsTests-pre.314.
Thanks to Levente for the idea!
=============== Diff against Collections-mt.845 ===============
Item was changed:
----- Method: Dictionary>>fillFrom:with: (in category 'private') -----
fillFrom: aCollection with: aBlock
"Evaluate aBlock with each of aCollections's elements as the argument.
Collect the resulting values into self. Answer self."
+ aCollection isDictionary
+ ifFalse:
- aCollection isSequenceable
- ifTrue:
[aCollection associationsDo:
[ :element | self add: (aBlock value: element)]]
+ ifTrue:
- ifFalse:
[aCollection keysAndValuesDo:
[ :key :value | self at: key put: (aBlock value: value)]]!
Levente Uzonyi uploaded a new version of ShoutTests to project The Trunk:
http://source.squeak.org/trunk/ShoutTests-ul.29.mcz
==================== Summary ====================
Name: ShoutTests-ul.29
Author: ul
Time: 19 July 2019, 12:12:23.29542 am
UUID: 0a0cf788-d9f5-4089-838a-b32342d3b21d
Ancestors: ShoutTests-ul.28
SHParserST80 >> #fail doesn't generate an empty range with type #excessCode anymore if the whole source was parsed.
=============== Diff against ShoutTests-ul.28 ===============
Item was changed:
----- Method: SHParserST80Test>>testNumbers (in category 'tests') -----
(excessive size, no diff calculated)