[Vm-dev] VM Maker: VMMaker.oscog-eem.621.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Feb 24 22:27:00 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.621.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.621
Author: eem
Time: 24 February 2014, 2:23:42.1 pm
UUID: 5b811028-86e2-4574-9163-5e47f4c7f3eb
Ancestors: VMMaker.oscog-eem.620
Use followForward: when accessing the elements of the array(s) in
become, since there's nothing that ensures uniqueness and/or
disjointness in the elements. Hence explicitly filter-out an object
becomming itself.
=============== Diff against VMMaker.oscog-eem.620 ===============
Item was changed:
----- Method: SpurMemoryManager>>innerBecomeObjectsIn:and:copyHash: (in category 'become implementation') -----
innerBecomeObjectsIn: array1 and: array2 copyHash: copyHashFlag
"Inner loop of two-way become."
0 to: (self numSlotsOf: array1) - 1 do:
[:i| | obj1 obj2 |
+ "At first blush it would appear unnecessary to use followField: here since
+ the validation in become:with:twoWay:copyHash: follows forwarders. But
+ there's nothing to ensure all elements of each array is unique and doesn't
+ appear in the other array. So the enumeration could encounter an object
+ already becommed earlier in the same enumeration."
+ obj1 := self followField: i ofObject: array1.
+ obj2 := self followField: i ofObject: array2.
+ obj1 ~= obj2 ifTrue:
+ [self doBecome: obj1 and: obj2 copyHash: copyHashFlag.
+ self followField: i ofObject: array1.
+ self followField: i ofObject: array2]]!
- obj1 := self fetchPointer: i ofObject: array1.
- obj2 := self fetchPointer: i ofObject: array2.
- self doBecome: obj1 and: obj2 copyHash: copyHashFlag.
- (self isForwarded: obj1) ifTrue:
- [obj1 := self followForwarded: obj1.
- self storePointer: i ofObject: array1 withValue: obj1].
- (self isForwarded: obj2) ifTrue:
- [obj2 := self followForwarded: obj2.
- self storePointer: i ofObject: array2 withValue: obj2]]!
Item was changed:
----- Method: SpurMemoryManager>>innerBecomeObjectsIn:to:copyHash: (in category 'become implementation') -----
innerBecomeObjectsIn: array1 to: array2 copyHash: copyHashFlag
"Inner loop of one-way become."
0 to: (self numSlotsOf: array1) - 1 do:
[:i| | obj1 obj2 |
+ "At first blush it would appear unnecessary to use followField: here since
+ the validation in become:with:twoWay:copyHash: follows forwarders. But
+ there's nothing to ensure all elements of each array is unique and doesn't
+ appear in the other array. So the enumeration could encounter an object
+ already becommed earlier in the same enumeration."
+ obj1 := self followField: i ofObject: array1.
+ obj2 := self followField: i ofObject: array2.
+ obj1 ~= obj2 ifTrue:
+ [self doBecome: obj1 to: obj2 copyHash: copyHashFlag.
+ self followField: i ofObject: array1.
+ self assert: (self isForwarded: obj2) not]]!
- obj1 := self fetchPointer: i ofObject: array1.
- obj2 := self fetchPointer: i ofObject: array2.
- self doBecome: obj1 to: obj2 copyHash: copyHashFlag.
- (self isForwarded: obj1) ifTrue:
- [obj1 := self followForwarded: obj1.
- self storePointer: i ofObject: array1 withValue: obj1].
- self assert: (self isForwarded: obj2) not]!
More information about the Vm-dev
mailing list