Marcel Taeumel uploaded a new version of ToolBuilder-Kernel to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Kernel-mt.165.mcz
==================== Summary ====================
Name: ToolBuilder-Kernel-mt.165
Author: mt
Time: 17 April 2023, 11:10:55.175908 am
UUID: a6da9de1-d469-cf49-b77d-4e74dea156e6
Ancestors: ToolBuilder-Kernel-mt.164
Complement Morphic-mt.2105
=============== Diff against ToolBuilder-Kernel-mt.164 ===============
Item was changed:
PluggableWidgetSpec subclass: #PluggableTreeSpec
+ instanceVariableNames: 'roots getSelectedPath setSelectedPath setSelected getSelected setSelectedParent getChildren hasChildren label icon unusedVar menu keyPress doubleClick dropItem dropAccept autoDeselect autoExpand dragItem dragType nodeClass columns vScrollBarPolicy hScrollBarPolicy dragStarted filterMode searchMode'
- instanceVariableNames: 'roots getSelectedPath setSelectedPath setSelected getSelected setSelectedParent getChildren hasChildren label icon unusedVar menu keyPress doubleClick dropItem dropAccept autoDeselect dragItem dragType nodeClass columns vScrollBarPolicy hScrollBarPolicy dragStarted filterMode searchMode'
classVariableNames: ''
poolDictionaries: ''
category: 'ToolBuilder-Kernel'!
!PluggableTreeSpec commentStamp: 'pre 4/24/2018 10:20' prior: 0!
A pluggable tree widget. PluggableTrees are slightly different from lists in such that they ALWAYS store the actual objects and use the label selector to query for the label of the item. PluggableTrees also behave somewhat differently in such that they do not have a "getSelected" message but only a getSelectedPath message. The difference is that getSelectedPath is used to indicate by the model that the tree should select the appropriate path. This allows disambiguation of items. Because of this, implementations of PluggableTrees must always set their internal selection directly, e.g., rather than sending the model a setSelected message and wait for an update of the #getSelected the implementation must set the selection before sending the #setSelected message. If a client doesn't want this, it can always just signal a change of getSelectedPath to revert to whatever is needed.
Instance variables:
roots <Symbol> The message to retrieve the roots of the tree.
getSelectedPath <Symbol> The message to retrieve the selected path in the tree.
setSelectedPath <Symbol> The message to set the selected path in the tree.
setSelected <Symbol> The message to set the selected item in the tree.
getChildren <Symbol> The message to retrieve the children of an item
hasChildren <Symbol> The message to query for children of an item
label <Symbol> The message to query for the label of an item.
icon <Symbol> The message to query for the icon of an item.
help <Symbol> The message to query for the help of an item.
menu <Symbol> The message to query for the tree's menu
keyPress <Symbol> The message to process a keystroke.
wantsDrop <Symbol> The message to query whether a drop might be accepted.
dropItem <Symbol> The message to drop an item.
enableDrag <Boolean> Enable dragging from this tree.
autoDeselect <Boolean> Whether the tree should allow automatic deselection or not.
unusedVar (unused) This variable is a placeholder to fix problems with loading packages in 3.10.!
Item was added:
+ ----- Method: PluggableTreeSpec>>autoExpand (in category 'accessing - hierarchy') -----
+ autoExpand
+ "If true, all children are always visible."
+
+ ^ autoExpand ifNil: [false]!
Item was added:
+ ----- Method: PluggableTreeSpec>>autoExpand: (in category 'accessing - hierarchy') -----
+ autoExpand: aBooleanOrSymbol
+
+ autoExpand := aBooleanOrSymbol.!
When we load something from an mcz it goes through the MCMethodDefinition>>#asMethodAddition method.
That used to just have a literal 'true' as the parameter for the logSource: part (in 5.3 images) but it got changed a while back to defer to 'SystemChangeNotifier uniqueInstance isBroadcasting'. I think that is incorrect and that it really ought to take into account the acceptsLoggingOfCompilation setting; interestingly, that is how the MCMethodDefinition>>#load handles things.
The immediate issue is wanting to be able to load mczs in a no-source server image, though it looks like there's a bit of work to do to factor out places where code is inadvisably expecting sources to be both available and held in a positionable stream.
Does anyone see a reason to not change MCMethodDefinition>>#asMethodAddition to be a bit more like MCMethodDefinition>>#load in this matter?
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: HALT: No-Op
Eliot Miranda uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-eem.228.mcz
==================== Summary ====================
Name: FFI-Kernel-eem.228
Author: eem
Time: 13 April 2023, 2:40:45.749373 pm
UUID: 77163f53-9648-49ae-904a-d16fd63af2ab
Ancestors: FFI-Kernel-eem.227
Make sure that compiledSpecs in ExternalLibraryFunctions in CompiledMethods are up-to-date after a platform change. The current FFI code invalidates these on platform change, but does nothing to update them.
Hence cache allInstances of ExternalLibraryFunction in a class var to avoid having to do an allInstancesDo: whenever the platform changes.
=============== Diff against FFI-Kernel-eem.227 ===============
Item was changed:
ExternalFunction subclass: #ExternalLibraryFunction
instanceVariableNames: 'name module errorCodeName'
+ classVariableNames: 'Instances'
- classVariableNames: ''
poolDictionaries: ''
category: 'FFI-Kernel'!
!ExternalLibraryFunction commentStamp: '' prior: 0!
An ExternalLibraryFunction specifies a fully qualified function from an external library.
Instance variables:
name <String | Integer> name or ordinal of function
module <String | nil> name of module (nil if bound in the VM).
errorCodeName <String | nil> name of temp receiving error code, if any!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>instances (in category 'private') -----
+ instances
+ "Cache our instances for faster reinitialization."
+ ^Instances ifNil: [Instances := WeakSet withAll: self allInstances]!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>new (in category 'instance creation') -----
+ new
+ ^self instances add: super new!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>platformChangedFrom:to: (in category 'instance initialization') -----
+ platformChangedFrom: lastPlatform to: currentPlatform
+ "Byte size or byte alignment for atomic types might be different on the new platform."
+
+ "Make sure that the cache of all instances is up-to-date before using it..."
+ Instances ifNil: [self new].
+
+ "Get all instances to update their compiledSpecs so that FFI calls work."
+ self updateArgTypeSpecs!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>updateArgTypeSpecs (in category 'instance initialization') -----
+ updateArgTypeSpecs
+ self instances do: [:elf| elf updateArgTypeSpecs]!
Item was added:
+ ----- Method: ExternalLibraryFunction>>updateArgTypeSpecs (in category 'instance initialization') -----
+ updateArgTypeSpecs
+ argTypes ifNotNil:
+ [:typeArray| typeArray do: [:argType| argType updateFromReferentClass]]!
Item was added:
+ ----- Method: ExternalType>>updateFromReferentClass (in category 'instance initialization') -----
+ updateFromReferentClass
+ "If I have a referentClass update my compiledSpec to reflect the new state of the system, e.g. after a platform change."
+
+ referentClass ifNotNil: [:refClass| self newReferentClass: refClass]!
Item was changed:
----- Method: FFIPlatformDescription class>>startUp: (in category 'system startup') -----
startUp: resuming
"Notify all FFI classes about platform changes."
resuming ifTrue: [
LastPlatform in: [:lastPlatform | self newCurrent in: [:currentPlatform |
lastPlatform = currentPlatform
ifTrue: [
self flag: #discuss. "mt: Maybe add #platformResuming?"
ExternalAddress allBeNull ]
ifFalse: [
LastPlatform := currentPlatform. "Update now. See #current."
+ { ExternalAddress. ExternalType. ExternalPool. ExternalLibrary. ExternalLibraryFunction }
- { ExternalAddress. ExternalType. ExternalPool. ExternalLibrary }
do: [:cls | cls
platformChangedFrom: lastPlatform
to: currentPlatform] ]]].
+ self checkFFIOnStartUp ifTrue: [self checkFFI]]!
- self checkFFIOnStartUp ifTrue: [self checkFFI]].!