CompiledCode.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 24401 0f0bdade5733
child 24604 f5af5c52a9e8
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22431
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
     1
"{ Encoding: utf8 }"
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
     2
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     3
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     4
 COPYRIGHT (c) 1994 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
     5
	      All Rights Reserved
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     6
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
1eba5946aea2 Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    13
"
5426
eef3df49b4e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    14
"{ Package: 'stx:libbasic' }"
eef3df49b4e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
    15
17513
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
    16
"{ NameSpace: Smalltalk }"
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
    17
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    18
ExecutableFunction variableSubclass:#CompiledCode
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    19
	instanceVariableNames:'flags byteCode'
7603
88c60268d47f Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
    20
	classVariableNames:''
1182
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    21
	poolDictionaries:''
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
    22
	category:'Kernel-Methods'
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    23
!
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    24
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
    25
!CompiledCode class methodsFor:'documentation'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    26
88
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    27
copyright
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    28
"
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    29
 COPYRIGHT (c) 1994 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 131
diff changeset
    30
	      All Rights Reserved
88
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    31
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    32
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    33
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    35
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    36
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    37
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    38
"
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    39
!
81dacba7a63a *** empty log message ***
claus
parents: 84
diff changeset
    40
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    41
documentation
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    42
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    43
    This is an abstract class, to merge common attributes of Blocks and
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
    44
    Methods i.e. describe all objects consisting of either compiled or
328
claus
parents: 326
diff changeset
    45
    interpreted code.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    46
1254
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    47
    Instances of CompiledCode are not to be created by user code
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    48
    (the compilers create Blocks, Methods etc.)
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    49
48c2748b5197 commentary
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
    50
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    51
    [Instance variables:]
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    52
357
claus
parents: 345
diff changeset
    53
      flags       <SmallInteger>    special flag bits coded in a number
21416
6f5e8696df0c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21310
diff changeset
    54
      byteCode    <ByteArray>       bytecode if it's an interpreted codeobject
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    55
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    56
      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
    57
      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
    58
      Object containing the literals.
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    59
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    60
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    61
    [Class variables:]
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    62
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    63
      NoByteCodeSignal              raised if a codeObject is about to be executed
23571
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
    64
				    which has neither code nor byteCode (i.e. both are nil)
225
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    65
      InvalidByteCodeSignal         raised if byteCode is not an instance of ByteArray
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    66
      InvalidInstructionSignal      raised if an invalid instruction opcode is encountered
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    67
      BadLiteralsSignal             raised if literalArray is not an array
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    68
      NonBooleanReceiverSignal      raised for conditional jumps where receiver is not a boolean
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    69
      ArgumentSignal                raised if argument count is not what the codeObject expects
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    70
7c8e57cc5b13 commenting
claus
parents: 159
diff changeset
    71
    all of these signals are children of ExecutionErrorSignal.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    72
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    73
    NOTICE: layout known by runtime system and compiler - do not change
1293
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    74
02fb05148c98 documentation
Claus Gittinger <cg@exept.de>
parents: 1264
diff changeset
    75
    [author:]
23571
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
    76
	Claus Gittinger
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    77
"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    78
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
    79
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
    80
!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
    81
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    82
new
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
    83
    "create a new method with an indirect literal array
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    84
     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
    85
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    86
    ^ self basicNew:1.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    87
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
    88
    "Created: / 24.6.1996 / 17:21:46 / stefan"
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
    89
    "Modified: / 23.1.1998 / 16:31:28 / stefan"
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    90
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    91
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    92
new:numberOfLiterals
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    93
    "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
    94
     Implementation note:
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
    95
	If (self size) == 1, the only literal is an indirect literal
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
    96
	containing an array of literals. Otherwise the literals
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
    97
	are stored in self.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    98
    "
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
    99
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   100
    |nlits|
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   101
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   102
    nlits := numberOfLiterals.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   103
    nlits <= 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   104
	nlits := nlits + 1.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   105
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   106
    ^ self basicNew:nlits.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   107
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   108
    "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
   109
    "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
   110
! !
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   111
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
   112
!CompiledCode class methodsFor:'Signal constants'!
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   113
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 6663
diff changeset
   114
wongNumberOfArgumentsSignal
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 6663
diff changeset
   115
    "return the signal raised when the number of arguments is wrong in a call"
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 6663
diff changeset
   116
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 6663
diff changeset
   117
    ^ WrongNumberOfArgumentsError
106
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   118
! !
a5906085b3e5 errors now raise signals
claus
parents: 92
diff changeset
   119
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
   120
!CompiledCode class methodsFor:'queries'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   121
18943
133920e78771 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 18436
diff changeset
   122
isAbstract
133920e78771 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 18436
diff changeset
   123
    ^ self == CompiledCode
133920e78771 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 18436
diff changeset
   124
!
133920e78771 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 18436
diff changeset
   125
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   126
isBuiltInClass
1264
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   127
    "return true if this class is known by the run-time-system.
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   128
     Here, true is returned for myself, false for subclasses."
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   129
1182
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   130
    ^ self == CompiledCode
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
   131
1264
8d916aa63bce commentary
Claus Gittinger <cg@exept.de>
parents: 1254
diff changeset
   132
    "Modified: 23.4.1996 / 15:57:03 / cg"
2806
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   133
!
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   134
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   135
maxNumberOfArguments
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   136
    "return the maximum number of arguments a method can have.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   137
     This is a limit in the VM, which may be removed in one of
2806
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   138
     the next versions ..."
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   139
9d3c4cf5f6e9 moved #maxNumberOfArguments from Method
Claus Gittinger <cg@exept.de>
parents: 2804
diff changeset
   140
%{  /* NOCONTEXT */
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
   141
    RETURN (__mkSmallInteger(MAX_METHOD_ARGS));
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   142
%}.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   143
    "/ fallback if no VM limit
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   144
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   145
    "/ actually: this limit is due to the single-byte encoding
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   146
    "/ in the send bytecode.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   147
    ^ 255
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   148
!
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   149
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   150
numArgsMaskInFlags
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   151
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   152
%{  /* NOCONTEXT */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   153
    /* made this a primitive to get define in stc.h */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   154
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
   155
    RETURN (__mkSmallInteger(F_NARGS));
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   156
%}.
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   157
    ^ nil "/ fallback if no primitive code
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   158
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   159
    "
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   160
     self numArgsMaskInFlags
5729
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   161
    "
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   162
!
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   163
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   164
numArgsShiftInFlags
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   165
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   166
%{  /* NOCONTEXT */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   167
    /* made this a primitive to get define in stc.h */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   168
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
   169
    RETURN (__mkSmallInteger(F_NARGSHIFT));
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   170
%}.
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   171
    ^ nil "/ fallback if no primitive code
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   172
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   173
    "
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   174
     self numArgsShiftInFlags
5729
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   175
    "
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   176
!
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   177
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   178
numVarsMaskInFlags
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   179
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   180
%{  /* NOCONTEXT */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   181
    /* made this a primitive to get define in stc.h */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   182
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
   183
    RETURN (__mkSmallInteger(F_NVARS));
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   184
%}.
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   185
    ^ nil "/ fallback if no primitive code
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   186
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   187
    "
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   188
     self numVarsMaskInFlags
5729
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   189
    "
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   190
!
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   191
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   192
numVarsShiftInFlags
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   193
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   194
%{  /* NOCONTEXT */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   195
    /* made this a primitive to get define in stc.h */
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   196
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
   197
    RETURN (__mkSmallInteger(F_NVARSHIFT));
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   198
%}.
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   199
    ^ nil "/ fallback if no primitive code
5674
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   200
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   201
    "
9decc87cc11b queries added
Claus Gittinger <cg@exept.de>
parents: 5555
diff changeset
   202
     self numVarsShiftInFlags
5729
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   203
    "
63af78505f23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5674
diff changeset
   204
