[Vm-dev] VM Maker: VMMaker.oscog-eem.1984.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Nov 7 16:38:25 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1984.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1984
Author: eem
Time: 7 November 2016, 8:34:15.049799 am
UUID: 3e33772d-bcef-4224-8a19-5dad15afb8c6
Ancestors: VMMaker.oscog-nice.1983
Minor correction to VMMaker.oscog-nice.1977 to note that Sista counters are always 32-bits, having two 16-bit halves for the reached and taken counts.
=============== Diff against VMMaker.oscog-nice.1983 ===============
Item was changed:
----- Method: SistaCogit>>picDataFor:Annotation:Mcpc:Bcpc:Method: (in category 'method introspection') -----
picDataFor: descriptor Annotation: isBackwardBranchAndAnnotation Mcpc: mcpc Bcpc: bcpc Method: cogMethodArg
<var: #descriptor type: #'BytecodeDescriptor *'>
<var: #mcpc type: #'char *'>
<var: #cogMethodArg type: #'void *'>
| annotation entryPoint tuple counter |
+ "N.B. Counters are always 32-bits, having two 16-bit halves for the reached and taken counts."
+ <var: #counter type: #'unsigned int'>
- <var: #counter type: #usqInt>
descriptor ifNil:
[^0].
descriptor isBranch ifTrue:
["it's a branch; conditional?"
(descriptor isBranchTrue or: [descriptor isBranchFalse]) ifTrue:
[counter := (self
cCoerce: ((self
cCoerceSimple: cogMethodArg
to: #'CogMethod *') counters)
to: #'usqInt *')
at: counterIndex.
tuple := self picDataForCounter: counter at: bcpc + 1.
tuple = 0 ifTrue: [^PrimErrNoMemory].
objectMemory storePointer: introspectionDataIndex ofObject: introspectionData withValue: tuple.
introspectionDataIndex := introspectionDataIndex + 1.
counterIndex := counterIndex + 1].
^0].
annotation := isBackwardBranchAndAnnotation >> 1.
((self isPureSendAnnotation: annotation)
and: [entryPoint := backEnd callTargetFromReturnAddress: mcpc asUnsignedInteger.
entryPoint > methodZoneBase]) ifFalse: "send is not linked, or is not a send"
[^0].
self targetMethodAndSendTableFor: entryPoint "It's a linked send; find which kind."
annotation: annotation
into: [:targetMethod :sendTable| | methodClassIfSuper association |
methodClassIfSuper := nil.
sendTable = superSendTrampolines ifTrue:
[methodClassIfSuper := coInterpreter methodClassOf: (self cCoerceSimple: cogMethodArg to: #'CogMethod *') methodObject].
sendTable = directedSuperSendTrampolines ifTrue:
[association := backEnd literalBeforeInlineCacheTagAt: mcpc asUnsignedInteger.
methodClassIfSuper := objectRepresentation valueOfAssociation: association].
tuple := self picDataForSendTo: targetMethod
methodClassIfSuper: methodClassIfSuper
at: mcpc
bcpc: bcpc + 1].
tuple = 0 ifTrue: [^PrimErrNoMemory].
objectMemory storePointer: introspectionDataIndex ofObject: introspectionData withValue: tuple.
introspectionDataIndex := introspectionDataIndex + 1.
^0!
Item was changed:
----- Method: SistaCogit>>picDataForCounter:at: (in category 'method introspection') -----
picDataForCounter: counter at: bcpc
| executedCount tuple untakenCount |
+ "N.B. Counters are always 32-bits, having two 16-bit halves for the reached and taken counts."
+ <var: #counter type: #'unsigned int'>
- <var: #counter type: #usqInt>
tuple := objectMemory
eeInstantiateClassIndex: ClassArrayCompactIndex
format: objectMemory arrayFormat
numSlots: 3.
tuple = 0 ifTrue:
[^0].
self assert: CounterBytes = 4.
executedCount := initialCounterValue - (counter >> 16).
untakenCount := initialCounterValue - (counter bitAnd: 16rFFFF).
objectMemory
storePointerUnchecked: 0 ofObject: tuple withValue: (objectMemory integerObjectOf: bcpc);
storePointerUnchecked: 1 ofObject: tuple withValue: (objectMemory integerObjectOf: executedCount);
storePointerUnchecked: 2 ofObject: tuple withValue: (objectMemory integerObjectOf: untakenCount).
^tuple!
More information about the Vm-dev
mailing list