[Vm-dev] VM Maker: VMMaker.oscog-eem.312.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jul 25 23:52:38 UTC 2013
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.312.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.312
Author: eem
Time: 25 July 2013, 4:51:01.71 pm
UUID: c3721341-0803-4acd-aa1e-48ab09aca8e3
Ancestors: VMMaker.oscog-eem.311
Add tracing of GCs and code compactions to primTraceLog.
=============== Diff against VMMaker.oscog-eem.311 ===============
Item was changed:
----- Method: CoInterpreter>>commenceCogCompiledCodeCompaction (in category 'process primitive support') -----
commenceCogCompiledCodeCompaction
| startTime |
<var: #startTime type: #usqLong>
cogCompiledCodeCompactionCalledFor := false.
cogit recordEventTrace ifTrue:
[self recordTrace: TraceCodeCompaction thing: TraceCodeCompaction source: 0].
+ cogit recordPrimTrace ifTrue:
+ [self fastLogPrim: TraceCodeCompaction].
startTime := self ioUTCMicrosecondsNow.
"This can be called in a number of circumstances. The instructionPointer
may contain a native pc that must be relocated. There may already be a
pushed instructionPointer on stack. Clients ensure that instructionPointer
is 0 if it should not be pushed and/or relocated. Pushing twice is a mistake
because only the top one will be relocated."
instructionPointer ~= 0 ifTrue:
[self push: instructionPointer.
self externalWriteBackHeadStackPointer].
self assertValidStackedInstructionPointers: #'__LINE__'.
cogit compactCogCompiledCode.
instructionPointer ~= 0 ifTrue:
[instructionPointer := self popStack.
self externalWriteBackHeadStackPointer].
self assertValidStackedInstructionPointers: #'__LINE__'.
statCodeCompactionCount := statCodeCompactionCount + 1.
statCodeCompactionUsecs := statCodeCompactionUsecs + (self ioUTCMicrosecondsNow - startTime).
objectMemory checkForLeaks ~= 0 ifTrue:
[objectMemory clearLeakMapAndMapAccessibleObjects.
self assert: (self checkCodeIntegrity: false)]!
Item was changed:
----- Method: CoInterpreter>>dumpPrimTraceLog (in category 'debug support') -----
dumpPrimTraceLog
"The prim trace log is a circular buffer of entries. If there is
an entry at primTraceLogIndex \\ PrimTraceLogSize it has entries.
If there is something at primTraceLogIndex it has wrapped."
<api>
<inline: false>
(primTraceLog at: (self safe: primTraceLogIndex - 1 mod: PrimTraceLogSize)) = 0 ifTrue: [^nil].
(primTraceLog at: primTraceLogIndex) ~= 0 ifTrue:
[primTraceLogIndex to: PrimTraceLogSize - 1 do:
+ [:i | self printPrimLogEntryAt: i; cr]].
- [:i | objectMemory safePrintStringOf: (primTraceLog at: i); cr]].
0 to: primTraceLogIndex - 1 do:
+ [:i | self printPrimLogEntryAt: i; cr]!
- [:i | objectMemory safePrintStringOf: (primTraceLog at: i); cr]!
Item was changed:
----- Method: CoInterpreter>>preGCAction: (in category 'object memory support') -----
preGCAction: gcModeArg
+ <inline: true>
"Need to write back the frame pointers unless all pages are free (as in snapshot).
Need to set gcMode var (to avoid passing the flag through a lot of the updating code)"
super preGCAction: gcModeArg.
gcMode := gcModeArg.
cogit recordEventTrace ifTrue:
[| traceType |
traceType := gcModeArg == GCModeFull ifTrue: [TraceFullGC] ifFalse: [TraceIncrementalGC].
+ self recordTrace: traceType thing: traceType source: 0].
+
+ cogit recordPrimTrace ifTrue:
+ [| traceType |
+ traceType := gcModeArg == GCModeFull ifTrue: [TraceFullGC] ifFalse: [TraceIncrementalGC].
+ self fastLogPrim: traceType]!
- self recordTrace: traceType thing: traceType source: 0]!
Item was added:
+ ----- Method: CoInterpreter>>printPrimLogEntryAt: (in category 'debug support') -----
+ printPrimLogEntryAt: i
+ <inline: false>
+ | intOrSelector |
+ intOrSelector := primTraceLog at: i.
+ (objectMemory isIntegerObject: intOrSelector)
+ ifTrue:
+ [ intOrSelector = TraceIncrementalGC ifTrue:
+ [self print: '**IncrementalGC**'. ^nil].
+ intOrSelector = TraceFullGC ifTrue:
+ [self print: '**FullGC**'. ^nil].
+ intOrSelector = TraceCodeCompaction ifTrue:
+ [self print: '**CompactCode**'. ^nil].
+ self print: '???']
+ ifFalse:
+ [objectMemory safePrintStringOf: intOrSelector]!
More information about the Vm-dev
mailing list