The Trunk: System-eem.760.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-eem.760.mcz

commits-2
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 ] ]!