CompCode.st
author Claus Gittinger <cg@exept.de>
Mon, 12 Jan 1998 14:23:21 +0100
changeset 3165 b6bde90005a8
parent 3145 35167e4ad9a5
child 3218 78255e232c66
permissions -rw-r--r--
also try package-subdir of source-dir for classes source
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     1
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
     3
	      All Rights Reserved
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     4
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    11
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    12
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    13
ExecutableFunction variableSubclass:#CompiledCode
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    14
	instanceVariableNames:'flags byteCode'
1182
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    15
	classVariableNames:'NoByteCodeSignal InvalidByteCodeSignal InvalidInstructionSignal
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    16
		BadLiteralsSignal NonBooleanReceiverSignal ArgumentSignal'
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    17
	poolDictionaries:''
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    18
	category:'Kernel-Methods'
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    19
!
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    20
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
    21
!CompiledCode class methodsFor:'documentation'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    22
88
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    23
copyright
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    24
"
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    25
 COPYRIGHT (c) 1994 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    26
	      All Rights Reserved
88
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    27
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    28
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    29
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    31
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    32
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    33
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    34
"
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    35
!
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    36
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    37
documentation
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    38
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    39
    This is an abstract class, to merge common attributes of Blocks and
328
claus
parents: 326
diff changeset
    40
    Methods i.e. describe all objects consisting of either compiled or 
claus
parents: 326
diff changeset
    41
    interpreted code.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    42
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    43
    Instances of CompiledCode are not to be created by user code
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    44
    (the compilers create Blocks, Methods etc.)
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    45
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    46
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    47
    [Instance variables:]
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    48
357
claus
parents: 345
diff changeset
    49
      flags       <SmallInteger>    special flag bits coded in a number
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    50
      byteCode    <ByteArray>       bytecode if its an interpreted codeobject
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    51
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    52
      The block/methods literals are stored in the indexed instance variables.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    53
      If there is only one indexed instvar, it contains a reference to an
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    54
      Object containing the literals.
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    55
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    56
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    57
    [Class variables:]
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    58
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    59
      NoByteCodeSignal              raised if a codeObject is about to be executed
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    60
                                    which has neither code nor byteCode (i.e. both are nil)
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    61
      InvalidByteCodeSignal         raised if byteCode is not an instance of ByteArray
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    62
      InvalidInstructionSignal      raised if an invalid instruction opcode is encountered
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    63
      BadLiteralsSignal             raised if literalArray is not an array
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    64
      NonBooleanReceiverSignal      raised for conditional jumps where receiver is not a boolean
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    65
      ArgumentSignal                raised if argument count is not what the codeObject expects
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    66
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    67
    all of these signals are children of ExecutionErrorSignal.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    68
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    69
    NOTICE: layout known by runtime system and compiler - do not change
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    70
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    71
    [author:]
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    72
        Claus Gittinger
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    73
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    74
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    75
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
    76
!CompiledCode class methodsFor:'initialization'!
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
    77
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
    78
initialize
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    79
    "create signals raised by various errors"
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    80
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
    81
    NoByteCodeSignal isNil ifTrue:[
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    82
        NoByteCodeSignal := ExecutionErrorSignal newSignalMayProceed:true.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    83
        NoByteCodeSignal nameClass:self message:#noByteCodeSignal.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    84
        NoByteCodeSignal notifierString:'nil byteCode in code-object - not executable'.
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    85
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    86
        InvalidByteCodeSignal := ExecutionErrorSignal newSignalMayProceed:true.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    87
        InvalidByteCodeSignal nameClass:self message:#invalidByteCodeSignal.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    88
        InvalidByteCodeSignal notifierString:'invalid byteCode in code-object - not executable'.
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    89
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    90
        InvalidInstructionSignal := ExecutionErrorSignal newSignalMayProceed:true.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    91
        InvalidInstructionSignal nameClass:self message:#invalidInstructionSignal.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    92
        InvalidInstructionSignal notifierString:'invalid instruction in code-object - not executable'.
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    93
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    94
        BadLiteralsSignal := ExecutionErrorSignal newSignalMayProceed:true.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    95
        BadLiteralsSignal nameClass:self message:#badLiteralsSignal.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    96
        BadLiteralsSignal notifierString:'bad literal table in code-object - should not happen'.
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    97
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    98
        NonBooleanReceiverSignal := ExecutionErrorSignal newSignalMayProceed:true.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    99
        NonBooleanReceiverSignal nameClass:self message:#nonBooleanReceiverSignal.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   100
        NonBooleanReceiverSignal notifierString:'if/while on non-boolean receiver'.
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
   101
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   102
        ArgumentSignal := ExecutionErrorSignal newSignalMayProceed:true.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   103
        ArgumentSignal nameClass:self message:#argumentSignal.
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   104
        ArgumentSignal notifierString:'bad argument(s)'.
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   105
    ]
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   106
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   107
    "Modified: 22.4.1996 / 16:33:38 / cg"
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   108
! !
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   109
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
   110
!CompiledCode class methodsFor:'instance creation'!
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   111
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   112
new
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   113
    "create a new method with an inirect literal array
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   114
     stored in the first and only indexed instvar"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   115
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   116
    ^ self basicNew:1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   117
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   118
    "Created: 24.6.1996 / 17:21:46 / stefan"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   119
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   120
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   121
new:numberOfLiterals
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   122
    "create a new method with numberOfLiterals.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   123
     Implementation note:
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   124
        If (self size) == 1, the only literal is an indirect literal
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   125
        containing an array of literals. Otherwise the literals
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   126
        are stored in self.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   127
    "
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   128
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   129
    |nlits|
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   130
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   131
    nlits := numberOfLiterals.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   132
    nlits <= 1 ifTrue:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   133
        nlits := nlits + 1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   134
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   135
    ^ self basicNew:nlits.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   136
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   137
    "Created: 24.6.1996 / 17:20:13 / stefan"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   138
    "Modified: 25.6.1996 / 14:25:14 / stefan"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   139