! !
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   205
21124
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   206
!CompiledCode methodsFor:'Compatibility-ANSI'!
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   207
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   208
argumentCount
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   209
    "ANSI alias for numArgs: return the number of arguments, the method expects."
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   210
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   211
%{  /* NOCONTEXT */
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   212
#ifdef __SCHTEAM__
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   213
    return __c__._RETURN( self.getNumberOfArguments() );
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   214
#else
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   215
    /* made this a primitive to get define in stc.h */
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   216
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   217
    RETURN (__mkSmallInteger((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT));
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   218
#endif
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   219
%}.
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   220
    "
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   221
     The old implementation simply counted the arguments from
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   222
     the methods source - new versions include this information
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   223
     in the flag instVar, for more security in #perform:
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   224
    "
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   225
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   226
    "
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   227
     (Method compiledMethodAt:#source) numArgs
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   228
     (Method compiledMethodAt:#source:) numArgs
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   229
    "
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   230
! !
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
   231
7261
f35fc9cee675 method category rename
Claus Gittinger <cg@exept.de>
parents: 7258
diff changeset
   232
!CompiledCode methodsFor:'Compatibility-ST80'!
2567
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   233
2696
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   234
getSource
22934
47470775327e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22431
diff changeset
   235
    "return the code object's source code, nil if none is available"
2696
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   236
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   237
    ^ self source.
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   238
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   239
    "Created: 19.6.1997 / 16:32:15 / cg"
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   240
!
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   241
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   242
getSourceForUserIfNone:aBlock
22934
47470775327e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22431
diff changeset
   243
    "return the code object's source code.
2696
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   244
     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
   245
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   246
    |src|
2696
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   247
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   248
    Screen current shiftDown ifTrue:[^ aBlock value].
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   249
    src := self source.
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   250
    src isNil ifTrue:[^ aBlock value].
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   251
    ^ src withoutTrailingSeparators
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   252
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   253
    "Modified: 19.6.1997 / 16:31:53 / cg"
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   254
!
0ab535637edc added #getSource & #getSourceForUser* for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   255
16129
fe2f9ba21dd4 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 15409
diff changeset
   256
initialPC
fe2f9ba21dd4 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 15409
diff changeset
   257
    ^ 1
fe2f9ba21dd4 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 15409
diff changeset
   258
!
fe2f9ba21dd4 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 15409
diff changeset
   259
5304
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   260
methodClass
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   261
    "return the class I am defined in"
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   262
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   263
    ^ self mclass.
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   264
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   265
    "Created: 19.6.1997 / 16:32:15 / cg"
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   266
!
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   267
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   268
sourceString
22934
47470775327e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22431
diff changeset
   269
    "return the code object's source code, nil if none is available"
5304
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   270
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   271
    ^ self source.
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   272
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   273
    "Created: 19.6.1997 / 16:32:15 / cg"
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   274
!
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   275
2567
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   276
withAllBlockMethodsDo:aBlock
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   277
    aBlock value:self
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   278
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   279
    "Created: 18.4.1997 / 20:42:07 / cg"
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   280
! !
f7a78b772aaf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   281
14044
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   282
!CompiledCode methodsFor:'Compatibility-V''Age'!
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   283
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   284
bytecodes
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   285
    ^ self byteCode
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   286
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   287
    "Created: / 05-03-2012 / 15:51:48 / cg"
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   288
! !
1a21e789f373 added: #bytecodes
Claus Gittinger <cg@exept.de>
parents: 13777
diff changeset
   289
249
claus
parents: 225
diff changeset
   290
!CompiledCode methodsFor:'accessing'!
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   291
2703
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   292
allLiterals
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   293
    "return a collection of all literals (includes all block literals)"
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   294
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   295
    ^ self literals ? #()
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   296
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   297
    "Modified: 19.6.1997 / 17:37:52 / cg"
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   298
!
80bc29446b42 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
   299
3076
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   300
allSymbolLiterals
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   301
    "return a collection of all symbol-literals"
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   302
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   303
    ^ self allLiterals select:[:lit | lit isSymbol]
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   304
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   305
    "Modified: / 19.6.1997 / 17:37:52 / cg"
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   306
    "Created: / 1.11.1997 / 13:14:44 / cg"
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   307
!
a383cf6706fa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3054
diff changeset
   308
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   309
byteCode
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   310
    "return the bytecode (a ByteArray)"
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   311
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   312
    ^ byteCode
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   313
!
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   314
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   315
changeLiteral:aLiteral to:newLiteral
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   316
    "change aLiteral to newLiteral"
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   317
1526
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   318
    |lits nLits "{ Class: SmallInteger }" |
1493
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
    self size == 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   321
	lits := self at:1.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   322
    ] ifFalse:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   323
	lits := self.
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
1526
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   326
    nLits := lits size.
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   327
    1 to:nLits do:[:i|
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   328
	(lits at:i) == aLiteral ifTrue:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   329
	    lits at:i put:newLiteral.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   330
	    ^ true.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   331
	].
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   332
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   333
    ^ false.
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
    "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
   336
    "Modified: 24.6.1996 / 17:07:56 / stefan"
1526
2ab8c4340bd1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1493
diff changeset
   337
    "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
   338
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   339
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   340
decompiledSource
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   341
    "reconstruct some synthetic source by decompiling by byteCode"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   342
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   343
    |s|
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   344
8222
f2c454a9a038 replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents: 7603
diff changeset
   345
    s := String writeStream.
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   346
    self decompileTo:s.
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   347
    ^ s contents
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   348
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   349
    "Modified: / 30.1.1999 / 14:53:30 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   350
    "Created: / 30.1.1999 / 14:54:09 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   351
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   352
6084
c6cf46dc9ac8 #decompiler -> #decompilerClass
Claus Gittinger <cg@exept.de>
parents: 6013
diff changeset
   353
decompilerClass
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   354
    ^ Decompiler
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   355
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   356
    "Created: 30.7.1997 / 16:36:40 / cg"
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   357
!
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
   358
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   359
do:aBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   360
    "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
   361
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   362
    ^ self literalsDo:aBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   363
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   364
    "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
   365
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   366
3882
3e11ea1568d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3771
diff changeset
   367
flags
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   368
    "return the flags (number of method variables, stacksize etc.).
20793
69430cee043b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20542
diff changeset
   369
     Don't depend on the values in the flag field - its interpretations
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   370
     may change without notice."
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   371
3882
3e11ea1568d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3771
diff changeset
   372
    ^ flags
3e11ea1568d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3771
diff changeset
   373
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   374
    "Modified: / 30.1.1999 / 14:51:59 / cg"
3882
3e11ea1568d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3771
diff changeset
   375
!
3e11ea1568d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3771
diff changeset
   376
14490
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   377
homeMethod
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   378
    "for common protocol with blocks: if the receiver is a method,
21416
6f5e8696df0c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21310
diff changeset
   379
     return the receiver; otherwise, if it's a block, return its home
14490
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   380
     method."
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   381
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   382
    ^ self
21416
6f5e8696df0c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21310
diff changeset
   383
6f5e8696df0c #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21310
diff changeset
   384
    "Modified (comment): / 13-02-2017 / 19:58:51 / cg"
14490
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   385
!
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   386
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   387
literalAt:index
10472
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   388
    "return a literal element"
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   389
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   390
    ^ self literalAt:index ifAbsent:[self error:'bad literal index']
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   391
!
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   392
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   393
literalAt:index ifAbsent:exceptionalValue
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   394
    "return a literal element"
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   395
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   396
    |lits numLits "{ Class: SmallInteger }"|
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   397
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   398
    numLits := self size.
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   399
    numLits == 0 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   400
	^ exceptionalValue value
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   401
    ].
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   402
    numLits == 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   403
	lits := self at:1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   404
	lits isArray ifFalse:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   405
	    index == 1 ifTrue:[^ lits].
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   406
	    ^ exceptionalValue value
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   407
	].
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   408
	^ lits at:index.
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   409
    ].
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   410
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   411
    "there may be a dummy (nil) literal to make the size > 1"
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   412
    (self at:2) isNil ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   413
	index == 1 ifTrue:[^ self at:1].
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   414
	^ exceptionalValue value
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   415
    ].
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   416
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   417
    ^ self at:index
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   418
!
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   419
9447
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   420
literalAt:index put:newValue
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   421
    "change a literal slots value.
10472
75266538f2d1 homeMethod fixed;
Claus Gittinger <cg@exept.de>
parents: 9447
diff changeset
   422
     WARNING: dangerous internal interface; only for knowledgable users"
9447
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   423
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   424
    |lits numLits "{ Class: SmallInteger }"|
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   425
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   426
    numLits := self size.
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   427
    numLits == 0 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   428
	self error:'bad literal index'
9447
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   429
    ].
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   430
    numLits == 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   431
	lits := self at:1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   432
	lits isArray ifFalse:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   433
	    index == 1 ifTrue:[^ self at:1 put:newValue.].
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   434
	    self error:'bad literal index'
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   435
	].
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   436
	^ lits at:index put:newValue.
9447
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   437
    ].
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   438
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   439
    "there may be a dummy (nil) literal to make the size > 1"
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   440
    (self at:2) isNil ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   441
	index == 1 ifTrue:[^ self at:1 put:newValue].
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   442
	self error:'bad literal index'.
9447
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   443
    ].
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   444
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   445
    ^ self at:index put:newValue
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   446
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   447
    "Created: / 16-07-2006 / 13:01:15 / cg"
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   448
!
6c4162883f37 +literalAt:put:
Claus Gittinger <cg@exept.de>
parents: 9304
diff changeset
   449
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   450
literals
6013
67fe7838f006 refactoring
Claus Gittinger <cg@exept.de>
parents: 5744
diff changeset
   451
    "return the literals as an array"
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   452
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   453
    |lits numLits "{ Class: SmallInteger }"|
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   454
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   455
    numLits := self size.
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   456
    numLits == 0 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   457
	^ #()
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   458
    ].
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   459
    numLits == 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   460
	lits := self at:1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   461
	lits isArray ifFalse:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   462
	    ^ Array with:lits.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   463
	].
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   464
	^ lits.
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   465
    ].
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   466
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   467
    "there may be a dummy (nil) literal to make the size > 1"
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   468
    (self at:2) isNil ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   469
	numLits := 1.
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   470
    ].
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   471
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   472
    lits := Array new:numLits.
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   473
    1 to:numLits do:[:i|
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   474
	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
   475
    ].
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   476
    ^ lits.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   477
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   478
    "
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   479
     (CompiledCode compiledMethodAt:#literals) literals
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   480
    "
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   481
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   482
    "Modified: / 30.1.1997 / 17:09:06 / cg"
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   483
    "Modified: / 23.1.1998 / 16:30:07 / stefan"
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   484
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   485
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   486
literalsDetect:aBlock ifNone:exceptionBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   487
    "execute a one arg block for each of our literals.
14488
12675c2b138a comment/format in: #literalsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 14441
diff changeset
   488
     Return the first literal for which aBlock returns true,
6013
67fe7838f006 refactoring
Claus Gittinger <cg@exept.de>
parents: 5744
diff changeset
   489
     or the value from exceptionBlock, if either no literals or
67fe7838f006 refactoring
Claus Gittinger <cg@exept.de>
parents: 5744
diff changeset
   490
     none satisfied the block"
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   491
6013
67fe7838f006 refactoring
Claus Gittinger <cg@exept.de>
parents: 5744
diff changeset
   492
    self literalsDo:[:eachLiteral |
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   493
	(aBlock value:eachLiteral) ifTrue:[
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   494
	    ^ eachLiteral
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   495
	]
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   496
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   497
    ^ exceptionBlock value.
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   498
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   499
    "Created: / 24.6.1996 / 14:27:35 / stefan"
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   500
    "Modified: / 30.1.1997 / 16:24:04 / cg"
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   501
    "Modified: / 23.1.1998 / 17:08:37 / stefan"
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   502
!
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   503
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   504
literalsDo:aBlock
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   505
    "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
   506
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   507
    |lits numLits "{ Class: SmallInteger }" |
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   508
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   509
    numLits := self size.
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   510
    numLits == 0 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   511
	^ self
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   512
    ].
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   513
    numLits == 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   514
	lits := self at:1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   515
	numLits := lits size.
6308
9722a8992196 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6084
diff changeset
   516
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   517
	lits isArray ifFalse:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   518
	    lits := self.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   519
	    numLits := 1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   520
	]
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   521
    ] ifFalse:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   522
	lits := self.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   523
	"there may be a dummy (nil) literal to make the size > 1"
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   524
	(self at:2) isNil ifTrue:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   525
	    numLits := 1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   526
	].
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   527
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   528
2330
6f501907d079 type hints for literal accessors
Claus Gittinger <cg@exept.de>
parents: 2087
diff changeset
   529
    1 to:numLits do:[:i |
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   530
	aBlock value:(lits at:i).
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   531
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
   532
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   533
    "Created: / 24.6.1996 / 14:17:12 / stefan"
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   534
    "Modified: / 30.1.1997 / 17:08:05 / cg"
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
   535
    "Modified: / 23.1.1998 / 16:39:17 / stefan"
2695
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   536
!
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   537
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   538
mclass
19447
44be407eaf89 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 18943
diff changeset
   539
    "return the class of the receiver's home method.
20407
940164393f2f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20292
diff changeset
   540
     That's the class of the method where the block was compiled."
2695
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   541
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   542
    ^ self homeMethod mclass
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   543
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   544
    "Modified: 19.6.1997 / 16:24:58 / cg"
79229a9ab2da added #mclass for ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 2567
diff changeset
   545
    "Created: 19.6.1997 / 16:27:34 / cg"
3328
0988d93b89c4 Add #refersToLiteral
Stefan Vogel <sv@exept.de>
parents: 3313
diff changeset
   546
!
0988d93b89c4 Add #refersToLiteral
Stefan Vogel <sv@exept.de>
parents: 3313
diff changeset
   547
10601
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   548
numLiterals
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   549
    "return the number of literals I have"
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   550
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   551
    |lits numLits "{ Class: SmallInteger }" |
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   552
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   553
    numLits := self size.
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   554
    numLits == 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   555
	lits := self at:1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   556
	numLits := lits size.
10601
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   557
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   558
	lits isArray ifFalse:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   559
	    lits := self.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   560
	    numLits := 1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   561
	]
10601
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   562
    ] ifFalse:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   563
	lits := self.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   564
	"there may be a dummy (nil) literal to make the size > 1"
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   565
	(self at:2) isNil ifTrue:[
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   566
	    numLits := 1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   567
	].
10601
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   568
    ].
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   569
    ^ numLits
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   570
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   571
    "Created: / 07-06-2007 / 10:08:01 / cg"
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   572
!
2974d94894ae +numLiterals
Claus Gittinger <cg@exept.de>
parents: 10472
diff changeset
   573
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   574
numberOfMethodArgs
18436
b729c0e1d40c class: CompiledCode
Stefan Vogel <sv@exept.de>
parents: 18423
diff changeset
   575
    <resource: #obsolete>
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   576
    "return the number of arguments, the method expects.
