[Vm-dev] VM Maker: VMMaker.oscog-eem.1028.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Jan 27 21:39:24 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1028.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1028
Author: eem
Time: 27 January 2015, 1:38:01.069 pm
UUID: 19752f44-5207-45a2-9930-ae424e662f66
Ancestors: VMMaker.oscog-eem.1027
Add/improve some debugging functions and
fix a comment typo.
=============== Diff against VMMaker.oscog-eem.1027 ===============
Item was changed:
----- Method: InterpreterPrimitives>>primitiveImmediateAsInteger (in category 'arithmetic float primitives') -----
primitiveImmediateAsInteger
+ "For a Smalllnteger, answer itself.
- "For a Smalnteger, answer itself.
For a Character, answer its code as an unsigned integer.
For a SmallFloat, answer the signed, but unadjusted bit pattern (so as to keep the result a SmallInteger).
This is a good value for an immediate's hash."
<option: #SpurObjectMemory>
| oop value |
oop := self stackTop.
(objectMemory isIntegerObject: oop) ifTrue:
[value := objectMemory integerValueOf: oop] ifFalse:
[(objectMemory isCharacterObject: oop) ifTrue:
[value := objectMemory characterValueOf: oop] ifFalse:
[(objectMemory isImmediateFloat: oop) ifTrue:
[value := objectMemory rotatedFloatBitsOf: oop] ifFalse:
[^self primitiveFailFor: PrimErrBadReceiver]]].
self pop: argumentCount + 1 thenPushInteger: value!
Item was added:
+ ----- Method: SpurMemoryManager>>printObjectsWithHash: (in category 'debug printing') -----
+ printObjectsWithHash: hash
+ "Scan the heap printing the oops of any and all objects whose hash equals the argument."
+ <api>
+ self allHeapEntitiesDo:
+ [:obj|
+ (self rawHashBitsOf: obj) = hash ifTrue:
+ [coInterpreter shortPrintOop: obj; cr]]!
Item was added:
+ ----- Method: StackInterpreter>>couldBeProcess: (in category 'debug support') -----
+ couldBeProcess: oop
+ <inline: #never>
+ ^(objectMemory addressCouldBeObj: oop)
+ and: [(objectMemory isPointersNonImm: oop)
+ and: [(objectMemory isContext: oop) not
+ and: [(objectMemory lengthOf: oop) > MyListIndex
+ and: [objectMemory isContext: (objectMemory
+ fetchPointer: SuspendedContextIndex
+ ofObject: oop)]]]]!
Item was changed:
----- Method: StackInterpreter>>printCallStackOf: (in category 'debug printing') -----
printCallStackOf: aContextOrProcessOrFrame
<api>
| context |
<inline: false>
(stackPages couldBeFramePointer: aContextOrProcessOrFrame) ifTrue:
[^self printCallStackFP: (self cCoerceSimple: aContextOrProcessOrFrame to: #'char *')].
+ (self couldBeProcess: aContextOrProcessOrFrame) ifTrue:
- ((objectMemory isContext: aContextOrProcessOrFrame) not
- and: [(objectMemory lengthOf: aContextOrProcessOrFrame) > MyListIndex
- and: [objectMemory isContext: (objectMemory
- fetchPointer: SuspendedContextIndex
- ofObject: aContextOrProcessOrFrame)]]) ifTrue:
[^self printCallStackOf: (objectMemory
fetchPointer: SuspendedContextIndex
ofObject: aContextOrProcessOrFrame)].
context := aContextOrProcessOrFrame.
[context = objectMemory nilObject] whileFalse:
[(self isMarriedOrWidowedContext: context)
ifTrue:
[(self checkIsStillMarriedContext: context currentFP: framePointer) ifFalse:
[self shortPrintContext: context.
^nil].
context := self shortReversePrintFrameAndCallers: (self frameOfMarriedContext: context)]
ifFalse:
[context := self printContextCallStackOf: context]]!
Item was changed:
----- Method: StackInterpreter>>printStackCallStackOf: (in category 'debug printing') -----
+ printStackCallStackOf: aContextOrProcessOrFrame
- printStackCallStackOf: frameOrContext
<api>
| theFP context |
<var: #theFP type: #'char *'>
+ (objectMemory addressCouldBeObj: aContextOrProcessOrFrame) ifTrue:
+ [((objectMemory isContext: aContextOrProcessOrFrame)
+ and: [self checkIsStillMarriedContext: aContextOrProcessOrFrame currentFP: nil]) ifTrue:
+ [^self printStackCallStackOf: (self frameOfMarriedContext: aContextOrProcessOrFrame) asInteger].
+ (self couldBeProcess: aContextOrProcessOrFrame) ifTrue:
+ [^self printCallStackOf: (objectMemory
+ fetchPointer: SuspendedContextIndex
+ ofObject: aContextOrProcessOrFrame)].
- (objectMemory addressCouldBeObj: frameOrContext) ifTrue:
- [((objectMemory isContext: frameOrContext)
- and: [self checkIsStillMarriedContext: frameOrContext currentFP: nil]) ifTrue:
- [^self printStackCallStackOf: (self frameOfMarriedContext: frameOrContext) asInteger].
^nil].
+
+ theFP := aContextOrProcessOrFrame asVoidPointer.
-
- theFP := frameOrContext asVoidPointer.
[context := self shortReversePrintFrameAndCallers: theFP.
((self isMarriedOrWidowedContext: context)
and:
[theFP := self frameOfMarriedContext: context.
self checkIsStillMarriedContext: context currentFP: theFP]) ifFalse:
[^nil]] repeat!
More information about the Vm-dev
mailing list