eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'LazyMethod':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: LazyMethod


Inheritance:

   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

Description:


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).

copyright

COPYRIGHT (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.

Class protocol:

Signal constants
o  compilationFailedSignal

initialization
o  initialize
(comment from inherited method)
create signals


Instance protocol:

compiling
o  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
o  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
o  isLazyMethod
return true, if this is a lazy method

o  literals
cannot ask a lazyMethod for literals ...

o  literalsDetect: aBlock ifNone: exceptionalValue
cannot ask a lazyMethod for literals ...

o  messagesSent
cannot ask a lazyMethod for messagesSent...
Try to autoload, then ask that method.

o  messagesSentToSelf
cannot ask a lazyMethod for messagesSentToSelf ...

o  messagesSentToSuper
cannot ask a lazyMethod for messagesSentToSuper ...

o  resources
cannot ask a lazyMethod for resources ...

Usage example(s):

(m := self asExecutableMethod) notNil ifTrue:[^ m resources].



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:18:44 GMT