WrappedMethod.st
author Claus Gittinger <cg@exept.de>
Wed, 05 Feb 2014 18:52:13 +0100
changeset 3456 fa2de838ee9b
parent 3392 876dd4c1ab5a
child 3509 3ec710a1ba02
permissions -rw-r--r--
merged in jv's changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     1
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
14
530bf06f9c78 *** empty log message ***
claus
parents: 10
diff changeset
     3
	      All Rights Reserved
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     4
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     5
 This software is furnished under a license and may be used
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     6
 only in accordance with the terms of that license and with the
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     8
 be provided or otherwise made available to, or used by, any
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
     9
 other person.  No title to or ownership of the software is
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    10
 hereby transferred.
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    11
"
940
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
    13
729
65df4874f0a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
    14
Method variableSubclass:#WrappedMethod
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    15
	instanceVariableNames:''
2395
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    16
	classVariableNames:'AllWrappedMethods'
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    17
	poolDictionaries:''
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    18
	category:'Kernel-Methods'
8
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
    19
!
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
    20
508
b9ac899e85c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
    21
!WrappedMethod class methodsFor:'documentation'!
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    22
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    23
copyright
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    24
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    25
 COPYRIGHT (c) 1994 by Claus Gittinger
14
530bf06f9c78 *** empty log message ***
claus
parents: 10
diff changeset
    26
	      All Rights Reserved
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    27
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    28
 This software is furnished under a license and may be used
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    29
 only in accordance with the terms of that license and with the
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    31
 be provided or otherwise made available to, or used by, any
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    32
 other person.  No title to or ownership of the software is
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    33
 hereby transferred.
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    34
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    35
!
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    36
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    37
documentation
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    38
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    39
    support for MessageTracer
234
6350e3b2223c documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
    40
2395
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    41
    notice: remembers wrappers in a weak classvar, because finding the wrapper for a
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    42
    method is required for single stepping, and used to take a long time when using allInstances.
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    43
    Therefore, wrappers are remembered.
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    44
234
6350e3b2223c documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
    45
    [author:]
6350e3b2223c documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
    46
        Claus Gittinger
6350e3b2223c documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
    47
6350e3b2223c documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
    48
    [see also:]
6350e3b2223c documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
    49
        MessageTracer
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    50
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    51
! !
f5b6ab00bdf6 *** empty log message ***
claus
parents: 8
diff changeset
    52
2869
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
    53
!WrappedMethod class methodsFor:'others'!
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
    54
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
    55
version_CVS
3456
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
    56
    ^ '$Header: /cvs/stx/stx/libbasic3/WrappedMethod.st,v 1.38 2014-02-05 17:52:13 cg Exp $'
2869
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
    57
! !
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
    58
2395
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    59
!WrappedMethod class methodsFor:'registration'!
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    60
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    61
allInstancesDo:aBlock
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    62
    AllWrappedMethods notNil ifTrue:[
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    63
        AllWrappedMethods copy do:aBlock
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    64
    ].
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    65
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    66
    "Created: / 01-07-2011 / 09:45:29 / cg"
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    67
!
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    68
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    69
register:aWrappedMethod
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    70
    AllWrappedMethods isNil ifTrue:[
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    71
        AllWrappedMethods := WeakIdentitySet new.
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    72
    ].
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    73
    AllWrappedMethods add:aWrappedMethod
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    74
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    75
    "Created: / 01-07-2011 / 09:44:56 / cg"
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    76
!
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    77
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    78
unregister:aWrappedMethod
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    79
    AllWrappedMethods notNil ifTrue:[
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    80
        AllWrappedMethods remove:aWrappedMethod ifAbsent:[]
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    81
    ].
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    82
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    83
    "Created: / 01-07-2011 / 10:03:55 / cg"
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    84
! !
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
    85
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    86
!WrappedMethod methodsFor:'accessing'!
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    87
2635
b99f9a1ecef4 added: #annotations
vrany
parents: 2395
diff changeset
    88
annotations
2931
8aa6fb3f210b comment/format in:7 methods
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
    89
    "return the wrapped method's annotations"
2635
b99f9a1ecef4 added: #annotations
vrany
parents: 2395
diff changeset
    90
b99f9a1ecef4 added: #annotations
vrany
parents: 2395
diff changeset
    91
    ^ self originalMethod annotations
