|
Class: WrappedMethod
Object
|
+--ExecutableFunction
|
+--CompiledCode
|
+--Method
|
+--WrappedMethod
- Package:
- stx:libbasic3
- Category:
- Kernel-Methods
- Version:
- rev:
1.47
date: 2017/02/13 19:43:29
- user: cg
- file: WrappedMethod.st directory: libbasic3
- module: stx stc-classLibrary: libbasic3
- Author:
- Claus Gittinger
support for MessageTracer
notice: remembers wrappers in a weak classvar, because finding the wrapper for a
method is required for single stepping, and used to take a long time when using allInstances.
Therefore, wrappers are remembered.
MessageTracer
registration
-
allInstancesDo: aBlock
-
-
allWrappedMethods
-
must double check - as this is a weak set, it gets cleaned up with a delay.
usage example(s):
-
allWrappedMethodsDo: aBlock
-
-
register: aWrappedMethod
-
-
unregister: aWrappedMethod
-
accessing
-
basicLiterals
-
return my literals
-
category: newCategory
-
-
literals
-
return the wrapped method's literals
-
literalsDetect: aBlock ifNone: exceptionBlock
-
access the wrapped method's literals
-
literalsDo: aBlock
-
access the wrapped method's literals
-
methodArgAndVarNames
-
return the names of the args and locals of the wrapped method.
-
methodArgAndVarNamesInContext: context
-
return the names of the args and locals of the wrapped method.
in given context (for Java, as in java local names differ by
actual program counter)
-
methodVarNames
-
return the names of the locals of the wrapped method.
-
numVars
-
return the number of locals in the wrapped method.
-
originalMethod
-
return the method the receiver is wrapping
-
originalMethodIfWrapped
-
return the method the receiver is wrapping
-
package: aSymbol
-
-
privacy
-
return the wrapped method's privacy
-
privacy: aSymbol
-
set the wrapped method's privacy
-
programmingLanguage
-
(comment from inherited method)
the following is correct, but might be too slow...
-
replaceOriginalMethodWith: aNewMethod
-
change the original method which is going to be invoked by this wrapper.
The only place where this makes sense is when the original method has to be
replaced by a recompiled breakpointed method (in the debugger).
-
restricted: aBoolean
-
-
setPrivacy: aSymbol
-
set the wrapped method's privacy
-
shadowedMethod
-
(comment from inherited method)
Return the shadowed method if this method is an extension (i.e. package ~= classes' package)
AND it shadows (redefines) an existing method from the method's class.
If this method does not shadow any other method, return nil.
-
source
-
return the source of the method
-
sourceFilename
-
return the sourcefilename if source is extern; nil otherwise
-
sourcePosition
-
return the sourceposition if source is extern; nil otherwise
accessing-annotations
-
annotateWith: annotation
-
add a (hidden) annotation
-
annotationAt: key
-
(comment from inherited method)
(Object >> #yourself) annotationAt: #namespace:
-
annotations
-
return the wrapped method's annotations
-
annotations: anObject
-
(comment from inherited method)
set the annotations
-
annotationsAt: key
-
-
annotationsAt: key1 orAt: key2
-
-
annotationsAt: key1 orAt: key2 do: block
-
-
annotationsDo: aBlock
-
misc
-
makeLocalStringSource
-
(comment from inherited method)
assure that the method's source code is stored locally as a string
within the method (as opposed to an external string, which is accessed
by reading the source code file).
This is required, when a method's package is changed, to assure that its
sourceCode is not lost.
-
register
-
-
unregister
-
printing & storing
-
selectorPrintStringInBrowserFor: selector
-
-
selectorPrintStringInBrowserFor: selector class: class
-
(comment from inherited method)
nsPart := selector copyFrom:2 to:idx-1.
ns := Smalltalk at:nsPart asSymbol.
printing and storing
-
printOn: aStream
-
put a printed representation of the receiver onto aStream.
Since methods do not store their class/selector, we have to search
for it here.
private
-
annotationAtIndex: index
-
return annotation at given index.
any raw annotation array is lazily initialized
-
annotationIndexOf: key
-
Returns index of annotation with given key
or nil if there is no such annotation
queries
-
argSignature
-
-
hasAnnotation
-
Return true iff the method has any annotation
-
hasResource
-
return the wrapped methods hasResource
-
isBreakpointed
-
return true, if the receiver is a wrapped method for a breakpoint.
Ask the messageTracer, since I don't know if it's a break or trace
-
isMocked
-
Return true, if the method has been mocked (by means of MessageTracer>>mockMethod:do:
-
isTimed
-
return true, if the receiver is a wrapped method for a time measurement.
Ask the messageTracer, since I don't know if it's a break or trace
-
isTraced
-
return true, if the receiver is a wrapped method for a trace point.
Ask the messageTracer, since I don't know if it's a break or trace
-
isWrapped
-
return true, if the receiver is a wrapped method.
True is returned here, since the receiver is always a wrapped one
-
messagesSent
-
return a collection of message selectors sent by this method
-
messagesSentToSelf
-
return a collection of message selectors sent to self by this method
-
messagesSentToSuper
-
return a collection of message selectors sent to super by this method
-
parse: parseSelector with: arg2 return: accessSelector or: valueIfNoSource
-
(comment from inherited method)
helper for methodArgNames, methodVarNames etc.
Get the source, let parser parse it using parseSelector,
return parser-info using accessSelector
-
refersToLiteral: anObject
-
-
resources
-
return the wrapped methods resources
-
signature
-
-
signatureNameWithoutReturnType
-
|