18436
b729c0e1d40c class: CompiledCode
Stefan Vogel <sv@exept.de>
parents: 18423
diff changeset
   577
     This method is left for backward compatibility - use #argumentCount."
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   578
18436
b729c0e1d40c class: CompiledCode
Stefan Vogel <sv@exept.de>
parents: 18423
diff changeset
   579
    "/ self obsoleteMethodWarning:'use argumentCount'.
b729c0e1d40c class: CompiledCode
Stefan Vogel <sv@exept.de>
parents: 18423
diff changeset
   580
    ^ self argumentCount
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   581
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   582
    "Modified: / 30.1.1999 / 14:55:27 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   583
    "Created: / 30.1.1999 / 14:55:47 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   584
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   585
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   586
numberOfMethodVars
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   587
    "return the number of method local variables.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   588
     This method is left for backward compatibility - use #numVars."
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   589
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   590
    "/ self obsoleteMethodWarning:'use numVars'.
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   591
    ^ self numVars
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   592
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   593
    "Modified: / 30.1.1999 / 14:55:42 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   594
    "Created: / 30.1.1999 / 14:55:51 / cg"
14490
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   595
!
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   596
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   597
source
832e236d9824 code move
Claus Gittinger <cg@exept.de>
parents: 14488
diff changeset
   598
    ^ self subclassResponsibility.
84
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   599
! !
1eba5946aea2 Initial revision
claus
parents:
diff changeset
   600
