CompiledCode.st
changeset 249 810798c5c2e5
parent 225 7c8e57cc5b13
child 255 2b2c5c0facab
equal deleted inserted replaced
248:601b44c71329 249:810798c5c2e5
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     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 ExecutableFunction subclass:#ExecutableCodeObject
    13 ExecutableFunction subclass:#CompiledCode
    14        instanceVariableNames:'byteCode literals'
    14        instanceVariableNames:'byteCode literals'
    15        classVariableNames:'NoByteCodeSignal InvalidByteCodeSignal
    15        classVariableNames:'NoByteCodeSignal InvalidByteCodeSignal
    16 			   InvalidInstructionSignal BadLiteralsSignal
    16 			   InvalidInstructionSignal BadLiteralsSignal
    17 			   NonBooleanReceiverSignal ArgumentSignal'
    17 			   NonBooleanReceiverSignal ArgumentSignal'
    18        poolDictionaries:''
    18        poolDictionaries:''
    19        category:'Kernel-Methods'
    19        category:'Kernel-Methods'
    20 !
    20 !
    21 
    21 
    22 ExecutableCodeObject comment:'
    22 CompiledCode comment:'
    23 COPYRIGHT (c) 1994 by Claus Gittinger
    23 COPYRIGHT (c) 1994 by Claus Gittinger
    24 	      All Rights Reserved
    24 	      All Rights Reserved
    25 
    25 
    26 $Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.7 1995-02-05 21:30:33 claus Exp $
    26 $Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.8 1995-02-15 10:21:38 claus Exp $
    27 '!
    27 '!
    28 
    28 
    29 !ExecutableCodeObject class methodsFor:'documentation'!
    29 !CompiledCode class methodsFor:'documentation'!
    30 
    30 
    31 copyright
    31 copyright
    32 "
    32 "
    33  COPYRIGHT (c) 1994 by Claus Gittinger
    33  COPYRIGHT (c) 1994 by Claus Gittinger
    34 	      All Rights Reserved
    34 	      All Rights Reserved
    42 "
    42 "
    43 !
    43 !
    44 
    44 
    45 version
    45 version
    46 "
    46 "
    47 $Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.7 1995-02-05 21:30:33 claus Exp $
    47 $Header: /cvs/stx/stx/libbasic/CompiledCode.st,v 1.8 1995-02-15 10:21:38 claus Exp $
    48 "
    48 "
    49 !
    49 !
    50 
    50 
    51 documentation
    51 documentation
    52 "
    52 "
    73 
    73 
    74     NOTICE: layout known by runtime system and compiler - do not change
    74     NOTICE: layout known by runtime system and compiler - do not change
    75 "
    75 "
    76 ! !
    76 ! !
    77 
    77 
    78 !ExecutableCodeObject class methodsFor:'initialization'!
    78 !CompiledCode class methodsFor:'initialization'!
    79 
    79 
    80 initialize
    80 initialize
    81     NoByteCodeSignal isNil ifTrue:[
    81     NoByteCodeSignal isNil ifTrue:[
    82 	ExecutableFunction initialize.
    82 	ExecutableFunction initialize.
    83 
    83 
   105 	ArgumentSignal nameClass:self message:#argumentSignal.
   105 	ArgumentSignal nameClass:self message:#argumentSignal.
   106 	ArgumentSignal notifierString:'bad argument(s)'.
   106 	ArgumentSignal notifierString:'bad argument(s)'.
   107     ]
   107     ]
   108 ! !
   108 ! !
   109 
   109 
   110 !ExecutableCodeObject class methodsFor:'signal access'!
   110 !CompiledCode class methodsFor:'signal access'!
   111 
   111 
   112 executionErrorSignal
   112 executionErrorSignal
   113     "return the parent-signal of all execution errors"
   113     "return the parent-signal of all execution errors"
   114 
   114 
   115     ^ ExecutionErrorSignal
   115     ^ ExecutionErrorSignal
   120      arguments"
   120      arguments"
   121 
   121 
   122     ^ ArgumentSignal
   122     ^ ArgumentSignal
   123 ! !
   123 ! !
   124 
   124 
   125 !ExecutableCodeObject class methodsFor:'queries'!
   125 !CompiledCode class methodsFor:'queries'!
   126 
   126 
   127 isBuiltInClass
   127 isBuiltInClass
   128     "this class is known by the run-time-system"
   128     "this class is known by the run-time-system"
   129 
   129 
   130     ^ true
   130     ^ true
   131 ! !
   131 ! !
   132 
   132 
   133 !ExecutableCodeObject methodsFor:'accessing'!
   133 !CompiledCode methodsFor:'accessing'!
   134 
   134 
   135 byteCode
   135 byteCode
   136     "return the bytecode (a ByteArray)"
   136     "return the bytecode (a ByteArray)"
   137 
   137 
   138     ^ byteCode
   138     ^ byteCode
   142     "return the literal array"
   142     "return the literal array"
   143 
   143 
   144     ^ literals
   144     ^ literals
   145 ! !
   145 ! !
   146 
   146 
   147 !ExecutableCodeObject methodsFor:'private accessing'!
   147 !CompiledCode methodsFor:'private accessing'!
   148 
   148 
   149 byteCode:aByteArray
   149 byteCode:aByteArray
   150     "set the bytecode field - DANGER ALERT"
   150     "set the bytecode field - DANGER ALERT"
   151 
   151 
   152     byteCode := aByteArray
   152     byteCode := aByteArray
   156     "set the literal array for evaluation - DANGER ALERT"
   156     "set the literal array for evaluation - DANGER ALERT"
   157 
   157 
   158     literals := aLiteralArray
   158     literals := aLiteralArray
   159 ! !
   159 ! !
   160 
   160 
   161 !ExecutableCodeObject methodsFor:'error handling'!
   161 !CompiledCode methodsFor:'error handling'!
   162 
   162 
   163 noByteCode
   163 noByteCode
   164     "this error is triggered when the interpreter tries to execute a
   164     "this error is triggered when the interpreter tries to execute a
   165      code object, where the byteCode is nil.
   165      code object, where the byteCode is nil.
   166      Can only happen when Compiler/runtime system is broken or
   166      Can only happen when Compiler/runtime system is broken or