InstrumentationInfo.st
author Claus Gittinger <cg@exept.de>
Wed, 04 Sep 2013 19:32:01 +0200
changeset 3317 55c8ae8f88e6
parent 2975 648a219eeacd
child 3557 3ccdd414b29f
permissions -rw-r--r--
class: MessageNode changed: #codeAndOn:inBlock:valueNeeded:for: #codeOrOn:inBlock:valueNeeded:for:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2010 by eXept Software AG
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libcomp' }"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#InstrumentationInfo
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:'owningMethod'
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Compiler-Instrumentation'
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!InstrumentationInfo class methodsFor:'documentation'!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2010 by eXept Software AG
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
documentation
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
2726
5b4e630c6b93 comment
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
    39
    (sub)instances of me are placed by the instrumenting compiler into the literal
5b4e630c6b93 comment
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
    40
    array of instrumented methods. 
5b4e630c6b93 comment
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
    41
    The InstrumentingCompiler generates code to update these, as code is executed.
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
! !
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
!InstrumentationInfo class methodsFor:'cleanup'!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
allInfosDo:aBlock
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    InstrumentedMethod allInstancesDo:[:m |
2943
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    49
        self allInfosOfMethod:m do:aBlock 
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    50
    ].
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    51
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    52
    "Created: / 27-04-2010 / 12:09:03 / cg"
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    53
!
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    54
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    55
allInfosOfClass:aClass do:aBlock
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    56
    aClass instAndClassMethodsDo:[:m |
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    57
        m isInstrumented ifTrue:[
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    58
            self allInfosOfMethod:m do:aBlock
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    59
        ].
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    60
    ].
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    61
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    62
    "Created: / 27-04-2010 / 12:09:03 / cg"
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    63
!
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    64
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    65
allInfosOfMethod:aMethod do:aBlock
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    66
    aMethod literalsDo:[:l |
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    67
        (l isKindOf:self) ifTrue:[
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    68
            aBlock value:l.
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
        ]
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    ].
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    "Created: / 27-04-2010 / 12:09:03 / cg"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
cleanAllInfoWithChange:withChange
2943
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    76
    self allInfosDo:[:info |
2d687913695b fixes and tuning
Claus Gittinger <cg@exept.de>
parents: 2726
diff changeset
    77
        info cleanInfoWithChange:withChange.
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    ].
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    "
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
     InstrumentingCompiler::InstrumentationInfo cleanAllInfo
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
     InstrumentingCompiler::MethodInvocationInfo cleanAllInfo
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    "Modified: / 27-04-2010 / 12:10:07 / cg"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "Created: / 20-07-2011 / 19:00:37 / cg"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
! !
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
!InstrumentationInfo methodsFor:'accessing'!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
2974
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
    91
currentInstrumentationContext
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
    92
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
    93
    "Created: / 08-08-2011 / 14:41:58 / cg"
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
    94
!
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
    95
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
owningMethod:something
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    owningMethod := something.
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
! !
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!InstrumentationInfo methodsFor:'instrumentation probe calls'!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
2974
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   102
entry:callingContext
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   103
    "called on entry from instrumented code"
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   104
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   105
    "Created: / 27-04-2010 / 12:06:48 / cg"
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   106
! !
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   107
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   108
!InstrumentationInfo methodsFor:'private'!
1045ec132dac class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2966
diff changeset
   109
2966
af0327e1a411 tuning by changing the class to speedup entry into already
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
   110
changeClassToAlreadyEntered
af0327e1a411 tuning by changing the class to speedup entry into already
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
   111
    "nothing done here"
af0327e1a411 tuning by changing the class to speedup entry into already
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
   112
!
af0327e1a411 tuning by changing the class to speedup entry into already
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
   113
af0327e1a411 tuning by changing the class to speedup entry into already
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
   114
changeClassToCoverageAndAlreadyEntered
af0327e1a411 tuning by changing the class to speedup entry into already
Claus Gittinger <cg@exept.de>
parents: 2943
diff changeset
   115
    "nothing done here"
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
!InstrumentationInfo methodsFor:'testing'!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
isBlockExecutionInfo
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    ^ false
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "Created: / 07-08-2011 / 17:06:54 / cg"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
isMethodInvocationInfo
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    ^ false
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "Created: / 08-08-2011 / 14:40:31 / cg"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
isSpecialInstrumentationInfoLiteral
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    "return true, if the receiver is a special instrumentation info
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
     object as placed into the literal array of instrumented methods"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    ^ true
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    "Created: / 07-08-2011 / 17:04:27 / cg"
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
isStatementExecutionInfo
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    ^ false
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    "Created: / 08-08-2011 / 14:40:43 / cg"
2975
648a219eeacd class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
   145
!
648a219eeacd class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
   146
648a219eeacd class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
   147
isVariableAccessExecutionInfo
648a219eeacd class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
   148
    ^ false
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
! !
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
!InstrumentationInfo class methodsFor:'documentation'!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
version
2975
648a219eeacd class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
   154
    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationInfo.st,v 1.6 2012-11-07 22:24:43 cg Exp $'
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
!
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
version_CVS
2975
648a219eeacd class: InstrumentationInfo
Claus Gittinger <cg@exept.de>
parents: 2974
diff changeset
   158
    ^ '$Header: /cvs/stx/stx/libcomp/InstrumentationInfo.st,v 1.6 2012-11-07 22:24:43 cg Exp $'
2630
9ebfaf153cae initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
! !