--- a/Method.st Sat Sep 16 19:14:32 1995 +0200
+++ b/Method.st Sun Sep 17 19:57:55 1995 +0200
@@ -23,7 +23,7 @@
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.48 1995-09-08 16:46:11 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.49 1995-09-17 17:56:43 claus Exp $
'!
!Method class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
version
"
-$Header: /cvs/stx/stx/libbasic/Method.st,v 1.48 1995-09-08 16:46:11 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Method.st,v 1.49 1995-09-17 17:56:43 claus Exp $
"
!
@@ -70,6 +70,12 @@
Do not depend on any value in the flags field - it may change without
notice.
+ Notice, that in ST/X, method can be subclassed; executable code is
+ identified not by being a subclass of Block or Method, but instead by
+ having the executable flag bit set in the class. The VM can execute anything
+ which is identified as executable (assuming that the first instance variable
+ is the machine-code address) - this allows for easy future extension.
+
Instance variables:
source <String> the source itself (if sourcePosition isNil)
@@ -125,6 +131,19 @@
may change (in case of some ANSI standard being defined).
Be warned and send me suggestions & critics (constructive ;-)
"
+!
+
+dynamicMethods
+"
+ On systems which support dynamic loading of machine code (SYS5.4, Linux),
+ methods may now be compiled to machine code from within the browser,
+ and the resulting machine code object be loaded in.
+ The ObjectFileLoader keeps (weak) handles to the resulting methods and
+ invalidates the corresponding method objects, if the underlying methods
+ object code is unloaded.
+ Invalid methods will trap into the debugger when executed;
+ also, the browser marks them as '(* not executable *)' in its method list.
+"
! !
!Method class methodsFor:'initialization'!
@@ -953,6 +972,37 @@
^ false
! !
+!Method methodsFor:'trap methods'!
+
+makeInvalid
+ "make the receiver an invalid method, which raises an invalidCodeObject
+ signal when executed. This is not for public use - it is required for
+ the objectFileLoader to invalidate methods whose code is unloaded."
+
+ |invldMethod|
+
+ invldMethod := self class compiledMethodAt:#invalidCodeObject.
+ self code:invldMethod code.
+ self byteCode:invldMethod byteCode.
+
+ "Created: 17.9.1995 / 15:00:52 / claus"
+!
+
+makeUncompiled
+ "make the receiver an uncompiled method, which raises an invalidCodeObject
+ signal when executed. This is not for public use - it is required for
+ the compiler to invalidate methods which cannot be compiled due to errors
+ after a class definition change (for example: instvars are no longer there)."
+
+ |invldMethod|
+
+ invldMethod := self class compiledMethodAt:#uncompiledCodeObject.
+ self code:invldMethod code.
+ self byteCode:invldMethod byteCode.
+
+ "Created: 17.9.1995 / 15:01:14 / claus"
+! !
+
!Method methodsFor:'error handling'!
invalidCodeObject