! !
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   140
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
   141
!CompiledCode class methodsFor:'Signal constants'!
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   142
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   143
argumentSignal
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   144
    "return the signal raised when something's wrong with the
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   145
     arguments"
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   146
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   147
    ^ ArgumentSignal
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   148
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   149
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   150
executionErrorSignal
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   151
    "return the parent-signal of all execution errors"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   152
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   153
    ^ ExecutionErrorSignal
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   154
! !
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   155
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
   156
!CompiledCode class methodsFor:'queries'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   157
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   158
isBuiltInClass
1264
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   159
    "return true if this class is known by the run-time-system.
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   160
     Here, true is returned for myself, false for subclasses."
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   161
1182
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   162
    ^ self == CompiledCode
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   163
1264
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   164
    "Modified: 23.4.1996 / 15:57:03 / cg"
2806
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   165
!
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   166
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   167
maxNumberOfArguments
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   168
    "return the maximum number of arguments a method can have.
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   169
     This is a limit in the VM, which may be removed in one of 
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   170
     the next versions ..."
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   171
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   172
%{  /* NOCONTEXT */
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   173
    RETURN (__MKSMALLINT(MAX_METHOD_ARGS));
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   174
%}
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   175
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   176
2567
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   177
!CompiledCode methodsFor:'ST-80 compatibility'!
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   178
2696
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   179
getSource
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   180
    "return the code objects source code, nil if none is available"
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   181
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   182
    ^ self source.
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   183
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   184
    "Created: 19.6.1997 / 16:32:15 / cg"
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   185
!
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   186
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   187
getSourceForUserIfNone:aBlock
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   188
    "return the code objects source code.
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   189
     If none is available, return the result from evaluating aBlock."
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   190
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   191
    |src| 
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   192
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   193
    Screen current shiftDown ifTrue:[^ aBlock value].
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   194
    src := self source.
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   195
    src isNil ifTrue:[^ aBlock value].
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   196
    ^ src withoutTrailingSeparators
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   197
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   198
    "Modified: 19.6.1997 / 16:31:53 / cg"
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   199
!
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   200
2567
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   201
withAllBlockMethodsDo:aBlock
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   202
    aBlock value:self
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   203
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   204
    "Created: 18.4.1997 / 20:42:07 / cg"
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   205
! !
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   206
249
claus
parents: 225
diff changeset
   207
!CompiledCode methodsFor:'accessing'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   208
2703
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   209
allLiterals
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   210
    "return a collection of all literals (includes all block literals)"
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   211
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   212
    ^ self literals ? #()
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   213
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   214
    "Modified: 19.6.1997 / 17:37:52 / cg"
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   215
!
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   216
3076
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   217
allSymbolLiterals
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   218
    "return a collection of all symbol-literals"
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   219
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   220
    ^ self allLiterals select:[:lit | lit isSymbol]
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   221
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   222
    "Modified: / 19.6.1997 / 17:37:52 / cg"
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   223
    "Created: / 1.11.1997 / 13:14:44 / cg"
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   224
!
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   225
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   226
byteCode
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   227
    "return the bytecode (a ByteArray)"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   228
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   229
    ^ byteCode
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   230
!
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   231
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   232
changeLiteral:aLiteral to:newLiteral
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   233
    "change aLiteral to newLiteral"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   234
