Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1566.mcz
==================== Summary ====================
Name: Kernel-mt.1566
Author: mt
Time: 17 May 2024, 11:50:00.270954 am
UUID: 97d1e36d-a215-d741-8ce5-a38d906fe570
Ancestors: Kernel-mt.1565
Now that we have AllProcessesLock and AllProcesses (ensured via update map), add new processes to that list.
=============== Diff against Kernel-mt.1565 ===============
Item was added:
+ ----- Method: Process class>>new (in category 'instance creation') -----
+ new
+ "Keep track of the processes being created and alive to avoid the need for #allSubInstances in tools such as the ProcessBrowser."
+
+ | newProcess |
+ newProcess := super new.
+ AllProcessesLock critical: [AllProcesses add: newProcess].
+ ^ newProcess
+
+
+ " [ [] newProcess terminate ] bench.
+
+ AFTER: '140,000 per second. 7.13 microseconds per run. 35.02 % GC time.'
+ BEFORE: '224,000 per second. 4.47 microseconds per run. 4.38 % GC time.'
+
+ [aProcessBrowser updateProcessList] bench. -- allow quick updates
+
+ AFTER: '4,410 per second. 227 microseconds per run. 77.34453 % GC time.'
+ BEFORE: '118 per second. 8.47 milliseconds per run. 2.59792 % GC time.'
+
+ "!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1253.mcz
==================== Summary ====================
Name: Tools-mt.1253
Author: mt
Time: 17 May 2024, 11:46:56.243954 am
UUID: b077ec04-5af1-ae43-a2dc-0ac137a0f916
Ancestors: Tools-mt.1252
Complement Kernel-mt.1565
=============== Diff against Tools-mt.1252 ===============
Item was changed:
Model subclass: #ProcessBrowser
+ instanceVariableNames: 'selectedProcess selectedContext methodText processList processListIndex stackList stackListIndex stackDepth sourceMap selectedClass selectedSelector searchString autoUpdateProcess startedCPUWatcher'
- instanceVariableNames: 'selectedProcess selectedContext methodText processList processListIndex stackList stackListIndex stackDepth sourceMap selectedClass selectedSelector searchString autoUpdateProcess lastUpdate startedCPUWatcher'
classVariableNames: 'Browsers SuspendedProcesses WellKnownProcesses'
poolDictionaries: ''
category: 'Tools-Process Browser'!
!ProcessBrowser commentStamp: '<historical>' prior: 0!
Change Set: ProcessBrowser
Date: 14 March 2000
Author: Ned Konz
email: ned(a)bike-nomad.com
This is distributed under the Squeak License.
Added 14 March:
CPUWatcher integration
automatically start and stop CPUWatcher
added CPUWatcher to process list menu
Added 29 October:
MVC version
2.8, 2.7 compatibility
rearranged menus
added pointer inspection and chasing
added suspend/resume
recognized more well-known processes
misc. bug fixes
Added 26 October: highlight pc in source code
Added 27 October: added 'signal semaphore'
added 'inspect receiver', 'explore receiver', 'message tally' to stack list menu
added 'find context', 'next context' to process list menu
added 'change priority' and 'debug' choices to process list menu
27 October mods by Bob Arning:
alters process display in Ned's ProcessBrowser to
- show process priority
- drop 'a Process in' that appears on each line
- show in priority order
- prettier names for known processes
- fix to Utilities to forget update downloading process when it ends (1 less dead
process)
- correct stack dump for the active process
!
Item was changed:
----- Method: ProcessBrowser>>initialize (in category 'initialize-release') -----
initialize
methodText := ''..
stackDepth := 20.
stackListIndex := 0.
searchString := ''.
- lastUpdate := 0.
startedCPUWatcher := CPUWatcher cpuWatcherEnabled and: [ self startCPUWatcher ].
self updateProcessList; processListIndex: 1.
Browsers add: self!
Item was changed:
----- Method: ProcessBrowser>>updateProcessList (in category 'process list') -----
updateProcessList
+ | oldSelectedProcess newIndex |
- | oldSelectedProcess newIndex now |
- now := Time millisecondClockValue.
- now - lastUpdate < 500
- ifTrue: [^ self].
- "Don't update too fast"
- lastUpdate := now.
oldSelectedProcess := selectedProcess.
processList := selectedProcess := selectedSelector := nil.
Smalltalk garbageCollectMost.
"lose defunct processes"
+ processList := Process allProcesses
- processList := Process allSubInstances
reject: [:each | each isTerminated].
processList := processList
sorted: [:a :b | a priority >= b priority].
processList := WeakArray withAll: processList.
newIndex := processList indexOf: oldSelectedProcess.
self changed: #processNameList.
self processListIndex: newIndex!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1253.mcz
==================== Summary ====================
Name: Tools-mt.1253
Author: mt
Time: 17 May 2024, 11:46:56.243954 am
UUID: b077ec04-5af1-ae43-a2dc-0ac137a0f916
Ancestors: Tools-mt.1252
Complement Kernel-mt.1565
=============== Diff against Tools-mt.1252 ===============
Item was changed:
Model subclass: #ProcessBrowser
+ instanceVariableNames: 'selectedProcess selectedContext methodText processList processListIndex stackList stackListIndex stackDepth sourceMap selectedClass selectedSelector searchString autoUpdateProcess startedCPUWatcher'
- instanceVariableNames: 'selectedProcess selectedContext methodText processList processListIndex stackList stackListIndex stackDepth sourceMap selectedClass selectedSelector searchString autoUpdateProcess lastUpdate startedCPUWatcher'
classVariableNames: 'Browsers SuspendedProcesses WellKnownProcesses'
poolDictionaries: ''
category: 'Tools-Process Browser'!
!ProcessBrowser commentStamp: '<historical>' prior: 0!
Change Set: ProcessBrowser
Date: 14 March 2000
Author: Ned Konz
email: ned(a)bike-nomad.com
This is distributed under the Squeak License.
Added 14 March:
CPUWatcher integration
automatically start and stop CPUWatcher
added CPUWatcher to process list menu
Added 29 October:
MVC version
2.8, 2.7 compatibility
rearranged menus
added pointer inspection and chasing
added suspend/resume
recognized more well-known processes
misc. bug fixes
Added 26 October: highlight pc in source code
Added 27 October: added 'signal semaphore'
added 'inspect receiver', 'explore receiver', 'message tally' to stack list menu
added 'find context', 'next context' to process list menu
added 'change priority' and 'debug' choices to process list menu
27 October mods by Bob Arning:
alters process display in Ned's ProcessBrowser to
- show process priority
- drop 'a Process in' that appears on each line
- show in priority order
- prettier names for known processes
- fix to Utilities to forget update downloading process when it ends (1 less dead
process)
- correct stack dump for the active process
!
Item was changed:
----- Method: ProcessBrowser>>initialize (in category 'initialize-release') -----
initialize
methodText := ''..
stackDepth := 20.
stackListIndex := 0.
searchString := ''.
- lastUpdate := 0.
startedCPUWatcher := CPUWatcher cpuWatcherEnabled and: [ self startCPUWatcher ].
self updateProcessList; processListIndex: 1.
Browsers add: self!
Item was changed:
----- Method: ProcessBrowser>>updateProcessList (in category 'process list') -----
updateProcessList
+ | oldSelectedProcess newIndex |
- | oldSelectedProcess newIndex now |
- now := Time millisecondClockValue.
- now - lastUpdate < 500
- ifTrue: [^ self].
- "Don't update too fast"
- lastUpdate := now.
oldSelectedProcess := selectedProcess.
processList := selectedProcess := selectedSelector := nil.
Smalltalk garbageCollectMost.
"lose defunct processes"
+ processList := Process allProcesses
- processList := Process allSubInstances
reject: [:each | each isTerminated].
processList := processList
sorted: [:a :b | a priority >= b priority].
processList := WeakArray withAll: processList.
newIndex := processList indexOf: oldSelectedProcess.
self changed: #processNameList.
self processListIndex: newIndex!
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1565.mcz
==================== Summary ====================
Name: Kernel-mt.1565
Author: mt
Time: 17 May 2024, 11:45:24.948954 am
UUID: c72d05b8-e3c0-924c-a5d0-62198e4eea70
Ancestors: Kernel-eem.1564
Manage list of known processes for faster lookup in tools.
See http://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfoun…
=============== Diff against Kernel-eem.1564 ===============
Item was changed:
Link subclass: #Process
instanceVariableNames: 'suspendedContext priority myList threadAffinity effectiveProcess name island env'
+ classVariableNames: 'AllProcesses AllProcessesLock'
- classVariableNames: ''
poolDictionaries: ''
category: 'Kernel-Processes'!
!Process commentStamp: 'eem 8/22/2023 12:52' prior: 0!
I represent an independent path of control in the system. This path of control may be stopped (by sending the message suspend) in such a way that it can later be restarted (by sending the message resume). When any one of several paths of control can be advanced, the single instance of ProcessorScheduler named Processor determines which one will actually be advanced, partly using the value of priority.
Instance Variables: N.B. The first four are used by the virtual machine. They must be defined, and defined in this order,
suspendedContext: <Context|nil>
priority: <Integer>
myList: <LinkedList|nil>
threadAffinity: <Integer|nil>
effectiveProcess: <Process|nil>
name: <String|nil>
island: <Island|nil>
env: <Dictionary|nil>
effectiveProcess
- if not nil effectiveProcess is a process I am running on behalf of. Used by the execution simulation machinery (used by the debugger) to ensure that Processor activeProcess et al answer the expected result when simulating execution (e.g. when debugging). See evaluate:onBehalfOf: and senders.
env
- if not nil this is a Dictionary providing process-specific variables. See e.g. environmentAt:*, DynamicVariable and ProcessSpecificVariable.
island
- used by Tweak and Croquet to partition the image into multiple address spaces
myList
- if nil, I am either suspended or the active process. If not nil it is either some condition variable (Semaphore, Mutex) that I am blocked waiting on, or it is the LinkedList in ProcessorScheduler quiescentProcesses that holds the processes for my priority that are not the current active process but still runnable.
name
- if not nil this is my name, used for information, see e.g. the names of processes displayed in the ProcessBrowser
priority
- my scheduling priority, which corresponds to the index in ProcessorScheduler quiescentProcesses that holds the LinkedList of processes at this priority. If I am running but quiescent, changing priority involves changing priority and myList.
suspendedContext
- if nil, then I am either the active process or I have been terminated. If not nil it is the Context at the hot end of my stack
threadAffinity
- if not nil then it is an integer value set by the VM that controls how I interact with underlying native threads. If positive, the threadAffinity is that of some native thread known to the VM, and the VM will ensure that when I am running, I will be running on that native thread. If negative, the absolute value of threadAffinity is that of some thread known to the VM, and the VM will ensure that when I am running, I will *not* be running on that native thread. Set by the VM. Not to be set manually. Meaningful only on threaded VMs (which do not mean VMs with a threaded heartbeat). It is required to be my fourth instance variable. See SmalltalkImage >> #processHasThreadAffinityInstVar: for further information.!
Item was added:
+ ----- Method: Process class>>allProcesses (in category 'utilities') -----
+ allProcesses
+
+ ^ AllProcesses asArray copyWithout: nil!
Item was added:
+ ----- Method: Process class>>initialize (in category 'class initialization') -----
+ initialize
+
+ AllProcesses := WeakSet new.
+ AllProcessesLock := Mutex new.
+
+ AllProcessesLock critical: [
+ Process allSubInstancesDo: [:p | AllProcesses add: p]].!
Item was added:
+ ----- Method: Process class>>shutDown: (in category 'class initialization') -----
+ shutDown: quitting
+
+ AllProcessesLock critical: [AllProcesses compact].!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.552.mcz
==================== Summary ====================
Name: Graphics-mt.552
Author: mt
Time: 17 May 2024, 11:24:11.557587 am
UUID: 290cc5e1-5c6b-4540-853b-142735116730
Ancestors: Graphics-nice.551
Complements GraphicsTests-mt.64, which means fixing symmetry between #fillColor: and #colorAt: in Form as well as #isTransparentAt:.
=============== Diff against Graphics-nice.551 ===============
Item was changed:
----- Method: Color class>>colorFromPixelValue:depth: (in category 'instance creation') -----
colorFromPixelValue: p depth: d
"Convert a pixel value for the given display depth into a color."
"Details: For depths of 8 or less, the pixel value is simply looked up in a table. For greater depths, the color components are extracted and converted into a color."
| r g b alpha |
d = 8 ifTrue: [^ IndexedColors at: (p bitAnd: 16rFF) + 1].
d = 4 ifTrue: [^ IndexedColors at: (p bitAnd: 16r0F) + 1].
d = 2 ifTrue: [^ IndexedColors at: (p bitAnd: 16r03) + 1].
d = 1 ifTrue: [^ IndexedColors at: (p bitAnd: 16r01) + 1].
(d = 16) | (d = 15) ifTrue: [
"five bits per component"
r := (p bitShift: -10) bitAnd: 16r1F.
g := (p bitShift: -5) bitAnd: 16r1F.
b := p bitAnd: 16r1F.
(r = 0 and: [g = 0]) ifTrue: [
b = 0 ifTrue: [^Color transparent].
b = 1 ifTrue: [^Color black]].
^ Color r: r g: g b: b range: 31].
d = 32 ifTrue: [
"eight bits per component; 8 bits of alpha"
r := (p bitShift: -16) bitAnd: 16rFF.
g := (p bitShift: -8) bitAnd: 16rFF.
b := p bitAnd: 16rFF.
alpha := p bitShift: -24.
alpha = 0 ifTrue: [^Color transparent].
+ (r = 0 and: [g = 0]) ifTrue: [
+ b = 0 ifTrue: [^Color transparent].
+ b = 1 ifTrue: [^Color black]].
- (r = 0 and: [g = 0 and: [b = 0]]) ifTrue: [^Color transparent].
alpha < 255
ifTrue: [^ (Color r: r g: g b: b range: 255) alpha: (alpha asFloat / 255.0)]
ifFalse: [^ (Color r: r g: g b: b range: 255)]].
d = 12 ifTrue: [
"four bits per component"
r := (p bitShift: -8) bitAnd: 16rF.
g := (p bitShift: -4) bitAnd: 16rF.
b := p bitAnd: 16rF.
^ Color r: r g: g b: b range: 15].
d = 9 ifTrue: [
"three bits per component"
r := (p bitShift: -6) bitAnd: 16r7.
g := (p bitShift: -3) bitAnd: 16r7.
b := p bitAnd: 16r7.
^ Color r: r g: g b: b range: 7].
self error: 'unknown pixel depth: ', d printString
!
Item was changed:
----- Method: Form>>isTransparentAt: (in category 'pixel access') -----
isTransparentAt: aPoint
"Return true if the receiver is transparent at the given point."
self depth = 1 ifTrue: [^ false]. "no transparency at depth 1"
+ self depth = 32 ifTrue: [ | p |
+ p := self pixelValueAt: aPoint.
+ (p >> 24) = 0 ifTrue: [^ true "alpha = 0"].
+ (p bitAnd: 16rFFFFFF) = 0 ifTrue: [^ true "rgb = 0"].
+ ^ false].
+ ^ (self pixelValueAt: aPoint) = (self pixelValueFor: Color transparent)!
- ^ (self pixelValueAt: aPoint) = (self pixelValueFor: Color transparent)
- !
David T. Lewis uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-dtl.458.mcz
==================== Summary ====================
Name: KernelTests-dtl.458
Author: dtl
Time: 12 May 2024, 10:37:12.037596 am
UUID: cd9bf759-88b2-45e1-8b9e-510b24ba0455
Ancestors: KernelTests-ct.457
Add testSinCosConsistency to document an issue with inconsistent behavior of sin and cos at large magnitudes. Test fails in the current image, see discussion in "Trigonometric function error" thread on squeak-dev April/May 2024.
=============== Diff against KernelTests-ct.457 ===============
Item was added:
+ ----- Method: FloatTest>>testSinCosConsistency (in category 'tests - mathematical functions') -----
+ testSinCosConsistency
+ "Float rounding imprecision is expected but sin and cos should answer consistent
+ values for any angle."
+
+ "Angles within a reasonable range in which float precision is a lesser concern"
+ -1234567 to: 123456789 by: 113 do: [:angle | | hypotenuse diff |
+ hypotenuse := ((angle sin**2) + (angle cos**2)) sqrt.
+ diff := (1 - hypotenuse) abs.
+ self assert: diff < 0.00001].
+
+ "Large magnitude angles for which results are not meaningful, but that should still be consistent"
+ (1 to: 1000) inject: 2**122 into: [ :angle :i | | hypotenuse diff |
+ hypotenuse := ((angle sin**2) + (angle cos**2)) sqrt.
+ diff := (1 - hypotenuse) abs.
+ self assert: diff < 0.00001.
+ angle asFloat successor asInteger].
+
+ "Large negative angle magnitudes"
+ (1 to: 1000) inject: (2**122) negated into: [ :angle :i | | hypotenuse diff |
+ hypotenuse := ((angle sin**2) + (angle cos**2)) sqrt.
+ diff := (1 - hypotenuse) abs.
+ self assert: diff < 0.00001.
+ angle asFloat predecessor asInteger].
+ !
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2157.mcz
==================== Summary ====================
Name: Morphic-mt.2157
Author: mt
Time: 15 May 2024, 3:28:11.637384 pm
UUID: bf3cf9ea-8445-944d-b566-89b66d0133a4
Ancestors: Morphic-mt.2156
Fixes small color glitch in multi-selection lists where the curren row does not currently belong to the selection. There, selectedRow is merely the cursor and has just an outline. In UI themes with a contrast color, this would otherwise look awkward.
Thanks to Tom (tobe) for thei hint!
=============== Diff against Morphic-mt.2156 ===============
Item was changed:
----- Method: LazyListMorph>>colorForRow: (in category 'drawing') -----
colorForRow: row
+ ^ ((listSource hasMultiSelection and: [ self listSource itemSelectedAmongMultiple: row ])
+ or: [ selectedRow notNil and: [ row = selectedRow] ])
+ ifTrue: [ self selectionTextColor ]
+ ifFalse: [ self color ]!
- ^(selectedRow notNil and: [ row = selectedRow])
- ifTrue: [ self selectionTextColor ]
- ifFalse: [ self color ].!