Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.327.mcz
==================== Summary ====================
Name: Tests-eem.327
Author: eem
Time: 25 August 2015, 4:21:25.745 pm
UUID: 40649464-54c2-4aab-b4a4-9df95952958d
Ancestors: Tests-ul.326
Revise the maxLiterals test given the bytecode set specific facilities in Encoder and CompiledMethod.
=============== Diff against Tests-ul.326 ===============
Item was changed:
----- Method: CompilerTest>>testMaxLiterals (in category 'limits') -----
testMaxLiterals
"Document the maximum number of literals in a compiled method"
| maxLiterals stringThatCanBeCompiled stringWithOneTooManyLiterals |
+ "Why 6? It's rather implementation dependent. But the {... construct is compiled as
+ (Array braceStream: size)
+ nextPut: expr;
+ ...;
+ braceArray
+ where nextPut: is a special selector. So one each for Array binding, #braceStream, #braceArray and the size,
+ one for the selector and one for the methodClass makes 6."
+ maxLiterals := thisContext method encoderClass new maxNumLiterals - 6.
- maxLiterals := 250.
stringThatCanBeCompiled := '{ ', (String streamContents: [:strm |
1 to: maxLiterals do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
stringWithOneTooManyLiterals := '{ ', (String streamContents: [:strm |
1 to: maxLiterals + 1 do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
self assert: ((1 to: maxLiterals) collect: #printString) equals: (Compiler evaluate: stringThatCanBeCompiled).
"If the following test fails, it means that the limit has been raised or eliminated,
and this test should be updated to reflect the improvement."
self should: [Compiler evaluate: stringWithOneTooManyLiterals] raise: Error.
!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.307.mcz
==================== Summary ====================
Name: Compiler-eem.307
Author: eem
Time: 25 August 2015, 4:08:43.685 pm
UUID: 01d3dbd8-8e6e-49b4-9a85-abdfdb847729
Ancestors: Compiler-ul.306
Make the literal limit in the compiler a funciton of both the bytecode set and CompiledMethod's implementation limit.
=============== Diff against Compiler-ul.306 ===============
Item was changed:
----- Method: Encoder>>allLiterals (in category 'results') -----
allLiterals
addedSelectorAndMethodClassLiterals ifFalse:
[addedSelectorAndMethodClassLiterals := true.
"Put the optimized selectors in literals so as to browse senders more easily"
optimizedSelectors := optimizedSelectors reject: [:e| literalStream originalContents hasLiteral: e].
optimizedSelectors isEmpty ifFalse: [
"Use one entry per literal if enough room, else make anArray"
+ literalStream position + optimizedSelectors size + 2 >= self maxNumLiterals
- literalStream position + optimizedSelectors size + 2 > 255
ifTrue: [self litIndex: optimizedSelectors asArray]
ifFalse: [optimizedSelectors do: [:e | self litIndex: e]]].
"Add a slot for selector or MethodProperties"
self litIndex: nil.
self litIndex: self associationForClass].
^literalStream contents!
Item was changed:
----- Method: Encoder>>litIndex: (in category 'encoding') -----
litIndex: literal
| p |
p := literalStream position.
+ p = self maxNumLiterals ifTrue:
+ [self notify: 'More than ', self maxNumLiterals printString, ' literals referenced.\You must split or otherwise simplify this method.\The ' withCRs, (self maxNumLiterals + 1) printString, 'th literal is: ', literal printString. ^nil].
+ "Would like to show where it is in the source code,
+ but that info is hard to get."
- p = 256 ifTrue:
- [self notify: 'More than 256 literals referenced.
- You must split or otherwise simplify this method.
- The 257th literal is: ', literal printString. ^nil].
- "Would like to show where it is in the source code,
- but that info is hard to get."
literalStream nextPut: literal.
+ ^p!
- ^ p!
Item was added:
+ ----- Method: Encoder>>maxIndexableLiterals (in category 'accessing') -----
+ maxIndexableLiterals
+ "Answer the maximum number of literals supported by the receiver's
+ bytecode set. This is a nominal value based on the Blue Book bytecode
+ set; subclasses answer a more accurate value."
+ ^63!
Item was added:
+ ----- Method: Encoder>>maxNumLiterals (in category 'accessing') -----
+ maxNumLiterals
+ ^CompiledMethod maxNumLiterals min: self maxIndexableLiterals!
Item was added:
+ ----- Method: EncoderForV3>>maxIndexableLiterals (in category 'bytecode generation') -----
+ maxIndexableLiterals
+ "This bytecode set can index up to 256 literals."
+ ^256!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.947.mcz
==================== Summary ====================
Name: Kernel-eem.947
Author: eem
Time: 25 August 2015, 4:04:50.097 pm
UUID: 1fd40c5c-0559-47a0-9a1d-1f634d652a28
Ancestors: Kernel-ul.946
Provide an accessor for Compiledmethod's max num literals. Recategorize the frame size accessors under accessing to join it.
=============== Diff against Kernel-ul.946 ===============
Item was changed:
+ ----- Method: CompiledMethod class>>fullFrameSize (in category 'constants') -----
- ----- Method: CompiledMethod class>>fullFrameSize (in category 'class initialization') -----
fullFrameSize "CompiledMethod fullFrameSize"
^ LargeFrame!
Item was added:
+ ----- Method: CompiledMethod class>>maxNumLiterals (in category 'constants') -----
+ maxNumLiterals
+ "The current header format and the VM's interpretation of it allows for a maximum of 32767 literals."
+ ^32767!
Item was changed:
+ ----- Method: CompiledMethod class>>smallFrameSize (in category 'constants') -----
- ----- Method: CompiledMethod class>>smallFrameSize (in category 'class initialization') -----
smallFrameSize
^ SmallFrame!
Changes to Trunk (http://source.squeak.org/trunk.html) in the last 24 hours:
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008894.html
Name: Graphics-mt.314
Ancestors: Graphics-mt.313
Fixes form scaling to always return a copy even if the extent does not change. Adds checks for zero-length edges to increase robustness. Updates argument name to make it clear that both numbers and points are accepted, which supports uniform and non-uniform scaling.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008895.html
Name: Graphics-mt.315
Ancestors: Graphics-mt.314
Let clients specify smoothing factor when scaling forms.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008896.html
Name: Morphic-mt.998
Ancestors: Morphic-dtl.997
Let the extended form scaling use the basic scaling implementation. The purpose of this method is to always return a form of the given extent with a uniformly scaled form.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008897.html
Name: ToolBuilder-Morphic-mt.149
Ancestors: ToolBuilder-Morphic-topa.148
Adds support for drag-type selectors in models for lists and trees instead of hardcoding #dragTransferPlus.
Note that we might want to get rid of Object >> #dragTransferTypeForMorph: someday.... No one is implementing that anyway. Maybe also Object >> #dragPassengerFor:inMorph:. Using #dragItemSelector to let the model decide seems more appropriate.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008898.html
Name: Morphic-mt.999
Ancestors: Morphic-mt.998
Fixes a bug with wrong Z order of morphs in system windows. There is no need to update pane order because retractable scroll bars got fixed.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008899.html
Name: Kernel-mt.945
Ancestors: Kernel-eem.944
Adds support for process stepping to watch out for other unhandled things. Adds a class for unhandled warnings.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008900.html
Name: System-mt.759
Ancestors: System-eem.758
Adds support for unhandled warnings.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008901.html
Name: Tools-mt.632
Ancestors: Tools-eem.631
Removes the hack for the debugger's notifier window because it is not necessary anymore. Warnings work fine now.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008902.html
Name: Installer-Core-cmm.400
Ancestors: Installer-Core-cmm.399
Original squeaksource.com does not allow dash characters in project id's.
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008903.html
Name: CollectionsTests-eem.248
Ancestors: CollectionsTests-ul.247
Remobe obsolete test for obsolete finalization mechanism
=============================================
http://lists.squeakfoundation.org/pipermail/packages/2015-August/008904.html
Name: System-eem.760
Ancestors: System-mt.759
Remove all but the hasNewFinalization vestiges of the "new" (now obsolete) finalization mechanism. Removing the method requires restarting the finalization method, which we'll do in a preamble.
=============================================
Levente Uzonyi uploaded a new version of Compiler to project The Inbox:
http://source.squeak.org/inbox/Compiler-ul.307.mcz
==================== Summary ====================
Name: Compiler-ul.307
Author: ul
Time: 25 August 2015, 10:47:14.444 pm
UUID: ace15cac-5bbf-48de-ac98-0254d5b8ff17
Ancestors: Compiler-ul.306
Set literal limit to 32767.
=============== Diff against Compiler-ul.306 ===============
Item was changed:
----- Method: Encoder>>allLiterals (in category 'results') -----
allLiterals
addedSelectorAndMethodClassLiterals ifFalse:
[addedSelectorAndMethodClassLiterals := true.
"Put the optimized selectors in literals so as to browse senders more easily"
optimizedSelectors := optimizedSelectors reject: [:e| literalStream originalContents hasLiteral: e].
optimizedSelectors isEmpty ifFalse: [
"Use one entry per literal if enough room, else make anArray"
+ literalStream position + optimizedSelectors size + 2 > 32767
- literalStream position + optimizedSelectors size + 2 > 255
ifTrue: [self litIndex: optimizedSelectors asArray]
ifFalse: [optimizedSelectors do: [:e | self litIndex: e]]].
"Add a slot for selector or MethodProperties"
self litIndex: nil.
self litIndex: self associationForClass].
^literalStream contents!
Item was changed:
----- Method: Encoder>>litIndex: (in category 'encoding') -----
litIndex: literal
| p |
p := literalStream position.
+ p = 32767 ifTrue:
+ [self notify: 'More than 32767 literals referenced.
- p = 256 ifTrue:
- [self notify: 'More than 256 literals referenced.
You must split or otherwise simplify this method.
+ The 32768th literal is: ', literal printString. ^nil].
- The 257th literal is: ', literal printString. ^nil].
"Would like to show where it is in the source code,
but that info is hard to get."
literalStream nextPut: literal.
^ p!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.760.mcz
==================== Summary ====================
Name: System-eem.760
Author: eem
Time: 25 August 2015, 10:47:43.942 am
UUID: 82cc4d4b-562e-4fc6-b8d5-eddb3376678f
Ancestors: System-mt.759
Remove all but the hasNewFinalization vestiges of the "new" (now obsolete) finalization mechanism. Removing the method requires restarting the finalization method, which we'll do in a preamble.
=============== Diff against System-mt.759 ===============
Item was changed:
----- Method: WeakArray class>>finalizationProcess (in category '*System-Finalization') -----
finalizationProcess
- | initialized |
- initialized := false.
[FinalizationSemaphore wait.
+ FinalizationLock
+ critical:
+ [FinalizationDependents do:
+ [ :weakDependent |
+ weakDependent ifNotNil:
+ [weakDependent finalizeValues]]]
- initialized ifFalse: ["check VM capability once at image startup time"
- WeakFinalizationList initTestPair.
- Smalltalk garbageCollect.
- WeakFinalizationList checkTestPair.
- initialized := true].
- FinalizationLock critical:
- [FinalizationDependents do:
- [ :weakDependent |
- weakDependent ifNotNil:
- [weakDependent finalizeValues]]]
ifError:
+ [:msg :rcvr | rcvr error: msg]] repeat!
- [:msg :rcvr | rcvr error: msg]] repeat!
Item was changed:
Object subclass: #WeakFinalizationList
instanceVariableNames: 'first'
+ classVariableNames: ''
- classVariableNames: 'HasNewFinalization TestItem TestList'
poolDictionaries: ''
category: 'System-Finalization'!
!WeakFinalizationList commentStamp: 'Igor.Stasenko 9/22/2010 21:09' prior: 0!
IMPORTANT!!!!!!
This class is a special object, recognized by VM.
Its only purpose is to
a) identify a special kind of objects who usually having a weak references but
also having an instance of me held by first non-weak fixed slot (instance variable).
b) a 'first' instance variable points to the head of a list of items, reported by VM which has weak references which became garbage during last garbage collection
At my class side, there are some public behavior, which is used by finalization process to detect if VM supports new finalization scheme or should use the old one.
Weak registry using #hasNewFinalization for switching to correct finalization logic,
depending on VM it currently runs on.
!
Item was removed:
- ----- Method: WeakFinalizationList class>>checkTestPair (in category 'vm capability test') -----
- checkTestPair
- HasNewFinalization := TestList swapWithNil notNil.!
Item was changed:
----- Method: WeakFinalizationList class>>hasNewFinalization (in category 'vm capability test') -----
hasNewFinalization
+ ^false!
- ^ HasNewFinalization == true!
Item was removed:
- ----- Method: WeakFinalizationList class>>initTestPair (in category 'vm capability test') -----
- initTestPair
- TestItem := WeakFinalizerItem new list: TestList object: Object new.
- !
Item was removed:
- ----- Method: WeakFinalizationList class>>initialize (in category 'class initialization') -----
- initialize
- TestList := self new.!
Item was changed:
----- Method: WeakRegistry>>finalizeValues (in category '*System-Finalization') -----
finalizeValues
"Finalize any values, which happen to stocked in our list, due to some weak references become garbage"
-
- | finalizer |
- WeakFinalizationList hasNewFinalization ifFalse: [
- self protected: [
- valueDictionary finalizeValues.
- finalizer := executors.
- executors := nil ].
- finalizer ifNotNil: [
- finalizer do: [ :each | each finalizeValues ] ].
- ^ self ].
+ | finalizer |
+ self protected:
+ [valueDictionary finalizeValues.
+ finalizer := executors.
+ executors := nil ].
+ finalizer ifNotNil: [finalizer do: [ :each | each finalizeValues]]!
- finalizer := self protected: [ list swapWithNil ].
-
- "We don't need to protect a following loop from concurrent access,
- because at the moment we're finalizing values,
- only we can access this list of finalizers, because valueDictionary already see them
- as an unused slots, because they're associated with key == nil"
-
- [ finalizer notNil ] whileTrue: [
- | next |
- next := finalizer next.
- finalizer finalizeValues.
- finalizer := next ].
- !
Item was changed:
----- Method: WeakRegistry>>installFinalizer (in category 'initialize-release') -----
installFinalizer
+ valueDictionary finalizer:
+ [:executor|
+ (executors ifNil: [executors := OrderedCollection new]) add: executor]!
- valueDictionary finalizer: [ :executor |
- WeakFinalizationList hasNewFinalization
- ifTrue: [ executor finalizeValues ]
- ifFalse: [
- (executors ifNil: [ executors := OrderedCollection new ]) add: executor ] ]!