eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'InstrumentingCompiler':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: InstrumentingCompiler


Inheritance:

   Object
   |
   +--Scanner
      |
      +--Parser
         |
         +--ByteCodeCompiler
            |
            +--InstrumentingCompiler

Package:
stx:libcomp
Category:
System-Compiler-Instrumentation
Version:
rev: 1.39 date: 2019/03/22 12:26:09
user: cg
file: InstrumentingCompiler.st directory: libcomp
module: stx stc-classLibrary: libcomp

Description:


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.


Class protocol:

compilation-public
o  compileClass: aClass
compile all methods of aClass with instrumentation

o  compileMethod: aMethod
compile a single method with instrumentation

o  compilePackage: aPackageID
compile all classes of a package instrumentation

usage example(s):

     InstrumentingCompiler compilePackage:'exept:workflow'.
     InstrumentingCompiler compilePackage:'exept:expecco'.

o  compilePackages: aCollectionOfPackageIDs
compile all classes of some packages with instrumentation

usage example(s):

     InstrumentingCompiler compilePackages:#( 'exept:workflow' 'exept:expecco' ).

special
o  allInstrumentedMethods
self allInstrumentedMethods

o  callersOf: aMethod do: aBlock
enumerate all callers of aMethod into a block

o  isInstrumented: aMethod
self methodInfoOf:aMethod

o  methodInfoOf: aMethod
self methodInfoOf:aMethod


** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  methodInvocationInfoOf: aMethod
self methodInfoOf:aMethod


** This is an obsolete interface - do not use it (it may vanish in future versions) **


Instance protocol:

code generation helpers
o  addBlockCounterTo: aBlockNode
called by the compiler to instrument a block node

o  addBlockCountersToEachBlockIn: aCollection
called by the compiler to instrument a collection of block nodes

o  createMethod
called by the compiler to instatiate a new method instance

o  methodClass
called by the compiler to ask for the method instance's class

o  statementCounterBefore: aStatementNode
called by the compiler to instrument a statement node (head of a basic block)

code generation hooks
o  assignmentRewriteHookFor: anAssignmentNode
invoked whenever an assignment node has been generated

o  blockNodeRewriteHookFor: aBlockNode
invoked whenever a block node has been generated

o  messageNodeRewriteHookFor: aMessageNode
invoked whenever a message send node has been generated

o  startCodeGenerationHookOn: codeStream
invoked before code is generated

o  statementListRewriteHookFor: firstStatementArg
invoked whenever a statement list node has been generated

o  variableReadRewriteHookFor: aVariableNode
invoked whenever a variable access node has been generated

redefinable
o  blockExecutionInfoInstance
one instance is generated for every block,
and called at execution time with entry:

o  methodInvocationInfoInstance
one instance is generated for every method,
and called at execution time with entry:

o  statementExecutionInfoInstance
one instance is generated for every statement,
and called at execution time with entry:


Private classes:

    BlockExecutionInfo
    MethodInvocationInfo
    MethodInvocationInfoForCoverageInAlreadyEnteredState
    MethodInvocationInfoInAlreadyEnteredState
    ReadAccessExecutionInfo
    StatementExecutionInfo
    VariableAccessExecutionInfo
    WriteAccessExecutionInfo


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 06:42:51 GMT