Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1359.mcz
==================== Summary ====================
Name: Kernel-eem.1359
Author: eem
Time: 30 October 2020, 12:10:07.699375 pm
UUID: 1ec9a445-37fa-4256-84d8-9bdf8b52eb7d
Ancestors: Kernel-eem.1358
Merge Kernel-ct.1358
Author: ct
Time: 28 October 2020, 11:37:24.817544 pm
UUID: c9af6acb-61cf-af42-b5fa-3afa8451bb24
Ancestors: Kernel-mt.1353
Fixes a simulation bug that occurs when executing ProtoObject >> #doesNotUnderstand:. See KernelTests-ct.388.
=============== Diff against Kernel-eem.1358 ===============
Item was changed:
----- Method: Context>>send:to:with:lookupIn: (in category 'controlling') -----
send: selector to: rcvr with: arguments lookupIn: lookupClass
"Simulate the action of sending a message with selector and arguments to rcvr. The argument, lookupClass, is the class in which to lookup the message. This is the receiver's class for normal messages, but for super messages it will be some specific class related to the source method."
| meth primIndex val ctxt |
(meth := lookupClass lookupSelector: selector) ifNil:
+ [selector == #doesNotUnderstand: ifTrue:
+ [self error: 'Recursive message not understood!!' translated].
+ ^self send: #doesNotUnderstand:
- [^self send: #doesNotUnderstand:
to: rcvr
with: {(Message selector: selector arguments: arguments) lookupClass: lookupClass}
lookupIn: lookupClass].
meth isCompiledMethod ifFalse:
["Object as Methods (OaM) protocol: 'The contract is that, when the VM encounters an ordinary object (rather than a compiled method) in the method dictionary during lookup, it sends it the special selector #run:with:in: providing the original selector, arguments, and receiver.'. DOI: 10.1145/2991041.2991062."
+ ^self send: #run:with:in:
- ^ self send: #run:with:in:
to: meth
with: {selector. arguments. rcvr}].
meth numArgs = arguments size ifFalse:
[^ self error: ('Wrong number of arguments in simulated message {1}' translated format: {selector})].
(primIndex := meth primitive) > 0 ifTrue:
[val := self doPrimitive: primIndex method: meth receiver: rcvr args: arguments.
(self isPrimFailToken: val) ifFalse:
[^val]].
(selector == #doesNotUnderstand: and: [lookupClass == ProtoObject]) ifTrue:
+ [^self error: ('Simulated message {1} not understood' translated format: {arguments first selector})].
- [^ self error: ('Simulated message {1} not understood' translated format: {arguments first selector})].
ctxt := Context sender: self receiver: rcvr method: meth arguments: arguments.
+ (primIndex isInteger and: [primIndex > 0]) ifTrue:
- (primIndex notNil and: [primIndex > 0]) ifTrue:
[ctxt failPrimitiveWith: val].
^ctxt!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1358.mcz
==================== Summary ====================
Name: Kernel-eem.1358
Author: eem
Time: 30 October 2020, 12:04:50.705166 pm
UUID: 9e6daea9-3c8f-4ffa-99ab-e76c50af41d0
Ancestors: Kernel-eem.1356, Kernel-ct.1357
Merge Kernel-ct.1357
Author: ct
Time: 28 October 2020, 9:30:35.577652 pm
UUID: efd94ae0-26ab-0c4f-b854-52f414ff2d3e
Ancestors: Kernel-eem.1354
Implement missing simulation of objects as methods.
In the past, it was not possible to debug/simulate code that used objects as methods properly. (Thanks to Marcel for the hint!) This very simple commit adds support of the OaM protocol [1] to the simulation machinery. Now you can debug all tests in TestObjectsAsMethods as you would expect, instead of crashing your image!
Update: Uploaded a third time, this time with Kent Beck block formatting preserved.
[1] "The [Objects as Methods] contract is that, when the VM encounters an ordinary object (rather than a compiled method) in the method dictionary during lookup, it sends it the special selector #run:with:in: providing the original selector, arguments, and receiver.". DOI: 10.1145/2991041.2991062.
=============== Diff against Kernel-eem.1356 ===============
Item was changed:
----- Method: Context>>send:to:with:lookupIn: (in category 'controlling') -----
send: selector to: rcvr with: arguments lookupIn: lookupClass
+ "Simulate the action of sending a message with selector and arguments to rcvr. The argument, lookupClass, is the class in which to lookup the message. This is the receiver's class for normal messages, but for super messages it will be some specific class related to the source method."
- "Simulate the action of sending a message with selector and arguments
- to rcvr. The argument, lookupClass, is the class in which to lookup the
- message. This is the receiver's class for normal messages, but for super
- messages it will be some specific class related to the source method."
| meth primIndex val ctxt |
(meth := lookupClass lookupSelector: selector) ifNil:
[^self send: #doesNotUnderstand:
to: rcvr
with: {(Message selector: selector arguments: arguments) lookupClass: lookupClass}
lookupIn: lookupClass].
+
+ meth isCompiledMethod ifFalse:
+ ["Object as Methods (OaM) protocol: 'The contract is that, when the VM encounters an ordinary object (rather than a compiled method) in the method dictionary during lookup, it sends it the special selector #run:with:in: providing the original selector, arguments, and receiver.'. DOI: 10.1145/2991041.2991062."
+ ^ self send: #run:with:in:
+ to: meth
+ with: {selector. arguments. rcvr}].
+
+ meth numArgs = arguments size ifFalse:
+ [^ self error: ('Wrong number of arguments in simulated message {1}' translated format: {selector})].
- meth numArgs ~= arguments size ifTrue:
- [^self error: 'Wrong number of arguments in simulated message ', selector printString].
(primIndex := meth primitive) > 0 ifTrue:
[val := self doPrimitive: primIndex method: meth receiver: rcvr args: arguments.
+ (self isPrimFailToken: val) ifFalse:
- (self isPrimFailToken: val) ifFalse:
[^val]].
+
(selector == #doesNotUnderstand: and: [lookupClass == ProtoObject]) ifTrue:
+ [^ self error: ('Simulated message {1} not understood' translated format: {arguments first selector})].
+
- [^self error: 'Simulated message ', arguments first selector, ' not understood'].
ctxt := Context sender: self receiver: rcvr method: meth arguments: arguments.
+ (primIndex notNil and: [primIndex > 0]) ifTrue:
- primIndex > 0 ifTrue:
[ctxt failPrimitiveWith: val].
+
^ctxt!
tim Rowledge uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tpr.1014.mcz
==================== Summary ====================
Name: Tools-tpr.1014
Author: tpr
Time: 30 October 2020, 11:35:44.264054 am
UUID: 5649c88a-0205-4ae7-abc7-f0b420348d4a
Ancestors: Tools-mt.1013
Yet a nother tiny bit of collateral damage fro mwhacking the MessageSet classes - the flaps related build of the RecentMessageSet was not getting a window label. Somehow the odler version was simply dragging in the class name, which wasn't really very helpful anyway.
This updates it to have the same name as the 'norammly opened variety.
There is probably some more refactoring that could be done.
=============== Diff against Tools-mt.1013 ===============
Item was changed:
----- Method: Utilities class>>recentSubmissionsWindow (in category '*Tools') -----
recentSubmissionsWindow
"Answer a SystemWindow holding recent submissions"
| messageSet |
messageSet := RecentMessageSet messageList: RecentMessages default methodReferences.
+ messageSet
+ autoSelectString: nil;
+ setInitialLabel: 'Recent Submissions'.
- messageSet autoSelectString: nil.
^ ToolBuilder build: messageSet!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1013.mcz
==================== Summary ====================
Name: Tools-mt.1013
Author: mt
Time: 30 October 2020, 6:39:01.425754 pm
UUID: 3fca46e0-aeec-d443-a197-80a731362fdb
Ancestors: Tools-mt.1012
Fixes strange init bug that was triggered through "ReleaseBuilder prepareEnvironment": windowLabel was nil for the RecentMessageSet. Might be related to that recent reset of all pragma preferences plus the changes in MessageSet labels.
=============== Diff against Tools-mt.1012 ===============
Item was changed:
----- Method: MessageSet>>initialize (in category 'initialize-release') -----
initialize
+
super initialize.
+
+ messageList := OrderedCollection new.
+ windowLabel := ''.!
- messageList := OrderedCollection new.!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1356.mcz
==================== Summary ====================
Name: Kernel-eem.1356
Author: eem
Time: 30 October 2020, 7:55:52.516141 am
UUID: 589e93d6-d597-46f2-a09c-9d646902f1e1
Ancestors: Kernel-eem.1355
selectorJustSentOrSelf (used in process termination) must be able to handle being at the start of a method.
=============== Diff against Kernel-eem.1355 ===============
Item was changed:
----- Method: InstructionStream>>selectorJustSentOrSelf (in category 'scanning') -----
selectorJustSentOrSelf
"If this instruction follows a send, answer the send's selector, otherwise answer self."
| method |
method := self method.
+ ^method encoderClass selectorToSendOrItselfFor: self in: method at: (self previousPc ifNil: [^self])!
- ^method encoderClass selectorToSendOrItselfFor: self in: method at: self previousPc!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1011.mcz
==================== Summary ====================
Name: Tools-eem.1011
Author: eem
Time: 29 October 2020, 9:22:00.000467 pm
UUID: ffdfbc30-2976-4a66-bada-49278510b8ba
Ancestors: Tools-tpr.1010
Fix the regression ot Recent Messages in Tools-tpr.1010
=============== Diff against Tools-tpr.1010 ===============
Item was added:
+ ----- Method: RecentMessageSet>>initializeMessageList: (in category 'private') -----
+ initializeMessageList: anArray
+ "Initialize my messageList from the given list of MethodReference or string objects. NB: special handling for uniclasses.
+ Do /not/ replace the elements of anArray if they are already MethodReferences, so as to allow users to construct richer systems, such as differencers between existing and edited versions of code."
+ messageList := OrderedCollection new.
+ anArray do:
+ [:each | each isMethodReference
+ ifTrue: [messageList addLast: each]
+ ifFalse:
+ [ MessageSet
+ parse: each
+ toClassAndSelector:
+ [ : class : sel | class ifNotNil: [ messageList addLast: (MethodReference class: class selector: sel) ] ] ] ].
+ messageListIndex := messageList isEmpty ifTrue: [0] ifFalse: [1].
+ contents := String empty!