[Vm-dev] VM Maker: Cog-eem.171.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jul 24 21:02:13 UTC 2014
Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.171.mcz
==================== Summary ====================
Name: Cog-eem.171
Author: eem
Time: 24 July 2014, 11:01:54.111 am
UUID: ffcca95f-67d7-4ad3-9350-8ae00f741126
Ancestors: Cog-eem.170
SpurBootstrap:
Fix the class of the [Method]Context class>>allInstances[Do:]
prototype.
Provide categories for (we hope) all uncategorized methods.
=============== Diff against Cog-eem.170 ===============
Item was removed:
- ----- Method: SpurBootstrap class>>ContextPROTOTYPEallInstances (in category 'method prototypes pharo') -----
- ContextPROTOTYPEallInstances
- "Answer all instances of the receiver."
- <primitive: 177>
- "The primitive can fail because memory is low. If so, fall back on the old
- enumeration code, which gives the system a chance to GC and/or grow.
- Because aBlock might change the class of inst (for example, using become:),
- it is essential to compute next before aBlock value: inst.
- Only count until thisContext since this context has been created only to
- compute the existing instances."
- | inst insts next |
- insts := WriteStream on: (Array new: 64).
- inst := self someInstance.
- [inst == thisContext or: [inst == nil]] whileFalse:
- [next := inst nextInstance.
- insts nextPut: inst.
- inst := next].
- ^insts contents!
Item was removed:
- ----- Method: SpurBootstrap class>>ContextPROTOTYPEallInstancesDo: (in category 'method prototypes pharo') -----
- ContextPROTOTYPEallInstancesDo: aBlock
- "Evaluate aBlock with each of the current instances of the receiver."
- | instances inst next |
- instances := self allInstancesOrNil.
- instances ifNotNil:
- [instances do: aBlock.
- ^self].
- "allInstancesOrNil can fail because memory is low. If so, fall back on the old
- enumeration code. Because aBlock might change the class of inst (for example,
- using become:), it is essential to compute next before aBlock value: inst.
- Only count until thisContext since evaluation of aBlock will create new contexts."
- inst := self someInstance.
- [inst == thisContext or: [inst == nil]] whileFalse:
- [next := inst nextInstance.
- aBlock value: inst.
- inst := next]!
Item was added:
+ ----- Method: SpurBootstrap class>>ContextclassPROTOTYPEallInstances (in category 'method prototypes pharo') -----
+ ContextclassPROTOTYPEallInstances
+ "Answer all instances of the receiver."
+ <primitive: 177>
+ "The primitive can fail because memory is low. If so, fall back on the old
+ enumeration code, which gives the system a chance to GC and/or grow.
+ Because aBlock might change the class of inst (for example, using become:),
+ it is essential to compute next before aBlock value: inst.
+ Only count until thisContext since this context has been created only to
+ compute the existing instances."
+ | inst insts next |
+ insts := WriteStream on: (Array new: 64).
+ inst := self someInstance.
+ [inst == thisContext or: [inst == nil]] whileFalse:
+ [next := inst nextInstance.
+ insts nextPut: inst.
+ inst := next].
+ ^insts contents!
Item was added:
+ ----- Method: SpurBootstrap class>>ContextclassPROTOTYPEallInstancesDo: (in category 'method prototypes pharo') -----
+ ContextclassPROTOTYPEallInstancesDo: aBlock
+ "Evaluate aBlock with each of the current instances of the receiver."
+ | instances inst next |
+ instances := self allInstancesOrNil.
+ instances ifNotNil:
+ [instances do: aBlock.
+ ^self].
+ "allInstancesOrNil can fail because memory is low. If so, fall back on the old
+ enumeration code. Because aBlock might change the class of inst (for example,
+ using become:), it is essential to compute next before aBlock value: inst.
+ Only count until thisContext since evaluation of aBlock will create new contexts."
+ inst := self someInstance.
+ [inst == thisContext or: [inst == nil]] whileFalse:
+ [next := inst nextInstance.
+ aBlock value: inst.
+ inst := next]!
Item was removed:
- ----- Method: SpurBootstrap class>>MethodContextPROTOTYPEallInstances (in category 'method prototypes squeak') -----
- MethodContextPROTOTYPEallInstances
- "Answer all instances of the receiver."
- <primitive: 177>
- "The primitive can fail because memory is low. If so, fall back on the old
- enumeration code, which gives the system a chance to GC and/or grow.
- Because aBlock might change the class of inst (for example, using become:),
- it is essential to compute next before aBlock value: inst.
- Only count until thisContext since this context has been created only to
- compute the existing instances."
- | inst insts next |
- insts := WriteStream on: (Array new: 64).
- inst := self someInstance.
- [inst == thisContext or: [inst == nil]] whileFalse:
- [next := inst nextInstance.
- insts nextPut: inst.
- inst := next].
- ^insts contents!
Item was removed:
- ----- Method: SpurBootstrap class>>MethodContextPROTOTYPEallInstancesDo: (in category 'method prototypes squeak') -----
- MethodContextPROTOTYPEallInstancesDo: aBlock
- "Evaluate aBlock with each of the current instances of the receiver."
- | instances inst next |
- instances := self allInstancesOrNil.
- instances ifNotNil:
- [instances do: aBlock.
- ^self].
- "allInstancesOrNil can fail because memory is low. If so, fall back on the old
- enumeration code. Because aBlock might change the class of inst (for example,
- using become:), it is essential to compute next before aBlock value: inst.
- Only count until thisContext since evaluation of aBlock will create new contexts."
- inst := self someInstance.
- [inst == thisContext or: [inst == nil]] whileFalse:
- [next := inst nextInstance.
- aBlock value: inst.
- inst := next]!
Item was added:
+ ----- Method: SpurBootstrap class>>MethodContextclassPROTOTYPEallInstances (in category 'method prototypes squeak') -----
+ MethodContextclassPROTOTYPEallInstances
+ "Answer all instances of the receiver."
+ <primitive: 177>
+ "The primitive can fail because memory is low. If so, fall back on the old
+ enumeration code, which gives the system a chance to GC and/or grow.
+ Because aBlock might change the class of inst (for example, using become:),
+ it is essential to compute next before aBlock value: inst.
+ Only count until thisContext since this context has been created only to
+ compute the existing instances."
+ | inst insts next |
+ insts := WriteStream on: (Array new: 64).
+ inst := self someInstance.
+ [inst == thisContext or: [inst == nil]] whileFalse:
+ [next := inst nextInstance.
+ insts nextPut: inst.
+ inst := next].
+ ^insts contents!
Item was added:
+ ----- Method: SpurBootstrap class>>MethodContextclassPROTOTYPEallInstancesDo: (in category 'method prototypes squeak') -----
+ MethodContextclassPROTOTYPEallInstancesDo: aBlock
+ "Evaluate aBlock with each of the current instances of the receiver."
+ | instances inst next |
+ instances := self allInstancesOrNil.
+ instances ifNotNil:
+ [instances do: aBlock.
+ ^self].
+ "allInstancesOrNil can fail because memory is low. If so, fall back on the old
+ enumeration code. Because aBlock might change the class of inst (for example,
+ using become:), it is essential to compute next before aBlock value: inst.
+ Only count until thisContext since evaluation of aBlock will create new contexts."
+ inst := self someInstance.
+ [inst == thisContext or: [inst == nil]] whileFalse:
+ [next := inst nextInstance.
+ aBlock value: inst.
+ inst := next]!
Item was added:
+ ----- Method: SpurBootstrap class>>categoryForClass:meta:selector: (in category 'method prototype categorization') -----
+ categoryForClass: className meta: isMeta selector: selector
+ ^(isMeta
+ ifTrue: [{ className. #class. selector }]
+ ifFalse: [{ className. selector }])
+ caseOf: {
+ [#(Behavior allInstancesOrNil)] -> [#enumerating].
+ [#(Behavior byteSizeOfInstance)] -> [#'accessing instances and variables'].
+ [#(Behavior byteSizeOfInstanceOfSize:)] -> [#'accessing instances and variables'].
+ [#(Behavior elementSize)] -> [#'accessing instances and variables'].
+ [#(Behavior handleFailingBasicNew)] -> [#private].
+ [#(Behavior handleFailingBasicNew:)] -> [#private].
+ [#(Behavior handleFailingFailingBasicNew)] -> [#private].
+ [#(Behavior handleFailingFailingBasicNew:)] -> [#private].
+ [#(Behavior identityHash)] -> [#comparing].
+ [#(Behavior isEphemeronClass)] -> [#testing].
+ [#(Behavior isImmediateClass)] -> [#testing].
+ [#(Character identityHash)] -> [#comparing].
+ [#(ClassBuilder superclass:immediateSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:)]
+ -> [#public].
+ [#(Context class allInstances)] -> [#enumerating].
+ [#(Context class allInstancesDo:)] -> [#enumerating].
+ [#(MethodContext class allInstances)] -> [#enumerating].
+ [#(MethodContext class allInstancesDo:)] -> [#enumerating].
+ [#(SmallInteger asCharacter)] -> [#converting].
+ }
+ otherwise:
+ [Transcript nextPutAll: className.
+ isMeta ifTrue: [Transcript nextPutAll: ' class'].
+ Transcript nextPutAll: '>>'; store: selector; nextPutAll: ' is unclassified'; cr.
+ ^Categorizer default]!
Item was changed:
----- Method: SpurBootstrapMonticelloPackagePatcher>>packagesAndPatches (in category 'private-accessing') -----
packagesAndPatches
"SpurBootstrapMonticelloPackagePatcher new packagesAndPatches"
packagesAndPatches ifNotNil:
[^packagesAndPatches].
packagesAndPatches := Dictionary new.
SpurBootstrap new prototypeClassNameMetaSelectorMethodDo:
[:className :isMeta :selector :method| | class methodReference source |
class := Smalltalk classNamed: className.
isMeta ifTrue:
[class := class class].
methodReference := (class includesSelector: selector) ifTrue:
[(class >> selector) methodReference].
+ methodReference category = Categorizer default ifTrue:
+ [methodReference := nil].
source := method getSourceFromFile asString allButFirst: method selector size - selector size.
source first ~= selector first ifTrue:
[source replaceFrom: 1 to: selector size with: selector startingAt: 1].
(packagesAndPatches
at: (methodReference
ifNotNil: [PackageOrganizer default packageOfMethod: methodReference]
+ ifNil: [PackageOrganizer default packageOfClass: class])
- ifNil: [PackageOrganizer default packageOfClass: class])
ifAbsentPut: [OrderedCollection new])
add: (MCAddition of: (MCMethodDefinition
className: className
classIsMeta: isMeta
selector: selector
category: (methodReference
ifNotNil: [methodReference category]
+ ifNil: [SpurBootstrap
+ categoryForClass: className
+ meta: isMeta
+ selector: selector])
- ifNil: [Categorizer default])
timeStamp: method timeStamp
source: source))].
^packagesAndPatches!
More information about the Vm-dev
mailing list