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.50 date: 2023/09/07 20:47:59
user: stefan
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.

copyright

COPYRIGHT (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.

Class protocol:

cleanup
o  cleanAllInfos

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

ignored error handling
o  undefError: varName position: pos1 to: pos2

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:27:49 GMT