6546
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   601
!CompiledCode methodsFor:'compiler interface'!
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   602
12160
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   603
compilerClass
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   604
    "who is responsible to parse the source code?
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   605
     Fetch it from the class"
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   606
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   607
    ^ self programmingLanguage compilerClass
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   608
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   609
    "
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   610
     (Object compiledMethodAt:#at:) compilerClass
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   611
    "
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   612
!
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   613
8419
42a6fd0ef3bd allow for subclasses to redefine the parserClass
ca
parents: 8314
diff changeset
   614
parserClass
9304
df985c5f2bda comment
Stefan Vogel <sv@exept.de>
parents: 9296
diff changeset
   615
    "who is responsible to parse the source code?
df985c5f2bda comment
Stefan Vogel <sv@exept.de>
parents: 9296
diff changeset
   616
     Fetch it from the class"
df985c5f2bda comment
Stefan Vogel <sv@exept.de>
parents: 9296
diff changeset
   617
12160
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   618
    ^ self programmingLanguage parserClass
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   619
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   620
    "
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   621
     (Object compiledMethodAt:#at:) parserClass
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   622
    "
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   623
!
8425
d9a9a254584a *** empty log message ***
martin
parents: 8419
diff changeset
   624
12160
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   625
programmingLanguage
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   626
    "/ the following is correct, but might be too slow...
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   627
    "/ we have language-specific Method subclasses anyway,
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   628
    "/ so simply redefine there.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   629
    "/    |mclass|
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   630
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   631
    "/    mclass := self mclass.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   632
    "/    mclass isNil ifTrue:[^ SmalltalkLanguage].
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
   633
    "/    ^ mclass programmingLanguage
12160
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   634
    ^  SmalltalkLanguage instance
8419
42a6fd0ef3bd allow for subclasses to redefine the parserClass
ca
parents: 8314
diff changeset
   635
42a6fd0ef3bd allow for subclasses to redefine the parserClass
ca
parents: 8314
diff changeset
   636
    "
42a6fd0ef3bd allow for subclasses to redefine the parserClass
ca
parents: 8314
diff changeset
   637
     (Object compiledMethodAt:#at:) parserClass
42a6fd0ef3bd allow for subclasses to redefine the parserClass
ca
parents: 8314
diff changeset
   638
    "
14153
6f22f72de84d changed: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 14068
diff changeset
   639
6f22f72de84d changed: #programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 14068
diff changeset
   640
    "Modified (comment): / 01-06-2012 / 21:10:56 / cg"
8419
42a6fd0ef3bd allow for subclasses to redefine the parserClass
ca
parents: 8314
diff changeset
   641
!
42a6fd0ef3bd allow for subclasses to redefine the parserClass
ca
parents: 8314
diff changeset
   642
6546
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   643
syntaxHighlighterClass
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   644
    "if #askClass is returned here, my owning class will be asked for the syntaxHighlighter.
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   645
     if nil is returned, no syntaxHighlighting will be done.
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   646
     Can be redefined in subclasses (MetaMethod) which use special syntax."
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   647
12160
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
   648
    ^ self programmingLanguage syntaxHighlighterClass
6546
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   649
! !
9cada8214da7 allow for method to define individual syntaxHighlighterClass
Claus Gittinger <cg@exept.de>
parents: 6544
diff changeset
   650
1461
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   651
!CompiledCode methodsFor:'converting'!
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   652
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   653
makeRealMethod
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   654
    "by default, we are a real method.
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   655
     Subclasses (e.g. LazyMethod) may redefine this"
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   656
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   657
    ^ self
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   658
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   659
    "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
   660
! !
dd25bb1e9973 Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents: 1293
diff changeset
   661
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   662
!CompiledCode methodsFor:'debugging'!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   663
5304
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   664
breakPointAfter:countInvocations
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   665
    "arrange for a breakpoint-debugger to be opened when this method
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   666
     was invoked countInvocations times."
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   667
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   668
    MessageTracer trapMethod:self after:countInvocations.
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   669
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   670
!
5a6bdbd6e340 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
   671
5538
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   672
breakPointIf:conditionBlock
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   673
    "arrange for a breakpoint-debugger to be opened when this method
22431
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   674
     is invoked AND conditionBlock evaluates to true.
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   675
     conditionBlock gets context and method as (optional) arguments."
5538
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   676
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   677
    MessageTracer trapMethod:self if:conditionBlock
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   678
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   679
    "Created: / 18.8.2000 / 22:09:59 / cg"
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   680
!
e0cd72dbdda7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
   681
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   682
breakPointInProcess:aProcess
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   683
    "arrange for a breakpoint-debugger to be opened when this method
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   684
     is invoked from withn aProcess."
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   685
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   686
    MessageTracer trapMethod:self inProcess:aProcess.
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   687
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   688
    "Modified: / 12.1.1998 / 18:22:39 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   689
    "Created: / 30.1.1999 / 14:50:01 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   690
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   691
22431
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   692
breakPointOnReturnIf:conditionBlock
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   693
    "arrange for a breakpoint-debugger to be opened when this method
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   694
     returns AND conditionBlock evaluates to true.
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   695
     conditionBlock gets returnValue, context and method as (optional) arguments."
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   696
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   697
    MessageTracer trapMethod:self onReturnIf:conditionBlock
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   698
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   699
    "Created: / 18.8.2000 / 22:09:59 / cg"
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   700
!
1da6e2a6be6d #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22367
diff changeset
   701
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   702
clearBreakPoint
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   703
    "remove any break/trace-point on this method"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   704
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   705
    MessageTracer unwrapMethod:self.
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   706
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   707
    "Modified: / 12.1.1998 / 18:22:14 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   708
    "Created: / 30.1.1999 / 14:49:53 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   709
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   710
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   711
isCounted
5525
c4329e3e6c06 added #isTiming
Claus Gittinger <cg@exept.de>
parents: 5522
diff changeset
   712
    "obsolete - replaced by isCountingMemoryUsage"
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   713
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   714
    ^ MessageTracer notNil
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   715
      and:[MessageTracer isCountingMemoryUsage:self]
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   716
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   717
    "Modified: / 27.7.1998 / 11:05:36 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   718
    "Created: / 30.1.1999 / 14:48:57 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   719
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   720
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   721
isCounting
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   722
    "return true, if invokations of this method are counted"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   723
15409
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   724
    ^ MessageTracer notNil and:[MessageTracer isCounting:self]
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   725
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   726
    "Modified: / 27.7.1998 / 11:06:00 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   727
    "Created: / 30.1.1999 / 14:49:19 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   728
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   729
15409
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   730
isCountingByReceiverClass
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   731
    "return true, if invokations of this method are counted"
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   732
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   733
    ^ MessageTracer notNil and:[MessageTracer isCountingByReceiverClass:self]
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   734
!
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   735
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   736
isCountingMemoryUsage
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   737
    "return true, if memory allocations done by this method (and callees)
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   738
     are counted"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   739
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   740
    ^ MessageTracer notNil
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   741
      and:[MessageTracer isCountingMemoryUsage:self]
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   742
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   743
    "Modified: / 27.7.1998 / 11:06:23 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   744
    "Created: / 30.1.1999 / 14:49:26 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   745
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   746
5525
c4329e3e6c06 added #isTiming
Claus Gittinger <cg@exept.de>
parents: 5522
diff changeset
   747
isTiming
21788
07e8ba40475d #DOCUMENTATION by mawalch
mawalch
parents: 21416
diff changeset
   748
    "return true if timing statistics are being gathered on this method."
5525
c4329e3e6c06 added #isTiming
Claus Gittinger <cg@exept.de>
parents: 5522
diff changeset
   749
c4329e3e6c06 added #isTiming
Claus Gittinger <cg@exept.de>
parents: 5522
diff changeset
   750
    ^ MessageTracer notNil
c4329e3e6c06 added #isTiming
Claus Gittinger <cg@exept.de>
parents: 5522
diff changeset
   751
      and:[MessageTracer isTiming:self]
21788
07e8ba40475d #DOCUMENTATION by mawalch
mawalch
parents: 21416
diff changeset
   752
07e8ba40475d #DOCUMENTATION by mawalch
mawalch
parents: 21416
diff changeset
   753
    "Modified (comment): / 08-06-2017 / 14:01:59 / mawalch"
5525
c4329e3e6c06 added #isTiming
Claus Gittinger <cg@exept.de>
parents: 5522
diff changeset
   754
!
c4329e3e6c06 added #isTiming
Claus Gittinger <cg@exept.de>
parents: 5522
diff changeset
   755
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   756
resetCountingStatistics
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   757
    "reset count statistics of the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   758
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   759
    MessageTracer resetCountOfMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   760
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   761
    "Modified: / 12.1.1998 / 18:24:30 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   762
    "Created: / 30.1.1999 / 14:50:19 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   763
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   764
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   765
resetMemoryUsageStatistics
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   766
    "reset count statistics of the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   767
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   768
    MessageTracer resetMemoryUsageOfMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   769
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   770
    "Modified: / 12.1.1998 / 18:24:30 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   771
    "Created: / 30.1.1999 / 14:50:22 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   772
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   773
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   774
resetTimingStatistics
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   775
    "reset timing statistics of the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   776
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   777
    MessageTracer resetExecutionTimesOfMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   778
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   779
    "Modified: / 12.1.1998 / 18:24:30 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   780
    "Created: / 30.1.1999 / 14:50:25 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   781
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   782
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   783
setBreakPoint
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   784
    "arrange for a breakpoint-debugger to be opened when this method
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   785
     is invoked."
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   786
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   787
    MessageTracer trapMethod:self.
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   788
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   789
    "Modified: / 12.1.1998 / 18:22:36 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   790
    "Created: / 30.1.1999 / 14:50:27 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   791
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   792
24401
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   793
setFullTracePoint
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   794
    "arrange for a full-backtrace to be sent to the standard-error stream
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   795
     when this method is invoked."
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   796
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   797
    MessageTracer traceMethodFull:self on:Transcript
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   798
24401
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   799
    "Created: / 29-06-2019 / 08:51:01 / Claus Gittinger"
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   800
!
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   801
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   802
setFullTracePointInProcess:aProcess
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   803
    "arrange for a full-backtrace to be sent to the standard-error stream
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   804
     when this method is invoked by the given process."
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   805
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   806
    MessageTracer traceMethodFull:self inProcess:aProcess on:Transcript
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   807
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   808
    "Created: / 29-06-2019 / 08:52:55 / Claus Gittinger"
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   809
!
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   810
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   811
setTraceFullPoint
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   812
    <resource: #obsolete>
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   813
    "arrange for a full-backtrace to be sent to the standard-error stream
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   814
     when this method is invoked."
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   815
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   816
    self setFullTracePoint
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   817
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   818
    "Modified: / 12-01-1998 / 18:23:11 / cg"
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   819
    "Created: / 30-01-1999 / 14:50:30 / cg"
0f0bdade5733 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24353
diff changeset
   820
    "Modified: / 29-06-2019 / 08:51:41 / Claus Gittinger"
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   821
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   822
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   823
setTracePoint
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   824
    "arrange for a trace-message to be sent to the standard-error stream
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   825
     when this method is invoked."
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   826
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   827
    MessageTracer traceMethod:self on:Transcript
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   828
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   829
    "Modified: / 12.1.1998 / 18:23:23 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   830
    "Created: / 30.1.1999 / 14:50:33 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   831
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   832
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   833
setTraceSenderPoint
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   834
    "arrange for a sender-trace-message to be sent to the standard-error stream
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   835
     when this method is invoked."
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   836
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   837
    MessageTracer traceMethodSender:self on:Transcript
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   838
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   839
    "Modified: / 12.1.1998 / 18:23:31 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   840
    "Created: / 30.1.1999 / 14:50:36 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   841
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   842
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   843
startCounting
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   844
    "start counting invokations of the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   845
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   846
    MessageTracer countMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   847
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   848
    "Modified: / 12.1.1998 / 18:23:45 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   849
    "Created: / 30.1.1999 / 14:50:38 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   850
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   851
15409
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   852
startCountingByReceiverClass
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   853
    "start counting invokations of the receiver"
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   854
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   855
    MessageTracer countMethodByReceiverClass:self
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   856
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   857
    "Modified: / 12.1.1998 / 18:23:45 / cg"
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   858
    "Created: / 30.1.1999 / 14:50:38 / cg"
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   859
!
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
   860
3962
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   861
startCountingMemoryUsage
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   862
    "start counting memory usage of the receiver (and every callee)"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   863
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   864
    MessageTracer countMemoryUsageOfMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   865
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   866
    "Modified: / 27.7.1998 / 11:06:55 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   867
    "Created: / 30.1.1999 / 14:50:41 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   868
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   869
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   870
startTiming
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   871
    "start timing the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   872
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   873
    MessageTracer timeMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   874
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   875
    "Modified: / 12.1.1998 / 18:24:05 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   876
    "Created: / 30.1.1999 / 14:50:44 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   877
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   878
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   879
stopCounting
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   880
    "stop counting calls of the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   881
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   882
    MessageTracer stopCountingMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   883
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   884
    "Modified: / 12.1.1998 / 18:24:15 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   885
    "Created: / 30.1.1999 / 14:50:47 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   886
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   887
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   888
stopCountingMemoryUsage
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   889
    "stop counting memory usage of the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   890
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   891
    MessageTracer stopCountingMemoryUsageOfMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   892
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   893
    "Modified: / 12.1.1998 / 18:24:22 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   894
    "Created: / 30.1.1999 / 14:50:51 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   895
!
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   896
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   897
stopTiming
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   898
    "stop timing of the receiver"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   899
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   900
    MessageTracer stopTimingMethod:self
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   901
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   902
    "Modified: / 12.1.1998 / 18:24:30 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   903
    "Created: / 30.1.1999 / 14:50:54 / cg"
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   904
! !
c941b3a72553 code move from Method (stuff common to Method & JavaMethod)
Claus Gittinger <cg@exept.de>
parents: 3933
diff changeset
   905
17546
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   906
!CompiledCode methodsFor:'enumeration'!
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   907
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   908
breakpointsDo:aBlock
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   909
    "Evaluate `aBlock` for every breakpoint installed in this method"
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   910
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   911
    "Created: / 23-02-2015 / 14:46:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   912
! !
dbbc0f131425 Moved breakpointsDo: to CompiledCode
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17513
diff changeset
   913
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   914
!CompiledCode methodsFor:'error handling'!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   915
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 6663
diff changeset
   916
badArgumentArray:argsGiven
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   917
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   918
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   919
    "this error is triggered, if a non-array is passed to
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   920
     #valueWithReceiver:.. type of methods"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   921
7603
88c60268d47f Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   922
    ^ ArgumentError
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   923
	raiseRequestWith:self
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
   924
	errorString:' - argumentArray is not an Array'
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   925
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   926
    "Modified: 4.11.1996 / 22:46:52 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   927
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   928
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   929
badLiteralTable
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   930
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   931
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   932
    "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
   933
     array (i.e. non-array) - this can only happen, if the
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   934
     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
   935
     literal table or the GC is broken and corrupted it."
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   936
7603
88c60268d47f Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   937
    ^ BadLiteralsError raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   938
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   939
    "Modified: 4.11.1996 / 22:46:55 / cg"
623
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
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   942
interpretWithReceiver:aReceiver
6544
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   943
    "invoked by VM for non-Smalltalk-methods (MetaMethods)"
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   944
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   945
    self subclassResponsibility
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   946
!
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   947
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   948
interpretWithReceiver:aReceiver arg:arg1
6544
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   949
    "invoked by VM for non-Smalltalk-methods (MetaMethods)"
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   950
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   951
    self subclassResponsibility
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   952
!
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   953
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   954
interpretWithReceiver:aReceiver arg:arg1 arg:arg2
6544
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   955
    "invoked by VM for non-Smalltalk-methods (MetaMethods)"
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   956
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   957
    self subclassResponsibility
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   958
!
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   959
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   960
interpretWithReceiver:aReceiver arg:arg1 arg:arg2 arg:arg3
6544
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   961
    "invoked by VM for non-Smalltalk-methods (MetaMethods)"
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   962
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   963
    self subclassResponsibility
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   964
!
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   965
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   966
interpretWithReceiver:aReceiver arguments:argVector
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   967
    "invoked by VM for non-Smalltalk-methods (MetaMethods)"
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   968
7f5d747a9a92 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6308
diff changeset
   969
    self subclassResponsibility
5744
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   970
!
229241968e2a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5729
diff changeset
   971
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   972
invalidByteCode
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   973
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   974
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   975
    "this error is triggered when the interpreter tries to execute a
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   976
     code object, where the byteCode is nonNil, but not a ByteArray.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   977
     Can only happen when Compiler/runtime system is broken or
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   978
     someone played around with a blocks/methods code."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   979
7603
88c60268d47f Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   980
    ^ InvalidByteCodeError raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   981
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   982
    "Modified: 4.11.1996 / 22:46:59 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   983
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   984
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   985
invalidInstruction
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   986
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   987
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   988
    "this error is triggered when the bytecode-interpreter tries to
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   989
     execute an invalid bytecode instruction.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   990
     Can only happen when Compiler/runtime system is broken or
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   991
     someone played around with a blocks/methods code."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   992
7603
88c60268d47f Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
   993
    ^ InvalidInstructionError raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
   994
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   995
    "Modified: 4.11.1996 / 22:47:03 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   996
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   997
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   998
noByteCode
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
   999
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1000
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1001
    "this error is triggered when the interpreter tries to execute a
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1002
     code object, where both the code and byteCode instances are nil.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1003
     This can happen if:
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1004
	- the Compiler/runtime system is broken, (should not happen)
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1005
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1006
	- someone played around with a block/method, (you should not do this)
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1007
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1008
	- compilation of a lazy method failed
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1009
	  (i.e. the lazy method contains an error or
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1010
	   it contains primitive code and there is no stc compiler available)
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1011
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1012
	- an unloaded object modules method is called for.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1013
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1014
     Only the first case is to be considered serious
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1015
     - it should not happen if the system is used correctly."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1016
9296
ff844fd2a954 NoByteCodeError is proceedable
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  1017
    ^ NoByteCodeError raiseRequest.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1018
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1019
    "Modified: 4.11.1996 / 22:47:07 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1020
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1021
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1022
receiverNotBoolean:anObject
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1023
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1024
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1025
    "this error is triggered when the bytecode-interpreter tries to
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1026
     execute ifTrue:/ifFalse or whileTrue: - type of expressions where the
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1027
     receiver is neither true nor false.
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1028
     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
  1029
7603
88c60268d47f Exception classes initialize themself.
Stefan Vogel <sv@exept.de>
parents: 7261
diff changeset
  1030
    ^ NonBooleanReceiverError raise.
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1031
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1032
    "Modified: 4.11.1996 / 22:47:11 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1033
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1034
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1035
tooManyArguments
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1036
    "{ Pragma: +optSpace }"
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1037
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1038
    "this error is triggered, when a method/block tries to perform a send with
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1039
     more arguments than supported by the interpreter.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1040
     This can only happen, if the compiler has been changed without
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1041
     updating the VM, since the compiler checks for allowed number of
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1042
     arguments."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1043
14441
a002093030c3 changed: #tooManyArguments
Stefan Vogel <sv@exept.de>
parents: 14423
diff changeset
  1044
    ^ WrongNumberOfArgumentsError
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1045
	raiseRequestWith:self
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1046
	errorString:' - too many args in send'
1544
ed34e792e12d comments
Claus Gittinger <cg@exept.de>
parents: 1526
diff changeset
  1047
1872
8a0f9ae176e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1869
diff changeset
  1048
    "Modified: 4.11.1996 / 22:47:14 / cg"
2827
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1049
!
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1050
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 6663
diff changeset
  1051
wrongNumberOfArguments:numArgsGiven
2827
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1052
    "{ Pragma: +optSpace }"
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1053
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1054
    "this error is triggered by the VM, if a method is called with a wrong number
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1055
     of arguments.
2827
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1056
     This only applies to #valueWithReceiverXXX and #perform:withArguments: - sends.
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1057
     With a normal send, this error cannot happen."
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1058
7150
a1fe0a0313a8 uses class-based exceptions
Claus Gittinger <cg@exept.de>
parents: 6663
diff changeset
  1059
    ^ WrongNumberOfArgumentsError
20292
632f0956cd1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 19447
diff changeset
  1060
	raiseRequestWith:self
632f0956cd1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 19447
diff changeset
  1061
	errorString:(' - %1 got %2 arg(s) where %3 expected'
632f0956cd1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 19447
diff changeset
  1062
			bindWith:self printString "/ self class name
632f0956cd1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 19447
diff changeset
  1063
			with:numArgsGiven
632f0956cd1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 19447
diff changeset
  1064
			with:self argumentCount)
2827
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1065
6663
a0a42694a4d5 errorStrings when raising exceptions.
Stefan Vogel <sv@exept.de>
parents: 6546
diff changeset
  1066
    "
10905
96c44ab0e80f wrongNumberOfArguments: error message
Claus Gittinger <cg@exept.de>
parents: 10601
diff changeset
  1067
     2 perform:#+
6663
a0a42694a4d5 errorStrings when raising exceptions.
Stefan Vogel <sv@exept.de>
parents: 6546
diff changeset
  1068
    "
a0a42694a4d5 errorStrings when raising exceptions.
Stefan Vogel <sv@exept.de>
parents: 6546
diff changeset
  1069
2827
0f653b53179a provide #wrongNumberOfArgs: for all subclasses.
Claus Gittinger <cg@exept.de>
parents: 2810
diff changeset
  1070
    "Modified: 1.8.1997 / 00:23:10 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1071
! !
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1072
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1073
!CompiledCode methodsFor:'executing'!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1074
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1075
valueWithReceiver:anObject
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1076
    "low level call of a method's code - BIG DANGER ALERT.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1077
     Perform the receiver-method on anObject as receiver and no arguments. 
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1078
     This does NO message lookup at all and mimics a traditional function call.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1079
     This method is provided for debugging- and breakpoint-support
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1080
     (replacing a method by a stub and recalling the original), or to implement
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1081
     experimental MI implementations - it is not for general use.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1082
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1083
     The receiver must be a method compiled in anObject's class or one of its
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1084
     superclasses and also, the number of arguments given must match the method's
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1085
     expectations -
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1086
     - otherwise strange things (and also strange crashes) can occur.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1087
     The system is NOT always detecting a wrong method/receiver combination.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1088
     YOU HAVE BEEN WARNED."
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1089
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1090
    ^ self
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1091
        valueWithReceiver:anObject
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1092
        arguments:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1093
        selector:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1094
        search:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1095
        sender:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1096
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1097
    "Created: / 25-06-2019 / 09:13:02 / Claus Gittinger"
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1098
!
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1099
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1100
valueWithReceiver:anObject arguments:argArray
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1101
    "low level call of a method's code - BIG DANGER ALERT.
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1102
     Perform the receiver-method on anObject as receiver and argArray as arguments. 
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1103
     This does NO message lookup at all and mimics a traditional function call.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1104
     This method is provided for debugging- and breakpoint-support
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1105
     (replacing a method by a stub and recalling the original), or to implement
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1106
     experimental MI implementations - it is not for general use.
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1107
22934
47470775327e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22431
diff changeset
  1108
     The receiver must be a method compiled in anObject's class or one of its
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1109
     superclasses and also, the number of arguments given must match the method's
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1110
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1111
     - 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
  1112
     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
  1113
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1114
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1115
    ^ self
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1116
        valueWithReceiver:anObject
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1117
        arguments:argArray
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1118
        selector:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1119
        search:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1120
        sender:nil
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1121
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1122
    "Modified: / 04-04-1997 / 23:33:56 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1123
    "Created: / 30-07-1997 / 12:04:52 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1124
    "Modified (comment): / 21-11-2017 / 13:00:13 / cg"
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1125
    "Modified (comment): / 25-06-2019 / 09:43:32 / Claus Gittinger"
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1126
!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1127
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1128
valueWithReceiver:anObject arguments:argArray selector:aSymbol
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1129
    "low level call of a method's code - BIG DANGER ALERT.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1130
     Perform the receiver-method on anObject as receiver and argArray as arguments. 
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1131
     This does NO message lookup at all and mimics a traditional function call.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1132
     This method is provided for debugging- and breakpoint-support
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1133
     (replacing a method by a stub and recalling the original), or to implement
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1134
     experimental MI implementations - it is not for general use.
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1135
22934
47470775327e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22431
diff changeset
  1136
     The receiver must be a method compiled in anObject's class or one of its
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1137
     superclasses and also, the number of arguments given must match the method's
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1138
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1139
     - 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
  1140
     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
  1141
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1142
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1143
    ^ self
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1144
        valueWithReceiver:anObject
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1145
        arguments:argArray
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1146
        selector:aSymbol
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1147
        search:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1148
        sender:nil
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1149
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1150
    "Modified: / 04-04-1997 / 23:34:08 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1151
    "Created: / 30-07-1997 / 12:04:49 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1152
    "Modified (comment): / 21-11-2017 / 13:00:23 / cg"
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1153
    "Modified (comment): / 25-06-2019 / 09:43:41 / Claus Gittinger"
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1154
!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1155
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1156
valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1157
    "low level call of a method's code - BIG DANGER ALERT.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1158
     Perform the receiver-method on anObject as receiver and argArray as arguments. 
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1159
     This does NO message lookup at all and mimics a traditional function call.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1160
     This method is provided for debugging- and breakpoint-support
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1161
     (replacing a method by a stub and recalling the original), or to implement
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1162
     experimental MI implementations - it is not for general use.
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1163
22934
47470775327e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 22431
diff changeset
  1164
     The receiver must be a method compiled in anObject's class or one of its
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1165
     superclasses and also, the number of arguments given must match the method's
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1166
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1167
     - 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
  1168
     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
  1169
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1170
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1171
    ^ self
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1172
        valueWithReceiver:anObject
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1173
        arguments:argArray
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1174
        selector:aSymbol
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1175
        search:nil
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1176
        sender:nil
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1177
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1178
    "Modified: / 04-04-1997 / 23:34:19 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1179
    "Created: / 30-07-1997 / 12:04:46 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1180
    "Modified (comment): / 21-11-2017 / 13:00:28 / cg"
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1181
    "Modified (comment): / 25-06-2019 / 09:43:58 / Claus Gittinger"
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1182
!
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1183
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1184
valueWithReceiver:anObject arguments:argArray selector:aSymbol search:aClass sender:virtualSender
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1185
    "low level call of a method's code - BIG DANGER ALERT.
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1186
     Perform the receiver-method on anObject as receiver and argArray as arguments.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1187
     This does NO message lookup at all and mimics a traditional function call.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1188
     This method is provided for debugging- and breakpoint-support
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1189
     (replacing a method by a stub and recalling the original), or to implement
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1190
     experimental MI implementations - it is not for general use.
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1191
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1192
     The receiver must be a method compiled in anObject's class or one of its
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1193
     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
  1194
     expectations -
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1195
     - 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
  1196
     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
  1197
     YOU HAVE BEEN WARNED."
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1198
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1199
%{
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1200
#ifdef __SCHTEAM__
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1201
    {
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1202
        int numArgs = 0;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1203
        STVector v = null;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1204
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1205
        if (argArray != STObject.Nil) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1206
            v = argArray.asSTVector();
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1207
            numArgs = v.vectorLength();
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1208
        }
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1209
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1210
        STCallable me = (STCompiledMethod)self.smalltalkCheckNumberOfArgs(1+numArgs);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1211
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1212
        __c__.push(anObject);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1213
        for (int i=0; i<numArgs; i++) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1214
            __c__.push( v.vectorRef(i) );
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1215
        }
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1216
        // the selector and searchClass args are not needed/passed
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1217
        // the virtualSender is (currently) not supported
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1218
        // (this is cosmetics only; therefore it's done later)
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1219
        return __c__.TAILCALL_nPUSHED( me, 1+numArgs);
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1220
    }
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1221
    /* NOT REACHED */
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1222
#else
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1223
    OBJFUNC code;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1224
    OBJ searchClass;
20292
632f0956cd1e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 19447
diff changeset
  1225
    static struct inlineCache dummy = __DUMMYILC0(0);
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1226
    int nargs;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1227
    OBJ *ap;
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1228
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1229
    /*
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1230
     * args must be an array, or nil
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1231
     */
18196
aa0aadd112ad class: CompiledCode
Stefan Vogel <sv@exept.de>
parents: 17546
diff changeset
  1232
    if (__isArrayLike(argArray)) {
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1233
        nargs = __arraySize(argArray);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1234
        ap = __ArrayInstPtr(argArray)->a_element;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1235
    } else {
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1236
        if (argArray != nil) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1237
            goto badArgs;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1238
        }
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1239
        nargs = 0;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1240
        ap = (OBJ *)0;
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1241
    }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1242
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1243
# ifdef F_NARGS
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1244
    if (((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT) == nargs)
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1245
# endif
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1246
    {
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1247
        code = __MethodInstPtr(self)->m_code;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1248
        if (aClass == nil) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1249
            searchClass = dummy.ilc_class = __Class(anObject);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1250
        } else {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1251
            searchClass = dummy.ilc_class = aClass;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1252
        }
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1253
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1254
        if (nargs <= 15) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1255
          OBJ rslt;
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1256
# ifdef CONTEXT_DEBUG
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1257
          OBJ sav = __thisContext;
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1258
# endif
3140
184145ae63f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
  1259
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1260
          /*
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1261
           * add virtual sender (unwinding) here later,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1262
           * to allow hiding contexts in lazy methods.
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1263
           * (this is cosmetics only; therefore its done later)
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1264
           */
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1265
          if (code) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1266
            /* compiled code */
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1267
            switch (nargs) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1268
                case 0:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1269
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1270
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1271
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1272
                case 1:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1273
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1274
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1275
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1276
                case 2:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1277
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1278
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1279
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1280
                case 3:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1281
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy, ap[0], ap[1], ap[2]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1282
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1283
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1284
                case 4:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1285
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1286
                                 ap[0], ap[1], ap[2], ap[3]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1287
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1288
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1289
                case 5:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1290
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1291
                                 ap[0], ap[1], ap[2], ap[3], ap[4]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1292
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1293
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1294
                case 6:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1295
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1296
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1297
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1298
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1299
                case 7:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1300
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1301
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1302
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1303
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1304
                case 8:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1305
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1306
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1307
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1308
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1309
                case 9:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1310
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1311
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1312
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1313
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1314
                case 10:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1315
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1316
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1317
                                 ap[9]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1318
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1319
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1320
                case 11:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1321
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1322
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1323
                                 ap[9], ap[10]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1324
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1325
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1326
                case 12:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1327
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1328
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1329
                                 ap[9], ap[10], ap[11]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1330
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1331
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1332
                case 13:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1333
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1334
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1335
                                 ap[9], ap[10], ap[11], ap[12]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1336
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1337
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1338
                case 14:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1339
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1340
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1341
                                 ap[9], ap[10], ap[11], ap[12], ap[13]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1342
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1343
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1344
                case 15:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1345
                    rslt = (*code)(anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1346
                                 ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7], ap[8],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1347
                                 ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1348
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1349
            }
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1350
          } else {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1351
            /* interpreted code */
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1352
# ifdef PASS_ARG_POINTER
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1353
            rslt = __interpret(self, nargs, anObject, aSymbol, searchClass, &dummy, ap);
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1354
# else
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1355
            switch (nargs) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1356
                case 0:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1357
                    rslt = __interpret(self, 0, anObject, aSymbol, searchClass, &dummy);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1358
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1359
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1360
                case 1:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1361
                    rslt = __interpret(self, 1, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1362
                                   ap[0]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1363
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1364
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1365
                case 2:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1366
                    rslt = __interpret(self, 2, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1367
                                   ap[0], ap[1]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1368
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1369
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1370
                case 3:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1371
                    rslt = __interpret(self, 3, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1372
                                   ap[0], ap[1], ap[2]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1373
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1374
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1375
                case 4:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1376
                    rslt = __interpret(self, 4, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1377
                                   ap[0], ap[1], ap[2], ap[3]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1378
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1379
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1380
                case 5:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1381
                    rslt = __interpret(self, 5, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1382
                                   ap[0], ap[1], ap[2], ap[3], ap[4]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1383
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1384
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1385
                case 6:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1386
                    rslt = __interpret(self, 6, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1387
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1388
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1389
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1390
                case 7:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1391
                    rslt = __interpret(self, 7, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1392
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1393
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1394
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1395
                case 8:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1396
                    rslt = __interpret(self, 8, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1397
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1398
                                   ap[7]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1399
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1400
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1401
                case 9:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1402
                    rslt = __interpret(self, 9, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1403
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1404
                                   ap[7], ap[8]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1405
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1406
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1407
                case 10:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1408
                    rslt = __interpret(self, 10, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1409
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1410
                                   ap[7], ap[8], ap[9]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1411
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1412
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1413
                case 11:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1414
                    rslt = __interpret(self, 11, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1415
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1416
                                   ap[7], ap[8], ap[9], ap[10]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1417
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1418
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1419
                case 12:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1420
                    rslt = __interpret(self, 12, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1421
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1422
                                   ap[7], ap[8], ap[9], ap[10], ap[11]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1423
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1424
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1425
                case 13:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1426
                    rslt = __interpret(self, 13, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1427
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1428
                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1429
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1430
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1431
                case 14:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1432
                    rslt = __interpret(self, 14, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1433
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1434
                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1435
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1436
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1437
                case 15:
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1438
                    rslt = __interpret(self, 15, anObject, aSymbol, searchClass, &dummy,
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1439
                                   ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6],
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1440
                                   ap[7], ap[8], ap[9], ap[10], ap[11], ap[12], ap[13], ap[14]);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1441
                    break;
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1442
            }
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1443
# endif
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1444
          }
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1445
# ifdef CONTEXT_DEBUG
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1446
          if (sav != __thisContext) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1447
              if (code) {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1448
                  printf("CONTEXT BOTCH after execution of %x\n", code);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1449
              } else {
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1450
                  printf("CONTEXT BOTCH after execution of interpreted method\n");
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1451
                  printf("code now: %x\n", __MethodInstPtr(self)->m_code);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1452
              }
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1453
              printf("context before:\n");
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1454
              __dumpObject__(sav, __LINE__,__FILE__);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1455
              printf("context now:\n");
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1456
              __dumpObject__(__thisContext, __LINE__,__FILE__);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1457
          }
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1458
# endif
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1459
          RETURN (rslt);
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1460
        }
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1461
    }
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1462
    badArgs: ;
18423
7eb7832f8e97 comment
Claus Gittinger <cg@exept.de>
parents: 18416
diff changeset
  1463
#endif /* not SCHTEAM */
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1464
%}.
18196
aa0aadd112ad class: CompiledCode
Stefan Vogel <sv@exept.de>
parents: 17546
diff changeset
  1465
    (argArray isArray) ifFalse:[
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1466
        (self argumentCount ~~ 0
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1467
         or:[argArray notNil]) ifTrue:[
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1468
            "
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1469
             arguments must be either nil or an array
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1470
            "
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1471
            ^ self badArgumentArray:argArray
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1472
        ]
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1473
    ].
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1474
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1475
    (argArray size ~~ self numArgs) ifTrue:[
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1476
        "
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1477
         the method expects a different number of arguments
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1478
        "
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1479
        ^ self wrongNumberOfArguments:argArray size
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1480
    ].
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1481
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1482
    "/ if the VM only supports a limited number of arguments in sends (ST/X: 15)
5426
eef3df49b4e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
  1483
    argArray size > self class maxNumberOfArguments ifTrue:[
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1484
        ^ self tooManyArguments
5426
eef3df49b4e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
  1485
    ].
eef3df49b4e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5304
diff changeset
  1486
    ^ self primitiveFailed
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1487
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1488
    "
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1489
     (Float compiledMethodAt:#+)
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1490
        valueWithReceiver:1.0 arguments:#(2.0)
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1491
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1492
     'the next example is a wrong one - which is detected by True's method ...'.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1493
     (True compiledMethodAt:#printString)
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1494
        valueWithReceiver:false arguments:nil
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1495
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1496
     '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
  1497
      and a wrong value returned ...'.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1498
     (Point compiledMethodAt:#x)
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1499
        valueWithReceiver:(1->2) arguments:nil
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1500
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1501
     '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
  1502
      and may crash the system WARNING: save your work before doing this ...'.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1503
     (Point compiledMethodAt:#x)
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1504
        valueWithReceiver:(Object new) arguments:nil
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1505
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1506
     '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
  1507
     (Object compiledMethodAt:#printOn:)
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1508
        valueWithReceiver:false arguments:nil
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1509
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1510
     '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
  1511
     (Object compiledMethodAt:#printOn:)
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1512
        valueWithReceiver:false arguments:#()
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1513
    "
13776
7705d7d06a11 changed: #valueWithReceiver:arguments:selector:search:sender:
Claus Gittinger <cg@exept.de>
parents: 13640
diff changeset
  1514
13777
7308f6b1eede changed: #valueWithReceiver:arguments:selector:search:sender:
Claus Gittinger <cg@exept.de>
parents: 13776
diff changeset
  1515
    "Modified: / 07-10-2011 / 13:58:21 / cg"
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  1516
    "Modified: / 25-06-2019 / 09:43:54 / Claus Gittinger"
2800
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1517
! !
f6ab31b2a27d moved valueWithReceiver-methods from Method to here
Claus Gittinger <cg@exept.de>
parents: 2703
diff changeset
  1518
7258
9ccdbee7d1ad method category rename
Claus Gittinger <cg@exept.de>
parents: 7150
diff changeset
  1519
!CompiledCode methodsFor:'private-accessing'!
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1520
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1521
byteCode:aByteArray
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1522
    "set the bytecode field - DANGER ALERT"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1523
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1524
    byteCode := aByteArray
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1525
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1526
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1527
checked:aBoolean
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1528
    "set/clear the flag bit stating that this method has already been checked
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1529
     by the just-in-time compiler.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1530
     Setting the flag prevents it from trying any compilation.
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1531
     Not for public use - for VM debugging only."
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1532
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1533
%{  /* NOCONTEXT */
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1534
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
  1535
    INT newFlags = __intVal(__INST(flags));
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1536
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1537
    /* made this a primitive to get define in stc.h */
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1538
    if (aBoolean == true)
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1539
	newFlags |= F_CHECKED;
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1540
    else
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1541
	newFlags &= ~F_CHECKED;
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1542
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
  1543
    __INST(flags) = __mkSmallInteger(newFlags);
1640
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1544
%}
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1545
!
db4aef0f601b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1544
diff changeset
  1546
16346
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1547
clearJittedCodeAndForceJittingAgain
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1548
    "clear the method's jitted code and clear the flag bit stating that this method has already been checked
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1549
     by the just-in-time compiler. Thus, it will be recompiled when called the next time.
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1550
     Not for public use - for VM debugging only."
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1551
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1552
%{  /* NOCONTEXT */
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1553
    __INST(flags) = (OBJ)((INT)__INST(flags) & ~__MASKSMALLINT(F_CHECKED));
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1554
    // prevent clearing code of non-jitted code (static library)
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1555
    if ( (INT)(__INST(flags)) & __MASKSMALLINT(F_DYNAMIC)) {
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1556
	__INST(code_) = nil;
16346
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1557
    }
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1558
%}
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1559
!
dc3c2a3dc157 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16333
diff changeset
  1560
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1561
dynamic
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1562
    "return the flag stating that the machine code was created
1774
ab14302c6497 comment
Claus Gittinger <cg@exept.de>
parents: 1772
diff changeset
  1563
     dynamically (from bytecode) or loaded dynamically from an objectFile
ab14302c6497 comment
Claus Gittinger <cg@exept.de>
parents: 1772
diff changeset
  1564
     (i.e. has machineCode, but is not in the executable)."
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1565
3662
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1566
    "/ obsolete
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1567
    ^ self isDynamic
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1568
3662
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1569
    "Modified: / 20.7.1998 / 14:22:35 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1570
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1571
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1572
literals:aLiteralArray
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1573
    "set the literal array for evaluation - DANGER ALERT"
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1574
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1575
    |i|
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1576
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1577
    aLiteralArray isNil ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1578
	^ self.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1579
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1580
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1581
    self size == 1 ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1582
	self at:1 put:(aLiteralArray asArray).
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1583
    ] ifFalse:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1584
	i := 1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1585
	aLiteralArray do:[:literal|
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1586
	    self at:i put:literal.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1587
	    i := i + 1.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1588
	].
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1589
    ].
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1590
3313
06da74a9cb04 make certain that literal array really is an array
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
  1591
    "Modified: / 25.6.1996 / 22:13:08 / stefan"
06da74a9cb04 make certain that literal array really is an array
Claus Gittinger <cg@exept.de>
parents: 3218
diff changeset
  1592
    "Modified: / 5.3.1998 / 02:05:56 / cg"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1593
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1594
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1595
markFlag
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1596
    "return the mark bits value as a boolean.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1597
     This bit is not used by the VM, but instead free to mark codeObjects
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1598
     for any (debugging/tracing) use. For example, the coverage test uses
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1599
     these to mark reached methods. (inspired by a note in c.l.s)"
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1600
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1601
%{  /* NOCONTEXT */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1602
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1603
    /* made this a primitive to get define in stc.h */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1604
1771
ccb8ff5d4763 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1669
diff changeset
  1605
    RETURN (( (INT)(__INST(flags)) & __MASKSMALLINT(F_MARKBIT)) ? true : false);
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1606
%}
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1607
!
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1608
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1609
markFlag:aBoolean
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1610
    "set/clear the mark flag bit.
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1611
     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
  1612
     for any (debugging/tracing) use. For example, the coverage test uses
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1613
     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
  1614
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1615
%{  /* NOCONTEXT */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1616
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
  1617
    INT newFlags = __intVal(__INST(flags));
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1618
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1619
    /* made this a primitive to get define in stc.h */
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1620
    if (aBoolean == true)
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1621
	newFlags |= F_MARKBIT;
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1622
    else
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1623
	newFlags &= ~F_MARKBIT;
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1624
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
  1625
    __INST(flags) = __mkSmallInteger(newFlags);
623
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1626
%}
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1627
! !
6795a71e39d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
  1628
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1629
!CompiledCode methodsFor:'private-compiler interface'!
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1630
4489
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1631
contextMustBeReturnable:aBoolean
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1632
%{  /* NOCONTEXT */
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1633
    /* made this a primitive to get define in stc.h */
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1634
    if (aBoolean == true) {
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1635
	__INST(flags) = (OBJ)( (INT)__INST(flags) | __MASKSMALLINT(F_RETURNABLE));
4489
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1636
    } else {
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1637
	__INST(flags) = (OBJ)( (INT)__INST(flags) & ~__MASKSMALLINT(F_RETURNABLE));
4489
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1638
    }
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1639
%}
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1640
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1641
!
b7e297fa3f64 pass down contextMustBeReturnable flag
Claus Gittinger <cg@exept.de>
parents: 3962
diff changeset
  1642
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1643
flags:newFlags
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1644
    "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
  1645
     WARNING: for internal use by the compiler only.
23571
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  1646
	      playing around here with incorrect values
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  1647
	      may crash smalltalk badly.
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1648
20793
69430cee043b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20542
diff changeset
  1649
     Don't depend on the values in the flag field - its interpretations
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1650
     may change without notice."
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1651
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1652
    "/ 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
  1653
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1654
    (newFlags isMemberOf:SmallInteger) ifTrue:[
23571
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  1655
	flags := newFlags
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1656
    ]
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1657
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1658
    "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
  1659
    "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
  1660
!
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1661
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1662
marked: aBoolean
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1663
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1664
    "Sets the mark bit. You may use it for whatever you want. Actually,
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1665
     it's used for marking profiled methods"
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1666
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1667
    self markFlag:aBoolean.
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1668
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1669
    "/ duplicate code...
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1670
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1671
    "/%{  /* NOCONTEXT */
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1672
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1673
    "/    INT newFlags = __intVal(__INST(flags));
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1674
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1675
    "/    /* made this a primitive to get define in stc.h */
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1676
    "/    if (aBoolean == true)
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1677
    "/        newFlags |= F_MARKBIT;
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1678
    "/    else
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1679
    "/        newFlags &= ~F_MARKBIT;
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1680
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1681
    "/    __INST(flags) = __mkSmallInteger(newFlags);
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1682
    "/%}
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1683
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1684
    "/    "Created: / 29-11-2010 / 21:20:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1685
!
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1686
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1687
numberOfArgs:aNumber
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1688
    "set the number of arguments, the codeObject expects.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1689
     WARNING: for internal use by the compiler only.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1690
	      playing around here with incorrect values
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1691
	      may (will ?)  crash smalltalk badly.
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1692
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1693
     The limitation in the max. number of arguments is due to the
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1694
     missing SENDxx functions in the VM and cases in #perform. This too
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1695
     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
  1696
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1697
    (aNumber between:0 and:self class maxNumberOfArguments) ifFalse:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1698
	self error:('ST/X only supports up to a maximum of ' ,
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1699
		    self class maxNumberOfArguments printString ,
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1700
		    ' method arguments').
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1701
	^ self
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1702
    ].
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1703
%{
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1704
#ifdef __SCHTEAM__
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1705
    self.setNumberOfArguments( aNumber.intValue() );
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1706
#else
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1707
    /* made this a primitive to get define in stc.h */
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1708
# ifdef F_NARGS
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
  1709
    __INST(flags) = __mkSmallInteger( (__intVal(__INST(flags)) & ~F_NARGS) | (__intVal(aNumber) << F_NARGSHIFT) );
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1710
# endif
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1711
#endif
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1712
%}
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1713
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1714
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1715
!
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1716
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1717
numberOfVars:aNumber
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1718
    "set the number of local variables - for use by compiler only.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1719
     WARNING: for internal use by the compiler only.
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1720
	      playing around here with incorrect values
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1721
	      may (will ?)  crash smalltalk badly."
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1722
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1723
%{  /* NOCONTEXT */
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1724
#ifdef __SCHTEAM__
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1725
    self.setNumberOfLocals( aNumber.intValue() );
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1726
#else
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
  1727
    INT f = __intVal(__INST(flags));
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1728
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1729
    /* made this a primitive to get define in stc.h */
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1730
    if (__isSmallInteger(aNumber)) {
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1731
	f = (f & ~F_NVARS) | (__intVal(aNumber) << F_NVARSHIFT);
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1732
	__INST(flags) = __mkSmallInteger(f);
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1733
    }
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1734
#endif
2804
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1735
%}
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1736
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1737
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1738
!
6b8a6d6bedf0 added #numberOfVars: / #numberOfArgs:
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
  1739
2543
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1740
stackSize
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1741
    "return thedepth of the local stack in the context.
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1742
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1743
     WARNING: for internal use by ST/X debuggers only.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1744
	      This method may be removed without notice."
2543
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1745
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1746
%{  /* NOCONTEXT */
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1747
#ifdef __SCHTEAM__
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1748
    return __c__._RETURN( self.getNumberOfStackTemporaries() );
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1749
#else
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
  1750
    INT n = (__intVal(__INST(flags)) & F_NSTACK) >> F_NSTACKSHIFT;
2543
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1751
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1752
    /* made this a primitive to get define in stc.h */
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
  1753
    RETURN (__mkSmallInteger(n));
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1754
#endif
2543
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1755
%}
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1756
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1757
!
b401cd5167e3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2540
diff changeset
  1758
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1759
stackSize:aNumber
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1760
    "set the depth of the local stack.
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1761
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1762
     WARNING: for internal use by the compiler only.
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1763
	      playing around here with incorrect values
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1764
	      may crash smalltalk badly.
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1765
	      if the runtime library was compiled with DEBUG,
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1766
	      a bad stack will be detected and triggers an error
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1767
	      (by default, the VM is compiled with this option)"
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1768
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1769
%{  /* NOCONTEXT */
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1770
#ifdef __SCHTEAM__
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1771
    self.setNumberOfStackTemporaries( aNumber.intValue() );
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1772
#else
2869
6fcc9aafb7c4 alpha64 stuff
Claus Gittinger <cg@exept.de>
parents: 2827
diff changeset
  1773
    INT f = __intVal(__INST(flags));
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1774
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1775
    /* 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
  1776
    if (__isSmallInteger(aNumber)) {
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1777
	f = (f & ~F_NSTACK) | (__intVal(aNumber) << F_NSTACKSHIFT);
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1778
	__INST(flags) = __mkSmallInteger(f);
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1779
    }
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1780
#endif
2540
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1781
%}
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1782
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1783
! !
a9388e872a51 moved #flags: and #stackSize: up from Method
Claus Gittinger <cg@exept.de>
parents: 2330
diff changeset
  1784
328
claus
parents: 326
diff changeset
  1785
!CompiledCode methodsFor:'queries'!
claus
parents: 326
diff changeset
  1786
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1787
decompileTo:aStream
8835
d9b8b58d6566 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8688
diff changeset
  1788
    |decompilerClass decompiler|
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1789
8835
d9b8b58d6566 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8688
diff changeset
  1790
    decompilerClass := self decompilerClass.
d9b8b58d6566 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8688
diff changeset
  1791
    decompilerClass isNil ifTrue:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1792
	^ false
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1793
    ].
8314
fc73718968f5 Streamline autoloading.
Stefan Vogel <sv@exept.de>
parents: 8222
diff changeset
  1794
fc73718968f5 Streamline autoloading.
Stefan Vogel <sv@exept.de>
parents: 8222
diff changeset
  1795
    Autoload autoloadFailedSignal handle:[:ex |
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1796
	^ false.
8314
fc73718968f5 Streamline autoloading.
Stefan Vogel <sv@exept.de>
parents: 8222
diff changeset
  1797
    ] do:[
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1798
	decompilerClass autoload.
1196
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1799
    ].
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1800
8835
d9b8b58d6566 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8688
diff changeset
  1801
    decompiler := decompilerClass new.
d9b8b58d6566 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8688
diff changeset
  1802
    decompiler targetClass:self mclass.
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1803
    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
  1804
    ^ true
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1805
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1806
    "Created: 16.4.1996 / 20:25:40 / cg"
2810
fd62b379212a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2806
diff changeset
  1807
    "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
  1808
!
7b3eeec128d3 moved decompilation into codeObject (allows handling of alien codeObjects)
Claus Gittinger <cg@exept.de>
parents: 1195
diff changeset
  1809
16333
4828c2efceeb class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16129
diff changeset
  1810
hasAnnotation: key
4828c2efceeb class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16129
diff changeset
  1811
    "Return false here, as a fallback"
4828c2efceeb class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16129
diff changeset
  1812
4828c2efceeb class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16129
diff changeset
  1813
    ^ false
4828c2efceeb class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16129
diff changeset
  1814
!
4828c2efceeb class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16129
diff changeset
  1815
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1816
isChecked
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1817
    "return true, if this method has been analyzed for jitting"
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1818
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1819
%{  /* NOCONTEXT */
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1820
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1821
    /* made this a primitive to get define in stc.h */
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1822
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1823
    RETURN (( (INT)(__INST(flags)) & __MASKSMALLINT(F_CHECKED)) ? true : false);
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1824
%}.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1825
    ^ true "/ an arbtrary return value as fallback
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1826
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1827
    "Created: / 29-11-2010 / 21:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1828
!
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1829
3662
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1830
isDynamic
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1831
    "return true, if the machine code was created
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1832
     dynamically (from bytecode); false if the machine code was
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1833
     already present in an objectFile
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1834
     (i.e. has JIT-compiled machineCode, as opposed to stc-compiled code)."
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1835
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1836
%{  /* NOCONTEXT */
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1837
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1838
    /* made this a primitive to get define in stc.h */
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1839
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1840
    RETURN (( (INT)(__INST(flags)) & __MASKSMALLINT(F_DYNAMIC)) ? true : false);
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1841
%}.
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1842
    ^ false "/ an arbitrary return value as fallback
3662
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1843
!
efe759ae4541 renamed #dynamic to #isDynamic
Claus Gittinger <cg@exept.de>
parents: 3328
diff changeset
  1844
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1845
isExecutable
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1846
    "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
  1847
     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
  1848
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1849
    self isInvalid ifTrue:[^ false].
3933
eb5fcca95dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3882
diff changeset
  1850
    ^ self byteCode notNil or:[self hasCode]
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1851
3933
eb5fcca95dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3882
diff changeset
  1852
    "Created: / 16.4.1996 / 17:52:16 / cg"
eb5fcca95dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3882
diff changeset
  1853
    "Modified: / 13.11.1998 / 23:18:01 / cg"
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1854
!
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1855
13640
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1856
isExtension
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1857
    "return true, if this method is an extension (i.e. package ~= classes' package)"
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1858
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1859
    ^ false
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1860
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1861
    "Created: / 07-09-2011 / 09:28:57 / cg"
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1862
!
d5ffef38fdd8 added: #isExtension
Claus Gittinger <cg@exept.de>
parents: 13427
diff changeset
  1863
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1864
isMarked
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1865
    "return true, if this method has been marked (for whatever reason)"
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1866
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1867
    ^ self markFlag
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1868
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1869
    "/ duplicate code:
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1870
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1871
    "/%{  /* NOCONTEXT */
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1872
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1873
    "/    /* made this a primitive to get define in stc.h */
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1874
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1875
    "/    RETURN (( (INT)(__INST(flags)) & __MASKSMALLINT(F_MARKBIT)) ? true : false);
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1876
    "/%}
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1877
    "/
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1878
    "/ "Created: / 29-11-2010 / 21:17:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1879
!
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  1880
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1881
isUnloaded
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1882
    "return true, if the method's machine code has been unloaded
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1883
     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
  1884
3933
eb5fcca95dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3882
diff changeset
  1885
    ^ (self hasCode not and:[self byteCode isNil])
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1886
22367
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1887
    "Created: / 16-04-1996 / 17:51:47 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1888
    "Modified: / 13-11-1998 / 23:18:18 / cg"
cdec34b6a6fa #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 21788
diff changeset
  1889
    "Modified (comment): / 21-11-2017 / 12:59:51 / cg"
1195
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1890
!
618e2cf3fb56 moved some protocol to upper levels; generalized queries
Claus Gittinger <cg@exept.de>
parents: 1190
diff changeset
  1891
328
claus
parents: 326
diff changeset
  1892
messages
claus
parents: 326
diff changeset
  1893
    "return a Set of all symbols referenced by this thingy.
claus
parents: 326
diff changeset
  1894
     (this is more than the message selectors, since also global names
claus
parents: 326
diff changeset
  1895
     and symbols found in immediate arrays are included)."
claus
parents: 326
diff changeset
  1896
claus
parents: 326
diff changeset
  1897
    |symbolSet|
claus
parents: 326
diff changeset
  1898
claus
parents: 326
diff changeset
  1899
    symbolSet := IdentitySet new.
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1900
    self literalsDo: [ :lit |
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1901
	lit isSymbol ifTrue: [
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1902
	    symbolSet add: lit
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1903
	] ifFalse: [
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1904
	    lit isArray ifTrue: [
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1905
		lit traverse: [ :el |
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1906
		    el isSymbol ifTrue: [symbolSet add: el]
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1907
		]
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1908
	    ]
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1909
	]
328
claus
parents: 326
diff changeset
  1910
    ].
claus
parents: 326
diff changeset
  1911
    ^ symbolSet
claus
parents: 326
diff changeset
  1912
claus
parents: 326
diff changeset
  1913
    "
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1914
     (CompiledCode compiledMethodAt:#messages) messages
328
claus
parents: 326
diff changeset
  1915
    "
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1916
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1917
    "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
  1918
!
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1919
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1920
numArgs
21124
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
  1921
    "return the number of arguments, the method expects.
3d9eac5b2a64 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 20793
diff changeset
  1922
     Please use argumentCount for ANSI compatibility."
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1923
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1924
%{  /* NOCONTEXT */
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1925
#ifdef __SCHTEAM__
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1926
    return __c__._RETURN( self.getNumberOfArguments() );
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1927
#else
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1928
    /* made this a primitive to get define in stc.h */
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1929
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
  1930
    RETURN (__mkSmallInteger((__intVal(__INST(flags)) & F_NARGS) >> F_NARGSHIFT));
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1931
#endif
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1932
%}.
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1933
    "
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1934
     The old implementation simply counted the arguments from
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1935
     the methods source - new versions include this information
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1936
     in the flag instVar, for more security in #perform:
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1937
    "
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1938
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1939
    "
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1940
     (Method compiledMethodAt:#source) numArgs
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1941
     (Method compiledMethodAt:#source:) numArgs
3218
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1942
    "
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1943
!
78255e232c66 Fixes for #literalsDo: and #literalsDetect:ifNone:
Stefan Vogel <sv@exept.de>
parents: 3145
diff changeset
  1944
1869
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1945
numVars
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1946
    "return the number of block local variables.
1869
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1947
     Do not depend on the returned value - future optimizations
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1948
     may change things here (i.e. when moving locals into
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1949
     surrounding context for inlining).
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1950
     - for debugging only."
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1951
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1952
%{  /* NOCONTEXT */
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1953
#ifdef __SCHTEAM__
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1954
    return __c__._RETURN( self.getNumberOfLocals() );
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1955
#else
1869
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1956
    /* made this a primitive to get define in stc.h */
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1957
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8835
diff changeset
  1958
    RETURN (__mkSmallInteger((__intVal(__INST(flags)) & F_NVARS) >> F_NVARSHIFT));
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1959
#endif
1869
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1960
%}
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1961
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1962
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1963
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1964
!
829415f1c38b lifted numVars
Claus Gittinger <cg@exept.de>
parents: 1774
diff changeset
  1965
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1966
referencesGlobal:aGlobalSymbol
17513
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
  1967
    "return true, if this method references the global named aGlobalSymbol.
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1968
     For now, this is the same as #referencesLiteral:,
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1969
     but this might change in the future to perform a deeper
17513
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
  1970
     analyzes on the bytecodes, to detect implicit global
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1971
     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
  1972
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1973
    ^ 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
  1974
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1975
    "
4977
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1976
     (CompiledCode compiledMethodAt:#referencesGlobal:) referencesGlobal:#referencesLiteral:
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1977
     (CompiledCode compiledMethodAt:#referencesGlobal:) referencesGlobal:#bla
1493
33e226c7d187 Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  1978
    "
1190
4ad1c8d6d94d moved & added some query methods (from method) to upper abstract classes
Claus Gittinger <cg@exept.de>
parents: 1182
diff changeset
  1979
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1980
    "Modified: / 24.6.1996 / 15:41:59 / stefan"
4977
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1981
    "Modified: / 9.11.1999 / 17:03:44 / cg"
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1982
!
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1983
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1984
referencesGlobalMatching:aMatchPattern
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1985
    "return true, if this method references the given a literal symbol,
17513
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
  1986
     which matches the given pattern."
4977
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1987
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1988
    ^ (self literalsDetect:[:mthdLit|
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1989
				(mthdLit isMemberOf:Symbol)
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1990
				  and:[aMatchPattern match:mthdLit]
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  1991
			   ] ifNone:[false]) ~~ false.
4977
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1992
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1993
    "
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1994
     (CompiledCode compiledMethodAt:#referencesGlobalMatching:) referencesGlobalMatching:'*atch*'
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  1995
     (CompiledCode compiledMethodAt:#referencesGlobalMatching:) referencesGlobalMatching:'*batch*'
4977
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1996
    "
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1997
17a819360ad5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4854
diff changeset
  1998
    "Modified: / 9.11.1999 / 17:03:16 / cg"
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  1999
!
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2000
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2001
referencesLiteral:aLiteral
20476
38e1aa0a3aef #DOCUMENTATION by mawalch
mawalch
parents: 20468
diff changeset
  2002
    "return true, if this method references the given literal directly
17513
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
  2003
     (i.e. a flat search, which does not look deeper into literal arrays)."
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2004
3771
9136d26808a9 allow for association to be passed to #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
  2005
    |lit|
9136d26808a9 allow for association to be passed to #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
  2006
9136d26808a9 allow for association to be passed to #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
  2007
    lit := aLiteral.
9136d26808a9 allow for association to be passed to #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
  2008
    aLiteral isAssociation ifTrue:[
23571
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2009
	"/ for ST80 compatibility (where variableBindings are used...)
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2010
	lit := lit key
3771
9136d26808a9 allow for association to be passed to #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 3662
diff changeset
  2011
    ].
21310
3f937bb2cdc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 21124
diff changeset
  2012
    ^ (self literalsDetect:[:mthdLit| mthdLit == lit] ifNone:[nil]) notNil.
3054
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2013
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2014
    "
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2015
     (CompiledCode compiledMethodAt:#referencesLiteral:) referencesGlobal:#literalsDetect:ifNone:
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2016
     (CompiledCode compiledMethodAt:#referencesLiteral:) referencesGlobal:#bla
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2017
    "
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2018
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2019
    "Modified: / 24.6.1996 / 15:41:59 / stefan"
a9616d9bc9a0 cleanup: #referencesGlobal: and #referencesLiteral:
Claus Gittinger <cg@exept.de>
parents: 2869
diff changeset
  2020
    "Created: / 28.10.1997 / 13:09:40 / cg"
5537
05d01dd462f6 comments
Claus Gittinger <cg@exept.de>
parents: 5533
diff changeset
  2021
    "Modified: / 18.8.2000 / 21:18:51 / cg"
3093
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  2022
!
642a1fa90695 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3076
diff changeset
  2023
5522
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2024
refersToLiteral:aLiteral
17513
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
  2025
    "return true if the receiver, or recursively any array element in the receiver,
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
  2026
     refers to aLiteral (i.e. a deep search)"
5522
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2027
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  2028
    self literalsDo: [ :el |
23571
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2029
	el == aLiteral ifTrue:[^true].
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2030
	el isArray ifTrue:[
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2031
	    (el refersToLiteral: aLiteral) ifTrue: [^true]
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2032
	]
5522
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2033
    ].
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2034
    ^ false
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2035
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2036
    "
14068
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  2037
     (CompiledCode compiledMethodAt:#refersToLiteral:) refersToLiteral:#foo
46a8289bf92a pass linenr to dumpObject
Claus Gittinger <cg@exept.de>
parents: 14044
diff changeset
  2038
     (CompiledCode compiledMethodAt:#refersToLiteral:) refersToLiteral:#class
5522
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2039
    "
754c11dfd208 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5426
diff changeset
  2040
14255
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2041
    "Modified: / 03-03-1998 / 00:02:28 / stefan"
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2042
    "Modified: / 26-07-2012 / 15:44:33 / cg"
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2043
!
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2044
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2045
refersToLiteralMatching:aMatchPattern
18416
f246b0e42278 comments
Claus Gittinger <cg@exept.de>
parents: 18196
diff changeset
  2046
    "return true if the receiver, or recursively any array element in the receiver,
17513
b6e36968f009 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 16346
diff changeset
  2047
     is symbolic and matches aMatchPattern (i.e. a deep search)"
14255
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2048
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2049
    self literalsDo: [ :el |
23571
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2050
	(el isSymbol and:[ aMatchPattern match: el]) ifTrue:[^true].
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2051
	el isArray ifTrue:[
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2052
	    (el refersToLiteralMatching: aMatchPattern) ifTrue: [^true]
4aa9bc1a2076 extra filename arg to __dumpObject__
Claus Gittinger <cg@exept.de>
parents: 22934
diff changeset
  2053
	]
14255
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2054
    ].
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2055
    ^ false
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2056
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2057
    "
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2058
     (CompiledCode compiledMethodAt:#refersToLiteralMatching:) refersToLiteral:'is*'
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2059
     (CompiledCode compiledMethodAt:#refersToLiteralMatching:) refersToLiteral:'foo*'
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2060
    "
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2061
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2062
    "Modified: / 03-03-1998 / 00:02:28 / stefan"
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2063
    "Modified: / 18-08-2000 / 21:17:47 / cg"
a5b9d39ad244 added: #refersToLiteralMatching:
Claus Gittinger <cg@exept.de>
parents: 14153
diff changeset
  2064
    "Created: / 26-07-2012 / 15:37:23 / cg"
328
claus
parents: 326
diff changeset
  2065
! !
claus
parents: 326
diff changeset
  2066
1772
d5d1d1fac79d the dynamic flag may never be set by anyone except the VM;
Claus Gittinger <cg@exept.de>
parents: 1771
diff changeset
  2067
!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
  2068
13777
7308f6b1eede changed: #valueWithReceiver:arguments:selector:search:sender:
Claus Gittinger <cg@exept.de>
parents: 13776
diff changeset
  2069
version
18943
133920e78771 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 18436
diff changeset
  2070
    ^ '$Header$'
13777
7308f6b1eede changed: #valueWithReceiver:arguments:selector:search:sender:
Claus Gittinger <cg@exept.de>
parents: 13776
diff changeset
  2071
!
7308f6b1eede changed: #valueWithReceiver:arguments:selector:search:sender:
Claus Gittinger <cg@exept.de>
parents: 13776
diff changeset
  2072
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  2073
version_CVS
18943
133920e78771 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 18436
diff changeset
  2074
    ^ '$Header$'
12160
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
  2075
!
48e09b1971f3 compiler interface
fm
parents: 10905
diff changeset
  2076
13427
6a957644862b Jan's changes
vrany
parents: 12160
diff changeset
  2077
version_SVN
15409
058210984b34 class: CompiledCode
Claus Gittinger <cg@exept.de>
parents: 14490
diff changeset
  2078
    ^ '$ Id: CompiledCode.st 10643 2011-06-08 21:53:07Z vranyj1  $'
1182
d8f8e18928a5 only CompiledCode, Method & Block are fixed - subclasses may look different
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  2079
! !
24353
60396a765720 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23571
diff changeset
  2080