moved some protocol to upper levels; generalized queries
authorClaus Gittinger <cg@exept.de>
Tue, 16 Apr 1996 20:16:43 +0200
changeset 1195 618e2cf3fb56
parent 1194 628abcb5fbb6
child 1196 7b3eeec128d3
moved some protocol to upper levels; generalized queries
CompCode.st
CompiledCode.st
ExecFunc.st
ExecutableFunction.st
--- a/CompCode.st	Tue Apr 16 20:12:36 1996 +0200
+++ b/CompCode.st	Tue Apr 16 20:16:43 1996 +0200
@@ -282,6 +282,25 @@
 
 !CompiledCode methodsFor:'queries'!
 
+isExecutable
+    "return true, if this method is executable.
+     I.e. neither an invalidated nor an unloaded method"
+
+    self isInvalid ifTrue:[^ false].
+    ^ self byteCode notNil or:[self code notNil]
+
+    "Created: 16.4.1996 / 17:52:16 / cg"
+!
+
+isUnloaded
+    "return true, if the methods machine code has been unloaded
+     from the system (i.e. it is not executable)."
+
+    ^ (self code isNil and:[self byteCode isNil])
+
+    "Created: 16.4.1996 / 17:51:47 / cg"
+!
+
 messages
     "return a Set of all symbols referenced by this thingy.
      (this is more than the message selectors, since also global names
@@ -325,6 +344,6 @@
 !CompiledCode class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/CompCode.st,v 1.24 1996-04-16 14:40:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/CompCode.st,v 1.25 1996-04-16 18:16:32 cg Exp $'
 ! !
 CompiledCode initialize!
--- a/CompiledCode.st	Tue Apr 16 20:12:36 1996 +0200
+++ b/CompiledCode.st	Tue Apr 16 20:16:43 1996 +0200
@@ -282,6 +282,25 @@
 
 !CompiledCode methodsFor:'queries'!
 
+isExecutable
+    "return true, if this method is executable.
+     I.e. neither an invalidated nor an unloaded method"
+
+    self isInvalid ifTrue:[^ false].
+    ^ self byteCode notNil or:[self code notNil]
+
+    "Created: 16.4.1996 / 17:52:16 / cg"
+!
+
+isUnloaded
+    "return true, if the methods machine code has been unloaded
+     from the system (i.e. it is not executable)."
+
+    ^ (self code isNil and:[self byteCode isNil])
+
+    "Created: 16.4.1996 / 17:51:47 / cg"
+!
+
 messages
     "return a Set of all symbols referenced by this thingy.
      (this is more than the message selectors, since also global names
@@ -325,6 +344,6 @@
 !CompiledCode class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.24 1996-04-16 14:40:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.25 1996-04-16 18:16:32 cg Exp $'
 ! !
 CompiledCode initialize!
--- a/ExecFunc.st	Tue Apr 16 20:12:36 1996 +0200
+++ b/ExecFunc.st	Tue Apr 16 20:16:43 1996 +0200
@@ -155,6 +155,14 @@
 
     aStream nextPutAll:self class name; nextPutAll:'(address: 0x';
 	    nextPutAll:(addr printStringRadix:16); nextPutAll:')'
+!
+
+printStringForBrowserWithSelector:selector
+    "return a printString to represent myself to the user"
+
+    ^ selector
+
+    "Modified: 16.4.1996 / 20:11:30 / cg"
 ! !
 
 !ExecutableFunction methodsFor:'private accessing'!
@@ -189,6 +197,15 @@
     "Created: 16.4.1996 / 16:31:15 / cg"
 !
 
+isExecutable
+    "return true, if this codeObject is executable."
+
+    self isInvalid ifTrue:[^ false].
+    ^ self code notNil
+
+    "Created: 16.4.1996 / 20:13:32 / cg"
+!
+
 isInvalid
     "return true, if this codeObject is invalidated.
      Return false here, to alow alien codeObjects to be handled by the
@@ -209,6 +226,15 @@
     "Modified: 16.4.1996 / 16:32:36 / cg"
 !
 
+isUnloaded
+    "return true, if the objects machine code has been unloaded
+     from the system (i.e. it is not executable)."
+
+    ^ self code isNil
+
+    "Created: 16.4.1996 / 20:15:52 / cg"
+!
+
 isWrapped
     "return true, if this is a wrapper method.
      False is returned here - this method is redefined in WrappedMethod"
@@ -256,6 +282,6 @@
 !ExecutableFunction class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/ExecFunc.st,v 1.22 1996-04-16 14:39:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/ExecFunc.st,v 1.23 1996-04-16 18:16:43 cg Exp $'
 ! !
 ExecutableFunction initialize!
--- a/ExecutableFunction.st	Tue Apr 16 20:12:36 1996 +0200
+++ b/ExecutableFunction.st	Tue Apr 16 20:16:43 1996 +0200
@@ -155,6 +155,14 @@
 
     aStream nextPutAll:self class name; nextPutAll:'(address: 0x';
 	    nextPutAll:(addr printStringRadix:16); nextPutAll:')'
+!
+
+printStringForBrowserWithSelector:selector
+    "return a printString to represent myself to the user"
+
+    ^ selector
+
+    "Modified: 16.4.1996 / 20:11:30 / cg"
 ! !
 
 !ExecutableFunction methodsFor:'private accessing'!
@@ -189,6 +197,15 @@
     "Created: 16.4.1996 / 16:31:15 / cg"
 !
 
+isExecutable
+    "return true, if this codeObject is executable."
+
+    self isInvalid ifTrue:[^ false].
+    ^ self code notNil
+
+    "Created: 16.4.1996 / 20:13:32 / cg"
+!
+
 isInvalid
     "return true, if this codeObject is invalidated.
      Return false here, to alow alien codeObjects to be handled by the
@@ -209,6 +226,15 @@
     "Modified: 16.4.1996 / 16:32:36 / cg"
 !
 
+isUnloaded
+    "return true, if the objects machine code has been unloaded
+     from the system (i.e. it is not executable)."
+
+    ^ self code isNil
+
+    "Created: 16.4.1996 / 20:15:52 / cg"
+!
+
 isWrapped
     "return true, if this is a wrapper method.
      False is returned here - this method is redefined in WrappedMethod"
@@ -256,6 +282,6 @@
 !ExecutableFunction class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.22 1996-04-16 14:39:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.23 1996-04-16 18:16:43 cg Exp $'
 ! !
 ExecutableFunction initialize!