ExecutableFunction.st
changeset 92 0c73b48551ac
parent 88 81dacba7a63a
child 107 f3e3e2dad7fd
equal deleted inserted replaced
91:b3971c7dc731 92:0c73b48551ac
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 Object subclass:#ExecutableFunction
    13 Object subclass:#ExecutableFunction
    14        instanceVariableNames:'code flags'
    14        instanceVariableNames:'code* flags'
    15        classVariableNames:''
    15        classVariableNames:''
    16        poolDictionaries:''
    16        poolDictionaries:''
    17        category:'Kernel-Methods'
    17        category:'Kernel-Methods'
    18 !
    18 !
    19 
    19 
    20 ExecutableFunction comment:'
    20 ExecutableFunction comment:'
    21 COPYRIGHT (c) 1994 by Claus Gittinger
    21 COPYRIGHT (c) 1994 by Claus Gittinger
    22               All Rights Reserved
    22               All Rights Reserved
       
    23 
       
    24 $Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.3 1994-08-05 00:54:34 claus Exp $
    23 '!
    25 '!
    24 
    26 
    25 !ExecutableFunction class methodsFor:'documentation'!
    27 !ExecutableFunction class methodsFor:'documentation'!
    26 
    28 
    27 copyright
    29 copyright
    38 "
    40 "
    39 !
    41 !
    40 
    42 
    41 version
    43 version
    42 "
    44 "
    43 $Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.2 1994-06-02 16:20:05 claus Exp $
    45 $Header: /cvs/stx/stx/libbasic/ExecutableFunction.st,v 1.3 1994-08-05 00:54:34 claus Exp $
    44 "
    46 "
    45 !
    47 !
    46 
    48 
    47 documentation
    49 documentation
    48 "
    50 "
    49     This is an abstract class, to merge common attributes of all kinds of
    51     This is an abstract class, to merge common attributes of all kinds of
    50     executable code objects; i.e. non-ST functions, Blocks and Methods.
    52     executable code objects; i.e. non-ST functions, Blocks and Methods.
    51 
    53 
    52     Instance variables:
    54     Instance variables:
    53 
    55 
    54     code        <not_an_object>   the function pointer if its a compiled block/method
    56     code        <not_an_object>   the function pointer to the machine code.
       
    57 				  Not accessable from smalltalk code.
    55     flags       <SmallInteger>    special flag bits coded in a number
    58     flags       <SmallInteger>    special flag bits coded in a number
    56 
    59 
    57     NOTICE: layout known by runtime system and compiler - do not change
    60     NOTICE: layout known by runtime system and compiler - do not change
    58 "
    61 "
    59 ! !
    62 ! !
    86     "return the code field. This is not an object but the address of the machine instructions. 
    89     "return the code field. This is not an object but the address of the machine instructions. 
    87      Therefore an integer representing the code-address is returned"
    90      Therefore an integer representing the code-address is returned"
    88 
    91 
    89 %{  /* NOCONTEXT */
    92 %{  /* NOCONTEXT */
    90 
    93 
    91     if (_INST(code) != nil) {
    94     if (_INST(code_) != nil) {
    92         RETURN ( _MKSMALLINT((int)(_INST(code))) )
    95         RETURN ( _MKSMALLINT((int)(_INST(code_))) )
    93     }
    96     }
    94 %}
    97 %}
    95 .
    98 .
    96     ^ nil
    99     ^ nil
    97 ! !
   100 ! !
   106      This method is for compiler support and very special cases (debugging) only
   109      This method is for compiler support and very special cases (debugging) only
   107      - do not use"
   110      - do not use"
   108 
   111 
   109 %{  /* NOCONTEXT */
   112 %{  /* NOCONTEXT */
   110     if (_isSmallInteger(anAddress))
   113     if (_isSmallInteger(anAddress))
   111         _INST(code) = (OBJ)(_intVal(anAddress));
   114         _INST(code_) = (OBJ)(_intVal(anAddress));
   112     else
   115     else
   113         _INST(code) = (OBJ)0;
   116         _INST(code_) = (OBJ)0;
   114 %}
   117 %}
   115 !
   118 !
   116 
   119 
   117 dynamic:aBoolean
   120 dynamic:aBoolean
   118     "set the flag bit stating that the machine code was created
   121     "set the flag bit stating that the machine code was created
   148 
   151 
   149 readBinaryContentsFrom: stream manager: manager
   152 readBinaryContentsFrom: stream manager: manager
   150     "make certain, that no invalid function addresses are created."
   153     "make certain, that no invalid function addresses are created."
   151 
   154 
   152     super readBinaryContentsFrom: stream manager: manager.
   155     super readBinaryContentsFrom: stream manager: manager.
   153     code := nil.
   156     self code:nil.
   154 ! !
   157 ! !