b99f9a1ecef4 added: #annotations
vrany
parents: 2395
diff changeset
    92
b99f9a1ecef4 added: #annotations
vrany
parents: 2395
diff changeset
    93
    "Created: / 04-12-2011 / 11:22:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b99f9a1ecef4 added: #annotations
vrany
parents: 2395
diff changeset
    94
!
b99f9a1ecef4 added: #annotations
vrany
parents: 2395
diff changeset
    95
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    96
basicLiterals
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    97
    "return my literals"
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    98
352
ac12b5bc2754 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 234
diff changeset
    99
    ^ super literals
ac12b5bc2754 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 234
diff changeset
   100
ac12b5bc2754 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 234
diff changeset
   101
    "Modified: 24.6.1996 / 14:10:34 / stefan"
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   102
!
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   103
1367
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   104
category:newCategory
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   105
    super category:newCategory.
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   106
    self originalMethod category:newCategory
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   107
!
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   108
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   109
literals
2931
8aa6fb3f210b comment/format in:7 methods
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
   110
    "return the wrapped method's literals"
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   111
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   112
    ^ self originalMethod literals
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   113
!
8
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   114
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   115
literalsDetect:aBlock ifNone:exceptionBlock
2931
8aa6fb3f210b comment/format in:7 methods
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
   116
    "access the wrapped method's literals"
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   117
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   118
    ^ self originalMethod literalsDetect:aBlock ifNone:exceptionBlock
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   119
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   120
    "Created: / 23.1.1998 / 13:23:15 / stefan"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   121
!
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   122
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   123
literalsDo:aBlock
2931
8aa6fb3f210b comment/format in:7 methods
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
   124
    "access the wrapped method's literals"
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   125
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   126
    ^ self originalMethod literalsDo:aBlock
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   127
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   128
    "Created: / 23.1.1998 / 13:09:36 / stefan"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   129
    "Modified: / 23.1.1998 / 13:22:38 / stefan"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   130
!
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   131
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   132
methodArgAndVarNames
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   133
    "return the names of the args and locals of the wrapped method."
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   134
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   135
    ^ self originalMethod methodArgAndVarNames
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   136
!
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   137
3456
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   138
methodArgAndVarNamesInContext: context
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   139
    "return the names of the args and locals of the wrapped method.
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   140
     in given context (for Java, as in java local names differ by 
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   141
     actual program counter)"
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   142
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   143
    ^ self originalMethod methodArgAndVarNamesInContext: context
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   144
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   145
    "Created: / 18-12-2012 / 18:16:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   146
!
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   147
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   148
methodVarNames
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   149
    "return the names of the locals of the wrapped method."
14
530bf06f9c78 *** empty log message ***
claus
parents: 10
diff changeset
   150
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   151
    ^ self originalMethod methodVarNames 
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   152
!
8
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   153
508
b9ac899e85c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
   154
numVars
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   155
    "return the number of locals in the wrapped method."
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   156
508
b9ac899e85c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
   157
    ^ self originalMethod numVars
b9ac899e85c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
   158
b9ac899e85c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
   159
    "Created: 4.11.1996 / 21:40:10 / cg"
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   160
!
8
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   161
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   162
originalMethod
14
530bf06f9c78 *** empty log message ***
claus
parents: 10
diff changeset
   163
    "return the method the receiver is wrapping"
8
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   164
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   165
    "a kludge: it must be in my literal array somewhere"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   166
    super literalsDo:[:aLiteral |
352
ac12b5bc2754 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 234
diff changeset
   167
        aLiteral isMethod ifTrue:[
ac12b5bc2754 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 234
diff changeset
   168
            ^ aLiteral
ac12b5bc2754 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 234
diff changeset
   169
        ]
8
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   170
    ].
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   171
    ^ nil
352
ac12b5bc2754 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 234
diff changeset
   172
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   173
    "Modified: / 23.1.1998 / 13:08:25 / stefan"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   174
!
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   175
2293
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   176
originalMethodIfWrapped
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   177
    "return the method the receiver is wrapping"
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   178
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   179
    ^ self originalMethod
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   180
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   181
    "Created: / 22-10-2010 / 11:45:42 / cg"
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   182
!
010e135714ae +originalMethodIfWrapped
Claus Gittinger <cg@exept.de>
parents: 2182
diff changeset
   183
