Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.639.mcz
==================== Summary ====================
Name: Collections-cmm.639
Author: cmm
Time: 19 July 2015, 1:16:45.217 pm
UUID: 09c450e3-5490-437a-9799-9444bef22954
Ancestors: Collections-topa.638
Squeak 5.0 release, Spur bootstrap changes to transition to Spur object model and core system.
=============== Diff against Collections-topa.638 ===============
Item was changed:
----- Method: Array>>elementsExchangeIdentityWith: (in category 'converting') -----
elementsExchangeIdentityWith: otherArray
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ At the same time, all pointers to the elements of otherArray are replaced by
+ pointers to the corresponding elements of this array. The identityHashes remain
+ with the pointers rather than with the objects so that objects in hashed structures
+ should still be properly indexed after the mutation."
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. At the same time, all pointers to the elements of otherArray are replaced by pointers to the corresponding elements of this array. The identityHashes remain with the pointers rather than with the objects so that objects in hashed structures should still be properly indexed after the mutation."
+ <primitive: 128 error: ec>
+ ec == #'bad receiver' ifTrue:
+ [^self error: 'receiver must be of class Array'].
+ ec == #'bad argument' ifTrue:
+ [^self error: (otherArray class == Array
+ ifTrue: ['arg must be of class Array']
+ ifFalse: ['receiver and argument must have the same size'])].
+ ec == #'inappropriate operation' ifTrue:
+ [^self error: 'can''t become immediates such as SmallIntegers or Characters'].
+ ec == #'no modification' ifTrue:
+ [^self error: 'can''t become immutable objects'].
+ ec == #'object is pinned' ifTrue:
+ [^self error: 'can''t become pinned objects'].
+ ec == #'insufficient object memory' ifTrue:
+ [Smalltalk garbageCollect < 1048576 ifTrue:
+ [Smalltalk growMemoryByAtLeast: 1048576].
+ ^self elementsExchangeIdentityWith: otherArray].
+ self primitiveFailed!
- <primitive: 128>
- otherArray class == Array ifFalse: [^ self error: 'arg must be array'].
- self size = otherArray size ifFalse: [^ self error: 'arrays must be same size'].
- (self anySatisfy: [:obj | obj class == SmallInteger]) ifTrue: [^ self error: 'can''t become SmallIntegers'].
- (otherArray anySatisfy: [:obj | obj class == SmallInteger]) ifTrue: [^ self error: 'can''t become SmallIntegers'].
- self with: otherArray do:[:a :b| a == b ifTrue:[^self error:'can''t become yourself']].
-
- "Must have failed because not enough space in forwarding table (see ObjectMemory-prepareForwardingTableForBecoming:with:twoWay:). Do GC and try again only once"
- (Smalltalk bytesLeft: true) = Smalltalk primitiveGarbageCollect
- ifTrue: [^ self primitiveFailed].
- ^ self elementsExchangeIdentityWith: otherArray!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo: (in category 'converting') -----
elementsForwardIdentityTo: otherArray
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ The identityHashes remain with the pointers rather than with the objects so that
+ the objects in this array should still be properly indexed in any existing hashed
+ structures after the mutation."
+ <primitive: 72 error: ec>
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. The identityHashes remain with the pointers rather than with the objects so that the objects in this array should still be properly indexed in any existing hashed structures after the mutation."
- <primitive: 72>
self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo:copyHash: (in category 'converting') -----
elementsForwardIdentityTo: otherArray copyHash: copyHash
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ If copyHash is true, the identityHashes remain with the pointers rather than with the
+ objects so that the objects in the receiver should still be properly indexed in any
+ existing hashed structures after the mutation. If copyHash is false, then the hashes
+ of the objects in otherArray remain unchanged. If you know what you're doing this
+ may indeed be what you want."
+ <primitive: 249 error: ec>
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. The identityHashes remain with the pointers rather than with the objects so that the objects in this array should still be properly indexed in any existing hashed structures after the mutation."
- <primitive: 249>
self primitiveFailed!
Item was changed:
==== ERROR ===
Error: Unrecognized class type
19 July 2015 6:17:36.982 pm
VM: unix - a SmalltalkImage
Image: Squeak3.11alpha [latest update: #8824]
SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/squeaksource
Trusted Dir /home/squeaksource/secure
Untrusted Dir /home/squeaksource/My Squeak
MCClassDefinition(Object)>>error:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
aString: 'Unrecognized class type'
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>kindOfSubclass
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>printDefinitionOn:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
stream: a WriteStream
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
Receiver: a MCDiffyTextWriter
Arguments and temporary variables:
definition: a WriteStream
s: a MCClassDefinition(Character)
Receiver's instance variables:
stream: a WriteStream
initStream: nil
--- The full stack ---
MCClassDefinition(Object)>>error:
MCClassDefinition>>kindOfSubclass
MCClassDefinition>>printDefinitionOn:
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>chunkContents:
MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
MCDiffyTextWriter(MCStWriter)>>visitClassDefinition:
MCClassDefinition>>accept:
[] in MCDiffyTextWriter(MCTextWriter)>>visitInFork:
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>visitInFork:
MCDiffyTextWriter>>writePatchFrom:to:
MCDiffyTextWriter>>writeModification:
[] in MCDiffyTextWriter>>writePatch:
SortedCollection(OrderedCollection)>>do:
MCDiffyTextWriter>>writePatch:
SSDiffyTextWriter>>writePatch:
[] in SSDiffyTextWriter>>writeVersion:for:
BlockClosure>>on:do:
SSDiffyTextWriter>>writeVersion:for:
[] in SSEMailSubscription>>versionAdded:to:
BlockClosure>>on:do:
SSEMailSubscription>>versionAdded:to:
[] in [] in SSProject>>versionAdded:
[] in BlockClosure>>newProcess
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cmm.639.mcz
==================== Summary ====================
Name: Collections-cmm.639
Author: cmm
Time: 19 July 2015, 1:16:45.217 pm
UUID: 09c450e3-5490-437a-9799-9444bef22954
Ancestors: Collections-topa.638
Squeak 5.0 release, Spur bootstrap changes to transition to Spur object model and core system.
=============== Diff against Collections-topa.638 ===============
Item was changed:
----- Method: Array>>elementsExchangeIdentityWith: (in category 'converting') -----
elementsExchangeIdentityWith: otherArray
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ At the same time, all pointers to the elements of otherArray are replaced by
+ pointers to the corresponding elements of this array. The identityHashes remain
+ with the pointers rather than with the objects so that objects in hashed structures
+ should still be properly indexed after the mutation."
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. At the same time, all pointers to the elements of otherArray are replaced by pointers to the corresponding elements of this array. The identityHashes remain with the pointers rather than with the objects so that objects in hashed structures should still be properly indexed after the mutation."
+ <primitive: 128 error: ec>
+ ec == #'bad receiver' ifTrue:
+ [^self error: 'receiver must be of class Array'].
+ ec == #'bad argument' ifTrue:
+ [^self error: (otherArray class == Array
+ ifTrue: ['arg must be of class Array']
+ ifFalse: ['receiver and argument must have the same size'])].
+ ec == #'inappropriate operation' ifTrue:
+ [^self error: 'can''t become immediates such as SmallIntegers or Characters'].
+ ec == #'no modification' ifTrue:
+ [^self error: 'can''t become immutable objects'].
+ ec == #'object is pinned' ifTrue:
+ [^self error: 'can''t become pinned objects'].
+ ec == #'insufficient object memory' ifTrue:
+ [Smalltalk garbageCollect < 1048576 ifTrue:
+ [Smalltalk growMemoryByAtLeast: 1048576].
+ ^self elementsExchangeIdentityWith: otherArray].
+ self primitiveFailed!
- <primitive: 128>
- otherArray class == Array ifFalse: [^ self error: 'arg must be array'].
- self size = otherArray size ifFalse: [^ self error: 'arrays must be same size'].
- (self anySatisfy: [:obj | obj class == SmallInteger]) ifTrue: [^ self error: 'can''t become SmallIntegers'].
- (otherArray anySatisfy: [:obj | obj class == SmallInteger]) ifTrue: [^ self error: 'can''t become SmallIntegers'].
- self with: otherArray do:[:a :b| a == b ifTrue:[^self error:'can''t become yourself']].
-
- "Must have failed because not enough space in forwarding table (see ObjectMemory-prepareForwardingTableForBecoming:with:twoWay:). Do GC and try again only once"
- (Smalltalk bytesLeft: true) = Smalltalk primitiveGarbageCollect
- ifTrue: [^ self primitiveFailed].
- ^ self elementsExchangeIdentityWith: otherArray!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo: (in category 'converting') -----
elementsForwardIdentityTo: otherArray
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ The identityHashes remain with the pointers rather than with the objects so that
+ the objects in this array should still be properly indexed in any existing hashed
+ structures after the mutation."
+ <primitive: 72 error: ec>
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. The identityHashes remain with the pointers rather than with the objects so that the objects in this array should still be properly indexed in any existing hashed structures after the mutation."
- <primitive: 72>
self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo:copyHash: (in category 'converting') -----
elementsForwardIdentityTo: otherArray copyHash: copyHash
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ If copyHash is true, the identityHashes remain with the pointers rather than with the
+ objects so that the objects in the receiver should still be properly indexed in any
+ existing hashed structures after the mutation. If copyHash is false, then the hashes
+ of the objects in otherArray remain unchanged. If you know what you're doing this
+ may indeed be what you want."
+ <primitive: 249 error: ec>
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. The identityHashes remain with the pointers rather than with the objects so that the objects in this array should still be properly indexed in any existing hashed structures after the mutation."
- <primitive: 249>
self primitiveFailed!
Item was changed:
==== ERROR ===
Error: Unrecognized class type
19 July 2015 6:17:36.982 pm
VM: unix - a SmalltalkImage
Image: Squeak3.11alpha [latest update: #8824]
SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/squeaksource
Trusted Dir /home/squeaksource/secure
Untrusted Dir /home/squeaksource/My Squeak
MCClassDefinition(Object)>>error:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
aString: 'Unrecognized class type'
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>kindOfSubclass
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>printDefinitionOn:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
stream: a WriteStream
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
Receiver: a MCDiffyTextWriter
Arguments and temporary variables:
definition: a WriteStream
s: a MCClassDefinition(Character)
Receiver's instance variables:
stream: a WriteStream
initStream: nil
--- The full stack ---
MCClassDefinition(Object)>>error:
MCClassDefinition>>kindOfSubclass
MCClassDefinition>>printDefinitionOn:
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>chunkContents:
MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
MCDiffyTextWriter(MCStWriter)>>visitClassDefinition:
MCClassDefinition>>accept:
[] in MCDiffyTextWriter(MCTextWriter)>>visitInFork:
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>visitInFork:
MCDiffyTextWriter>>writePatchFrom:to:
MCDiffyTextWriter>>writeModification:
[] in MCDiffyTextWriter>>writePatch:
SortedCollection(OrderedCollection)>>do:
MCDiffyTextWriter>>writePatch:
SSDiffyTextWriter>>writePatch:
[] in SSDiffyTextWriter>>writeVersion:for:
BlockClosure>>on:do:
SSDiffyTextWriter>>writeVersion:for:
[] in SSEMailSubscription>>versionAdded:to:
BlockClosure>>on:do:
SSEMailSubscription>>versionAdded:to:
[] in [] in SSProject>>versionAdded:
[] in BlockClosure>>newProcess
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.994.mcz
==================== Summary ====================
Name: Morphic-eem.994
Author: eem
Time: 18 July 2015, 10:22:51.401 am
UUID: bd1bf232-933d-4017-95d5-974200758bb6
Ancestors: Morphic-cmm.993
Fix a serious bug with interCyclePause:. On the first invocation, lastCycleTime may be far in the future (since it will be whatever it was when the image is saved), hence Time millisecondsSince: lastCycleTime can be large and negative, hence milliSecs - (Time millisecondsSince: lastCycleTime) can be large and positive, which can result in a delay of many minutes in the first invocation. This was causing the unresponsivness of the 64-bit Spur image on start-up. The fix is simple; if lastCycleTime iks in the future it should be reset.
Change HandMorph>>handleEvent: to only update EventStats if it is non-nil, and change the package prologue to nil it. Nothing reads EventStats, so it is taking cycles for no purpose. This isn;t an issue until the count of mouse move events rolls over into large positive integers, at which point there's real overhead. There's a comment in the method to allow one to "install" EventStats if and when one does want to collect such stats. But IMO this shouldn't be enabled by default. Waste not, want not.
=============== Diff against Morphic-cmm.993 ===============
Item was changed:
----- Method: HandMorph>>handleEvent: (in category 'events-processing') -----
handleEvent: anEvent
| evt ofs |
owner ifNil:[^self].
evt := anEvent.
+ "EventStats ifNil:[EventStats := IdentityDictionary new] ifNotNil: [EventStats := nil]."
+ EventStats ifNotNil:
+ [EventStats
+ at: #TypicalStack ifAbsentPut: [thisContext copyStack];
+ at: #count put: (EventStats at: #count ifAbsent:[0]) + 1;
+ at: evt type put: (EventStats at: evt type ifAbsent:[0]) + 1].
- EventStats ifNil:[EventStats := IdentityDictionary new].
- EventStats at: #count put: (EventStats at: #count ifAbsent:[0]) + 1.
- EventStats at: evt type put: (EventStats at: evt type ifAbsent:[0]) + 1.
evt isMouseOver ifTrue:[^self sendMouseEvent: evt].
ShowEvents == true ifTrue:[
Display fill: (0@0 extent: 250@120) rule: Form over fillColor: Color white.
ofs := (owner hands indexOf: self) - 1 * 60.
evt printString displayAt: (0@ofs) + (evt isKeyboard ifTrue:[0@30] ifFalse:[0@0]).
self keyboardFocus printString displayAt: (0@ofs)+(0@45).
].
"Notify listeners"
self sendListenEvent: evt to: self eventListeners.
evt isWindowEvent ifTrue: [
self sendEvent: evt focus: nil.
^self mouseOverHandler processMouseOver: lastMouseEvent].
evt isKeyboard ifTrue:[
self sendListenEvent: evt to: self keyboardListeners.
self sendKeyboardEvent: evt.
^self mouseOverHandler processMouseOver: lastMouseEvent].
evt isDropEvent ifTrue:[
self sendEvent: evt focus: nil.
^self mouseOverHandler processMouseOver: lastMouseEvent].
evt isMouse ifTrue:[
self sendListenEvent: evt to: self mouseListeners.
lastMouseEvent := evt].
"Check for pending drag or double click operations."
mouseClickState ifNotNil:[
(mouseClickState handleEvent: evt from: self) ifFalse:[
"Possibly dispatched #click: or something and will not re-establish otherwise"
^self mouseOverHandler processMouseOver: lastMouseEvent]].
evt isMove ifTrue:[
self position: evt position.
self sendMouseEvent: evt.
] ifFalse:[
"Issue a synthetic move event if we're not at the position of the event"
(evt position = self position) ifFalse:[self moveToEvent: evt].
"Drop submorphs on button events"
(self hasSubmorphs)
ifTrue:[self dropMorphs: evt]
ifFalse:[self sendMouseEvent: evt].
].
ShowEvents == true ifTrue:[self mouseFocus printString displayAt: (0@ofs) + (0@15)].
self mouseOverHandler processMouseOver: lastMouseEvent.
"self handleDragOutside: anEvent."
!
Item was changed:
----- Method: WorldState>>interCyclePause: (in category 'update cycle') -----
interCyclePause: milliSecs
+ "Delay enough that the previous cycle plus the amount of delay will equal milliSecs. If the cycle is
+ already expensive, then no delay occurs. However, if the system is idly waiting for interaction from
+ the user, the method will delay for a proportionally long time and cause the overall CPU usage of
+ Squeak to be low. If the preference #serverMode is enabled, always do a complete delay of 50ms,
+ independant of my argument. This prevents the freezing problem described in Mantis #6581"
- "delay enough that the previous cycle plus the amount of delay will equal milliSecs. If the cycle is already expensive, then no delay occurs. However, if the system is idly waiting for interaction from the user, the method will delay for a proportionally long time and cause the overall CPU usage of Squeak to be low.
- If the preference #serverMode is enabled, always do a complete delay of 50ms, independant of my argument. This prevents the freezing problem described in Mantis #6581"
+ | now millisecondsToWait |
+ now := Time millisecondClockValue.
+ "Be careful not to be misled by the first invocation after start-up.
+ lastCycleTime may be a left-over. On clock wraparound, this will
+ result in a delya-less cycle, which should not be a problem."
+ (lastCycleTime notNil and: [lastCycleTime > now]) ifTrue:
+ [lastCycleTime := nil].
- | millisecondsToWait |
millisecondsToWait := Preferences serverMode
ifTrue: [ 50 ]
+ ifFalse: "e.g. CanSurrenderToOS is falsified by mouse move events in the SketchEditor for maximal responsiveness."
+ [ (lastCycleTime isNil or: [ CanSurrenderToOS == false ])
- ifFalse: [
- (lastCycleTime isNil or: [ CanSurrenderToOS == false ])
ifTrue: [ 0 ]
+ ifFalse: [ milliSecs - (now - lastCycleTime) ] ].
+ millisecondsToWait > 0 ifTrue:
+ [ (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
- ifFalse: [ milliSecs - (Time millisecondsSince: lastCycleTime) ] ].
- millisecondsToWait > 0 ifTrue: [
- (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
ifTrue: [ interCycleDelay := Delay forMilliseconds: millisecondsToWait ]
ifFalse: [ interCycleDelay delayDuration: millisecondsToWait ].
interCycleDelay wait ].
+ lastCycleTime := now.
+ CanSurrenderToOS := true!
- lastCycleTime := Time millisecondClockValue.
- CanSurrenderToOS := true.!
Item was changed:
(PackageInfo named: 'Morphic') postscript: '"Initialize the key bindings and menus"
Editor initialize.
"apply the new icons"
MenuIcons initializeIcons.
TheWorldMainDockingBar updateInstances.
"Fix missing inset of old-style windows."
SystemWindow allSubInstancesDo: [:ea |
(ea paneMorphs detect: [:m | m layoutFrame leftFraction = 0] ifNone: [])
ifNotNil: [:m | m layoutFrame leftOffset > 0
ifTrue: [ea layoutInset: 0]]].
"Remove non-functional tools from world menu."
LanguageEditor unload.
UUniverseBrowser unload.
+ UUniverseEditor unload.
+
+ "Nuke the dubious EventStats dictionary"
+ HandMorph classPool at: #EventStats put: nil.'!
- UUniverseEditor unload.'!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.994.mcz
==================== Summary ====================
Name: Morphic-eem.994
Author: eem
Time: 18 July 2015, 10:22:51.401 am
UUID: bd1bf232-933d-4017-95d5-974200758bb6
Ancestors: Morphic-cmm.993
Fix a serious bug with interCyclePause:. On the first invocation, lastCycleTime may be far in the future (since it will be whatever it was when the image is saved), hence Time millisecondsSince: lastCycleTime can be large and negative, hence milliSecs - (Time millisecondsSince: lastCycleTime) can be large and positive, which can result in a delay of many minutes in the first invocation. This was causing the unresponsivness of the 64-bit Spur image on start-up. The fix is simple; if lastCycleTime iks in the future it should be reset.
Change HandMorph>>handleEvent: to only update EventStats if it is non-nil, and change the package prologue to nil it. Nothing reads EventStats, so it is taking cycles for no purpose. This isn;t an issue until the count of mouse move events rolls over into large positive integers, at which point there's real overhead. There's a comment in the method to allow one to "install" EventStats if and when one does want to collect such stats. But IMO this shouldn't be enabled by default. Waste not, want not.
=============== Diff against Morphic-cmm.993 ===============
Item was changed:
----- Method: HandMorph>>handleEvent: (in category 'events-processing') -----
handleEvent: anEvent
| evt ofs |
owner ifNil:[^self].
evt := anEvent.
+ "EventStats ifNil:[EventStats := IdentityDictionary new] ifNotNil: [EventStats := nil]."
+ EventStats ifNotNil:
+ [EventStats
+ at: #TypicalStack ifAbsentPut: [thisContext copyStack];
+ at: #count put: (EventStats at: #count ifAbsent:[0]) + 1;
+ at: evt type put: (EventStats at: evt type ifAbsent:[0]) + 1].
- EventStats ifNil:[EventStats := IdentityDictionary new].
- EventStats at: #count put: (EventStats at: #count ifAbsent:[0]) + 1.
- EventStats at: evt type put: (EventStats at: evt type ifAbsent:[0]) + 1.
evt isMouseOver ifTrue:[^self sendMouseEvent: evt].
ShowEvents == true ifTrue:[
Display fill: (0@0 extent: 250@120) rule: Form over fillColor: Color white.
ofs := (owner hands indexOf: self) - 1 * 60.
evt printString displayAt: (0@ofs) + (evt isKeyboard ifTrue:[0@30] ifFalse:[0@0]).
self keyboardFocus printString displayAt: (0@ofs)+(0@45).
].
"Notify listeners"
self sendListenEvent: evt to: self eventListeners.
evt isWindowEvent ifTrue: [
self sendEvent: evt focus: nil.
^self mouseOverHandler processMouseOver: lastMouseEvent].
evt isKeyboard ifTrue:[
self sendListenEvent: evt to: self keyboardListeners.
self sendKeyboardEvent: evt.
^self mouseOverHandler processMouseOver: lastMouseEvent].
evt isDropEvent ifTrue:[
self sendEvent: evt focus: nil.
^self mouseOverHandler processMouseOver: lastMouseEvent].
evt isMouse ifTrue:[
self sendListenEvent: evt to: self mouseListeners.
lastMouseEvent := evt].
"Check for pending drag or double click operations."
mouseClickState ifNotNil:[
(mouseClickState handleEvent: evt from: self) ifFalse:[
"Possibly dispatched #click: or something and will not re-establish otherwise"
^self mouseOverHandler processMouseOver: lastMouseEvent]].
evt isMove ifTrue:[
self position: evt position.
self sendMouseEvent: evt.
] ifFalse:[
"Issue a synthetic move event if we're not at the position of the event"
(evt position = self position) ifFalse:[self moveToEvent: evt].
"Drop submorphs on button events"
(self hasSubmorphs)
ifTrue:[self dropMorphs: evt]
ifFalse:[self sendMouseEvent: evt].
].
ShowEvents == true ifTrue:[self mouseFocus printString displayAt: (0@ofs) + (0@15)].
self mouseOverHandler processMouseOver: lastMouseEvent.
"self handleDragOutside: anEvent."
!
Item was changed:
----- Method: WorldState>>interCyclePause: (in category 'update cycle') -----
interCyclePause: milliSecs
+ "Delay enough that the previous cycle plus the amount of delay will equal milliSecs. If the cycle is
+ already expensive, then no delay occurs. However, if the system is idly waiting for interaction from
+ the user, the method will delay for a proportionally long time and cause the overall CPU usage of
+ Squeak to be low. If the preference #serverMode is enabled, always do a complete delay of 50ms,
+ independant of my argument. This prevents the freezing problem described in Mantis #6581"
- "delay enough that the previous cycle plus the amount of delay will equal milliSecs. If the cycle is already expensive, then no delay occurs. However, if the system is idly waiting for interaction from the user, the method will delay for a proportionally long time and cause the overall CPU usage of Squeak to be low.
- If the preference #serverMode is enabled, always do a complete delay of 50ms, independant of my argument. This prevents the freezing problem described in Mantis #6581"
+ | now millisecondsToWait |
+ now := Time millisecondClockValue.
+ "Be careful not to be misled by the first invocation after start-up.
+ lastCycleTime may be a left-over. On clock wraparound, this will
+ result in a delya-less cycle, which should not be a problem."
+ (lastCycleTime notNil and: [lastCycleTime > now]) ifTrue:
+ [lastCycleTime := nil].
- | millisecondsToWait |
millisecondsToWait := Preferences serverMode
ifTrue: [ 50 ]
+ ifFalse: "e.g. CanSurrenderToOS is falsified by mouse move events in the SketchEditor for maximal responsiveness."
+ [ (lastCycleTime isNil or: [ CanSurrenderToOS == false ])
- ifFalse: [
- (lastCycleTime isNil or: [ CanSurrenderToOS == false ])
ifTrue: [ 0 ]
+ ifFalse: [ milliSecs - (now - lastCycleTime) ] ].
+ millisecondsToWait > 0 ifTrue:
+ [ (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
- ifFalse: [ milliSecs - (Time millisecondsSince: lastCycleTime) ] ].
- millisecondsToWait > 0 ifTrue: [
- (interCycleDelay isNil or: [ interCycleDelay beingWaitedOn ])
ifTrue: [ interCycleDelay := Delay forMilliseconds: millisecondsToWait ]
ifFalse: [ interCycleDelay delayDuration: millisecondsToWait ].
interCycleDelay wait ].
+ lastCycleTime := now.
+ CanSurrenderToOS := true!
- lastCycleTime := Time millisecondClockValue.
- CanSurrenderToOS := true.!
Item was changed:
(PackageInfo named: 'Morphic') postscript: '"Initialize the key bindings and menus"
Editor initialize.
"apply the new icons"
MenuIcons initializeIcons.
TheWorldMainDockingBar updateInstances.
"Fix missing inset of old-style windows."
SystemWindow allSubInstancesDo: [:ea |
(ea paneMorphs detect: [:m | m layoutFrame leftFraction = 0] ifNone: [])
ifNotNil: [:m | m layoutFrame leftOffset > 0
ifTrue: [ea layoutInset: 0]]].
"Remove non-functional tools from world menu."
LanguageEditor unload.
UUniverseBrowser unload.
+ UUniverseEditor unload.
+
+ "Nuke the dubious EventStats dictionary"
+ HandMorph classPool at: #EventStats put: nil.'!
- UUniverseEditor unload.'!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections.spur-topa.638.mcz
==================== Summary ====================
Name: Collections.spur-topa.638
Author: eem
Time: 8 July 2015, 5:19:46.214 pm
UUID: 74b2d4fa-c030-48a7-ae6c-c6809bd0318a
Ancestors: Collections-topa.638, Collections.spur-topa.637
Collections-topa.638 patched for Spur by SpurBootstrapMonticelloPackagePatcher Cog-eem.270
Let's say PluggableTextAttributes are not serializable.
=============== Diff against Collections-topa.638 ===============
Item was changed:
----- Method: Array>>elementsExchangeIdentityWith: (in category 'converting') -----
elementsExchangeIdentityWith: otherArray
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ At the same time, all pointers to the elements of otherArray are replaced by
+ pointers to the corresponding elements of this array. The identityHashes remain
+ with the pointers rather than with the objects so that objects in hashed structures
+ should still be properly indexed after the mutation."
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. At the same time, all pointers to the elements of otherArray are replaced by pointers to the corresponding elements of this array. The identityHashes remain with the pointers rather than with the objects so that objects in hashed structures should still be properly indexed after the mutation."
+ <primitive: 128 error: ec>
+ ec == #'bad receiver' ifTrue:
+ [^self error: 'receiver must be of class Array'].
+ ec == #'bad argument' ifTrue:
+ [^self error: (otherArray class == Array
+ ifTrue: ['arg must be of class Array']
+ ifFalse: ['receiver and argument must have the same size'])].
+ ec == #'inappropriate operation' ifTrue:
+ [^self error: 'can''t become immediates such as SmallIntegers or Characters'].
+ ec == #'no modification' ifTrue:
+ [^self error: 'can''t become immutable objects'].
+ ec == #'object is pinned' ifTrue:
+ [^self error: 'can''t become pinned objects'].
+ ec == #'insufficient object memory' ifTrue:
+ [Smalltalk garbageCollect < 1048576 ifTrue:
+ [Smalltalk growMemoryByAtLeast: 1048576].
+ ^self elementsExchangeIdentityWith: otherArray].
+ self primitiveFailed!
- <primitive: 128>
- otherArray class == Array ifFalse: [^ self error: 'arg must be array'].
- self size = otherArray size ifFalse: [^ self error: 'arrays must be same size'].
- (self anySatisfy: [:obj | obj class == SmallInteger]) ifTrue: [^ self error: 'can''t become SmallIntegers'].
- (otherArray anySatisfy: [:obj | obj class == SmallInteger]) ifTrue: [^ self error: 'can''t become SmallIntegers'].
- self with: otherArray do:[:a :b| a == b ifTrue:[^self error:'can''t become yourself']].
-
- "Must have failed because not enough space in forwarding table (see ObjectMemory-prepareForwardingTableForBecoming:with:twoWay:). Do GC and try again only once"
- (Smalltalk bytesLeft: true) = Smalltalk primitiveGarbageCollect
- ifTrue: [^ self primitiveFailed].
- ^ self elementsExchangeIdentityWith: otherArray!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo: (in category 'converting') -----
elementsForwardIdentityTo: otherArray
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ The identityHashes remain with the pointers rather than with the objects so that
+ the objects in this array should still be properly indexed in any existing hashed
+ structures after the mutation."
+ <primitive: 72 error: ec>
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. The identityHashes remain with the pointers rather than with the objects so that the objects in this array should still be properly indexed in any existing hashed structures after the mutation."
- <primitive: 72>
self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo:copyHash: (in category 'converting') -----
elementsForwardIdentityTo: otherArray copyHash: copyHash
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ If copyHash is true, the identityHashes remain with the pointers rather than with the
+ objects so that the objects in the receiver should still be properly indexed in any
+ existing hashed structures after the mutation. If copyHash is false, then the hashes
+ of the objects in otherArray remain unchanged. If you know what you're doing this
+ may indeed be what you want."
+ <primitive: 249 error: ec>
- "This primitive performs a bulk mutation, causing all pointers to the elements of this array to be replaced by pointers to the corresponding elements of otherArray. The identityHashes remain with the pointers rather than with the objects so that the objects in this array should still be properly indexed in any existing hashed structures after the mutation."
- <primitive: 249>
self primitiveFailed!
Item was changed:
==== ERROR ===
Error: Unrecognized class type
9 July 2015 12:20:49.041 am
VM: unix - a SmalltalkImage
Image: Squeak3.11alpha [latest update: #8824]
SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/squeaksource
Trusted Dir /home/squeaksource/secure
Untrusted Dir /home/squeaksource/My Squeak
MCClassDefinition(Object)>>error:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
aString: 'Unrecognized class type'
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>kindOfSubclass
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
MCClassDefinition>>printDefinitionOn:
Receiver: a MCClassDefinition(Character)
Arguments and temporary variables:
stream: a WriteStream
Receiver's instance variables:
name: #Character
superclassName: #Magnitude
variables: an OrderedCollection(a MCClassVariableDefinition(AlphaNumericMask) a...etc...
category: #'Collections-Strings'
type: #immediate
comment: 'I represent a character by storing its associated Unicode as an unsig...etc...
commentStamp: 'eem 8/12/2014 14:53'
traitComposition: nil
classTraitComposition: nil
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
Receiver: a MCDiffyTextWriter
Arguments and temporary variables:
definition: a WriteStream
s: a MCClassDefinition(Character)
Receiver's instance variables:
stream: a WriteStream
initStream: nil
--- The full stack ---
MCClassDefinition(Object)>>error:
MCClassDefinition>>kindOfSubclass
MCClassDefinition>>printDefinitionOn:
[] in MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>chunkContents:
MCDiffyTextWriter(MCStWriter)>>writeClassDefinition:
MCDiffyTextWriter(MCStWriter)>>visitClassDefinition:
MCClassDefinition>>accept:
[] in MCDiffyTextWriter(MCTextWriter)>>visitInFork:
String class(SequenceableCollection class)>>new:streamContents:
String class(SequenceableCollection class)>>streamContents:
MCDiffyTextWriter(MCTextWriter)>>visitInFork:
MCDiffyTextWriter>>writePatchFrom:to:
MCDiffyTextWriter>>writeModification:
[] in MCDiffyTextWriter>>writePatch:
SortedCollection(OrderedCollection)>>do:
MCDiffyTextWriter>>writePatch:
SSDiffyTextWriter>>writePatch:
[] in SSDiffyTextWriter>>writeVersion:for:
BlockClosure>>on:do:
SSDiffyTextWriter>>writeVersion:for:
[] in SSEMailSubscription>>versionAdded:to:
BlockClosure>>on:do:
SSEMailSubscription>>versionAdded:to:
[] in [] in SSProject>>versionAdded:
[] in BlockClosure>>newProcess