Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1419.mcz
==================== Summary ====================
Name: Kernel-eem.1419
Author: eem
Time: 21 October 2021, 12:02:22.351426 pm
UUID: c8e298e1-78ac-453c-8460-d89e539f636d
Ancestors: Kernel-eem.1418
Use bytecode set specific canBeSpecialLiteral: when checking if a method hasLiteral:.
=============== Diff against Kernel-eem.1418 ===============
Item was changed:
----- Method: CompiledCode>>hasLiteral: (in category 'literals') -----
hasLiteral: aLiteral
+ "Overwrite this method to invoke the bytecode encoder scanner explicitly. This might be removed if there would be a way to enumerate special literals in a compiled-code object. See #allLiteralsDo:."
- "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:."
^ self
hasLiteral: aLiteral
+ scanForSpecial: (self encoderClass canBeSpecialLiteral: aLiteral)!
- scanForSpecial: (BytecodeEncoder canBeSpecialLiteral: aLiteral)!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1244.mcz
==================== Summary ====================
Name: System-eem.1244
Author: eem
Time: 17 October 2021, 9:01:41.697469 pm
UUID: f8db54c3-2831-41f1-9335-e157b5a877a3
Ancestors: System-eem.1243
Give a more informative space left message which includes the amount of memory in use.
=============== Diff against System-eem.1243 ===============
Item was added:
+ ----- Method: SmalltalkImage>>bytesUsedString (in category 'memory space') -----
+ bytesUsedString
+ "Answer a string describing the amount of memory in use."
+ "Smalltalk bytesUsedString"
+ | totalUsed |
+ totalUsed := (self vmParameterAt: 2 "used eden + used past space")
+ + ((self vmParameterAt: 1 "old space size") - (self vmParameterAt: 54 "free old space")).
+ ^totalUsed asStringWithCommas, ' bytes in use'!
Item was changed:
----- Method: Utilities class>>garbageCollectAndReport (in category 'miscellaneous') -----
garbageCollectAndReport
"Do a garbage collection, and report results to the user."
| reportString |
reportString := String streamContents:
[:aStream |
aStream
nextPutAll: 'The following amounts of memory are still available:' translated;
+ crtab.
+ aStream nextPutAll: (Smalltalk bytesLeftString copyReplaceAll: (String with: Character cr) with: (String with: Character cr with: Character tab)).
+ aStream skip: -1; nextPutAll: Smalltalk bytesUsedString.
- cr.
- aStream nextPutAll: Smalltalk bytesLeftString.
Smalltalk at: #Command ifPresent:
[:cmdClass | | cc |
(cc := cmdClass instanceCount) > 0 ifTrue:
[aStream
+ cr; cr;
- cr;
nextPutAll: '(note: there are ';
print: cc;
nextPutAll: ' undo record(s) present in your';
cr;
nextPutAll: 'system; purging them may free up more space.)']]].
self inform: reportString
!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1784.mcz
==================== Summary ====================
Name: Morphic-eem.1784
Author: eem
Time: 17 October 2021, 11:34:29.99006 am
UUID: 7e3f944d-18fc-4a6f-bb86-03c8037ec775
Ancestors: Morphic-mt.1783
Text editing bug fixes.
A paragraph may not have been composed when interrogated for test and/or graphic coordinates.
A TextEditor for a Transcript may have no history but still be asked to openTypeInFor:/closeTypeIn:.
=============== Diff against Morphic-mt.1783 ===============
Item was changed:
----- Method: NewParagraph>>fastFindFirstLineSuchThat: (in category 'private') -----
fastFindFirstLineSuchThat: lineBlock
"Perform a binary search of the lines array and return the index
of the first element for which lineBlock evaluates as true.
This assumes the condition is one that goes from false to true for
increasing line numbers (as, eg, yval > somey or start char > somex).
If lineBlock is not true for any element, return size+1."
+ lines ifNil:
+ [self composeAll].
-
^lines
findBinaryIndex: [ :each |
(lineBlock value: each)
ifTrue: [ -1 ]
ifFalse: [ 1 ] ]
ifNone: [ :lower :upper | upper ]!
Item was changed:
----- Method: TextEditor>>closeTypeIn (in category 'typing support') -----
closeTypeIn
"See comment in openTypeIn. It is important to call closeTypeIn before executing
any non-typing key, making a new selection, etc. It is called automatically for
menu commands."
| begin stop |
+ beginTypeInIndex ifNotNil:
+ [begin := beginTypeInIndex.
- beginTypeInIndex ifNotNil: [
- begin := beginTypeInIndex.
stop := self stopIndex.
+ self history ifNotNil:
+ [:myHistory|
+ myHistory current
+ contentsAfter: (stop <= begin
+ ifTrue: [self nullText]
+ ifFalse: [paragraph text copyFrom: begin to: stop-1]);
+ intervalAfter: (stop to: stop-1);
+ intervalBetween: (stop < begin
+ ifTrue: [stop to: stop-1]
+ ifFalse: [begin to: stop-1]);
+ messageToUndo: (Message selector: #undoAndReselect);
+ messageToRedo: (Message selector: #redoAndReselect).
+
+ myHistory finishRemember].
- self history current
- contentsAfter: (stop <= begin
- ifTrue: [self nullText]
- ifFalse: [paragraph text copyFrom: begin to: stop-1]);
- intervalAfter: (stop to: stop-1);
- intervalBetween: (stop < begin
- ifTrue: [stop to: stop-1]
- ifFalse: [begin to: stop-1]);
- messageToUndo: (Message selector: #undoAndReselect);
- messageToRedo: (Message selector: #redoAndReselect).
-
- self history finishRemember.
beginTypeInIndex := nil]!
Item was changed:
----- Method: TextEditor>>openTypeInFor: (in category 'typing support') -----
openTypeInFor: editType
"Set up UndoSelection to null text (to be added to by readKeyboard and backTo:),
beginTypeInBlock to keep track of the leftmost backspace, and UndoParameter to tally
how many deleted characters were backspaced over rather than 'cut'.
You can't undo typing until after closeTypeIn."
+ beginTypeInIndex ifNil:
+ [beginTypeInIndex := self startIndex.
+ self history ifNotNil:
+ [:myHistory|
+ myHistory beginRemember:
+ (TextEditorCommand new
+ type: editType;
+ contentsBefore: (self hasSelection ifTrue: [self selection] ifFalse: [self nullText]);
+ intervalBefore: (beginTypeInIndex to: self stopIndex-1)
+ yourself)]]!
- beginTypeInIndex ifNil: [
- beginTypeInIndex := self startIndex.
- self history beginRemember: (TextEditorCommand new
- type: editType;
- contentsBefore: (self hasSelection ifTrue: [self selection] ifFalse: [self nullText]);
- intervalBefore: (beginTypeInIndex to: self stopIndex-1)
- yourself)].!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1243.mcz
==================== Summary ====================
Name: System-eem.1243
Author: eem
Time: 9 October 2021, 6:04:14.414339 pm
UUID: e670b073-df3e-460e-a8fe-a019a11bede8
Ancestors: System-eem.1242
oops; fix slip in shared pool search.
=============== Diff against System-eem.1242 ===============
Item was changed:
----- Method: SystemNavigation>>allUnreferencedClassVariablesOf: (in category 'query') -----
allUnreferencedClassVariablesOf: aClass
"Answer a list of the names of all the receiver's unreferenced class vars,
including those defined in superclasses."
| unusedClassVars sequence |
aClass isMeta ifTrue:
[^self allUnreferencedClassVariablesOf: aClass theNonMetaClass].
unusedClassVars := Set new.
aClass withAllSuperclasses do:
[:class| unusedClassVars addAll: class classPool associations].
(aClass includesBehavior: SharedPool)
ifTrue:
[self allSelectorsAndMethodsDo:
+ [:b :s :m|
- [:s :m|
m allLiteralsDo: [:l| l isVariableBinding ifTrue: [unusedClassVars remove: l ifAbsent: nil]]]]
ifFalse:
[aClass withAllSuperclasses, (aClass withAllSuperclasses collect: [:class| class class]) do:
[:behavior |
behavior selectorsAndMethodsDo:
[:s :m|
m allLiteralsDo: [:l| l isVariableBinding ifTrue: [unusedClassVars remove: l ifAbsent: nil]]].
unusedClassVars isEmpty ifTrue: [^OrderedCollection new]]].
"now compute the order in which to present the unused varables..."
sequence := OrderedCollection new.
aClass withAllSuperclasses reverseDo:
[:aSuperClass |
sequence addAll: (aSuperClass classVarNames select:
[:classVarName|
unusedClassVars includes: (aSuperClass classPool associationAt: classVarName)])].
^sequence!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1242.mcz
==================== Summary ====================
Name: System-eem.1242
Author: eem
Time: 9 October 2021, 5:56:44.727952 pm
UUID: c64c4476-34da-4974-b440-833417d434a3
Ancestors: System-mt.1241
Make searching for unused class vars single-pass. With the new search for implicit literals multi-pass searches for unused class vars can be rather slow.
Provide a convenience to find all pragma selectors.
=============== Diff against System-mt.1241 ===============
Item was added:
+ ----- Method: SystemNavigation>>allPragmaSelectors (in category 'query') -----
+ allPragmaSelectors
+ "Answer the set of all pragma selectors."
+ "self systemNavigation allPragmaSelectors asArray sort"
+
+ | result |
+ result := Set new.
+ self allSelectorsAndMethodsDo:
+ [:behavior :selector :method |
+ method pragmas do:
+ [:pragma|
+ result add: pragma keyword]].
+ ^result!
Item was changed:
----- Method: SystemNavigation>>allUnreferencedClassVariablesOf: (in category 'query') -----
allUnreferencedClassVariablesOf: aClass
+ "Answer a list of the names of all the receiver's unreferenced class vars,
+ including those defined in superclasses."
+ | unusedClassVars sequence |
+ aClass isMeta ifTrue:
+ [^self allUnreferencedClassVariablesOf: aClass theNonMetaClass].
+ unusedClassVars := Set new.
+ aClass withAllSuperclasses do:
+ [:class| unusedClassVars addAll: class classPool associations].
+ (aClass includesBehavior: SharedPool)
+ ifTrue:
+ [self allSelectorsAndMethodsDo:
+ [:s :m|
+ m allLiteralsDo: [:l| l isVariableBinding ifTrue: [unusedClassVars remove: l ifAbsent: nil]]]]
+ ifFalse:
+ [aClass withAllSuperclasses, (aClass withAllSuperclasses collect: [:class| class class]) do:
+ [:behavior |
+ behavior selectorsAndMethodsDo:
+ [:s :m|
+ m allLiteralsDo: [:l| l isVariableBinding ifTrue: [unusedClassVars remove: l ifAbsent: nil]]].
+ unusedClassVars isEmpty ifTrue: [^OrderedCollection new]]].
+ "now compute the order in which to present the unused varables..."
+ sequence := OrderedCollection new.
+ aClass withAllSuperclasses reverseDo:
+ [:aSuperClass |
+ sequence addAll: (aSuperClass classVarNames select:
+ [:classVarName|
+ unusedClassVars includes: (aSuperClass classPool associationAt: classVarName)])].
+ ^sequence!
- "Answer a list of the names of all the receiver's unreferenced class
- vars, including those defined in superclasses"
- | aList |
- aList := OrderedCollection new.
- aClass withAllSuperclasses
- reverseDo: [:aSuperClass | aSuperClass classVarNames
- do: [:var | (self allCallsOn: (aSuperClass classPool associationAt: var)) isEmpty
- ifTrue: [aList add: var]]].
- ^ aList!