--- a/ExecFunc.st Thu Nov 23 12:08:17 1995 +0100
+++ b/ExecFunc.st Thu Nov 23 12:17:00 1995 +0100
@@ -11,10 +11,10 @@
"
Object subclass:#ExecutableFunction
- instanceVariableNames:'code*'
- classVariableNames:'ExecutionErrorSignal InvalidCodeSignal'
- poolDictionaries:''
- category:'Kernel-Methods'
+ instanceVariableNames:'code*'
+ classVariableNames:'ExecutionErrorSignal InvalidCodeSignal'
+ poolDictionaries:''
+ category:'Kernel-Methods'
!
!ExecutableFunction class methodsFor:'documentation'!
@@ -33,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/ExecFunc.st,v 1.17 1995-11-11 15:22:25 cg Exp $'
-!
-
documentation
"
This is an abstract class, to merge common attributes of all kinds of
@@ -60,14 +56,10 @@
NOTICE: layout known by runtime system and compiler - do not change
"
-! !
-
-!ExecutableFunction class methodsFor:'queries'!
+!
-isBuiltInClass
- "this class is known by the run-time-system"
-
- ^ true
+version
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/ExecFunc.st,v 1.18 1995-11-23 11:17:00 cg Exp $'
! !
!ExecutableFunction class methodsFor:'initialization'!
@@ -92,21 +84,15 @@
^ ExecutionErrorSignal
! !
-!ExecutableFunction methodsFor:'accessing'!
+!ExecutableFunction class methodsFor:'queries'!
-instVarAt:index
- "have to catch instVar access to code - since its no object"
+isBuiltInClass
+ "this class is known by the run-time-system"
- (index == 1) ifTrue:[^ self code].
- ^ super instVarAt:index
-!
+ ^ true
+! !
-instVarAt:index put:value
- "have to catch instVar access to code - since its no object"
-
- (index == 1) ifTrue:[^ self code:value].
- ^ super instVarAt:index put:value
-!
+!ExecutableFunction methodsFor:'accessing'!
code
"return the code field. This is not an object but the address of the machine instructions.
@@ -125,26 +111,29 @@
}
%}.
^ nil
+!
+
+instVarAt:index
+ "have to catch instVar access to code - since its no object"
+
+ (index == 1) ifTrue:[^ self code].
+ ^ super instVarAt:index
+!
+
+instVarAt:index put:value
+ "have to catch instVar access to code - since its no object"
+
+ (index == 1) ifTrue:[^ self code:value].
+ ^ super instVarAt:index put:value
! !
-!ExecutableFunction methodsFor:'private accessing'!
+!ExecutableFunction methodsFor:'binary storage'!
-code:anAddress
- "set the code field - DANGER ALERT.
- This is not an object but the address of the machine instructions.
- Therefore the argument must be an integer representing this address.
- You can crash Smalltalk very badly when playing around here ...
- This method is for compiler support and very special cases (debugging) only
- - do not use"
+readBinaryContentsFrom: stream manager: manager
+ "make certain, that no invalid function addresses are created."
-%{ /* NOCONTEXT */
-
- if (__isSmallInteger(anAddress))
- _INST(code_) = (OBJ)(_intVal(anAddress));
- else {
- _INST(code_) = (OBJ)(__longIntVal(anAddress));
- }
-%}
+ super readBinaryContentsFrom: stream manager: manager.
+ self code:nil.
! !
!ExecutableFunction methodsFor:'error handling'!
@@ -171,11 +160,24 @@
nextPutAll:(addr printStringRadix:16); nextPutAll:')'
! !
-!ExecutableFunction methodsFor:'binary storage'!
+!ExecutableFunction methodsFor:'private accessing'!
+
+code:anAddress
+ "set the code field - DANGER ALERT.
+ This is not an object but the address of the machine instructions.
+ Therefore the argument must be an integer representing this address.
+ You can crash Smalltalk very badly when playing around here ...
+ This method is for compiler support and very special cases (debugging) only
+ - do not use"
-readBinaryContentsFrom: stream manager: manager
- "make certain, that no invalid function addresses are created."
+%{ /* NOCONTEXT */
- super readBinaryContentsFrom: stream manager: manager.
- self code:nil.
+ if (__isSmallInteger(anAddress))
+ _INST(code_) = (OBJ)(_intVal(anAddress));
+ else {
+ _INST(code_) = (OBJ)(__longIntVal(anAddress));
+ }
+%}
! !
+
+ExecutableFunction initialize!