1367
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   184
package:aSymbol
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   185
    super package:aSymbol.
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   186
    self originalMethod package:aSymbol
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   187
!
00692bfc2516 care for category and package changes
Claus Gittinger <cg@exept.de>
parents: 971
diff changeset
   188
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   189
privacy
2931
8aa6fb3f210b comment/format in:7 methods
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
   190
    "return the wrapped method's privacy"
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   191
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   192
    ^ self originalMethod privacy
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   193
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   194
    "Created: / 23.1.1998 / 13:09:17 / stefan"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   195
    "Modified: / 23.1.1998 / 13:20:59 / stefan"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   196
!
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   197
1396
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   198
privacy:aSymbol
2931
8aa6fb3f210b comment/format in:7 methods
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
   199
    "set the wrapped method's privacy"
1396
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   200
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   201
    ^ self originalMethod privacy:aSymbol
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   202
!
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   203
2182
36769d2ca946 compiler interface
fm
parents: 2101
diff changeset
   204
programmingLanguage
3392
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   205
    ^ (self originalMethod ? self mclass ? Smalltalk) programmingLanguage
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   206
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   207
    "Modified: / 29-08-2013 / 10:59:20 / cg"
2182
36769d2ca946 compiler interface
fm
parents: 2101
diff changeset
   208
!
36769d2ca946 compiler interface
fm
parents: 2101
diff changeset
   209
3306
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   210
replaceOriginalMethodWith:aNewMethod
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   211
    "change the original method which is going to be invoked by this wrapper.
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   212
     The only place where this makes sense is when the original method has to be 
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   213
     replaced by a recompiled breakpointed method (in the debugger)."
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   214
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   215
    "a kludge: it is in my literal array somewhere"
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   216
    1 to:(super numLiterals) do:[:i |
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   217
        (super literalAt:i) isMethod ifTrue:[
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   218
            super literalAt:i put:aNewMethod.
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   219
            ^ self.
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   220
        ]
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   221
    ].
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   222
    ^ self
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   223
!
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   224
1396
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   225
restricted:aBoolean
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   226
    ^ self originalMethod restricted:aBoolean
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   227
!
8204bcfc697a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
   228
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   229
setPrivacy:aSymbol
2931
8aa6fb3f210b comment/format in:7 methods
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
   230
    "set the wrapped method's privacy"
644
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   231
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   232
    ^ self originalMethod setPrivacy:aSymbol
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   233
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   234
    "Modified: / 23.1.1998 / 13:21:26 / stefan"
ffba6b23cc6d Redirect privacy and more literal sends to originalMethod
Stefan Vogel <sv@exept.de>
parents: 580
diff changeset
   235
    "Created: / 23.1.1998 / 15:26:26 / stefan"
2101
a9c9794266b8 Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents: 2012
diff changeset
   236
!
a9c9794266b8 Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents: 2012
diff changeset
   237
a9c9794266b8 Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents: 2012
diff changeset
   238
source
a9c9794266b8 Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents: 2012
diff changeset
   239
    "return the source of the method"
a9c9794266b8 Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents: 2012
diff changeset
   240
a9c9794266b8 Redirect #source to the original method
Stefan Vogel <sv@exept.de>
parents: 2012
diff changeset
   241
    ^ self originalMethod source
3456
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   242
!
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   243
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   244
sourceFilename
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   245
    "return the sourcefilename if source is extern; nil otherwise"
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   246
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   247
    ^ self originalMethod sourceFilename
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   248
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   249
    "Created: / 16-10-2013 / 00:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   250
!
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   251
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   252
sourcePosition
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   253
    "return the sourceposition if source is extern; nil otherwise"
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   254
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   255
    ^ self originalMethod sourcePosition
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   256
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   257
    "Created: / 16-10-2013 / 00:05:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
8
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   258
! !
3fba2acf0eeb Initial revision
claus
parents:
diff changeset
   259
2395
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   260
!WrappedMethod methodsFor:'misc'!
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   261
2869
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   262
makeLocalStringSource
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   263
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   264
    self originalMethod makeLocalStringSource
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   265
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   266
    "Created: / 11-02-2012 / 19:09:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   267
