|
Class: LazyMethod
Object
|
+--ExecutableFunction
|
+--CompiledCode
|
+--Method
|
+--LazyMethod
- Package:
- stx:libcomp
- Category:
- Kernel-Methods
- Version:
- rev:
1.40
date: 2021/01/20 15:27:53
- user: cg
- file: LazyMethod.st directory: libcomp
- module: stx stc-classLibrary: libcomp
Instances of LazyMethod are created when doing a lazy autoload.
They do not contain any code (neither byte- nor machinecode), but
keep their sourcecode only.
When executed, these will trigger an error in the VM (noByteCode),
which is caught here to create a real method from the receiver,
amd re-execute the method.
This allows faster loading of code, which will be later compiled
when first executed; for classes with a large number of methods, of
which only a small subset is actually used, this can also save
lots of memory (beside making autoloading faster).
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.
Signal constants
-
compilationFailedSignal
-
initialization
-
initialize
-
(comment from inherited method)
create signals
compiling
-
makeRealMethod
-
make the receiver a real method; i.e. compile the sourcecode and
fill in the bytecode. This must be done in order to execute the receiver.
error handling
-
noByteCode
-
this is triggered by the interpreter when a lazy method is about to
be executed (by sending the to-be executed method this message).
Hard-compile the method, install its bytecode in the receiver,
and recall it.
queries
-
isLazyMethod
-
return true, if this is a lazy method
-
literals
-
cannot ask a lazyMethod for literals ...
-
literalsDetect: aBlock ifNone: exceptionalValue
-
cannot ask a lazyMethod for literals ...
-
messagesSent
-
cannot ask a lazyMethod for messagesSent...
Try to autoload, then ask that method.
-
messagesSentToSelf
-
cannot ask a lazyMethod for messagesSentToSelf ...
-
messagesSentToSuper
-
cannot ask a lazyMethod for messagesSentToSuper ...
-
resources
-
cannot ask a lazyMethod for resources ...
Usage example(s):
(m := self asExecutableMethod) notNil ifTrue:[^ m resources].
|
|