Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.498.mcz
==================== Summary ====================
Name: System-ul.498
Author: ul
Time: 28 September 2012, 11:04:36.54 am
UUID: cee97707-7da6-c943-a664-3e8a6f185f37
Ancestors: System-ul.494
Another possible fix for ClassRemovalTest >> #testClassRemovalAndRecompilcationWontCreateDuplicateVariableBindings. This time when the class is removed:
- replace the bindings in that class with a copy
- search for other referrers in the system
- if such referrer was found, then nil out the value of the original binding and move it to Undeclared
=============== Diff against System-ul.494 ===============
Item was changed:
----- Method: SystemDictionary>>forgetClass:logged: (in category 'classes and traits') -----
forgetClass: aClass logged: aBool
"Delete the class, aClass, from the system.
Note that this doesn't do everything required to dispose of a class - to do that use Class>>removeFromSystem."
aBool ifTrue: [SystemChangeNotifier uniqueInstance classRemoved: aClass fromCategory: aClass category].
self organization removeElement: aClass name.
Smalltalk removeFromStartUpList: aClass.
Smalltalk removeFromShutDownList: aClass.
+ aClass isObsolete ifFalse: [
+ (self associationAt: aClass name ifAbsent: [ nil ]) ifNotNil: [ :oldBinding |
+ | newBinding |
+ newBinding := oldBinding shallowCopy.
+ self replaceBinding: oldBinding in: aClass with: newBinding.
+ (self isThisBindingReferred: oldBinding) ifTrue: [
+ oldBinding value: nil.
+ Undeclared add: oldBinding ] ] ].
self removeKey: aClass name ifAbsent: [].
+ self flushClassNameCache!
- self flushClassNameCache.!
Item was added:
+ ----- Method: SystemDictionary>>isThisBindingReferred: (in category 'classes and traits') -----
+ isThisBindingReferred: binding
+
+ self systemNavigation allSelectorsAndMethodsDo: [ :behavior :selector :method |
+ (method instVarsInclude: binding) ifTrue: [
+ method literalsDo: [ :literal | "Avoid possible false positives from the primitive."
+ literal == binding ifTrue: [ ^true ] ] ] ].
+ ^false!
Item was added:
+ ----- Method: SystemDictionary>>replaceBinding:in:with: (in category 'classes and traits') -----
+ replaceBinding: oldBinding in: aClass with: newBinding
+ "Replace oldBinding with newBinding in aClass. This method is expected to be used during the removal of aClass."
+
+ aClass methodsDo: [ :method |
+ 1 to: method numLiterals do: [ :index |
+ (method literalAt: index) == oldBinding ifTrue: [
+ method literalAt: index put: newBinding ] ] ]!
Item was added:
+ ----- Method: SystemDictionary>>replaceBinding:inAllMethodsWith: (in category 'classes and traits') -----
+ replaceBinding: oldBinding inAllMethodsWith: newBinding
+ "Replace oldBinding to newBinding in all methods in the system except for those which are the methods of the class of oldBinding. Return true if such replacement were made, false otherwise."
+
+ | foundReferringMethod |
+ foundReferringMethod := false.
+ self systemNavigation allSelectorsAndMethodsDo: [ :behavior :selector :method |
+ (behavior ~~ oldBinding value and: [
+ method instVarsInclude: oldBinding ]) ifTrue: [ "Use the fast primitive first."
+ "The penultimate literal holds the selector of the method, the last literal is the class."
+ 1 to: method numLiterals - 2 do: [ :index |
+ (method literalAt: index) == oldBinding ifTrue: [
+ foundReferringMethod := true.
+ method
+ literalAt: index put: newBinding;
+ flushCache ] ] ] ].
+ ^foundReferringMethod!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.498.mcz
==================== Summary ====================
Name: System-ul.498
Author: ul
Time: 28 September 2012, 11:04:36.54 am
UUID: cee97707-7da6-c943-a664-3e8a6f185f37
Ancestors: System-ul.494
Another possible fix for ClassRemovalTest >> #testClassRemovalAndRecompilcationWontCreateDuplicateVariableBindings. This time when the class is removed:
- replace the bindings in that class with a copy
- search for other referrers in the system
- if such referrer was found, then nil out the value of the original binding and move it to Undeclared
=============== Diff against System-ul.494 ===============
Item was changed:
----- Method: SystemDictionary>>forgetClass:logged: (in category 'classes and traits') -----
forgetClass: aClass logged: aBool
"Delete the class, aClass, from the system.
Note that this doesn't do everything required to dispose of a class - to do that use Class>>removeFromSystem."
aBool ifTrue: [SystemChangeNotifier uniqueInstance classRemoved: aClass fromCategory: aClass category].
self organization removeElement: aClass name.
Smalltalk removeFromStartUpList: aClass.
Smalltalk removeFromShutDownList: aClass.
+ aClass isObsolete ifFalse: [
+ (self associationAt: aClass name ifAbsent: [ nil ]) ifNotNil: [ :oldBinding |
+ | newBinding |
+ newBinding := oldBinding shallowCopy.
+ self replaceBinding: oldBinding in: aClass with: newBinding.
+ (self isThisBindingReferred: oldBinding) ifTrue: [
+ oldBinding value: nil.
+ Undeclared add: oldBinding ] ] ].
self removeKey: aClass name ifAbsent: [].
+ self flushClassNameCache!
- self flushClassNameCache.!
Item was added:
+ ----- Method: SystemDictionary>>isThisBindingReferred: (in category 'classes and traits') -----
+ isThisBindingReferred: binding
+
+ self systemNavigation allSelectorsAndMethodsDo: [ :behavior :selector :method |
+ (method instVarsInclude: binding) ifTrue: [
+ method literalsDo: [ :literal | "Avoid possible false positives from the primitive."
+ literal == binding ifTrue: [ ^true ] ] ] ].
+ ^false!
Item was added:
+ ----- Method: SystemDictionary>>replaceBinding:in:with: (in category 'classes and traits') -----
+ replaceBinding: oldBinding in: aClass with: newBinding
+ "Replace oldBinding with newBinding in aClass. This method is expected to be used during the removal of aClass."
+
+ aClass methodsDo: [ :method |
+ 1 to: method numLiterals do: [ :index |
+ (method literalAt: index) == oldBinding ifTrue: [
+ method literalAt: index put: newBinding ] ] ]!
Item was added:
+ ----- Method: SystemDictionary>>replaceBinding:inAllMethodsWith: (in category 'classes and traits') -----
+ replaceBinding: oldBinding inAllMethodsWith: newBinding
+ "Replace oldBinding to newBinding in all methods in the system except for those which are the methods of the class of oldBinding. Return true if such replacement were made, false otherwise."
+
+ | foundReferringMethod |
+ foundReferringMethod := false.
+ self systemNavigation allSelectorsAndMethodsDo: [ :behavior :selector :method |
+ (behavior ~~ oldBinding value and: [
+ method instVarsInclude: oldBinding ]) ifTrue: [ "Use the fast primitive first."
+ "The penultimate literal holds the selector of the method, the last literal is the class."
+ 1 to: method numLiterals - 2 do: [ :index |
+ (method literalAt: index) == oldBinding ifTrue: [
+ foundReferringMethod := true.
+ method
+ literalAt: index put: newBinding;
+ flushCache ] ] ] ].
+ ^foundReferringMethod!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.498.mcz
==================== Summary ====================
Name: System-ul.498
Author: ul
Time: 28 September 2012, 11:04:36.54 am
UUID: cee97707-7da6-c943-a664-3e8a6f185f37
Ancestors: System-ul.494
Another possible fix for ClassRemovalTest >> #testClassRemovalAndRecompilcationWontCreateDuplicateVariableBindings. This time when the class is removed:
- replace the bindings in that class with a copy
- search for other referrers in the system
- if such referrer was found, then nil out the value of the original binding and move it to Undeclared
=============== Diff against System-ul.494 ===============
Item was changed:
----- Method: SystemDictionary>>forgetClass:logged: (in category 'classes and traits') -----
forgetClass: aClass logged: aBool
"Delete the class, aClass, from the system.
Note that this doesn't do everything required to dispose of a class - to do that use Class>>removeFromSystem."
aBool ifTrue: [SystemChangeNotifier uniqueInstance classRemoved: aClass fromCategory: aClass category].
self organization removeElement: aClass name.
Smalltalk removeFromStartUpList: aClass.
Smalltalk removeFromShutDownList: aClass.
+ aClass isObsolete ifFalse: [
+ (self associationAt: aClass name ifAbsent: [ nil ]) ifNotNil: [ :oldBinding |
+ | newBinding |
+ newBinding := oldBinding shallowCopy.
+ self replaceBinding: oldBinding in: aClass with: newBinding.
+ (self isThisBindingReferred: oldBinding) ifTrue: [
+ oldBinding value: nil.
+ Undeclared add: oldBinding ] ] ].
self removeKey: aClass name ifAbsent: [].
+ self flushClassNameCache!
- self flushClassNameCache.!
Item was added:
+ ----- Method: SystemDictionary>>isThisBindingReferred: (in category 'classes and traits') -----
+ isThisBindingReferred: binding
+
+ self systemNavigation allSelectorsAndMethodsDo: [ :behavior :selector :method |
+ (method instVarsInclude: binding) ifTrue: [
+ method literalsDo: [ :literal | "Avoid possible false positives from the primitive."
+ literal == binding ifTrue: [ ^true ] ] ] ].
+ ^false!
Item was added:
+ ----- Method: SystemDictionary>>replaceBinding:in:with: (in category 'classes and traits') -----
+ replaceBinding: oldBinding in: aClass with: newBinding
+ "Replace oldBinding with newBinding in aClass. This method is expected to be used during the removal of aClass."
+
+ aClass methodsDo: [ :method |
+ 1 to: method numLiterals do: [ :index |
+ (method literalAt: index) == oldBinding ifTrue: [
+ method literalAt: index put: newBinding ] ] ]!
Item was added:
+ ----- Method: SystemDictionary>>replaceBinding:inAllMethodsWith: (in category 'classes and traits') -----
+ replaceBinding: oldBinding inAllMethodsWith: newBinding
+ "Replace oldBinding to newBinding in all methods in the system except for those which are the methods of the class of oldBinding. Return true if such replacement were made, false otherwise."
+
+ | foundReferringMethod |
+ foundReferringMethod := false.
+ self systemNavigation allSelectorsAndMethodsDo: [ :behavior :selector :method |
+ (behavior ~~ oldBinding value and: [
+ method instVarsInclude: oldBinding ]) ifTrue: [ "Use the fast primitive first."
+ "The penultimate literal holds the selector of the method, the last literal is the class."
+ 1 to: method numLiterals - 2 do: [ :index |
+ (method literalAt: index) == oldBinding ifTrue: [
+ foundReferringMethod := true.
+ method
+ literalAt: index put: newBinding;
+ flushCache ] ] ] ].
+ ^foundReferringMethod!
Levente Uzonyi uploaded a new version of Traits to project The Trunk:
http://source.squeak.org/trunk/Traits-ul.290.mcz
==================== Summary ====================
Name: Traits-ul.290
Author: ul
Time: 28 September 2012, 10:30:33.464 am
UUID: 3e58b2db-945d-5e41-b9d8-5f5880d86ca8
Ancestors: Traits-ul.289
Speed up Trait class>>allTraitsDo: by using Smalltalk instead of #allInstances.
=============== Diff against Traits-ul.289 ===============
Item was changed:
----- Method: Trait class>>allTraitsDo: (in category 'public') -----
allTraitsDo: aBlock
"Evaluate aBlock with all the instance and class traits present in the system"
+
+ Smalltalk allTraitsDo: [ :aTrait |
+ aBlock
+ value: aTrait instanceSide;
+ value: aTrait classSide ]!
- Trait allInstances do: [:aTrait|
- aBlock value: aTrait instanceSide.
- aBlock value: aTrait classSide.
- ].!
Levente Uzonyi uploaded a new version of Traits to project The Trunk:
http://source.squeak.org/trunk/Traits-ul.290.mcz
==================== Summary ====================
Name: Traits-ul.290
Author: ul
Time: 28 September 2012, 10:30:33.464 am
UUID: 3e58b2db-945d-5e41-b9d8-5f5880d86ca8
Ancestors: Traits-ul.289
Speed up Trait class>>allTraitsDo: by using Smalltalk instead of #allInstances.
=============== Diff against Traits-ul.289 ===============
Item was changed:
----- Method: Trait class>>allTraitsDo: (in category 'public') -----
allTraitsDo: aBlock
"Evaluate aBlock with all the instance and class traits present in the system"
+
+ Smalltalk allTraitsDo: [ :aTrait |
+ aBlock
+ value: aTrait instanceSide;
+ value: aTrait classSide ]!
- Trait allInstances do: [:aTrait|
- aBlock value: aTrait instanceSide.
- aBlock value: aTrait classSide.
- ].!
Levente Uzonyi uploaded a new version of Traits to project The Trunk:
http://source.squeak.org/trunk/Traits-ul.290.mcz
==================== Summary ====================
Name: Traits-ul.290
Author: ul
Time: 28 September 2012, 10:30:33.464 am
UUID: 3e58b2db-945d-5e41-b9d8-5f5880d86ca8
Ancestors: Traits-ul.289
Speed up Trait class>>allTraitsDo: by using Smalltalk instead of #allInstances.
=============== Diff against Traits-ul.289 ===============
Item was changed:
----- Method: Trait class>>allTraitsDo: (in category 'public') -----
allTraitsDo: aBlock
"Evaluate aBlock with all the instance and class traits present in the system"
+
+ Smalltalk allTraitsDo: [ :aTrait |
+ aBlock
+ value: aTrait instanceSide;
+ value: aTrait classSide ]!
- Trait allInstances do: [:aTrait|
- aBlock value: aTrait instanceSide.
- aBlock value: aTrait classSide.
- ].!
Levente Uzonyi uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ul.171.mcz
==================== Summary ====================
Name: Tests-ul.171
Author: ul
Time: 29 September 2012, 9:48:51.438 am
UUID: 647a45be-83ba-5d49-8ad6-198909ed5b70
Ancestors: Tests-dtl.170
Keep the timestamp of methods in PCCByCompilation>>privateDisableCallIn: and PCCByCompilation>>privateEnableCallIn:.
=============== Diff against Tests-dtl.170 ===============
Item was changed:
----- Method: PCCByCompilation>>privateDisableCallIn: (in category 'private user interface') -----
privateDisableCallIn: aMethodRef
"Disables enabled or failed external prim call by recompiling method
with prim call commented out, will be called by superclass."
| src newMethodSource |
"higher priority to avoid source file accessing errors"
src := [aMethodRef sourceString]
valueAt: self higherPriority.
newMethodSource := self enabled2DisabledPrimMethodString: src.
"higher priority to avoid source file accessing errors"
[aMethodRef actualClass
compile: newMethodSource
classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
+ withStamp: aMethodRef timeStamp
notifying: nil]
valueAt: self higherPriority!
Item was changed:
----- Method: PCCByCompilation>>privateEnableCallIn: (in category 'private user interface') -----
privateEnableCallIn: aMethodRef
"Enables disabled external prim call by recompiling method with prim
call taken from disabling comment, will be called by superclass."
| src newMethodSource |
"higher priority to avoid source file accessing errors"
src := [aMethodRef sourceString]
valueAt: self higherPriority.
newMethodSource := self disabled2EnabledPrimMethodString: src.
"higher priority to avoid source file accessing errors"
[aMethodRef actualClass
compile: newMethodSource
classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
+ withStamp: aMethodRef timeStamp
notifying: nil]
valueAt: self higherPriority!
Levente Uzonyi uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ul.171.mcz
==================== Summary ====================
Name: Tests-ul.171
Author: ul
Time: 29 September 2012, 9:48:51.438 am
UUID: 647a45be-83ba-5d49-8ad6-198909ed5b70
Ancestors: Tests-dtl.170
Keep the timestamp of methods in PCCByCompilation>>privateDisableCallIn: and PCCByCompilation>>privateEnableCallIn:.
=============== Diff against Tests-dtl.170 ===============
Item was changed:
----- Method: PCCByCompilation>>privateDisableCallIn: (in category 'private user interface') -----
privateDisableCallIn: aMethodRef
"Disables enabled or failed external prim call by recompiling method
with prim call commented out, will be called by superclass."
| src newMethodSource |
"higher priority to avoid source file accessing errors"
src := [aMethodRef sourceString]
valueAt: self higherPriority.
newMethodSource := self enabled2DisabledPrimMethodString: src.
"higher priority to avoid source file accessing errors"
[aMethodRef actualClass
compile: newMethodSource
classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
+ withStamp: aMethodRef timeStamp
notifying: nil]
valueAt: self higherPriority!
Item was changed:
----- Method: PCCByCompilation>>privateEnableCallIn: (in category 'private user interface') -----
privateEnableCallIn: aMethodRef
"Enables disabled external prim call by recompiling method with prim
call taken from disabling comment, will be called by superclass."
| src newMethodSource |
"higher priority to avoid source file accessing errors"
src := [aMethodRef sourceString]
valueAt: self higherPriority.
newMethodSource := self disabled2EnabledPrimMethodString: src.
"higher priority to avoid source file accessing errors"
[aMethodRef actualClass
compile: newMethodSource
classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
+ withStamp: aMethodRef timeStamp
notifying: nil]
valueAt: self higherPriority!
Levente Uzonyi uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ul.171.mcz
==================== Summary ====================
Name: Tests-ul.171
Author: ul
Time: 29 September 2012, 9:48:51.438 am
UUID: 647a45be-83ba-5d49-8ad6-198909ed5b70
Ancestors: Tests-dtl.170
Keep the timestamp of methods in PCCByCompilation>>privateDisableCallIn: and PCCByCompilation>>privateEnableCallIn:.
=============== Diff against Tests-dtl.170 ===============
Item was changed:
----- Method: PCCByCompilation>>privateDisableCallIn: (in category 'private user interface') -----
privateDisableCallIn: aMethodRef
"Disables enabled or failed external prim call by recompiling method
with prim call commented out, will be called by superclass."
| src newMethodSource |
"higher priority to avoid source file accessing errors"
src := [aMethodRef sourceString]
valueAt: self higherPriority.
newMethodSource := self enabled2DisabledPrimMethodString: src.
"higher priority to avoid source file accessing errors"
[aMethodRef actualClass
compile: newMethodSource
classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
+ withStamp: aMethodRef timeStamp
notifying: nil]
valueAt: self higherPriority!
Item was changed:
----- Method: PCCByCompilation>>privateEnableCallIn: (in category 'private user interface') -----
privateEnableCallIn: aMethodRef
"Enables disabled external prim call by recompiling method with prim
call taken from disabling comment, will be called by superclass."
| src newMethodSource |
"higher priority to avoid source file accessing errors"
src := [aMethodRef sourceString]
valueAt: self higherPriority.
newMethodSource := self disabled2EnabledPrimMethodString: src.
"higher priority to avoid source file accessing errors"
[aMethodRef actualClass
compile: newMethodSource
classified: (aMethodRef actualClass whichCategoryIncludesSelector: aMethodRef methodSymbol)
+ withStamp: aMethodRef timeStamp
notifying: nil]
valueAt: self higherPriority!
David T. Lewis uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-dtl.137.mcz
==================== Summary ====================
Name: Network-dtl.137
Author: dtl
Time: 23 September 2012, 1:32:32.394 pm
UUID: b4bcd6e4-6a2d-4fc6-be4b-0d01accc3c72
Ancestors: Network-ul.136
Add a preference for "Enable IPv6 and new network support" in preference category "general". If enabled, IPv6 and the new network support will be enabled if the required primitives are present in the VM, otherwise the new network support is disabled regardless of whether the VM provides IPv6 primitives.
=============== Diff against Network-ul.136 ===============
Item was changed:
Object subclass: #NetNameResolver
instanceVariableNames: ''
+ classVariableNames: 'DefaultHostName EnableIPv6 HaveNetwork ResolverBusy ResolverError ResolverMutex ResolverReady ResolverSemaphore ResolverUninitialized UseOldNetwork'
- classVariableNames: 'DefaultHostName HaveNetwork ResolverBusy ResolverError ResolverMutex ResolverReady ResolverSemaphore ResolverUninitialized UseOldNetwork'
poolDictionaries: ''
category: 'Network-Kernel'!
!NetNameResolver commentStamp: '<historical>' prior: 0!
This class implements TCP/IP style network name lookup and translation facilities.
Attempt to keep track of whether there is a network available.
HaveNetwork true if last attempt to contact the network was successful.
LastContact Time of that contact (totalSeconds).
haveNetwork returns true, false, or #expired. True means there was contact in the last 30 minutes. False means contact failed or was false last time we asked. Get out of false state by making contact with a server in some way (FileList or updates).!
Item was added:
+ ----- Method: NetNameResolver class>>enableIPv6 (in category 'system startup') -----
+ enableIPv6
+ <preference: 'Enable IPv6 and new network support'
+ category: 'general'
+ description: 'If true allow IPv6 support. If false, NetNameResolver useOldNetwork is set.'
+ type: #Boolean>
+ ^EnableIPv6!
Item was added:
+ ----- Method: NetNameResolver class>>enableIPv6: (in category 'system startup') -----
+ enableIPv6: aBool
+ "Set a preference to control whether IPv6 primitives and new network support
+ should be used if available, and reinitialize the UseOldNetwork flag to recognize
+ the setting. If true, the new networking support will be used if the VM provides
+ the required primitives. If false, IPv6 and new network support will not be used.
+ The new network support may be unreliable on some platforms, so this preference
+ allows it to be explicitly disabled."
+
+ EnableIPv6 := aBool.
+ self initializeOldNetworkFlag
+ !
Item was changed:
----- Method: NetNameResolver class>>initialize (in category 'class initialization') -----
initialize
"NetNameResolver initialize"
"Note: On the Mac, the name resolver is asynchronous (i.e., Squeak can do other things while it is working), but can only handle one request at a time. On other platforms, such as Unix, the resolver is synchronous; a call to, say, the name lookup primitive will block all Squeak processes until it returns."
"Resolver Status Values"
ResolverUninitialized := 0. "network is not initialized"
ResolverReady := 1. "resolver idle, last request succeeded"
ResolverBusy := 2. "lookup in progress"
ResolverError := 3. "resolver idle, last request failed"
DefaultHostName := ''.
UseOldNetwork := self hasIpv6PrimSupport not.
+ self enableIPv6: true. "Initialize preference to permit use of new networking"
Smalltalk addToStartUpList: self.
!
Item was added:
+ ----- Method: NetNameResolver class>>initializeOldNetworkFlag (in category 'system startup') -----
+ initializeOldNetworkFlag
+
+ UseOldNetwork := self hasIpv6PrimSupport not or: [self enableIPv6 ~= true]!
Item was changed:
----- Method: NetNameResolver class>>startUp: (in category 'system startup') -----
startUp: resuming
+ "Set the UseOldNetwork flag if ipv6 primitives are not present or if the EnableIPv6 preference is not set."
- "Set the UseOldNetwork flag if ipv6 primitives are not present"
+ resuming ifTrue: [self initializeOldNetworkFlag]!
- resuming ifTrue: [UseOldNetwork := self hasIpv6PrimSupport not]!