[Vm-dev] VM Maker Inbox: VMMaker.oscog-eem.2766.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jun 24 02:19:41 UTC 2020
Eliot Miranda uploaded a new version of VMMaker to project VM Maker Inbox:
http://source.squeak.org/VMMakerInbox/VMMaker.oscog-eem.2766.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2766
Author: eem
Time: 23 June 2020, 7:19:31.803115 pm
UUID: 308db3f3-ab74-442d-a8ac-d142375477b1
Ancestors: VMMaker.oscog-eem.2765
Spur: For Slang to inline numPointerSlotsOf:format: into followForwardedObjectFields:toDepth: (given Slang's current limitations) we must simply assign the result of numPointerSlotsOf:format: to a variable, not use it in an expression.
=============== Diff against VMMaker.oscog-eem.2765 ===============
Item was changed:
+ ----- Method: Spur32BitCoMemoryManager>>followForwardedObjectFields:toDepth: (in category 'forwarding') -----
- ----- Method: Spur32BitCoMemoryManager>>followForwardedObjectFields:toDepth: (in category 'as yet unclassified') -----
followForwardedObjectFields: objOop toDepth: depth
"Follow pointers in the object to depth.
Answer if any forwarders were found.
How to avoid cyclic structures?? A temporary mark bit? eem 6/22/2020 no need since depth is always finite."
<api>
<inline: false>
+ | found fmt numSlots |
- | found fmt limit |
found := false.
self assert: ((self isPointers: objOop) or: [self isOopCompiledMethod: objOop]).
fmt := self formatOf: objOop.
+ numSlots := self numPointerSlotsOf: objOop format: fmt.
- limit := (self numPointerSlotsOf: objOop format: fmt) - 1.
"It is essential to skip the first field of a method because it may be a
reference to a Cog method in the method zone, not a real object at all."
((self isCompiledMethodFormat: fmt)
ifTrue: [1]
ifFalse: [0])
+ to: numSlots - 1
- to: limit
do: [:i| | oop |
oop := self fetchPointer: i ofObject: objOop.
(self isNonImmediate: oop) ifTrue:
[(self isForwarded: oop) ifTrue:
[found := true.
oop := self followForwarded: oop.
self storePointer: i ofObject: objOop withValue: oop].
(depth > 0
and: [(self hasPointerFields: oop)
and: [self followForwardedObjectFields: oop toDepth: depth - 1]]) ifTrue:
[found := true]]].
^found!
Item was changed:
----- Method: Spur64BitCoMemoryManager>>followForwardedObjectFields:toDepth: (in category 'forwarding') -----
followForwardedObjectFields: objOop toDepth: depth
"Follow pointers in the object to depth.
Answer if any forwarders were found.
How to avoid cyclic structures?? A temporary mark bit? eem 6/22/2020 no need since depth is always finite."
<api>
<inline: false>
+ | found fmt numSlots |
- | found fmt limit |
found := false.
self assert: ((self isPointers: objOop) or: [self isOopCompiledMethod: objOop]).
fmt := self formatOf: objOop.
+ numSlots := self numPointerSlotsOf: objOop format: fmt.
- limit := (self numPointerSlotsOf: objOop format: fmt) - 1.
"It is essential to skip the first field of a method because it may be a
reference to a Cog method in the method zone, not a real object at all."
((self isCompiledMethodFormat: fmt)
ifTrue: [1]
ifFalse: [0])
+ to: numSlots - 1
- to: limit
do: [:i| | oop |
oop := self fetchPointer: i ofObject: objOop.
(self isNonImmediate: oop) ifTrue:
[(self isForwarded: oop) ifTrue:
[found := true.
oop := self followForwarded: oop.
self storePointer: i ofObject: objOop withValue: oop].
(depth > 0
and: [(self hasPointerFields: oop)
and: [self followForwardedObjectFields: oop toDepth: depth - 1]]) ifTrue:
[found := true]]].
^found!
More information about the Vm-dev
mailing list