[Vm-dev] VM Maker: VMMaker.oscog-eem.712.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat May 10 03:40:19 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.712.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.712
Author: eem
Time: 9 May 2014, 8:36:18.801 pm
UUID: 2f12e8dd-7da6-4358-9eb4-ba4782b7206d
Ancestors: VMMaker.oscog-eem.711
Fix receiver of heapMapAtWord: and hence simulation of leak
checking. Nuke the now unnecessary simulator redirect.
In Spur32BitMMLECoSimulator>>heapMapAtWord: send
asInteger to coerce cog methods.
=============== Diff against VMMaker.oscog-eem.711 ===============
Item was changed:
----- Method: CoInterpreter>>checkStackIntegrity (in category 'object memory support') -----
checkStackIntegrity
"Perform an integrity/leak check using the heapMap. Assume
clearLeakMapAndMapAccesibleObjects has set a bit at each
object's header. Scan all objects accessible from the stack
checking that every pointer points to a header. Answer if no
dangling pointers were detected."
| ok |
<inline: false>
<var: #thePage type: #'StackPage *'>
<var: #theSP type: #'char *'>
<var: #theFP type: #'char *'>
<var: #callerFP type: #'char *'>
<var: #frameRcvrOffset type: #'char *'>
<var: #cogMethod type: #'CogMethod *'>
ok := true.
0 to: numStackPages - 1 do:
[:i| | thePage theSP theFP frameRcvrOffset callerFP oop |
thePage := stackPages stackPageAt: i.
(stackPages isFree: thePage) ifFalse:
[thePage = stackPage
ifTrue:
[theSP := stackPointer.
theFP := framePointer]
ifFalse:
[theSP := thePage headSP.
theFP := thePage headFP].
"Skip the instruction pointer on top of stack of inactive pages."
thePage = stackPage ifFalse:
[theSP := theSP + BytesPerWord].
[frameRcvrOffset := self frameReceiverOffset: theFP.
[theSP <= frameRcvrOffset] whileTrue:
[oop := stackPages longAt: theSP.
((objectMemory isNonImmediate: oop)
+ and: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- and: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in frame temp' andFrame: theFP at: theSP.
ok := false].
theSP := theSP + BytesPerWord].
(self frameHasContext: theFP) ifTrue:
[oop := self frameContext: theFP.
((objectMemory isImmediate: oop)
+ or: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- or: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in frame ctxt' andFrame: theFP at: theFP + FoxThisContext.
ok := false].
(objectMemory isContext: oop) ifFalse:
[self printFrameThing: 'frame ctxt should be context' andFrame: theFP at: theFP + FoxThisContext.
ok := false].
((objectMemory isContext: oop) and: [self isMarriedOrWidowedContext: oop]) ifFalse:
[self printFrameThing: 'frame ctxt should be married' andFrame: theFP at: theFP + FoxThisContext.
ok := false].
((objectMemory isContext: oop) and: [(self frameOfMarriedContext: oop) = theFP]) ifFalse:
[self printFrameThing: 'frame ctxt should be married to this frame ' andFrame: theFP at: theFP + FoxThisContext.
ok := false]].
(self isMachineCodeFrame: theFP)
ifTrue:
[| cogMethod |
cogMethod := self mframeHomeMethod: theFP.
+ (objectMemory heapMapAtWord: (self pointerForOop: cogMethod)) = 0 ifTrue:
- (self heapMapAtWord: (self pointerForOop: cogMethod)) = 0 ifTrue:
[self printFrameThing: 'object leak in mframe mthd' andFrame: theFP at: theFP + FoxMethod.
ok := false]]
ifFalse:
[oop := self iframeMethod: theFP.
((objectMemory isImmediate: oop)
+ or: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- or: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in iframe mthd' andFrame: theFP at: theFP + FoxMethod.
ok := false]].
(callerFP := self frameCallerFP: theFP) ~= 0] whileTrue:
[theSP := theFP + FoxCallerSavedIP + BytesPerWord.
theFP := callerFP].
theSP := theFP + FoxCallerSavedIP + BytesPerWord.
[theSP <= thePage baseAddress] whileTrue:
[oop := stackPages longAt: theSP.
((objectMemory isNonImmediate: oop)
+ and: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- and: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in frame arg' andFrame: theFP at: theSP.
ok := false].
theSP := theSP + BytesPerWord]]].
^ok!
Item was changed:
----- Method: CogObjectRepresentation>>checkValidObjectReference: (in category 'garbage collection') -----
checkValidObjectReference: anOop
^(objectMemory isImmediate: anOop) not
+ and: [(objectMemory heapMapAtWord: (self pointerForOop: anOop)) ~= 0]!
- and: [(self heapMapAtWord: (self pointerForOop: anOop)) ~= 0]!
Item was changed:
----- Method: CogObjectRepresentationForSqueakV3>>checkValidOopReference: (in category 'garbage collection') -----
checkValidOopReference: anOop
^(objectMemory isIntegerObject: anOop)
+ or: [(objectMemory heapMapAtWord: (self pointerForOop: anOop)) ~= 0]!
- or: [(self heapMapAtWord: (self pointerForOop: anOop)) ~= 0]!
Item was removed:
- ----- Method: CogVMSimulator>>heapMapAtWord: (in category 'debug support') -----
- heapMapAtWord: address
- ^objectMemory heapMap heapMapAtWord: address asUnsignedInteger!
Item was changed:
----- Method: Spur32BitMMLECoSimulator>>heapMapAtWord: (in category 'debug support') -----
heapMapAtWord: address
+ ^heapMap heapMapAtWord: address asInteger!
- ^heapMap heapMapAtWord: address!
Item was added:
+ ----- Method: Spur32BitMMLESimulator>>heapMapAtWord: (in category 'debug support') -----
+ heapMapAtWord: address
+ ^heapMap heapMapAtWord: address!
Item was changed:
----- Method: StackInterpreter>>checkStackIntegrity (in category 'object memory support') -----
checkStackIntegrity
"Perform an integrity/leak check using the heapMap. Assume
clearLeakMapAndMapAccesibleObjects has set a bit at each
object's header. Scan all objects accessible from the stack
checking that every pointer points to a header. Answer if no
dangling pointers were detected."
| ok |
<inline: false>
<var: #thePage type: #'StackPage *'>
<var: #theSP type: #'char *'>
<var: #theFP type: #'char *'>
<var: #callerFP type: #'char *'>
ok := true.
0 to: numStackPages - 1 do:
[:i| | thePage theSP theFP callerFP oop |
thePage := stackPages stackPageAt: i.
(stackPages isFree: thePage) ifFalse:
[thePage = stackPage
ifTrue:
[theSP := stackPointer.
theFP := framePointer]
ifFalse:
[theSP := thePage headSP.
theFP := thePage headFP].
"Skip the instruction pointer on top of stack of inactive pages."
thePage = stackPage ifFalse:
[theSP := theSP + BytesPerWord].
[[theSP <= (theFP + FoxReceiver)] whileTrue:
[oop := stackPages longAt: theSP.
((objectMemory isNonImmediate: oop)
+ and: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- and: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in frame temp' andFrame: theFP at: theSP.
ok := false].
theSP := theSP + BytesPerWord].
(self frameHasContext: theFP) ifTrue:
[oop := self frameContext: theFP.
((objectMemory isImmediate: oop)
+ or: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- or: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in frame ctxt' andFrame: theFP at: theFP + FoxThisContext.
ok := false].
(objectMemory isContext: oop) ifFalse:
[self printFrameThing: 'frame ctxt should be context' andFrame: theFP at: theFP + FoxThisContext.
ok := false].
((objectMemory isContext: oop) and: [self isMarriedOrWidowedContext: oop]) ifFalse:
[self printFrameThing: 'frame ctxt should be married' andFrame: theFP at: theFP + FoxThisContext.
ok := false].
((objectMemory isContext: oop)
and: [(self isMarriedOrWidowedContext: oop)
and: [(self frameOfMarriedContext: oop) = theFP]]) ifFalse:
[self printFrameThing: 'frame ctxt should be married to this frame ' andFrame: theFP at: theFP + FoxThisContext.
ok := false]].
oop := self frameMethod: theFP.
((objectMemory isImmediate: oop)
+ or: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- or: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in frame mthd' andFrame: theFP at: theFP + FoxMethod.
ok := false].
(callerFP := self frameCallerFP: theFP) ~= 0] whileTrue:
[theSP := theFP + FoxCallerSavedIP + BytesPerWord.
theFP := callerFP].
theSP := theFP + FoxCallerSavedIP + BytesPerWord.
[theSP <= thePage baseAddress] whileTrue:
[oop := stackPages longAt: theSP.
((objectMemory isNonImmediate: oop)
+ and: [(objectMemory heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
- and: [(self heapMapAtWord: (self pointerForOop: oop)) = 0]) ifTrue:
[self printFrameThing: 'object leak in frame arg' andFrame: theFP at: theSP.
ok := false].
theSP := theSP + BytesPerWord]]].
^ok!
Item was removed:
- ----- Method: StackInterpreterSimulator>>heapMapAtWord: (in category 'debug support') -----
- heapMapAtWord: address
- ^objectMemory heapMap heapMapAtWord: address!
More information about the Vm-dev
mailing list