ExecutableFunction.st
branchjv
changeset 25415 4ea1fe7c363f
parent 23547 c69c97cec351
--- a/ExecutableFunction.st	Thu May 13 11:26:34 2021 +0100
+++ b/ExecutableFunction.st	Mon Aug 31 11:59:30 2020 +0100
@@ -111,6 +111,13 @@
     ^ nil
 !
 
+getCode
+    "return the code field. This is not an object but the address of the machine instructions.
+     Therefore an externalAddress representing the code-address is returned"
+
+    ^ self code
+!
+
 instVarAt:index
     "have to catch instVar access to code - since its no object"
 
@@ -125,7 +132,6 @@
     ^ super instVarAt:index put:value
 ! !
 
-
 !ExecutableFunction methodsFor:'error handling'!
 
 invalidCode
@@ -149,7 +155,7 @@
 
     |addr|
 
-    addr := self code.
+    addr := self getCode.
     addr isNil ifTrue:[^ super printOn:aStream].
 
     aStream nextPutAll:self class name; nextPutAll:'(address: 0x'.
@@ -372,7 +378,7 @@
 !
 
 privacy
-    "return a symbol describing the methods access rights (privacy);
+    "return a symbol describing the method's access rights (privacy);
      Currently, this is one of #private, #protected, #public or #ignored.
 
      Here we unconditionally return #public, to allow alien code objects
@@ -380,7 +386,8 @@
 
     ^ #public
 
-    "Created: 16.4.1996 / 16:35:18 / cg"
+    "Created: / 16-04-1996 / 16:35:18 / cg"
+    "Modified (comment): / 21-11-2017 / 13:01:32 / cg"
 !
 
 referencesGlobal:aGlobalSymbol
@@ -444,14 +451,54 @@
 !
 
 sends:aSelectorSymbol
-    "return true, if this code object contains a message-send with aSelectorSymbol as selector. 
-     - due to the simple check in the literal array, also simple uses 
+    <resource: #obsolete>
+
+    "return true, if this code object contains a message-send with aSelectorSymbol as selector.
+     - due to the simple check in the literal array, also simple uses
+       of aSelectorSymbol as symbol will return true.
+       Should ask compiler, if there is really a send."
+
+    self obsoleteFeatureWarning:'please use #sendsSelector:'.
+    ^ self sendsSelector:aSelectorSymbol
+
+    "Created: / 16-04-1996 / 16:35:53 / cg"
+    "Modified: / 05-02-2017 / 01:21:26 / cg"
+!
+
+sendsAny:aCollectionOfSelectorSymbols
+    <resource: #obsolete>
+
+    "return true, if this method contains a message-send
+     to any of aCollectionOfSelectorSymbols."
+
+    self obsoleteFeatureWarning:'please use #sendsAnySelector:'.
+    ^ self sendsAnySelector:aCollectionOfSelectorSymbols
+
+    "Created: / 08-08-2011 / 18:53:24 / cg"
+    "Modified: / 05-02-2017 / 01:31:22 / cg"
+!
+
+sendsAnySelector:aCollectionOfSelectorSymbols
+    "return true, if this method contains a message-send
+     to any of aCollectionOfSelectorSymbols."
+
+    (aCollectionOfSelectorSymbols contains:[:sym | self referencesLiteral:sym]) ifTrue:[
+	^ true.
+    ].
+    ^ false
+
+    "Created: / 05-02-2017 / 01:27:11 / cg"
+!
+
+sendsSelector:aSelectorSymbol
+    "return true, if this code object contains a message-send with aSelectorSymbol as selector.
+     - due to the simple check in the literal array, also simple uses
        of aSelectorSymbol as symbol will return true.
        Should ask compiler, if there is really a send."
 
     ^ self referencesLiteral:aSelectorSymbol
 
-    "Created: 16.4.1996 / 16:35:53 / cg"
+    "Created: / 05-02-2017 / 01:19:03 / cg"
 !
 
 usedGlobals