!
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   268
2395
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   269
register
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   270
    self class register:self
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   271
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   272
    "Created: / 01-07-2011 / 10:03:26 / cg"
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   273
!
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   274
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   275
unregister
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   276
    self class unregister:self
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   277
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   278
    "Created: / 01-07-2011 / 10:03:32 / cg"
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   279
! !
e9082ccc0d80 remember wrapped methods to speedup allInstances
Claus Gittinger <cg@exept.de>
parents: 2293
diff changeset
   280
3456
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   281
!WrappedMethod methodsFor:'printing & storing'!
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   282
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   283
selectorPrintStringInBrowserFor:selector
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   284
    ^ [
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   285
        self originalMethod perform:  #selectorPrintStringInBrowserFor: with: selector
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   286
    ] on: Object messageNotUnderstoodSignal do:[
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   287
        super selectorPrintStringInBrowserFor:selector
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   288
    ].
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   289
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   290
    "Created: / 16-10-2013 / 01:04:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   291
!
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   292
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   293
selectorPrintStringInBrowserFor:selector class: class
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   294
    ^ [
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   295
        self originalMethod perform:  #selectorPrintStringInBrowserFor:class: with: selector with: class
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   296
    ] on: Object messageNotUnderstoodSignal do:[
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   297
        super selectorPrintStringInBrowserFor:selector class: class
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   298
    ].
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   299
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   300
    "Created: / 16-10-2013 / 01:04:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   301
! !
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   302
3306
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   303
!WrappedMethod methodsFor:'printing and storing'!
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   304
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   305
printOn:aStream
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   306
    "put a printed representation of the receiver onto aStream.
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   307
     Since methods do not store their class/selector, we have to search
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   308
     for it here."
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   309
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   310
    self basicPrintOn:aStream."/ aStream nextPutAll:(self classNameWithArticle).
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   311
    aStream nextPutAll:'(for '.
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   312
    aStream nextPutAll:self originalMethod whoString.
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   313
    aStream nextPutAll:')'.
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   314
! !
b4017262b2cd class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3296
diff changeset
   315
2644
vrany
parents: 2635
diff changeset
   316
!WrappedMethod methodsFor:'private'!
vrany
parents: 2635
diff changeset
   317
vrany
parents: 2635
diff changeset
   318
annotationAtIndex: index
vrany
parents: 2635
diff changeset
   319
vrany
parents: 2635
diff changeset
   320
    "return annotation at given index.
vrany
parents: 2635
diff changeset
   321
     any raw annotation array is lazily
vrany
parents: 2635
diff changeset
   322
     initialized"
vrany
parents: 2635
diff changeset
   323
vrany
parents: 2635
diff changeset
   324
    ^self originalMethod annotationAtIndex: index
vrany
parents: 2635
diff changeset
   325
vrany
parents: 2635
diff changeset
   326
    "Created: / 16-12-2011 / 19:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2635
diff changeset
   327
!
vrany
parents: 2635
diff changeset
   328
vrany
parents: 2635
diff changeset
   329
annotationIndexOf: key
vrany
parents: 2635
diff changeset
   330
vrany
parents: 2635
diff changeset
   331
    "Returns index of annotation with given key
vrany
parents: 2635
diff changeset
   332
     or nil if there is no such annotation"
vrany
parents: 2635
diff changeset
   333
vrany
parents: 2635
diff changeset
   334
    ^self originalMethod annotationIndexOf: key
vrany
parents: 2635
diff changeset
   335
vrany
parents: 2635
diff changeset
   336
    "Created: / 16-12-2011 / 19:53:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 2635
diff changeset
   337
! !
vrany
parents: 2635
diff changeset
   338
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   339
!WrappedMethod methodsFor:'queries'!
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   340
733
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   341
argSignature
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   342
    ^ self originalMethod argSignature
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   343
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   344
    "Created: / 27.1.1999 / 20:23:17 / cg"
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   345
!
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   346
3296
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   347
hasAnnotation
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   348
    "Return true iff the method has any annotation"
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   349
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   350
    ^ self originalMethod hasAnnotation
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   351
!
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   352
2012
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   353
hasResource
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   354
    "return the wrapped methods hasResource"
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   355
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   356
    ^ self originalMethod hasResource
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   357
!
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   358
576
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   359
isBreakpointed
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   360
    "return true, if the receiver is a wrapped method for a breakpoint.
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   361
     Ask the messageTracer, since I dont know if its a break or trace"
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   362
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   363
    ^ (MessageTracer isTrapped:self)
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   364
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   365
    "Created: 7.4.1997 / 17:25:40 / cg"
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   366
!
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   367
580
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   368
isTimed
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   369
    "return true, if the receiver is a wrapped method for a time measurement.
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   370
     Ask the messageTracer, since I dont know if its a break or trace"
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   371
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   372
    ^ (MessageTracer isTiming:self)
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   373
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   374
    "Created: 11.4.1997 / 17:06:14 / cg"
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   375
!
8810e941bcfb #isTimed query
Claus Gittinger <cg@exept.de>
parents: 576
diff changeset
   376
