|
Class: InstrumentingCompiler
Object
|
+--Scanner
|
+--Parser
|
+--ByteCodeCompiler
|
+--InstrumentingCompiler
- Package:
- stx:libcomp
- Category:
- System-Compiler-Instrumentation
- Version:
- rev:
1.50
date: 2023/09/07 20:47:59
- user: stefan
- file: InstrumentingCompiler.st directory: libcomp
- module: stx stc-classLibrary: libcomp
an experiment - recompile classes using this compiler adds instrumentation code.
This remembers who calls a method from where (methodInvocationInfo) what the receiver's types are
(inherited classes) and how often basic blocks (blockExecutionInfo) and statements
(statementExecutionInfo) are invoked .
The who-calls and receiver type info may produce some overhead, which can be avoided by
using the somewhat more naive InstrumentingForSimpleCoverageCompiler (that is what people are
used to from the C/Java world, anyway).
From the first bulk, we can compute the inheritanceCoverage info (which methods have been called for which
subclass) in addition to the known line and block coverages.
copyrightCOPYRIGHT (c) 2010 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
cleanup
-
cleanAllInfos
-
compilation-public
-
compileClass: aClass
-
compile all methods of aClass with instrumentation
-
compileMethod: aMethod
-
compile a single method with instrumentation
-
compilePackage: aPackageID
-
compile all classes of a package instrumentation
Usage example(s):
InstrumentingCompiler compilePackage:'exept:workflow'.
InstrumentingCompiler compilePackage:'exept:expecco'.
|
-
compilePackages: aCollectionOfPackageIDs
-
compile all classes of some packages with instrumentation
Usage example(s):
InstrumentingCompiler compilePackages:#( 'exept:workflow' 'exept:expecco' ).
|
special
-
allInstrumentedMethods
-
self allInstrumentedMethods
-
callersOf: aMethod do: aBlock
-
enumerate all callers of aMethod into a block
-
isInstrumented: aMethod
-
self methodInfoOf:aMethod
-
methodInfoOf: aMethod
-
self methodInfoOf:aMethod
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
methodInvocationInfoOf: aMethod
-
self methodInfoOf:aMethod
** This is an obsolete interface - do not use it (it may vanish in future versions) **
code generation helpers
-
addBlockCounterTo: aBlockNode
-
called by the compiler to instrument a block node
-
addBlockCountersToEachBlockIn: aCollection
-
called by the compiler to instrument a collection of block nodes
-
createMethod
-
called by the compiler to instatiate a new method instance
-
methodClass
-
called by the compiler to ask for the method instance's class
-
statementCounterBefore: aStatementNode
-
called by the compiler to instrument a statement node (head of a basic block)
code generation hooks
-
assignmentRewriteHookFor: anAssignmentNode
-
invoked whenever an assignment node has been generated
-
blockNodeRewriteHookFor: aBlockNode
-
invoked whenever a block node has been generated
-
messageNodeRewriteHookFor: aMessageNode
-
invoked whenever a message send node has been generated
-
startCodeGenerationHookOn: codeStream
-
invoked before code is generated
-
statementListRewriteHookFor: firstStatementArg
-
invoked whenever a statement list node has been generated
-
variableReadRewriteHookFor: aVariableNode
-
invoked whenever a variable access node has been generated
ignored error handling
-
undefError: varName position: pos1 to: pos2
-
redefinable
-
blockExecutionInfoInstance
-
one instance is generated for every block,
and called at execution time with entry:
-
methodInvocationInfoInstance
-
one instance is generated for every method,
and called at execution time with entry:
-
statementExecutionInfoInstance
-
one instance is generated for every statement,
and called at execution time with entry:
BlockExecutionInfo
MethodInvocationInfo
MethodInvocationInfoForCoverageInAlreadyEnteredState
MethodInvocationInfoInAlreadyEnteredState
ReadAccessExecutionInfo
StatementExecutionInfo
VariableAccessExecutionInfo
WriteAccessExecutionInfo
|