1526
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   235
    |lits nLits "{ Class: SmallInteger }" |
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   236
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   237
    self size == 1 ifTrue:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   238
        lits := self at:1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   239
    ] ifFalse:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   240
        lits := self.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   241
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   242
1526
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   243
    nLits := lits size.
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   244
    1 to:nLits do:[:i|
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   245
        (lits at:i) == aLiteral ifTrue:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   246
            lits at:i put:newLiteral.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   247
            ^ true.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   248
        ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   249
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   250
    ^ false.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   251
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   252
    "Created: 24.6.1996 / 15:08:11 / stefan"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   253
    "Modified: 24.6.1996 / 17:07:56 / stefan"
1526
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   254
    "Modified: 4.7.1996 / 11:12:39 / cg"
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   255
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   256
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   257
decompiler
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   258
    ^ Decompiler
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   259
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   260
    "Created: 30.7.1997 / 16:36:40 / cg"
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   261
!
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   262
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   263
do:aBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   264
    "same as #literalsDo:, in order to get common protocol with Array"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   265
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   266
    ^ self literalsDo:aBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   267
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   268
    "Modified: 25.6.1996 / 22:16:44 / stefan"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   269
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   270
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   271
literals
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   272
    "return the literal array"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   273
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   274
    |lits numLits "{ Class: SmallInteger }"|
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   275
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   276
    (numLits := self size) == 1 ifTrue:[
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   277
        ^ self at:1.
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   278
    ].
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   279
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   280
    lits := Array new:numLits.
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   281
    1 to:numLits do:[:i|
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   282
        lits at:i put:(self at:i).
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   283
    ].
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   284
    ^ lits.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   285
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   286
    "
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   287
     (CompiledCode compiledMethodAt:#literals) literals
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   288
    "
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   289
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   290
    "Modified: 24.6.1996 / 17:12:06 / stefan"
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   291
    "Modified: 30.1.1997 / 17:09:06 / cg"
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   292
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   293
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   294
literalsDetect:aBlock ifNone:exceptionBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   295
    "execute a one arg block for each of our literals.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   296
     return the first literal for which aBlock returns true"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   297
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   298
    |lits theLit numLits "{Class: SmallInteger }"|
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   299
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   300
    self size == 1 ifTrue:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   301
        lits := self at:1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   302
    ] ifFalse:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   303
        lits := self.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   304
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   305
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   306
    numLits := lits size.
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   307
    1 to:numLits do:[:i |
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   308
        theLit := lits at:i.
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   309
        (aBlock value:theLit) ifTrue:[
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   310
            ^ theLit.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   311
        ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   312
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   313
    ^ exceptionBlock value.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   314
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   315
    "Created: 24.6.1996 / 14:27:35 / stefan"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   316
    "Modified: 24.6.1996 / 17:13:02 / stefan"
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   317
    "Modified: 30.1.1997 / 16:24:04 / cg"
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   318
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   319
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   320
literalsDo:aBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   321
    "execute a one arg block for each of our literals"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   322
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   323
    |lits numLits "{ Class: SmallInteger }" |
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   324
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   325
    self size == 1 ifTrue:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   326
        lits := self at:1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   327
    ] ifFalse:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   328
        lits := self.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   329
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   330
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   331
    numLits := lits size.
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   332
    1 to:numLits do:[:i |
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   333
        aBlock value:(lits at:i)
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   334
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   335
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   336
    "Created: 24.6.1996 / 14:17:12 / stefan"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   337
    "Modified: 24.6.1996 / 17:13:28 / stefan"
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   338
    "Modified: 30.1.1997 / 17:08:05 / cg"
2695
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   339
!
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   340
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   341
mclass
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   342
    "return the class of the receivers home method.
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   343
     Thats the class of the method where the block was compiled."
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   344
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   345
    ^ self homeMethod mclass
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   346
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   347
    "Modified: 19.6.1997 / 16:24:58 / cg"
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   348
    "Created: 19.6.1997 / 16:27:34 / cg"
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   349
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   350
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   351
!CompiledCode methodsFor:'converting'!
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   352
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   353
makeRealMethod
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   354
    "by default, we are a real method.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   355
     Subclasses (e.g. LazyMethod) may redefine this"
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   356
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   357
    ^ self
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   358
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   359
    "Created: 7.6.1996 / 12:45:50 / stefan"
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   360
! !
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   361
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   362
!CompiledCode methodsFor:'error handling'!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   363
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   364
badArgumentArray
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   365
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   366
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   367
    "this error is triggered, if a non array is passed to 
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   368
     #valueWithReceiver:.. type of methods"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   369
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   370
    ^ ArgumentSignal
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   371
        raiseRequestWith:self
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   372
        errorString:'argumentArray must be an Array'
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   373
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   374
    "Modified: 4.11.1996 / 22:46:52 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   375
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   376
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   377
badLiteralTable
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   378
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   379
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   380
    "this error is triggered, when a block/method is called with a bad literal
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   381
     array (i.e. non-array) - this can only happen, if the
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   382
     compiler is broken or someone played around with a blocks/methods
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   383
     literal table or the GC is broken and corrupted it."
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   384
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   385
    ^ BadLiteralsSignal raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   386
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   387
    "Modified: 4.11.1996 / 22:46:55 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   388
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   389
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   390
invalidByteCode
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   391
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   392
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   393
    "this error is triggered when the interpreter tries to execute a
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   394
     code object, where the byteCode is nonNil, but not a ByteArray.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   395
     Can only happen when Compiler/runtime system is broken or
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   396
     someone played around with a blocks/methods code."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   397
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   398
    ^ InvalidByteCodeSignal raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   399
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   400
    "Modified: 4.11.1996 / 22:46:59 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   401
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   402
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   403
invalidInstruction
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   404
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   405
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   406
    "this error is triggered when the bytecode-interpreter tries to
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   407
     execute an invalid bytecode instruction.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   408
     Can only happen when Compiler/runtime system is broken or
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   409
     someone played around with a blocks/methods code."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   410
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   411
    ^ InvalidInstructionSignal raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   412
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   413
    "Modified: 4.11.1996 / 22:47:03 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   414
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   415
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   416
noByteCode
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   417
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   418
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   419
    "this error is triggered when the interpreter tries to execute a
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   420
     code object, where both the code and byteCode instances are nil.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   421
     This can happen if:
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   422
        - the Compiler/runtime system is broken, (should not happen)
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   423
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   424
        - someone played around with a block/method, (you should not do this)
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   425
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   426
        - compilation of a lazy method failed
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   427
          (i.e. the lazy method contains an error or
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   428
           it contains primitive code and there is no stc compiler available)
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   429
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   430
        - an unloaded object modules method is called for.
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   431
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   432
     Only the first case is to be considered serious 
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   433
     - it should not happen if the system is used correctly."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   434
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   435
    ^ NoByteCodeSignal raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   436
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   437
    "Modified: 4.11.1996 / 22:47:07 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   438
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   439
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   440
receiverNotBoolean:anObject
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   441
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   442
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   443
    "this error is triggered when the bytecode-interpreter tries to
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   444
     execute ifTrue:/ifFalse or whileTrue: - type of expressions where the
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   445
     receiver is neither true nor false.
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   446
     Machine compiled code does not detect this, and may behave undeterministec."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   447
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   448
    ^ NonBooleanReceiverSignal raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   449
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   450
    "Modified: 4.11.1996 / 22:47:11 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   451
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   452
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   453
tooManyArguments
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   454
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   455
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   456
    "this error is triggered, when a method/block tries to perform a send with
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   457
     more arguments than supported by the interpreter. 
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   458
     This can only happen, if the compiler has been changed without 
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   459
     updating the VM, since the compiler checks for allowed number of
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   460
     arguments."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   461
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   462
    ^ ArgumentSignal
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   463
        raiseRequestWith:self
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   464
        errorString:'too many args in send'
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   465
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   466
    "Modified: 4.11.1996 / 22:47:14 / cg"
2827
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   467
!
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   468
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   469
wrongNumberOfArguments:numberGiven
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   470
    "{ Pragma: +optSpace }"
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   471
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   472
    "this error is triggered by the VM, if a method is called with a wrong number
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   473
     of arguments. 
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   474
     This only applies to #valueWithReceiverXXX and #perform:withArguments: - sends.
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   475
     With a normal send, this error cannot happen."
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   476
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   477
    ^ ArgumentSignal
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   478
        raiseRequestWith:self
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   479
        errorString:(self class name ,
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   480
                     ' got ' , numberGiven printString ,
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   481
                     ' arg(s) where ' , self numArgs printString , ' expected')
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   482
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
   483
    "Modified: 1.8.1997 / 00:23:10 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   484
! !
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   485
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   486
!CompiledCode methodsFor:'executing'!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   487
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   488
valueWithReceiver:anObject arguments:argArray
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   489
    "low level call of a methods code - BIG DANGER ALERT.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   490
     Perform the receiver-method on anObject as receiver and argArray as
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   491
     arguments. This does NO message lookup at all and mimics a
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   492
     traditional function call.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   493
     This method is provided for debugging- and breakpoint-support 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   494
     (replacing a method by a stub and recalling the original), or to implement
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   495
     experimental MI implementations - it is not for general use. 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   496
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   497
     The receiver must be a method compiled in anObjects class or one of its 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   498
     superclasses and also, the number of arguments given must match the methods
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   499
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   500
     - otherwise strange things (and also strange crashes) can occur.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   501
     The system is NOT always detecting a wrong method/receiver combination.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   502
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   503
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   504
    ^ self 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   505
        valueWithReceiver:anObject 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   506
        arguments:argArray 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   507
        selector:nil 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   508
        search:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   509
        sender:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   510
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   511
    "Modified: 4.4.1997 / 23:33:56 / cg"
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   512
    "Created: 30.7.1997 / 12:04:52 / cg"
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   513
!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   514
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   515
valueWithReceiver:anObject arguments:argArray selector:aSymbol
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   516
    "low level call of a methods code - BIG DANGER ALERT.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   517
     Perform the receiver-method on anObject as receiver and argArray as
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   518
     arguments. This does NO message lookup at all and mimics a
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   519
     traditional function call.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   520
     This method is provided for debugging- and breakpoint-support 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   521
     (replacing a method by a stub and recalling the original), or to implement
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   522
     experimental MI implementations - it is not for general use. 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   523
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   524
     The receiver must be a method compiled in anObjects class or one of its 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   525
     superclasses and also, the number of arguments given must match the methods
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   526
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   527
     - otherwise strange things (and also strange crashes) can occur.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   528
     The system is NOT always detecting a wrong method/receiver combination.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   529
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   530
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   531
    ^ self 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   532
        valueWithReceiver:anObject 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   533
        arguments:argArray 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   534
        selector:aSymbol 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   535
        search:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   536
        sender:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   537
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   538
    "Modified: 4.4.1997 / 23:34:08 / cg"
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   539
    "Created: 30.7.1997 / 12:04:49 / cg"
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   540
!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   541
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   542
valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   543
    "low level call of a methods code - BIG DANGER ALERT.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   544
     Perform the receiver-method on anObject as receiver and argArray as
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   545
     arguments. This does NO message lookup at all and mimics a
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   546
     traditional function call.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   547
     This method is provided for debugging- and breakpoint-support 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   548
     (replacing a method by a stub and recalling the original), or to implement
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   549
     experimental MI implementations - it is not for general use. 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   550
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   551
     The receiver must be a method compiled in anObjects class or one of its 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   552
     superclasses and also, the number of arguments given must match the methods
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   553
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   554
     - otherwise strange things (and also strange crashes) can occur.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   555
     The system is NOT always detecting a wrong method/receiver combination.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   556
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   557
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   558
    ^ self 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   559
        valueWithReceiver:anObject 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   560
        arguments:argArray 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   561
        selector:aSymbol 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   562
        search:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   563
        sender:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   564
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   565
    "Modified: 4.4.1997 / 23:34:19 / cg"
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   566
    "Created: 30.7.1997 / 12:04:46 / cg"
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   567
!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   568
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   569
valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass sender:virtualSender
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   570
    "low level call of a methods code - BIG DANGER ALERT.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   571
     Perform the receiver-method on anObject as receiver and argArray as
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   572
     arguments. This does NO message lookup at all and mimics a
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   573
     traditional function call.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   574
     This method is provided for debugging- and breakpoint-support 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   575
     (replacing a method by a stub and recalling the original), or to implement
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   576
     experimental MI implementations - it is not for general use. 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   577
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   578
     The receiver must be a method compiled in anObjects class or one of its 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   579
     superclasses and also, the number of arguments given must match the methods
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   580
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   581
     - otherwise strange things (and also strange crashes) can occur.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   582
     The system is NOT always detecting a wrong method/receiver combination.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   583
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   584
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   585
%{
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   586
    OBJFUNC code;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   587
    OBJ searchClass;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   588
    static struct inlineCache dummy = _DUMMYILC0;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   589
    int nargs;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   590
    OBJ *ap;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   591
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   592
    /*
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   593
     * args must be an array, or nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   594
     */
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   595
    if (__isArray(argArray)) {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   596
        nargs = __arraySize(argArray);
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   597
        ap = __ArrayInstPtr(argArray)->a_element;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   598
    } else {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   599
        if (argArray != nil) {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   600
            goto badArgs;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   601
        }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   602
        nargs = 0;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   603
    }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   604
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   605
#ifdef F_NARGS
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   606
    if (((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT) == nargs) 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   607
#endif
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   608
    {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   609
        code = __MethodInstPtr(self)->m_code;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   610
        if (aClass == nil) {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   611
            searchClass = dummy.ilc_class = __Class(anObject);
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   612
        } else {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   613
            searchClass = dummy.ilc_class = aClass;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   614
        }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   615
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   616
        if (nargs <= 15) {
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   617
	  OBJ rslt;
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   618
#ifdef CONTEXT_DEBUG
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   619
	  OBJ sav = __thisContext;
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   620
#endif
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   621
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   622
          /*
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   623
           * add virtual sender (unwinding) here later,
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   624
           * to allow hiding contexts in lazy methods.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   625
           * (this is cosmetics only; therefore its done later)
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   626
           */
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   627
          if (code) {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   628
            /* compiled code */
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   629
            switch (nargs) {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   630
                case 0:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   631
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   632
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   633
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   634
                case 1:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   635
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   636
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   637
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   638
                case 2:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   639
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   640
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   641
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   642
                case 3:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   643
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1], ap[2]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   644
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   645
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   646
                case 4:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   647
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   648
                                 ap[0], ap[1], ap[2], ap[3]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   649
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   650
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   651
                case 5:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   652
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   653
                                 ap[0], ap[1], ap[2], ap[3], ap[4]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   654
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   655
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   656
                case 6:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   657
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   658
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   659
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   660
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   661
                case 7:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   662
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   663
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   664
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   665
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   666
                case 8:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   667
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   668
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   669
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   670
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   671
                case 9:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   672
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   673
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   674
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   675
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   676
                case 10:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   677
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   678
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   679
                                 ap[9]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   680
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   681
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   682
                case 11:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   683
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   684
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   685
                                 ap[9], ap[10]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   686
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   687
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   688
                case 12:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   689
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   690
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   691
                                 ap[9], ap[10], ap[11]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   692
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   693
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   694
                case 13:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   695
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   696
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   697
                                 ap[9], ap[10], ap[11], ap[12]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   698
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   699
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   700
                case 14:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   701
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   702
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   703
                                 ap[9], ap[10], ap[11], ap[12], ap[13]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   704
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   705
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   706
                case 15:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   707
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, 
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   708
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8], 
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   709
                                 ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   710
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   711
            }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   712
          } else {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   713
            /* interpreted code */
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   714
#ifdef PASS_ARG_POINTER
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   715
            rslt = __interpret(self, nargs, anObject, aSymbol, searchClass, &dummy, ap);
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   716
#else
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   717
            switch (nargs) {
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   718
                case 0:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   719
                    rslt = __interpret(self, 0, anObject, aSymbol, searchClass, &dummy);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   720
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   721
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   722
                case 1:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   723
                    rslt = __interpret(self, 1, anObject, aSymbol, searchClass, &dummy,
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   724
                                   ap[0]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   725
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   726
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   727
                case 2:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   728
                    rslt = __interpret(self, 2, anObject, aSymbol, searchClass, &dummy,
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   729
                                   ap[0], ap[1]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   730
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   731
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   732
                case 3:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   733
                    rslt = __interpret(self, 3, anObject, aSymbol, searchClass, &dummy,
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   734
                                   ap[0], ap[1], ap[2]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   735
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   736
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   737
                case 4:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   738
                    rslt = __interpret(self, 4, anObject, aSymbol, searchClass, &dummy,
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   739
                                   ap[0], ap[1], ap[2], ap[3]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   740
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   741
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   742
                case 5:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   743
                    rslt = __interpret(self, 5, anObject, aSymbol, searchClass, &dummy,
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   744
                                   ap[0], ap[1], ap[2], ap[3], ap[4]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   745
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   746
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   747
                case 6:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   748
                    rslt = __interpret(self, 6, anObject, aSymbol, searchClass, &dummy,
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   749
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   750
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   751
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   752
                case 7:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   753
                    rslt = __interpret(self, 7, anObject, aSymbol, searchClass, &dummy,
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   754
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   755
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   756
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   757
                case 8:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   758
                    rslt = __interpret(self, 8, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   759
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   760
                                   ap[7]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   761
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   762
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   763
                case 9:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   764
                    rslt = __interpret(self, 9, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   765
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   766
                                   ap[7], ap[8]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   767
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   768
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   769
                case 10:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   770
                    rslt = __interpret(self, 10, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   771
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   772
                                   ap[7], ap[8], ap[9]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   773
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   774
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   775
                case 11:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   776
                    rslt = __interpret(self, 11, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   777
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   778
                                   ap[7], ap[8], ap[9], ap[10]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   779
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   780
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   781
                case 12:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   782
                    rslt = __interpret(self, 12, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   783
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   784
                                   ap[7], ap[8], ap[9], ap[11]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   785
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   786
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   787
                case 13:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   788
                    rslt = __interpret(self, 13, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   789
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   790
                                   ap[7], ap[8], ap[9], ap[11], ap[12]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   791
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   792
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   793
                case 14:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   794
                    rslt = __interpret(self, 14, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   795
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   796
                                   ap[7], ap[8], ap[9], ap[11], ap[12], ap[13]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   797
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   798
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   799
                case 15:
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   800
                    rslt = __interpret(self, 15, anObject, aSymbol, searchClass, &dummy,
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   801
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   802
                                   ap[7], ap[8], ap[9], ap[11], ap[12], ap[13], ap[14]);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   803
		    break;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   804
            }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   805
#endif
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   806
          }
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   807
#ifdef CONTEXT_DEBUG
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   808
	  if (sav != __thisContext) {
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   809
	      if (code) {
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   810
	          printf("CONTEXT BOTCH after execution of %x\n", code);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   811
	      } else {
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   812
	          printf("CONTEXT BOTCH after execution of interpreted method\n");
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   813
	          printf("code now: %x\n", __MethodInstPtr(self)->m_code);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   814
	      }
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   815
	      printf("context before:\n");
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   816
	      __dumpObject__(sav);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   817
	      printf("context now:\n");
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   818
	      __dumpObject__(__thisContext);
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   819
	  }
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   820
#endif
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   821
	  RETURN (rslt);
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   822
        }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   823
    }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   824
    badArgs: ;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   825
%}.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   826
    (argArray isMemberOf:Array) ifFalse:[
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   827
        "
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   828
         arguments must be either nil or an array
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   829
        "
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   830
        ^ self badArgumentArray
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   831
    ].
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   832
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   833
    (argArray size ~~ self numArgs) ifTrue:[
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   834
        "
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   835
         the method expects a different number of arguments
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   836
        "
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   837
        ^ self wrongNumberOfArguments:argArray size
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   838
    ].
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   839
    
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   840
    "/ the VM only supports a limited number of arguments in sends
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   841
    "/ (currently, 15)
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   842
    
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   843
    ^ self tooManyArguments
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   844
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   845
    "
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   846
     (Float compiledMethodAt:#+) 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   847
        valueWithReceiver:1.0 arguments:#(2.0)
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   848
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   849
     'the next example is a wrong one - which is detected by True's method ...'.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   850
     (True compiledMethodAt:#printString) 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   851
        valueWithReceiver:false arguments:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   852
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   853
     'the next example is a wrong one - it is nowhere detected
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   854
      and a wrong value returned ...'.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   855
     (Point compiledMethodAt:#x) 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   856
        valueWithReceiver:(1->2) arguments:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   857
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   858
     'the next example is VERY bad one - it is nowhere detected
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   859
      and may crash the system WARNING: save your work before doing this ...'.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   860
     (Point compiledMethodAt:#x) 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   861
        valueWithReceiver:(Object new) arguments:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   862
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   863
     'the next example is a wrong one - which is detected here ...'.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   864
     (Object compiledMethodAt:#printOn:)
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   865
        valueWithReceiver:false arguments:nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   866
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   867
     'the next example is a wrong one - which is detected here ...'.
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   868
     (Object compiledMethodAt:#printOn:)
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   869
        valueWithReceiver:false arguments:#() 
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   870
    "
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   871
! !
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
   872
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   873
!CompiledCode methodsFor:'private accessing'!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   874
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   875
byteCode:aByteArray
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   876
    "set the bytecode field - DANGER ALERT"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   877
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   878
    byteCode := aByteArray
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   879
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   880
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   881
checked:aBoolean
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   882
    "set/clear the flag bit stating that this method has already been checked
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   883
     by the just-in-time compiler. Setting the flag prevents it from
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   884
     trying any compilation.
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   885
     Not for public use - for VM debugging only."
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   886
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   887
%{  /* NOCONTEXT */
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   888
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
   889
    INT newFlags = __intVal(__INST(flags));
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   890
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   891
    /* made this a primitive to get define in stc.h */
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   892
    if (aBoolean == true)
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   893
        newFlags |= F_CHECKED;
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   894
    else
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   895
        newFlags &= ~F_CHECKED;
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   896
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   897
    __INST(flags) = __MKSMALLINT(newFlags);
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   898
%}
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   899
!
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
   900
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   901
dynamic
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   902
    "return the flag stating that the machine code was created
1774
ab14302c6497 comment
Claus Gittinger <cg@exept.de>
parents: 1772
diff changeset
   903
     dynamically (from bytecode) or loaded dynamically from an objectFile
ab14302c6497 comment
Claus Gittinger <cg@exept.de>
parents: 1772
diff changeset
   904
     (i.e. has machineCode, but is not in the executable)."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   905
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   906
%{  /* NOCONTEXT */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   907
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   908
    /* made this a primitive to get define in stc.h */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   909
1771
ccb8ff5d4763 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   910
    RETURN (( (INT)(__INST(flags)) & __MASKSMALLINT(F_DYNAMIC)) ? true : false);
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   911
%}
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   912
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   913
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   914
literals:aLiteralArray 
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   915
    "set the literal array for evaluation - DANGER ALERT"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   916
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   917
    |i|
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   918
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   919
    aLiteralArray isNil ifTrue:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   920
        ^ self.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   921
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   922
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   923
    self size == 1 ifTrue:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   924
        self at:1 put:aLiteralArray.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   925
    ] ifFalse:[
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   926
        i := 1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   927
        aLiteralArray do:[:literal|
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   928
            self at:i put:literal.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   929
            i := i + 1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   930
        ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   931
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   932
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   933
    "Modified: 25.6.1996 / 22:13:08 / stefan"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   934
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   935
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   936
markFlag
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   937
    "return the mark bits value as a boolean"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   938
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   939
%{  /* NOCONTEXT */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   940
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   941
    /* made this a primitive to get define in stc.h */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   942
1771
ccb8ff5d4763 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
   943
    RETURN (( (INT)(__INST(flags)) & __MASKSMALLINT(F_MARKBIT)) ? true : false);
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   944
%}
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   945
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   946
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   947
markFlag:aBoolean
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   948
    "set/clear the mark flag bit.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   949
     This bit is not used by the VM, but instead free to mark codeObjects
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   950
     for any (debugging/tracing) use. For example, the coverage test uses
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   951
     these to mark reached methods. (inspired by a note in c.l.s)"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   952
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   953
%{  /* NOCONTEXT */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   954
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
   955
    INT newFlags = __intVal(__INST(flags));
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   956
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   957
    /* made this a primitive to get define in stc.h */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   958
    if (aBoolean == true)
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   959
	newFlags |= F_MARKBIT;
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   960
    else
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   961
	newFlags &= ~F_MARKBIT;
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   962
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
   963
    __INST(flags) = __MKSMALLINT(newFlags);
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   964
%}
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   965
! !
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   966
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   967
!CompiledCode methodsFor:'private-compiler interface'!
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   968
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   969
flags:newFlags
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   970
    "set the flags (number of method variables, stacksize).
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   971
     WARNING: for internal use by the compiler only.
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   972
              playing around here with incorrect values 
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   973
              may crash smalltalk badly.
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   974
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   975
     Dont depend on the values in the flag field - its interpretations
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   976
     may change without notice."
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   977
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   978
    "/ protect myself a bit - putting in an object would crash me ...
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   979
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   980
    (newFlags isMemberOf:SmallInteger) ifTrue:[
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   981
        flags := newFlags
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   982
    ]
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   983
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   984
    "Modified: 8.3.1996 / 13:26:05 / cg"
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   985
    "Created: 13.4.1997 / 00:01:11 / cg"
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   986
!
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
   987
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   988
numberOfArgs:aNumber
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   989
    "set the number of arguments, the codeObject expects.
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   990
     WARNING: for internal use by the compiler only.     
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   991
              playing around here with incorrect values 
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   992
              may (will ?)  crash smalltalk badly.
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   993
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   994
     The limitation in the max. number of arguments is due to the
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   995
     missing SENDxx functions in the VM and cases in #perform. This too 
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   996
     will be removed in a later release, allowing any number of arguments."
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   997
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   998
    (aNumber between:0 and:self class maxNumberOfArguments) ifFalse:[
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   999
        self error:('ST/X only supports up to a maximum of ' ,
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1000
                    self class maxNumberOfArguments printString ,
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1001
                    ' method arguments').
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1002
        ^ self
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1003
    ].
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1004
%{
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1005
    /* made this a primitive to get define in stc.h */
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1006
#ifdef F_NARGS
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1007
    __INST(flags) = __MKSMALLINT( (__intVal(__INST(flags)) & ~F_NARGS) | (__intVal(aNumber) << F_NARGSHIFT) );
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1008
#endif
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1009
%}
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1010
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1011
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1012
!
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1013
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1014
numberOfVars:aNumber
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1015
    "set the number of local variables - for use by compiler only.
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1016
     WARNING: for internal use by the compiler only.     
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1017
              playing around here with incorrect values 
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1018
              may (will ?)  crash smalltalk badly."
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1019
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1020
%{  /* NOCONTEXT */
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
  1021
    INT f = __intVal(__INST(flags));
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1022
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1023
    /* made this a primitive to get define in stc.h */
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1024
    if (__isSmallInteger(aNumber)) {
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1025
        f = (f & ~F_NVARS) | (__intVal(aNumber) << F_NVARSHIFT);
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1026
        __INST(flags) = __MKSMALLINT(f);
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1027
    }
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1028
%}
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1029
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1030
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1031
!
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1032
2543
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1033
stackSize
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1034
    "return thedepth of the local stack in the context.
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1035
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1036
     WARNING: for internal use by ST/X debuggers only.
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1037
              This method may be removed without notice."
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1038
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1039
%{  /* NOCONTEXT */
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1040
    int n = (__intVal(__INST(flags)) & F_NSTACK) >> F_NSTACKSHIFT;
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1041
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1042
    /* made this a primitive to get define in stc.h */
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1043
    RETURN (__MKSMALLINT(n));
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1044
%}
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1045
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1046
!
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1047
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1048
stackSize:aNumber
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1049
    "set the depth of the local stack.
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1050
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1051
     WARNING: for internal use by the compiler only.
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1052
              playing around here with incorrect values 
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1053
              may crash smalltalk badly.
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1054
              (if the runtime library was compiled with DEBUG, 
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1055
               a bad stack will be detected and triggers an error)"
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1056
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1057
%{  /* NOCONTEXT */
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
  1058
    INT f = __intVal(__INST(flags));
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1059
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1060
    /* made this a primitive to get define in stc.h */
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1061
    if (__isSmallInteger(aNumber)) {
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1062
        f = (f & ~F_NSTACK) | (__intVal(aNumber) << F_NSTACKSHIFT);
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1063
        __INST(flags) = __MKSMALLINT(f);
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1064
    }
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1065
%}
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1066
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1067
! !
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1068
328
claus
parents: 326
diff changeset
  1069
!CompiledCode methodsFor:'queries'!
claus
parents: 326
diff changeset
  1070
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1071
decompileTo:aStream
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1072
    |decompiler|
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1073
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1074
    decompiler := self decompiler.
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1075
    decompiler notNil ifTrue:[
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1076
        Autoload autoloadFailedSignal handle:[:ex |
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1077
            ex return
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1078
        ] do:[
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1079
            decompiler autoload.
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1080
        ].
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1081
    ].
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1082
    (decompiler isNil or:[decompiler isLoaded not]) ifTrue:[
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1083
        ^ false
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1084
    ].
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1085
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1086
    decompiler decompile:self to:aStream.
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1087
    ^ true
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1088
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1089
    "Created: 16.4.1996 / 20:25:40 / cg"
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1090
    "Modified: 30.7.1997 / 16:37:14 / cg"
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1091
!
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1092
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1093
isExecutable
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1094
    "return true, if this method is executable.
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1095
     I.e. neither an invalidated nor an unloaded method"
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1096
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1097
    self isInvalid ifTrue:[^ false].
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1098
    ^ self byteCode notNil or:[self code notNil]
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1099
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1100
    "Created: 16.4.1996 / 17:52:16 / cg"
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1101
!
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1102
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1103
isUnloaded
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1104
    "return true, if the methods machine code has been unloaded
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1105
     from the system (i.e. it is not executable)."
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1106
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1107
    ^ (self code isNil and:[self byteCode isNil])
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1108
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1109
    "Created: 16.4.1996 / 17:51:47 / cg"
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1110
!
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1111
3142
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1112
numArgs
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1113
    "return the number of arguments, the method expects." 
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1114
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1115
%{  /* NOCONTEXT */
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1116
    /* made this a primitive to get define in stc.h */
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1117
3145
35167e4ad9a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3142
diff changeset
  1118
    RETURN (__MKSMALLINT((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT));
35167e4ad9a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3142
diff changeset
  1119
%}.
3142
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1120
    "
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1121
     The old implementation simply counted the arguments from
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1122
     the methods source - new versions include this information
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1123
     in the flag instVar, for more security in #perform:
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1124
    "
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1125
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1126
    "
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1127
     (Method compiledMethodAt:#source) numArgs  
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1128
     (Method compiledMethodAt:#source:) numArgs 
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1129
    "
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1130
!
4eeb61890b9b moved numArgs from Method to here.
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
  1131
328
claus
parents: 326
diff changeset
  1132
messages
claus
parents: 326
diff changeset
  1133
    "return a Set of all symbols referenced by this thingy.
claus
parents: 326
diff changeset
  1134
     (this is more than the message selectors, since also global names
claus
parents: 326
diff changeset
  1135
     and symbols found in immediate arrays are included)."
claus
parents: 326
diff changeset
  1136
claus
parents: 326
diff changeset
  1137
    |symbolSet|
claus
parents: 326
diff changeset
  1138
claus
parents: 326
diff changeset
  1139
    symbolSet := IdentitySet new.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1140
    self literalsDo: [ :lit |
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1141
        lit isSymbol ifTrue: [
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1142
            symbolSet add: lit
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1143
        ] ifFalse: [
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1144
            lit isArray ifTrue: [
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1145
                lit traverse: [ :el |
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1146
                    el isSymbol ifTrue: [symbolSet add: el]
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1147
                ]
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1148
            ]
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1149
        ]
328
claus
parents: 326
diff changeset
  1150
    ].
claus
parents: 326
diff changeset
  1151
    ^ symbolSet
claus
parents: 326
diff changeset
  1152
claus
parents: 326
diff changeset
  1153
    "
claus
parents: 326
diff changeset
  1154
     (CompiledCode compiledMethodAt:#messages) messages 
claus
parents: 326
diff changeset
  1155
    "
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1156
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1157
    "Modified: 25.6.1996 / 22:24:20 / stefan"
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1158
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1159
1869
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1160
numVars
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1161
    "return the number of block local variables. 
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1162
     Do not depend on the returned value - future optimizations
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1163
     may change things here (i.e. when moving locals into
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1164
     surrounding context for inlining).
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1165
     - for debugging only."
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1166
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1167
%{  /* NOCONTEXT */
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1168
    /* made this a primitive to get define in stc.h */
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1169
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1170
    RETURN (__MKSMALLINT((__intVal(__INST(flags)) & F_NVARS) >> F_NVARSHIFT));
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1171
%}
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1172
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1173
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1174
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1175
!
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1176
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1177
referencesGlobal:aGlobalSymbol
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1178
    "return true, if this method references the global
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1179
     bound to aGlobalSymbol.
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1180
     For now, this is the same as #referencesLiteral:,
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1181
     but this might change in the future to perform a deeper
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1182
     analyzes on the bytecodes, to detect implizit global
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1183
     refs (as done by some special bytecodes)"
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1184
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1185
    ^ self referencesLiteral:aGlobalSymbol
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1186
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1187
    "
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1188
     (CompiledCode compiledMethodAt:#referencesGlobal:) referencesGlobal:#literalsDetect:ifNone:
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1189
     (CompiledCode compiledMethodAt:#referencesGlobal:) referencesGlobal:#bla
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1190
    "
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1191
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1192
    "Modified: / 24.6.1996 / 15:41:59 / stefan"
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1193
    "Modified: / 28.10.1997 / 13:11:11 / cg"
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1194
!
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1195
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1196
referencesLiteral:aLiteral
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1197
    "return true, if this method references the given literal."
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1198
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1199
    ^ (self literalsDetect:[:lit| lit == aLiteral] ifNone:[false]) ~~ false.
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1200
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1201
    "
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1202
     (CompiledCode compiledMethodAt:#referencesLiteral:) referencesGlobal:#literalsDetect:ifNone:
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1203
     (CompiledCode compiledMethodAt:#referencesLiteral:) referencesGlobal:#bla
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1204
    "
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1205
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1206
    "Modified: / 24.6.1996 / 15:41:59 / stefan"
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1207
    "Created: / 28.10.1997 / 13:09:40 / cg"
3093
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  1208
!
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  1209
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  1210
resources
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  1211
    ^ nil
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  1212
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  1213
    "Created: / 3.11.1997 / 09:09:01 / cg"
328
claus
parents: 326
diff changeset
  1214
! !
claus
parents: 326
diff changeset
  1215
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
  1216
!CompiledCode class methodsFor:'documentation'!
1182
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1217
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1218
version
3145
35167e4ad9a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3142
diff changeset
  1219
    ^ '$Header: /cvs/stx/stx/libbasic/Attic/CompCode.st,v 1.60 1998-01-05 17:21:31 cg Exp $'
1182
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1220
! !
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1221
CompiledCode initialize!