Marcel Taeumel uploaded a new version of Environments to project The Trunk:
http://source.squeak.org/trunk/Environments-jr.82.mcz
==================== Summary ====================
Name: Environments-jr.82
Author: jr
Time: 10 April 2021, 12:34:34.717998 am
UUID: 2935eb63-046e-c344-8fba-771fb62fb5c2
Ancestors: Environments-tonyg.81
Sending resume: from defaultAction is erroneous in the ANSI standard.
In Squeak, unhandled exceptions are resumed with the answer to the defaultAction message.
=============== Diff against Environments-tonyg.81 ===============
Item was changed:
----- Method: EnvironmentRequest>>defaultAction (in category 'exceptionDescription') -----
defaultAction
| all environment |
all := Environment allInstances.
environment := UIManager default
chooseFrom: (all collect: [:ea | ea printString])
values: all.
+ ^ environment!
- self resume: environment.!
Nicolas Cellier uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-nice.455.mcz
==================== Summary ====================
Name: Tests-nice.455
Author: nice
Time: 19 April 2021, 9:18:01.955183 pm
UUID: 94f23508-c48c-0d47-8588-b2367071c298
Ancestors: Tests-nice.454
Two unrelated changes:
1) Kernel does not depend on Multilingual anymore (really?)
Aknowledge this little victory before the dependecy come back.
Alas, Kernel now depend on Morphic due to MouseEvent so the test still fails.
Either EventSensor shouldn't be in Kernel, or MouseEvent should not be in Morphic (or both?)...
2) workaround source range test in presence of FullBlockClosure
My understanding is that full block bytecodes are not hosted in their home method.
As a consequence, full block also have their own PC.
So a simple PC map is not elaborate enough to test the selection inside the block.
By now, just skip the test of selection inside the full block closure.
If some good soul wants to revise the test and make it thorough again, welcome!
=============== Diff against Tests-nice.454 ===============
Item was changed:
----- Method: ClosureCompilerTest>>supportTestSourceRangeAccessForInjectInto:source: (in category 'tests') -----
supportTestSourceRangeAccessForInjectInto: method source: source
"Test debugger source range selection for inject:into:"
^self
supportTestSourceRangeAccessForInjectInto: method
source: source
+ selectionSequence: (method encoderClass supportsFullBlocks
+ ifTrue: ["Full blocks are searated from home method, with their own PC"
+ #( ':= thisValue'
+ 'do: [:each | nextValue := binaryBlock value: nextValue value: each]'
+ '^nextValue')]
+ ifFalse: [#( ':= thisValue'
+ 'do: [:each | nextValue := binaryBlock value: nextValue value: each]'
+ 'value: nextValue value: each'
+ ':= binaryBlock value: nextValue value: each'
+ 'nextValue := binaryBlock value: nextValue value: each'
+ 'value: nextValue value: each'
+ ':= binaryBlock value: nextValue value: each'
+ 'nextValue := binaryBlock value: nextValue value: each'
+ '^nextValue')]).!
- selectionSequence: #( ':= thisValue'
- 'do: [:each | nextValue := binaryBlock value: nextValue value: each]'
- 'value: nextValue value: each'
- ':= binaryBlock value: nextValue value: each'
- 'nextValue := binaryBlock value: nextValue value: each'
- 'value: nextValue value: each'
- ':= binaryBlock value: nextValue value: each'
- 'nextValue := binaryBlock value: nextValue value: each'
- '^nextValue')!
Item was changed:
----- Method: ClosureCompilerTest>>supportTestSourceRangeAccessForInjectInto:source:selectionSequence: (in category 'tests') -----
supportTestSourceRangeAccessForInjectInto: method source: source selectionSequence: selections
"Test debugger source range selection for inject:into:"
| evaluationCount sourceMap debugTokenSequence debugCount |
DebuggerMethodMap voidMapCache.
evaluationCount := 0.
+ sourceMap := method debuggerMap abstractSourceMapForMethod: method.
- sourceMap := method debuggerMap abstractSourceMap.
debugTokenSequence := selections collect: [:string| Scanner new scanTokens: string].
debugCount := 0.
thisContext
runSimulated: [(1 to: 2)
withArgs:
{ 0.
[:sum :each|
evaluationCount := evaluationCount + 1.
sum + each]}
executeMethod: method]
contextAtEachStep:
[:ctxt| | range debugTokens |
(ctxt method == method
and: ["Exclude the send of #blockCopy: or #closureCopy:copiedValues: and braceWith:with:
to create the block, and the #new: and #at:'s for the indirect temp vector.
This for compilation without closure bytecodes. (Note that at:put:'s correspond to stores)"
(ctxt willSend
and: [(#(closureCopy:copiedValues: blockCopy: new: at: braceWith:with:) includes: ctxt selectorToSendOrSelf) not])
"Exclude the store of the argument into the home context (for BlueBook blocks)
and the store of an indirection vector into an initial temp"
or: [(ctxt willStore
and: [(ctxt isBlock and: [ctxt pc = ctxt startpc]) not
and: [(ctxt isBlock not
and: [(method usesClosureBytecodes and: [ctxt abstractPC = 2])]) not]])
or: [ctxt willReturn]]]) ifTrue:
[debugTokens := debugTokenSequence at: (debugCount := debugCount + 1) ifAbsent: [#(bogusToken)].
self assert: (sourceMap includesKey: ctxt abstractPC).
range := sourceMap at: ctxt abstractPC ifAbsent: [(1 to: 0)].
self assert: (Scanner new scanTokens: (source copyFrom: range first to: range last)) = debugTokens]].
self assert: evaluationCount = 2!
Item was changed:
----- Method: PackageDependencyTest>>testKernel (in category 'tests') -----
testKernel
self testPackage: #Kernel dependsExactlyOn: #(
#'Chronology-Core'
Collections
Compiler
Environments
Files
- Multilingual
System
#'ToolBuilder-Kernel'
).!
Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1390.mcz
==================== Summary ====================
Name: Kernel-nice.1390
Author: nice
Time: 19 April 2021, 6:37:54.360183 pm
UUID: 3ba56195-f0d4-454c-b3f7-d07e1eadcad7
Ancestors: Kernel-nice.1389
Fixes regression in Context >> #runSimulated:contextAtEachStep: when the message is sent to something else than thisContext.
This happens when tallying sends (see MessageTally class >> #tallySendsTo:inBlock:showTree: )
This commit integrates the change poposed in:
https://source.squeak.org/treated/Kernel-ct.1363.diff
which was a commented version of:
https://source.squeak.org/treated/Kernel-ct.1362.diff
Thanks Christoph for the fix!
Also implement #asContextWithSender: in Context so that testRunSimulatedContextAtEachStep continues to work.
Thanks Jaromir for the suggestion.
=============== Diff against Kernel-nice.1389 ===============
Item was added:
+ ----- Method: Context>>asContextWithSender: (in category 'closure support') -----
+ asContextWithSender: aContext
+ self privSender: aContext.
+ ^ self!
Item was changed:
----- Method: Context>>runSimulated:contextAtEachStep: (in category 'system simulation') -----
runSimulated: aBlock contextAtEachStep: anotherBlock
"Simulate the execution of the argument, aBlock, until it ends or is curtailed. If any exception is signaled during the execution, simulate it being handled on the present caller stack. Evaluate anotherBlock with the current context prior to each instruction executed. Answer the simulated value of aBlock."
| current resume ensure |
resume := false.
+ "Affect the context stack of the receiver during the simulation of aBlock."
+ current := aBlock asContextWithSender: self.
+ "Insert outer context denoting the end of the simulation."
+ ensure := (ensure := current) insertSender: (Context contextEnsure:
+ [resume := true.
+ ensure privSender: thisContext home sender]).
- current := aBlock asContext.
- ensure := current insertSender: (Context contextEnsure: [resume := true]).
- ensure sender ifNil: [ensure privSender: self]. "For backward compatibility, do not fail if aBlock is dead."
(anotherBlock numArgs = 0
ifTrue: ["optimized" [resume]]
ifFalse: ["stop execution on time, don't expose simulation details to caller"
[current == ensure or:
["Context >> #resume:"
current size >= 2 and:
[(current at: 2) == ensure]]] ])
whileFalse:
[anotherBlock cull: current.
current := current step].
+ "Continue with the execution in the previous context."
^ current jump!
Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-mt.79.mcz
==================== Summary ====================
Name: MorphicTests-mt.79
Author: mt
Time: 19 April 2021, 10:04:21.810053 am
UUID: 7bae0322-f841-224f-ac06-f4e370992115
Ancestors: MorphicTests-mt.78
Update test03EventHandler to be more realistic. Avoid triggering the mouse-focus-event-disptach path.
=============== Diff against MorphicTests-mt.78 ===============
Item was changed:
----- Method: MorphicEventTests>>test03EventHandler (in category 'tests') -----
test03EventHandler
+ "Test a morph's event handler, which is configured via #on:send:to:. Note that the handler only reacts on #mouseDown but we do send a #mouseUp to reset the mouse focus to ensure the same event-dispatching flow for all three mouse buttons."
| m |
m := Morph new.
m extent: 20@20; topLeft: 0@0.
m wantsHaloFromClick: false.
m wantsYellowButtonMenu: false.
m wantsMetaMenu: false.
m on: #mouseDown send: #value: to: [:evt|
evt redButtonPressed ifTrue:[m color: Color red].
evt yellowButtonPressed ifTrue:[m color: Color yellow].
evt blueButtonPressed ifTrue:[m color: Color blue]].
m color: Color blue.
m openInWorld: world.
+ self assert: hand mouseFocus isNil.
hand handleEvent: (self redMouseDownAt: m center).
+ hand handleEvent: (self redMouseUpAt: m center).
self assert: Color red equals: m color.
+ self assert: hand mouseFocus isNil.
hand handleEvent: (self yellowMouseDownAt: m center).
+ hand handleEvent: (self yellowMouseUpAt: m center).
self assert: Color yellow equals: m color.
+
+ self assert: hand mouseFocus isNil.
-
hand handleEvent: (self blueMouseDownAt: m center).
+ hand handleEvent: (self blueMouseUpAt: m center).
self assert: Color blue equals: m color.!
Item was added:
+ ----- Method: UserInputEventTests>>blueMouseUpAt: (in category 'support') -----
+ blueMouseUpAt: point
+
+ ^ MouseButtonEvent new
+ setType: #mouseUp
+ position: point
+ which: 2r001 "blue changed"
+ buttons: 2r000 "nothing pressed"
+ hand: hand
+ stamp: Time millisecondClockValue!
Item was added:
+ ----- Method: UserInputEventTests>>yellowMouseUpAt: (in category 'support') -----
+ yellowMouseUpAt: point
+
+ ^ MouseButtonEvent new
+ setType: #mouseUp
+ position: point
+ which: 2r010 "yellow changed"
+ buttons: 2r000 "nothing pressed"
+ hand: hand
+ stamp: Time millisecondClockValue!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1228.mcz
==================== Summary ====================
Name: System-mt.1228
Author: mt
Time: 18 April 2021, 6:49:05.736254 pm
UUID: 513db764-6353-204e-9724-18519504a7b5
Ancestors: System-ul.1227
Adds queries to enumerate actual domain objects for changed classes or methods.
Adds change stamps for class changes and method removal.
Note that I followed the not-so-good practice of using "Utilities changeStamp" to assure a single kind of timestamp (to sort later). In the future, we should change all this to DateAndTime and deprecate TimeStamp.
=============== Diff against System-ul.1227 ===============
Item was changed:
----- Method: ChangeSet>>changedClasses (in category 'class changes') -----
changedClasses
- "Answer an OrderedCollection of changed or edited classes.
- Does not include removed classes. Sort alphabetically by name."
+ ^ Array streamContents: [:stream |
+ self changedClassesDo: [:class |
+ stream nextPut: class]]!
- "Much faster to sort names first, then convert back to classes. Because metaclasses reconstruct their name at every comparison in the sorted collection.
- 8/91 sw chgd to filter out non-existent classes (triggered by problems with class-renames"
-
- ^ self changedClassNames
- collect: [:className | Smalltalk classNamed: className]
- thenSelect: [:aClass | aClass notNil]!
Item was added:
+ ----- Method: ChangeSet>>changedClassesDo: (in category 'class changes') -----
+ changedClassesDo: block
+ "Answer an OrderedCollection of changed or edited classes.
+ Does not include removed classes. Sort alphabetically by name."
+
+ "Much faster to sort names first, then convert back to classes. Because metaclasses reconstruct their name at every comparison in the sorted collection.
+ 8/91 sw chgd to filter out non-existent classes (triggered by problems with class-renames"
+
+ self flag: #environmentsMissing.
+ self changedClassNames do: [:className | | record class changeTypes dateAndTime category |
+ record := changeRecords at: className.
+ class := (Smalltalk classNamed: className) ifNil: [
+ PseudoClass new
+ name: className;
+ definition: record priorDefinition;
+ yourself].
+ changeTypes := record allChangeTypes.
+ dateAndTime := [TimeStamp fromMethodTimeStamp: record timeStamp]
+ ifError: [TimeStamp epoch].
+ category := [class category] ifError: ['unknown'].
+ block
+ cull: class
+ cull: changeTypes
+ cull: dateAndTime
+ cull: category].!
Item was added:
+ ----- Method: ChangeSet>>changedMethods (in category 'method changes') -----
+ changedMethods
+
+ ^ Array streamContents: [:stream |
+ self changedMethodsDo: [:class |
+ stream nextPut: class]]!
Item was added:
+ ----- Method: ChangeSet>>changedMethodsDo: (in category 'method changes') -----
+ changedMethodsDo: block
+
+ self flag: #environmentsMissing.
+ changeRecords keysAndValuesDo: [:className :classRecord |
+ (Smalltalk classNamed: className) ifNotNil: [:class |
+ classRecord methodChanges keysAndValuesDo: [:selector :methodRecord |
+ | method category sourcePointer dateAndTime |
+ (class includesSelector: selector)
+ ifTrue: [
+ method := class compiledMethodAt: selector.
+ category := class organization categoryOfElement: selector.
+ sourcePointer := method sourcePointer.
+ dateAndTime := method timeStamp]
+ ifFalse: [ "Method was removed. Try to reconstruct information."
+ methodRecord methodInfoFromRemoval ifNotNil: [:spec |
+ sourcePointer := spec first.
+ category := spec second.
+ method := CompiledMethod toReturnSelfTrailerBytes:
+ (CompiledMethodTrailer new sourcePointer: sourcePointer).
+ method methodClass: class; selector: selector.
+ dateAndTime := spec size > 2 ifTrue: [spec third]]].
+ method ifNotNil: [
+ dateAndTime := [TimeStamp fromMethodTimeStamp: dateAndTime]
+ ifError: [TimeStamp epoch].
+ block
+ cull: method
+ cull: methodRecord changeType
+ cull: dateAndTime
+ cull: category]]]].!
Item was added:
+ ----- Method: ChangeSet>>classChanges (in category 'accessing') -----
+ classChanges
+
+ ^ changeRecords keys select:
+ [:className | (changeRecords at: className) allChangeTypes notEmpty]!
Item was changed:
----- Method: ChangeSet>>event: (in category 'change logging') -----
event: anEvent
"Hook for SystemChangeNotifier"
anEvent itemKind = SystemChangeNotifier classKind ifTrue: [
anEvent isRemoved
ifTrue: [self noteRemovalOf: anEvent item].
anEvent isAdded
ifTrue: [self addClass: anEvent item].
anEvent isModified
ifTrue: [anEvent anyChanges ifTrue: [self changeClass: anEvent item from: anEvent oldItem]].
anEvent isCommented
ifTrue: [self commentClass: anEvent item].
anEvent isRenamed
ifTrue: [self renameClass: anEvent item from: anEvent oldName to: anEvent newName].
anEvent isReorganized
ifTrue: [self reorganizeClass: anEvent item].
anEvent isRecategorized
ifTrue: [self changeClass: anEvent item from: anEvent item].
].
anEvent itemKind = SystemChangeNotifier methodKind ifTrue: [
anEvent isAdded
ifTrue: [self noteNewMethod: anEvent item forClass: anEvent itemClass selector: anEvent itemSelector priorMethod: nil].
anEvent isModified
ifTrue: [self noteNewMethod: anEvent item forClass: anEvent itemClass selector: anEvent itemSelector priorMethod: anEvent oldItem].
anEvent isRemoved
+ ifTrue: [self removeSelector: anEvent itemSelector class: anEvent itemClass priorMethod: anEvent item lastMethodInfo: {anEvent item sourcePointer. anEvent itemProtocol. Utilities changeStamp}].
- ifTrue: [self removeSelector: anEvent itemSelector class: anEvent itemClass priorMethod: anEvent item lastMethodInfo: {anEvent item sourcePointer. anEvent itemProtocol}].
anEvent isRecategorized
ifTrue: [self reorganizeClass: anEvent itemClass].
].!
Item was changed:
Object subclass: #ClassChangeRecord
+ instanceVariableNames: 'inForce revertable changeTypes thisDefinition priorDefinition thisName priorName thisOrganization priorOrganization thisComment priorComment thisMD priorMD methodChanges timeStamp'
- instanceVariableNames: 'inForce revertable changeTypes thisDefinition priorDefinition thisName priorName thisOrganization priorOrganization thisComment priorComment thisMD priorMD methodChanges'
classVariableNames: ''
poolDictionaries: ''
category: 'System-Changes'!
!ClassChangeRecord commentStamp: 'fbs 9/6/2013 17:32' prior: 0!
A ClassChangeRecorder keeps track of most substantive changes permissible in a project, isolated or not.
Structure:
inForce a boolean
Tells whether these changes are in effect.
true for all changeSets in and above the current project.
It should be sufficient only to record this for the changeSet
as a whole, but this redundancy could help in error recovery.
classIsLocal a boolean
True if and only if this class is defined in this layer of the
project structure.
changeTypes an identitySet
Summarizes which changes have been made in this class.
Values include #comment, #reorganize, #rename,
and the four more summarized below.
thisName a string
Retains the class name for this layer.
priorName a string
Preserves the prior name.
thisComment a text
Retains the class comment for this layer.
priorComment a text
Preserves the prior comment.
thisOrganization a classOrganizer
Retains the class organization for this layer.
priorOrganization a classOrganizer
Preserves the prior organization.
thisMD a methodDictionary
Used to prepare changes for nearly atomic invocation
of this layer (see below).
priorMD a methodDictionary
Preserves the state of an altered class as it exists in the next
outer layer of the project structure.
methodChanges a dictionary of classChangeRecords
Retains all the method changes for this layer.
Four of the possible changeTypes are maintained in a mutually exclusive set, analogously to MethodChangeRecords. Here is a simple summary of the relationship between these four changeType symbols and the recording of prior state
| prior == nil | prior not nil
--------- |---------------------------- |--------------------
add | add | change
--------- |---------------------------- |--------------------
remove | addedThenRemoved | remove
A classChangeRecorder is notified of changes by the method
noteMethodChange: <ClassChangeRecord>.
ClassChangeRecorders are designed to invoke a set of changes relative to the definition of a class in an prior layer. It is important that both invocation and revocation of these changes take place in a nearly atomic fashion so that interdependent changes will be adopted as a whole, and so that only one flush of the method cache should be necessary. A further reason for revocation to be simple is that it may be requested as an attempt to recover from an error in a project that is failing.!
Item was changed:
----- Method: ClassChangeRecord>>noteChangeType:fromClass: (in category 'all changes') -----
noteChangeType: changeSymbol fromClass: class
+ timeStamp := Utilities changeStamp.
(changeSymbol = #new or: [changeSymbol = #add]) ifTrue:
[changeTypes add: #add.
changeTypes remove: #change ifAbsent: [].
revertable := false.
^ self].
changeSymbol = #change ifTrue:
[(changeTypes includes: #add) ifTrue: [^ self].
^ changeTypes add: changeSymbol].
changeSymbol == #addedThenRemoved ifTrue:
[^ self]. "An entire class was added but then removed"
changeSymbol = #comment ifTrue:
[^ changeTypes add: changeSymbol].
changeSymbol = #reorganize ifTrue:
[^ changeTypes add: changeSymbol].
changeSymbol = #rename ifTrue:
[^ changeTypes add: changeSymbol].
(changeSymbol beginsWith: 'oldName: ') ifTrue:
["Must only be used when assimilating other changeSets"
(changeTypes includes: #add) ifTrue: [^ self].
priorName := changeSymbol copyFrom: 'oldName: ' size + 1 to: changeSymbol size.
^ changeTypes add: #rename].
changeSymbol = #remove ifTrue:
[(changeTypes includes: #add)
ifTrue: [changeTypes add: #addedThenRemoved]
ifFalse: [changeTypes add: #remove].
^ changeTypes removeAllFoundIn: #(add change comment reorganize)].
self error: 'Unrecognized changeType'!
Item was added:
+ ----- Method: ClassChangeRecord>>timeStamp (in category 'accessing') -----
+ timeStamp
+
+ ^ timeStamp!