|
Class: WrappedMethod
Object
|
+--ExecutableFunction
|
+--CompiledCode
|
+--Method
|
+--WrappedMethod
- Package:
- stx:libbasic3
- Category:
- Kernel-Methods
- Version:
- rev:
1.62
date: 2024/03/14 16:21:21
- user: cg
- file: WrappedMethod.st directory: libbasic3
- module: stx stc-classLibrary: libbasic3
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.
copyrightCOPYRIGHT (c) 1994 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.
registration
-
allInstancesDo: aBlock
-
(comment from inherited method)
evaluate aBlock for all of my instances
-
allWrappedMethods
-
must eliminate dead entries - 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
-
(comment from inherited method)
set the method's category
-
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
-
(comment from inherited method)
set the package-symbol
-
privacy
-
return the wrapped method's privacy
-
privacy: aSymbol
-
set the wrapped method's privacy
-
programmingLanguage
-
-
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
-
(comment from inherited method)
set or clear the flag bit stating that this method is restricted.
Execution of the receiver will only be allowed if the system is not in
'trap restricted mode' (-->ObjectMemory) otherise a runtime
error (PrivateMethodSignal) is raised.
Notice: method restriction is a nonstandard feature, not supported
by other smalltalk implementations and not specified in the ANSI spec.
This is EXPERIMENTAL - and being evaluated for usability.
It may change or even vanish (if it shows to be not useful).
-
setPrivacy: aSymbol
-
set the wrapped method's privacy
-
shadowedMethod
-
return true, if this method is an extension (i.e. package ~= classes' package)
which shadows an existing method from another package (i.e. a package conflict)
-
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:
(WindowsAutomation2::Client >> #stopRecording) annotationAt: #foreignSelectors:
-
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
-
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.
-
selectorPrintStringInBrowserFor: selector
-
-
selectorPrintStringInBrowserFor: selector class: class
-
(comment from inherited method)
nsPart := selector copyFrom:2 to:idx-1.
ns := Smalltalk at:nsPart asSymbol.
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 set-like collection with the message selectors sent by the receiver.
Uses Parser to parse method's source and extract the names.
The returned collection includes all used message selectors
(i.e. including super-send messages)
-
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
-
(comment from inherited method)
redefined to also search in annotations
-
resources
-
return the wrapped methods resources
-
sendsAnySelector: aCollection
-
(comment from inherited method)
return true, if this method contains a message-send
to any of aCollectionOfSelectorSymbols.
-
signature
-
-
signatureNameWithoutReturnType
-
|