The Inbox: Kernel-ct.1690.mcz
[email protected] Sat, 25 Jul 2026 18:02:56 0000
| Newsgroups | gmane.comp.lang.smalltalk.squeak.general |
|---|---|
| Message-ID | <[email protected]> |
Christoph Thiede uploaded a new version of Kernel to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1690.mcz
==================== Summary ====================
Name: Kernel-ct.1690
Author: ct
Time: 25 July 2026, 8:02:55.720864 pm
UUID: 969e7f32-d3db-487c-ae06-96c8d8a5ed28
Ancestors: Kernel-mt.1689
Adds missing simulation of #cannotInterpret: instead of attempting to recover the method dict from the simulator. First draft of simulating no-lookup sends correctly (needs more work for remaining selectors, and we should finally move up #class to ProtoObject).
=============== Diff against Kernel-mt.1689 ===============
Item was added:
+ ----- Method: Behavior>>basicMethodDict (in category 'accessing') -----
+ basicMethodDict
+
+ ^ methodDict!
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 |
+ lookupClass basicMethodDict ifNil:
+ [^self send: #cannotInterpret:
+ to: rcvr
+ with: {(Message selector: selector arguments: arguments)
+ lookupClass: lookupClass} lookupIn: lookupClass superclass].
(meth := lookupClass lookupSelector: selector) ifNil:
[selector == #doesNotUnderstand: ifTrue:
[self error: 'Recursive message not understood!!' translated].
^self send: #doesNotUnderstand:
to: rcvr
with: {(Message selector: selector arguments: arguments) lookupClass: lookupClass}
lookupIn: lookupClass].
^ self
executeMethod: meth
forSelector: selector
withArgs: arguments
receiver: rcvr!
Item was changed:
----- Method: Context>>sendSpecial:numArgs: (in category 'instruction decoding implicit literals') -----
sendSpecial: selector numArgs: numArgs
"Simulate the action of bytecodes that send a message with selector,
selector. The arguments of the message are found in the top numArgs
locations on the stack and the receiver just below them."
| thisReceiver arguments lookupClass |
arguments := Array new: numArgs.
numArgs to: 1 by: -1 do: [ :i | arguments at: i put: self pop].
thisReceiver := self pop.
lookupClass := self objectClass: thisReceiver.
+ (selector
+ caseOf:
+ {[#==] -> [110].
+ [#~~] -> [169].
+ [#class] -> [111]}
+ otherwise: [nil])
+ ifNotNil: [:primIndex |
+ ^self doPrimitive: primIndex method: nil receiver: thisReceiver args: arguments].
QuickStep == self ifTrue:
[QuickStep := nil.
^self quickSend: selector to: thisReceiver with: arguments lookupIn: lookupClass].
^self send: selector to: thisReceiver with: arguments lookupIn: lookupClass!
Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]