Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1153.mcz
==================== Summary ====================
Name: System-mt.1153
Author: mt
Time: 17 April 2020, 5:16:44.35686 pm
UUID: ed1deacd-13b8-9144-850a-a91589b99e87
Ancestors: System-eem.1152
Adds a query for information about the CI status to the system version. Why? Because the system version shapes that query.
=============== Diff against System-eem.1152 ===============
Item was added:
+ ----- Method: SystemVersion>>ciStatusBadgeUrl (in category 'continuous integration') -----
+ ciStatusBadgeUrl
+
+ | branch |
+ branch := 'squeak-{1}{2}{3}' format: {
+ self isRelease ifTrue: [self majorVersionNumber] ifFalse: [''].
+ self isRelease ifTrue: ['.'] ifFalse: ['trunk'].
+ self isRelease ifTrue: [self minorVersionNumber] ifFalse: [''] }.
+
+ ^ 'https://secure.travis-ci.org/squeak-smalltalk/squeak-app.png?branch=', branch!
Item was added:
+ ----- Method: SystemVersion>>ciStatusPageUrl (in category 'continuous integration') -----
+ ciStatusPageUrl
+ "In a release image, let the user see the overview of branches to choose from. I am not aware of a permanent link for a specific branch. In a trunk image, just let Travis report the state of the main branch, which is usually for trunk builds."
+
+ ^ 'http://travis-ci.org/squeak-smalltalk/squeak-app{1}' format: {
+ self isRelease ifFalse: [''] ifTrue: ['/branches'] }!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1646.mcz
==================== Summary ====================
Name: Morphic-mt.1646
Author: mt
Time: 17 April 2020, 4:53:37.50186 pm
UUID: 6ae785a0-37da-9f46-ae73-134ea9c42153
Ancestors: Morphic-mt.1645
Complement Graphics-mt.430.
=============== Diff against Morphic-mt.1645 ===============
Item was added:
+ ----- Method: Morph>>asTextAnchor (in category 'text-anchor') -----
+ asTextAnchor
+ "Convert the receiver to be embedded in text."
+
+ ^ TextAnchor new anchoredMorph: self!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.430.mcz
==================== Summary ====================
Name: Graphics-mt.430
Author: mt
Time: 17 April 2020, 4:52:36.27086 pm
UUID: 1e5eac6b-e758-8445-b60e-7b09db8dcc63
Ancestors: Graphics-nice.429
Adds a simple way to use forms as text anchors without exposing Morphic, where such anchors are currently implemented.
=============== Diff against Graphics-nice.429 ===============
Item was added:
+ ----- Method: Form>>asTextAnchor (in category 'converting') -----
+ asTextAnchor
+ "Convert the receiver to be embedded in text."
+
+ self flag: #refactor. "mt: Text anchors should work outside of Morphic, too. Any instance of Form could be embedded in Text."
+ ^ (Smalltalk classNamed: 'TextAnchor')
+ ifNil: [TextColor black "Fall back"]
+ ifNotNil: [:cls | cls new anchoredMorph: self]!
Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-mt.430.mcz
==================== Summary ====================
Name: Tests-mt.430
Author: mt
Time: 17 April 2020, 10:00:04.765586 am
UUID: f6a52e06-a24a-ca4b-bbea-8cf479934e4a
Ancestors: Tests-ul.429
First steps to improve CaseErrorTest:
- the faulty #printOn: must be in a separate object so that the instance of TestCase can be printed as usual in logs and views
- adds #testCaseErrorMessage, which actually documents another bug, which is that #printString in #caseError is called on the wrong object
I suppose that the idea of having "self printString" in #caseError is that the user learns about the actual cases of the receiver *and not* about the outer-context object that is triggering that case-of in the first place.
=============== Diff against Tests-ul.429 ===============
Item was removed:
- ----- Method: CaseErrorTest>>printOn: (in category 'tests') -----
- printOn: aStream
- 3 caseOf:
- { [1] -> [aStream nextPutAll: 'option 1'].
- [2] -> [aStream nextPutAll: 'option 2'] }
- "caseError in printOn:"!
Item was changed:
----- Method: CaseErrorTest>>testCaseErrorInPrintOn (in category 'tests') -----
testCaseErrorInPrintOn
+ self should: [ CaseErrorTestObject new printString ] raise: Error!
- self should: [ self printString ] raise: Error!
Item was added:
+ ----- Method: CaseErrorTest>>testCaseErrorMessage (in category 'tests') -----
+ testCaseErrorMessage
+ "Check whether the error message actually includes the printString of the object where #caseOf: is sent to. As of April 17, 2020, the error message actually uses the printString of the outer-contxt receiver, which is wrong. Take a look at Object >> #caseOf:. There is no indication of 'self' not being the receiver of #caseOf:."
+
+ ['my message' caseOf: { [1] -> ['option 1'] }]
+ on: Error
+ do: [:error | self assert: (error messageText includesSubstring: 'my message' printString)].!
Item was added:
+ Object subclass: #CaseErrorTestObject
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Tests-Bugs'!
Item was added:
+ ----- Method: CaseErrorTestObject>>printOn: (in category 'printing') -----
+ printOn: aStream
+ 3 caseOf:
+ { [1] -> [aStream nextPutAll: 'option 1'].
+ [2] -> [aStream nextPutAll: 'option 2'] }
+ "caseError in printOn:"!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1323.mcz
==================== Summary ====================
Name: Kernel-eem.1323
Author: eem
Time: 15 April 2020, 4:46:14.261016 pm
UUID: 5ea740f0-f4c6-4808-b7b6-2e3aee87aa91
Ancestors: Kernel-eem.1322
Update the ClassBuilder and instance migration, given the changes in Collections-eem.885. See http://forum.world.st/How-to-become-immediate-objects-td5114931.html.
=============== Diff against Kernel-eem.1322 ===============
Item was changed:
----- Method: ClassBuilder>>update:to: (in category 'class mutation') -----
update: oldClass to: newClass
"Convert oldClass, all its instances and possibly its meta class into newClass,
instances of newClass and possibly its meta class. The process is surprisingly
simple in its implementation and surprisingly complex in its nuances and potentially
bad side effects.
We can rely on two assumptions (which are critical):
#1: The method #updateInstancesFrom: will not create any lasting pointers to
'old' instances ('old' is quote on quote since #updateInstancesFrom: will do
a become of the old vs. the new instances and therefore it will not create
pointers to *new* instances before the #become: which are *old* afterwards)
#2: The non-preemptive execution of the critical piece of code guarantees that
nobody can get a hold by 'other means' (such as process interruption and
reflection) on the old instances.
Given the above two, we know that after #updateInstancesFrom: there are no pointers
to any old instances. After the forwarding become there will be no pointers to the old
class or meta class either.
Andreas Raab, 2/27/2003 23:42"
| meta |
meta := oldClass isMeta.
"Note: Everything from here on will run without the ability to get interrupted
to prevent any other process to create new instances of the old class."
["Note: The following removal may look somewhat obscure and needs an explanation.
When we mutate the class hierarchy we create new classes for any existing subclass.
So it may look as if we don't have to remove the old class from its superclass. However,
at the top of the hierarchy (the first class we reshape) that superclass itself is not newly
created so therefore it will hold both the oldClass and newClass in its (obsolete or not)
subclasses. Since the #become: below will transparently replace the pointers to oldClass
with newClass the superclass would have newClass in its subclasses TWICE. With rather
unclear effects if we consider that we may convert the meta-class hierarchy itself (which
is derived from the non-meta class hierarchy).
Due to this problem ALL classes are removed from their superclass just prior to converting
them. Here, breaking the superclass/subclass invariant really doesn't matter since we will
effectively remove the oldClass (becomeForward:) just a few lines below."
oldClass superclass removeSubclass: oldClass.
oldClass superclass removeObsoleteSubclass: oldClass.
"make sure that the VM cache is clean"
oldClass methodDict do: [:cm | cm flushCache].
"Convert the instances of oldClass into instances of newClass"
newClass updateInstancesFrom: oldClass.
meta
ifTrue:
+ [{oldClass} elementsForwardIdentityAndHashTo: {newClass}.
- [oldClass becomeForward: newClass.
oldClass updateMethodBindingsTo: oldClass binding]
ifFalse:
+ [{oldClass. oldClass class} elementsForwardIdentityAndHashTo: {newClass. newClass class}.
- [{oldClass. oldClass class} elementsForwardIdentityTo: {newClass. newClass class}.
oldClass updateMethodBindingsTo: oldClass binding.
oldClass class updateMethodBindingsTo: oldClass class binding].
"eem 5/31/2014 07:22 At this point there used to be a garbage collect whose purpose was
to ensure no old instances existed after the becomeForward:. Without the GC it was possible
to resurrect old instances using e.g. allInstancesDo:. This was because the becomeForward:
updated references from the old objects to new objects but didn't destroy the old objects.
But as of late 2013/early 2014 becomeForward: has been modified to free all the old objects."]
valueUnpreemptively!
Item was changed:
----- Method: ClassDescription>>updateInstances:from:isMeta: (in category 'initialize-release') -----
updateInstances: oldInstances from: oldClass isMeta: isMeta
"Recreate any existing instances of the argument, oldClass, as instances of the receiver,
which is a newly changed class. Permute variables as necessary, and forward old instances
to new instances. Answer nil to defeat old clients that expect an array of old instances.
The old behaviour, which necessitated a global GC, exchanged identities and answered
the old instances. But no clients used the result. This way we avoid the unnecessary GC,"
| map variable instSize newInstances |
oldInstances isEmpty ifTrue:
[^nil]. "no instances to convert"
isMeta ifTrue:
[(oldInstances size = 1
and: [self soleInstance class == self
or: [self soleInstance class == oldClass]]) ifFalse:
[^self error: 'Metaclasses can only have one instance']].
map := self instVarMappingFrom: oldClass.
variable := self isVariable.
instSize := self instSize.
newInstances := Array new: oldInstances size.
1 to: oldInstances size do:
[:i|
newInstances
at: i
put: (self newInstanceFrom: (oldInstances at: i) variable: variable size: instSize map: map)].
"Now perform a bulk mutation of old instances into new ones"
+ oldInstances elementsForwardIdentityAndHashTo: newInstances.
- oldInstances elementsForwardIdentityTo: newInstances.
^nil!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1322.mcz
==================== Summary ====================
Name: Kernel-eem.1322
Author: eem
Time: 15 April 2020, 4:39:29.367332 pm
UUID: 94e874d1-0572-4a1d-9934-edcf87b8ecb5
Ancestors: Kernel-eem.1321
Move the become: methods from ProtoObject to Object. See http://forum.world.st/How-to-become-immediate-objects-td5114931.html
=============== Diff against Kernel-eem.1321 ===============
Item was added:
+ ----- Method: Object>>become: (in category 'system primitives') -----
+ become: otherObject
+ "Primitive. Swap the object pointers of the receiver and the argument.
+ All variables in the entire system that used to point to the receiver now
+ point to the argument, and vice-versa. Fails if either object is read-only
+ or is an immediate such as a SmallInteger."
+
+ {self} elementsExchangeIdentityWith: {otherObject}!
Item was added:
+ ----- Method: Object>>becomeForward: (in category 'system primitives') -----
+ becomeForward: otherObject
+ "Primitive. All variables in the entire system that used to point
+ to the receiver now point to the argument.
+ Fails if either argument is an immediate such as a SmallInteger,
+ or if the receiver is read-only."
+
+ {self} elementsForwardIdentityTo: {otherObject}!
Item was added:
+ ----- Method: Object>>becomeForward:copyHash: (in category 'system primitives') -----
+ becomeForward: otherObject copyHash: copyHash
+ "Primitive. All variables in the entire system that used to point to
+ the receiver now point to the argument. If copyHash is true, the
+ argument's identity hash bits will be set to those of the receiver.
+ Fails if
+ - either argument is an immediate such as a SmallInteger,
+ - if the receiver is read-only
+ - otherObject is read-only and copyHash is true."
+
+ {self}
+ elementsForwardIdentityTo: {otherObject}
+ copyHash: copyHash!
Item was removed:
- ----- Method: ProtoObject>>become: (in category 'system primitives') -----
- become: otherObject
- "Primitive. Swap the object pointers of the receiver and the argument.
- All variables in the entire system that used to point to the receiver
- now point to the argument, and vice-versa.
- Fails if either object is an immediate such as a SmallInteger."
-
- {self} elementsExchangeIdentityWith: {otherObject}!
Item was removed:
- ----- Method: ProtoObject>>becomeForward: (in category 'system primitives') -----
- becomeForward: otherObject
- "Primitive. All variables in the entire system that used to point
- to the receiver now point to the argument.
- Fails if either argument is an immediate such as a SmallInteger."
-
- {self} elementsForwardIdentityTo: {otherObject}!
Item was removed:
- ----- Method: ProtoObject>>becomeForward:copyHash: (in category 'system primitives') -----
- becomeForward: otherObject copyHash: copyHash
- "Primitive. All variables in the entire system that used to point to
- the receiver now point to the argument. If copyHash is true, the
- argument's identity hash bits will be set to those of the receiver.
- Fails if either argument is an immediate such as a SmallInteger."
-
- {self}
- elementsForwardIdentityTo: {otherObject}
- copyHash: copyHash!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.885.mcz
==================== Summary ====================
Name: Collections-eem.885
Author: eem
Time: 15 April 2020, 4:37:54.800631 pm
UUID: 45d219d3-6ed0-4401-a820-44eebe21d71a
Ancestors: Collections-eem.883, Collections-dtl.884
Switch elementsForwardIdentityTo: to not copy the hash, see http://forum.world.st/How-to-become-immediate-objects-td5114931.html.
Add elementsForwardIdentityAndHashTo: for the old behavior.
=============== Diff against Collections-dtl.884 ===============
Item was added:
+ ----- Method: Array>>elementsForwardIdentityAndHashTo: (in category 'converting') -----
+ elementsForwardIdentityAndHashTo: 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>
+ ec == #'no modification' ifTrue:
+ [^self modificationForbiddenFor: otherArray becomeSelector: #elementsForwardIdentityAndHashTo:].
+ 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 == #'object is pinned' ifTrue:
+ [^self error: 'can''t become pinned objects'].
+ ec == #'insufficient object memory' ifTrue:
+ [self error: 'The virtual machine is out-of-date. Please upgrade.'].
+ self primitiveFailed!
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 are not copied to the target objects so that the objects in otherArray
+ should still be properly indexed in any existing hashed structures after the mutation."
+ <primitive: 248 error: ec>
- 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>
ec == #'no modification' ifTrue:
[^self modificationForbiddenFor: otherArray becomeSelector: #elementsForwardIdentityTo:].
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 == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
ec == #'insufficient object memory' ifTrue:
[self error: 'The virtual machine is out-of-date. Please upgrade.'].
self primitiveFailed!