576
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   377
isTraced
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   378
    "return true, if the receiver is a wrapped method for a trace point.
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   379
     Ask the messageTracer, since I dont know if its a break or trace"
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   380
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   381
    ^ (MessageTracer isTrapped:self) not
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   382
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   383
    "Created: 7.4.1997 / 17:25:54 / cg"
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   384
!
9519831877b1 moved isBreakPointed / isTrapped queries into method
Claus Gittinger <cg@exept.de>
parents: 551
diff changeset
   385
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   386
isWrapped
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   387
    "return true, if the receiver is a wrapped method.
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   388
     True is returned here, since the receiver is always a wrapped one"
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   389
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   390
    ^ true
729
65df4874f0a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   391
!
65df4874f0a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   392
971
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   393
messagesSent
940
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   394
    "return a collection of message selectors sent by this method"
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   395
971
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   396
    ^ self originalMethod messagesSent 
940
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   397
!
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   398
971
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   399
messagesSentToSelf
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   400
    "return a collection of message selectors sent to self by this method"
940
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   401
971
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   402
    ^ self originalMethod messagesSentToSelf 
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   403
!
940
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   404
971
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   405
messagesSentToSuper
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   406
    "return a collection of message selectors sent to super by this method"
940
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   407
971
685a322f25de checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   408
    ^ self originalMethod messagesSentToSuper 
940
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   409
!
2ec011688c35 more queries (sentMessages ...)
Claus Gittinger <cg@exept.de>
parents: 839
diff changeset
   410
3366
ec8284efff96 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3306
diff changeset
   411
parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource
3392
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   412
    |m|
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   413
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   414
    (m := self originalMethod) notNil ifTrue:[
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   415
        ^ m parse:parseSelector with:arg2 return:accessSelector or:valueIfNoSource
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   416
    ].
876dd4c1ab5a class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
   417
    ^ valueIfNoSource
3366
ec8284efff96 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3306
diff changeset
   418
ec8284efff96 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3306
diff changeset
   419
    "Created: / 02-08-2013 / 10:57:02 / cg"
ec8284efff96 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3306
diff changeset
   420
!
ec8284efff96 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 3306
diff changeset
   421
3296
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   422
refersToLiteral: anObject
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   423
    ^ self originalMethod refersToLiteral: anObject
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   424
!
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   425
2012
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   426
resources
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   427
    "return the wrapped methods resources"
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   428
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   429
    ^ self originalMethod resources
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   430
!
cb8630ac1ed4 forward resource query
Michael Beyl <mb@exept.de>
parents: 1396
diff changeset
   431
729
65df4874f0a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   432
signature
65df4874f0a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   433
    ^ self originalMethod signature
65df4874f0a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   434
65df4874f0a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   435
    "Created: / 14.11.1998 / 00:01:50 / cg"
733
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   436
!
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   437
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   438
signatureNameWithoutReturnType
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   439
    ^ self originalMethod signatureNameWithoutReturnType
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   440
2afae9b25d47 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   441
    "Created: / 27.1.1999 / 20:52:25 / cg"
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   442
! !
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   443
508
b9ac899e85c6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
   444
!WrappedMethod class methodsFor:'documentation'!
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   445
2869
be54d6d26dbf Merged from SVN
vrany
parents: 2644
diff changeset
   446
version_SVN
3456
fa2de838ee9b merged in jv's changes
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   447
    ^ '$Id: WrappedMethod.st,v 1.38 2014-02-05 17:52:13 cg Exp $'
210
3638d229ce41 subclasses of fixed classes are still possible
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
   448
! !
3296
b35d12f98716 class: WrappedMethod
Claus Gittinger <cg@exept.de>
parents: 2931
diff changeset
   449