ByteCodeCompiler.st
author Claus Gittinger <cg@exept.de>
Wed, 22 Nov 2000 12:02:23 +0100
changeset 1118 01e9dcf336e5
parent 1117 f03c007dadc6
child 1122 ae6b9ea5c7ba
permissions -rw-r--r--
method category: and package: now send change notifications.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
     1
"
4
f6fd83437415 *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
45
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
     3
	      All Rights Reserved
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
     4
7ad01559b262 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
7ad01559b262 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
7ad01559b262 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
7ad01559b262 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
7ad01559b262 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
7ad01559b262 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
7ad01559b262 Initial revision
claus
parents:
diff changeset
    11
"
7ad01559b262 Initial revision
claus
parents:
diff changeset
    12
1046
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
    13
"{ Package: 'stx:libcomp' }"
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
    14
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    15
Parser subclass:#ByteCodeCompiler
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
    16
	instanceVariableNames:'codeBytes codeIndex litArray stackDelta extra lineno extraLiteral
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    17
		maxStackDepth relocList methodTempVars numTemp maxNumTemp
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
    18
		methodClass'
172
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    19
	classVariableNames:'JumpToAbsJump SequenceNumber STCCompilationDefines
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    20
		STCCompilationIncludes STCCompilationOptions STCCompilation
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
    21
		ShareCode STCKeepSTIntermediate STCKeepCIntermediate
704
387a61fb1839 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
    22
		STCModulePath CCCompilationOptions CC STC ListCompiledMethods
1049
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
    23
		STCKeepOIntermediate Verbose NewCodeSet NewPrimitives'
172
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    24
	poolDictionaries:''
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    25
	category:'System-Compiler'
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    26
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    27
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
    28
!ByteCodeCompiler class methodsFor:'documentation'!
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
    29
1030
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    30
byteCode
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    31
"
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    32
    TOS   - top of stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    33
    NOS   - next on stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    34
    uu    - byte-valued unsigned (0..16rFF)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    35
    uuuu  - twoByte-valued unsigned (0..16rFFFF); msb-first
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    36
    ll    - byte-valued literal index (0..16rFF)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    37
    nn    - byte-valued signed (-128..+127)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    38
    nnnn  - twoByte-valued signed (16r-8000 .. 16r7FFF)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    39
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    40
    Notes: 
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    41
        - bytecode optimized for space, not interpreter speed,
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    42
          since JITTER is assumed to be present and compensate for decoding
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    43
          overhead.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    44
        - number assignments due to backward compatible extensions of the
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    45
          bytecode set - reassignment & cleanup would be nice.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    46
        - codes marked with (*) make the minimal set; all others duplicate
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    47
          the functionality of a minimalSet code, but provides dense encoding
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    48
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    49
    definition of ST/X byteCode:
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    50
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    51
    *   00          RET_TOP         return TOS from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    52
        01          RET_NIL         return nil from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    53
        02          RET_TRUE        return true from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    54
        03          RET_FALSE       return false from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    55
        04          RET_0           return 0 (zero) from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    56
        05          RET_SELF        return the current receiver from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    57
    *   06          DUP_OVER        push NOS (used with inlined loops)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    58
    *   07          HOME_RET_TOP    return TOS from home context (method return from block)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    59
        08 uu       LINENO          line number information dummy     
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    60
    *   09 uuuu     LINENO16        line number information dummy
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    61
        0A          PUSH_NIL        push nil onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    62
        0B          PUSH_TRUE       push true onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    63
        0C          PUSH_FALSE      push false onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    64
        0D          SEND_SELF       self-send
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    65
    *   0E ll       PUSH_LIT        push a literal
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    66
        0F          PUSH_SELF       push the current receiver onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    67
        10 nn       PUSH_NUM        push a byte-valued smallInteger onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    68
        11 nnnn     PUSH_NUM16      push a twoByte-valued smallInteger onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    69
    *   12          DROP            pop & forget
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    70
    *   13          SEND            send 
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    71
    *   14          SUPER_SEND      super-send (actually: directed send) 
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    72
        15          SEND0           send 0-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    73
        16          SEND1           send 1-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    74
        17          SEND2           send 2-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    75
        18          SEND3           send 3-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    76
        19          SEND_DROP       send & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    77
        1A          SEND0_DROP      send 0-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    78
        1B          SEND1_DROP      send 1-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    79
        1C          SEND2_DROP      send 2-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    80
        1D          SEND3_DROP      send 3-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    81
    *   1E          PUSH_MARG       push method arg
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    82
    *   1F          PUSH_MVAR       push method variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    83
    *   20          PUSH_BARG       push block arg
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    84
    *   21          PUSH_BVAR       push block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    85
    *   22          PUSH_IVAR       push instance variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    86
        23          PUSH_CVAR       -- obsolete -- no longer used.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    87
    *   24          PUSH_GLOB       push global
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    88
    *   25          STORE_MVAR      pop and store into method variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    89
    *   26          STORE_BVAR      pop and store into block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    90
    *   27          STORE_IVAR      pop and store into instance variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    91
        28          STORE_CVAR      -- obsolete -- no longer used.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    92
    *   29          STORE_GLOB      pop and store into global
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    93
    *   2A          PUSH_OBARG      push outer block arg (n levels)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    94
        2B          PUSH_OBARG1     push outer block arg (1 level)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    95
        2C          PUSH_OBARG2     push outer block arg (2 levels)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    96
        2D          EQEQ            == -> pop a,b; push a==b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    97
        2E          NENE            ~~ -> pop a,b; push a~~b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    98
    *   2F          DUP             duplicate TOS
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    99
        30          EQEQ0           ==0 -> pop a; push a==0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   100
        31          NENE0           ~~0 -> pop a; push a~~0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   101
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   102
        32          JMP_FALSE       pop; branch if false
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   103
        33          JMP_TRUE        pop; branch if true
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   104
        34          JMP_NIL         pop; branch if nil
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   105
        35          JMP_NOTNIL      pop; branch if not nil
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   106
        36          JMP             branch always
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   107
        37          MAKE_BLOCK      make a block
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   108
        38          JMP_ZERO        pop; branch if ==0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   109
        39          JMP_NOTZERO     pop; branch if ~~0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   110
        3A          JMP_EQEQ        pop a,b; branch if a==b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   111
        3B          JMP_NENE        pop a,b; branch if a~~b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   112
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   113
        3C          JMPL_FALSE      like above, extended branch delta, (add +128/-128 to offs)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   114
        ...          ...
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   115
        45          JMPL_NENE       like above, extended branch delta, (add +128/-128 to offs)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   116
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   117
        46          JMPVL_FALSE     like above, extended branch delta, (add +256/-256 to offs)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   118
        ...          ...
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   119
        4F          JMPVL_NENE      like above, extended branch delta, (add +256/-256 to offs)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   120
        
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   121
        50          PUSH_MVAR1      push method variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   122
        51          PUSH_MVAR2      push method variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   123
        52          PUSH_MVAR3      push method variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   124
        53          PUSH_MVAR4      push method variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   125
        54          PUSH_MVAR5      push method variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   126
        55          PUSH_MVAR6      push method variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   127
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   128
        56          PUSH_MARG1      push method arg 1
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   129
        57          PUSH_MARG2      push method arg 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   130
        58          PUSH_MARG3      push method arg 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   131
        59          PUSH_MARG4      push method arg 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   132
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   133
        5A          PUSH_IVAR1      push inst variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   134
        5B          PUSH_IVAR2      push inst variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   135
        5C          PUSH_IVAR3      push inst variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   136
        5D          PUSH_IVAR4      push inst variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   137
        5E          PUSH_IVAR5      push inst variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   138
        5F          PUSH_IVAR6      push inst variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   139
        60          PUSH_IVAR7      push inst variable 7
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   140
        61          PUSH_IVAR8      push inst variable 8
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   141
        62          PUSH_IVAR9      push inst variable 9
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   142
        63          PUSH_IVAR10     push inst variable 10
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   143
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   144
        64          STORE_MVAR1     pop and store into method variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   145
        65          STORE_MVAR2     pop and store into method variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   146
        66          STORE_MVAR3     pop and store into method variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   147
        67          STORE_MVAR4     pop and store into method variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   148
        68          STORE_MVAR5     pop and store into method variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   149
        69          STORE_MVAR6     pop and store into method variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   150
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   151
        6A          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   152
        6B          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   153
        6C          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   154
        6D          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   155
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   156
        6E          STORE_IVAR1     pop and store into inst variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   157
        6F          STORE_IVAR2     pop and store into inst variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   158
        70          STORE_IVAR3     pop and store into inst variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   159
        71          STORE_IVAR4     pop and store into inst variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   160
        72          STORE_IVAR5     pop and store into inst variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   161
        73          STORE_IVAR6     pop and store into inst variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   162
        74          STORE_IVAR7     pop and store into inst variable 7
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   163
        75          STORE_IVAR8     pop and store into inst variable 8
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   164
        76          STORE_IVAR9     pop and store into inst variable 9
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   165
        77          STORE_IVAR10    pop and store into inst variable 10
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   166
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   167
        78          PUSH_0          push smallinteger 0 constant
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   168
        79          PUSH_1          push smallinteger 1 constant
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   169
        7A          PUSH_M1         push smallinteger -1 constant
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   170
1031
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   171
        7B          SEND_PLUS1      send '+ 1' to TOS; replace TOS by result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   172
        7C          SEND_MINUS1     send '- 1' to TOS; replace TOS by result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   173
        7D          INC_MVAR        send '+ 1' to a method variable; store result into same mvar (for inlined loops)
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   174
        7E          DEC_MVAR        send '- 1' to a method variable; store result into same mvar (for inlined loops)
1030
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   175
        7F nn       RET_NUM         return a smallInteger from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   176
    *   80          PUSH_OBVAR      push outer block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   177
    *   81          STORE_OBVAR     pop and store into outer block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   178
1031
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   179
        82          SEND_EQ         send #= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   180
        83          SEND_PLUS       send #+ 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   181
        84          SEND_NE         send #~= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   182
        85          SEND_MINUS      send #- 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   183
        86          SEND_CLASS      send #class 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   184
        87          SEND_AT         send #at:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   185
        88          SEND_ATPUT      send #at:put: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   186
        89          SEND_BITAND     send #bitAnd: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   187
        8A          SEND_BITOR      send #bitOr: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   188
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   189
        8B          PUSH_2          push constant 2
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   190
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   191
        8C          PUSH_BARG1      push block argument 1
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   192
        8D          PUSH_BARG2      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   193
        8E          PUSH_BARG3      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   194
        8F          PUSH_BARG4      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   195
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   196
    *   90          PUSH_CONTEXT    push thisContext
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   197
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   198
        91          SEND_GT         send > 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   199
        92          SEND_GE         send >= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   200
        93          SEND_LT         send < 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   201
        94          SEND_LE         send <= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   202
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   203
        95          UNUSED_149      obsolete; was: send #next 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   204
        96          UNUSED_150      obsolete; was: send #peek 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   205
        97          SEND_VALUE      send #value 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   206
        98          SEND_VALUE1     send #value: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   207
        99          SEND_SIZE       send #size 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   208
        9A          UNUSED_154      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   209
        9B          UNUSED_155      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   210
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   211
        9C          MK0BLOCK        make a 0-returning block     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   212
        9D          MKNILBLOCK      make a nil-returning block
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   213
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   214
        9E          UNUSED_158      obsolete; was: send #asInteger */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   215
        9F          UNUSED_159      obsolete; was: send #rounded */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   216
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   217
        A0          RET_MVAR1       return method variable 1 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   218
        A1          RET_MVAR2       return method variable 2 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   219
        A2          RET_MVAR3       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   220
        A3          RET_MVAR4       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   221
        A4          RET_MVAR5       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   222
        A5          RET_MVAR6       return method variable 6 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   223
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   224
        A6          RET_IVAR1       return instance variable 1 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   225
        A7          RET_IVAR2       return instance variable 2 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   226
        A8          RET_IVAR3       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   227
        A9          RET_IVAR4       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   228
        AA          RET_IVAR5       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   229
        AB          RET_IVAR6       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   230
        AC          RET_IVAR7       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   231
        AD          RET_IVAR8       return instance variable 8 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   232
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   233
        AE          RET_MARG1       return method arg 1 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   234
        AF          RET_MARG2       return method arg 1 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   235
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   236
        B0          PUSH_CIVAR      obsolete; push class instance variable 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   237
        B1          STORE_CIVAR     obsolete; store top of stack in class instance variable 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   238
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   239
        B2          SEND_VALUE2     send #value:value:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   240
        B3          SEND_NOT        send #not     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   241
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   242
        B4          SEND_SELF0      send a 0-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   243
        B5          SEND_SELF1      send a 1-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   244
        B6          SEND_SELF2      send a 2-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   245
        B7          SEND_SELF3      send a 3-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   246
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   247
        B8          SEND_SELF_DROP0 send a 0-arg message to self forget result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   248
        B9          SEND_SELF_DROP1 send a 1-arg message to self forget result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   249
        BA          SEND_SELF_DROP2 send a 2-arg message to self forget result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   250
        BB          SEND_SELF_DROP3 send a 3-arg message to self forget result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   251
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   252
        BC          ISNIL           replace TOS by 'TOS isNil'     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   253
        BD          NOTNIL          replace TOS by 'TOS notNil'     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   254
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   255
        BE uuuu     JMPA_FALSE      jumps to absolute offset (2 byte hi-lo) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   256
        BF uuuu     JMPA_TRUE       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   257
        C0 uuuu     JMPA_NIL        
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   258
        C1 uuuu     JMPA_NOTNIL     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   259
        C2 uuuu     JMPA            
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   260
        C3          MAKE_ABLOCK     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   261
        C4 uuuu     JMPA_ZERO       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   262
        C5 uuuu     JMPA_NOTZERO    
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   263
        C6 uuuu     JMPA_EQ         
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   264
        C7 uuuu     JMPA_NOTEQ      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   265
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   266
        C8 xx       PUSH_GSPECIAL   push a special global; xx specifies what:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   267
           00        Array   (push 'Smalltalk at:#Array'; i.e. the Array class)
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   268
           01        String  (push 'Smalltalk at:#String'; i.e. the String class)
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   269
           02        FloatArray
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   270
           03        DoubleArray
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   271
           04        Point
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   272
           05        Symbol
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   273
           06        Smalltalk
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   274
           07        Processor
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   275
           08        SmallInteger
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   276
           09        Character
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   277
           0A        Float
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   278
           0B        Process
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   279
           0C        Set
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   280
           0D        IdentitySet
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   281
           0E        Dictionary
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   282
           0F        IdentityDictionary
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   283
           10        Semaphore
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   284
           11        OrderedCollection
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   285
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   286
        C9 uuuu     PUSH_LLIT       push a literal (2-byte literal-number)
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   287
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   288
        CA nn       JMP_FALSE_L     jump if top is false (+127 .. -128) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   289
        CB nn       JMP_TRUE_L      jump if top is true 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   290
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   291
        CC          UNUSED_204      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   292
        CD          LSEND_MSG       send with 16 bit literal index */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   293
        CE          LSUPERSEND_MSG  super send with 16 bit literal index */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   294
        CF          LSEND_SELF      self-send send with 16 bit literal index */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   295
        D0          PUSH_GT0        push 'TOS > 0'; leaves original TOS as NOS
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   296
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   297
        D1          UNUSED_209      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   298
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   299
        D2          SEND_ARRAY_NEW  use for new/basicNew; top is size (0 for Array new) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   300
        D3          SEND_BASICNEW   top is class (receiver) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   301
        D4          SEND_GT0        replace TOS by result of send 'TOS > 0' 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   302
        D5          SEND_NEW        top is class (receiver) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   303
        D6          SEND_BASICNEWN  top is class (receiver) and arg 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   304
        D7          SEND_NEWN       top is class (receiver) and arg
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   305
        D8          SEND_LOGAND     send & 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   306
        D9          SEND_LOGOR      send | 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   307
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   308
        DA uuuu     PUSH_LGLOB      push global variable word index literal 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   309
        DB uuuu     STORE_LGLOB     store global with word index literal 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   310
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   311
        DC          UNUSED_220      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   312
        DE          UNUSED_221      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   313
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   314
        DF          PUSH_LIT1       push 1st literal
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   315
        E0          PUSH_LIT2       push 2nd literal 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   316
        E1          PUSH_LIT3       push literal 3 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   317
        E2          PUSH_LIT4       push literal 4 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   318
        E3          PUSH_LIT5       push literal 5 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   319
        E4          PUSH_LIT6       push literal 6 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   320
        E5          PUSH_LIT7       push literal 7 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   321
        E6          PUSH_LIT8       push literal 8 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   322
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   323
        E7          SEND_MUL        send #* 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   324
        E8 xx       SEND_SPECIAL    special send; as specified by xx:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   325
           00         top           send #top
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   326
           01         bottom        send #bottom
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   327
           02         left          send #left
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   328
           03         right         send #right
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   329
           04         x             send #x
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   330
           05         y             send #y
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   331
           06         width         send #width
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   332
           07         height        send #height
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   333
           08         origin        send #origin
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   334
           09         extent        send #extent
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   335
           0A         asInteger     send #asInteger
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   336
           0B         rounded       send #rounded
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   337
           0C         next          send #next
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   338
           0D         peek          send #peek
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   339
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   340
        E9          PUSH_BVAR1      push block variable 1
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   341
        EA          PUSH_BVAR2      push block variable 2
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   342
        EB          PUSH_BVAR3      push block variable 3
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   343
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   344
        EC          STORE_BVAR1     store TOS in block variable 1 and drop
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   345
        ED          STORE_BVAR2     store TOS in block variable 2 and drop
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   346
        EE          STORE_BVAR3     store TOS in block variable 3 and drop
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   347
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   348
     *  EF          BLOCK_REF       internal - check if a block is referenced by TOS
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   349
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   350
        F0          PUSH_LVAR       push local variable 0..numArgs-1 for args; numArgs..numArgs+nLocal-1 for mVars 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   351
        F1          STORE_LVAR      store local variable 0..numArgs-1 for args; numArgs..numArgs+nLocal-1 for mVars 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   352
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   353
        F2          UNUSED_242      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   354
        F3          UNUSED_243      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   355
        F4          UNUSED_244      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   356
        F5          UNUSED_245      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   357
        F6          UNUSED_246      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   358
        F7          UNUSED_247      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   359
        F8          UNUSED_248      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   360
        F9          UNUSED_249      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   361
        FA          UNUSED_250      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   362
        FB          UNUSED_251      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   363
        FC          UNUSED_252      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   364
        FD          UNUSED_253      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   365
        FE          UNUSED_254      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   366
        FF          UNUSED_255      
1030
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   367
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   368
    [author:]
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   369
        Claus Gittinger
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   370
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   371
"
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   372
!
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   373
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   374
copyright
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   375
"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   376
 COPYRIGHT (c) 1989 by Claus Gittinger
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   377
	      All Rights Reserved
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   378
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   379
 This software is furnished under a license and may be used
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   380
 only in accordance with the terms of that license and with the
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   381
 inclusion of the above copyright notice.   This software may not
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   382
 be provided or otherwise made available to, or used by, any
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   383
 other person.  No title to or ownership of the software is
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   384
 hereby transferred.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   385
"
135
aa4f7b8f121e uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   386
!
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   387
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
   388
documentation
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
   389
"
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   390
    This class performs compilation into ByteCodes.
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   391
    First, parsing is done using superclass methods,
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   392
    then the parse-tree is converted into an array of symbolic codes
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   393
    and a relocation table; 
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   394
    these two are finally combined into a byteArray of the codes.
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   395
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   396
    (the intermediate step through symbolic codes is for debugging
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
   397
     only - it may vanish in future releases)
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   398
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   399
    There are many dependencies to the run-time-system (especially the
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   400
    interpreter) in here - be careful when playing around ...
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   401
259
a469695d8d19 commentary
Claus Gittinger <cg@exept.de>
parents: 256
diff changeset
   402
    [Instance variables:]
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   403
1055
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   404
        codeBytes       <ByteArry>              bytecodes
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   405
        codeIndex       <SmallInteger>          next index to put into code array
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   406
        litArray        <OrderedCollection>     literals
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   407
        stackDelta      <SmallInteger>          return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   408
        extra           <Symbol>                return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   409
        lineno          <Boolean>               return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   410
        extraLiteral    <Symbol>                return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   411
        maxStackDepth   <SmallInteger>          stack need of method
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   412
        relocList       <Array>                 used temporary for relocation
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   413
259
a469695d8d19 commentary
Claus Gittinger <cg@exept.de>
parents: 256
diff changeset
   414
    [Class variables:]
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   415
1055
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   416
        JumpToAbsJump   <Dictionary>            internal table to map opcodes
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   417
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   418
        SequenceNumber  <Integer>               counting intermediate stc-compiled
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   419
                                                objects (for unique o-file naming)
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   420
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   421
        STCCompilationDefines                   passed to stc as command line arguments
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   422
        STCCompilationIncludes
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   423
        STCCompilationOptions
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   424
                        <String>                
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   425
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   426
        STCCompilation  <Symbol>                #always, #primitiveOnly or #never
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   427
                                                controls when stc compilation is wanted
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   428
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   429
        ShareCode       <Boolean>               reuse byteArrays for common (simple) code sequences
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   430
                                                This is normally a 'good' optimization,
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   431
                                                except if you plan to modify the byteCodes.
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   432
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   433
    [author:]
1055
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   434
        Claus Gittinger
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   435
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
   436
"
98
claus
parents: 97
diff changeset
   437
! !
claus
parents: 97
diff changeset
   438
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   439
!ByteCodeCompiler class methodsFor:'initialization'!
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   440
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   441
initialize
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   442
    Smalltalk vmMajorVersionNr >= 5 ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   443
        NewCodeSet := true.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   444
        NewPrimitives := true.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   445
    ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   446
        NewCodeSet := false.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   447
        NewPrimitives := false.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   448
    ].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   449
    ShareCode := true.
295
ec9ca802683e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 292
diff changeset
   450
    STCKeepCIntermediate := false.
704
387a61fb1839 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
   451
    STCKeepOIntermediate := false.
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
   452
    STCKeepSTIntermediate := false.
301
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   453
    STCModulePath := './modules'.
603
021722b8a427 correctly scan trailing period after a number in a block (as in x := x + 1.]
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   454
    ListCompiledMethods := false.
021722b8a427 correctly scan trailing period after a number in a block (as in x := x + 1.]
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   455
792
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   456
   "
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   457
    STCKeepCIntermediate := true.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   458
    STCKeepOIntermediate := true.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   459
    STCKeepSTIntermediate := true.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   460
   "
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   461
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
   462
    "Modified: / 21.10.1998 / 15:39:52 / cg"
1046
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   463
!
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   464
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   465
newCodeSet
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   466
    ^ NewCodeSet 
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   467
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   468
!
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   469
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   470
newCodeSet:aBoolean
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   471
    NewCodeSet := aBoolean.
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   472
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   473
    "
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   474
     ByteCodeCompiler newCodeSet:true
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   475
    "
1049
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   476
!
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   477
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   478
newPrimitives
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   479
    ^ NewPrimitives 
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   480
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   481
!
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   482
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   483
newPrimitives:aBoolean
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   484
    NewPrimitives := aBoolean.
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   485
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   486
    "
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   487
     ByteCodeCompiler newPrimitives:true
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   488
    "
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   489
! !
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   490
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   491
!ByteCodeCompiler class methodsFor:'compiling methods'!
98
claus
parents: 97
diff changeset
   492
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   493
compile:methodText forClass:classToCompileFor
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   494
    "compile a source-string for a method in classToCompileFor.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   495
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   496
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   497
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   498
        compile:methodText
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   499
        forClass:classToCompileFor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   500
        inCategory:'others'
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   501
        notifying:nil
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   502
        install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   503
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   504
        silent:false
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   505
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
   506
7ad01559b262 Initial revision
claus
parents:
diff changeset
   507
compile:aString forClass:aClass inCategory:cat
7ad01559b262 Initial revision
claus
parents:
diff changeset
   508
    "compile a source-string for a method in classToCompileFor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   509
     The method will get cat as category.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   510
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   511
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   512
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   513
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   514
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   515
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   516
        notifying:nil
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   517
        install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   518
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   519
        silent:false
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   520
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
   521
84
claus
parents: 78
diff changeset
   522
compile:aString forClass:aClass inCategory:cat notifying:requestor
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   523
    "compile a source-string for a method in classToCompileFor.
84
claus
parents: 78
diff changeset
   524
     errors are forwarded to requestor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   525
     The method will get cat as category.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   526
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   527
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   528
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   529
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   530
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   531
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   532
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   533
        install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   534
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   535
        silent:false
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   536
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
   537
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   538
compile:aString forClass:aClass inCategory:cat notifying:requestor install:install
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   539
    "compile a source-string for a method in classToCompileFor.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   540
     The install-argument controls if the method is to be installed into the
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   541
     classes method-dictionary, or just to be compiled and a method object to be returned.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   542
     Errors are forwarded to requestor. The method will get cat as category.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   543
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   544
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   545
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   546
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   547
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   548
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   549
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   550
        install:install
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   551
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   552
        silent:false
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   553
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   554
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   555
compile:aString forClass:aClass inCategory:cat notifying:requestor
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   556
                 install:install skipIfSame:skipIfSame
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   557
    "compile a source-string for a method in classToCompileFor.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   558
     The install-argument controls if the method is to be installed into the
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   559
     classes method-dictionary, or just to be compiled and a method object to be returned.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   560
     Errors are forwarded to requestor. The method will get cat as category.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   561
     If skipIsSame is true, and the source is the same as an existing
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   562
     methods source, this is a noop (for fast fileIn).
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   563
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   564
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   565
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   566
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   567
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   568
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   569
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   570
        install:install
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   571
        skipIfSame:skipIfSame
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   572
        silent:false
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   573
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   574
84
claus
parents: 78
diff changeset
   575
compile:aString forClass:aClass inCategory:cat notifying:requestor
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   576
                 install:install skipIfSame:skipIfSame silent:silent
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   577
    "compile a source-string for a method in aClass.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   578
     errors are forwarded to requestor.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   579
     The method will get cat as category.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   580
     if install is true, the method is installed in the class.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   581
     if skipIfSame, the method is not installed if there is no change
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   582
     (used when filing in).
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   583
     if silent is true, no warnings are output.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   584
     Returns the new method, #Error or nil."
230
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   585
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   586
    ^ self
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   587
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   588
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   589
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   590
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   591
        install:install
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   592
        skipIfSame:skipIfSame
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   593
        silent:silent
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   594
        foldConstants:true
230
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   595
!
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   596
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   597
compile:aString forClass:aClass inCategory:cat notifying:requestor
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   598
                 install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   599
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   600
    "the basic workhorse method for compiling:
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   601
     compile a source-string for a method in classToCompileFor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   602
     errors are forwarded to requestor 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   603
     (report on Transcript and return #Error, if requestor is nil).
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   604
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   605
     The new method will get cat as category. 
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   606
     If install is true, the method will go into the classes method-table, 
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   607
     otherwise the method is simply returned (for anonymous methods).
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   608
     If skipIsSame is true, and the source is the same as an existing
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   609
     methods source, this is a noop (for fast fileIn).
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   610
     The argument, silent controls if errors are to be reported.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   611
     Returns the method, #Error or nil."
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   612
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
   613
    |compiler newMethod tree symbolicCodeArray oldMethod lazy silencio 
459
3a0a95c1a0e8 unchanged methods may have a new package id
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   614
     sourceFile sourceStream newSource primNr pos sel keptOldCode msg answer
3a0a95c1a0e8 unchanged methods may have a new package id
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   615
     pkg|
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   616
7ad01559b262 Initial revision
claus
parents:
diff changeset
   617
    aString isNil ifTrue:[^ nil].
603
021722b8a427 correctly scan trailing period after a number in a block (as in x := x + 1.]
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   618
    silencio := silent 
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   619
                or:[Smalltalk silentLoading == true
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   620
                or:[ListCompiledMethods == false]].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   621
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   622
    "lazy compilation is EXPERIMENTAL"
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   623
    lazy := (LazyCompilation == true) and:[install].
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   624
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   625
    "create a compiler, let it parse and create the parsetree"
7ad01559b262 Initial revision
claus
parents:
diff changeset
   626
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   627
    compiler := self for:(ReadStream on:aString) in:aClass.
84
claus
parents: 78
diff changeset
   628
    compiler parseForCode.
230
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   629
    fold ifFalse:[compiler foldConstants:nil].
84
claus
parents: 78
diff changeset
   630
    compiler notifying:requestor.
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   631
    silent ifTrue:[
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   632
"/        compiler ignoreErrors.
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   633
        compiler ignoreWarnings.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   634
        compiler warnUndeclared:false.
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   635
    ].
256
ae09ebb4aa35 no need to send nextToken when parsing a method
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
   636
"/    compiler nextToken.
350
13e1dcaf87eb oops - the classes version method may not be lazy
Claus Gittinger <cg@exept.de>
parents: 330
diff changeset
   637
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   638
    (compiler parseMethodSpec == #Error) ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   639
        compiler parseError:'syntax error in method specification'.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   640
        tree := #Error
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   641
    ] ifFalse:[
974
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   642
        (aClass isNil or:[aClass owningClass isNil]) ifTrue:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   643
            (requestor respondsTo:#packageToInstall) ifFalse:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   644
                pkg := Class packageQuerySignal query.
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   645
            ] ifTrue:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   646
                pkg := requestor packageToInstall
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   647
            ].
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   648
        ] ifFalse:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   649
            pkg := aClass owningClass package
946
f768a4b86f8d package setting fixed
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
   650
        ].
f768a4b86f8d package setting fixed
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
   651
f768a4b86f8d package setting fixed
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
   652
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   653
        lazy ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   654
            "/
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   655
            "/ that one method IS required
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   656
            "/
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   657
            (aClass isMeta and:[compiler selector == #version]) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   658
                lazy := false
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   659
            ]
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   660
        ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   661
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   662
        lazy ifFalse:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   663
            "check if same source"
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   664
            (skipIfSame and:[(sel := compiler selector) notNil]) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   665
                oldMethod := aClass compiledMethodAt:sel.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   666
                oldMethod notNil ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   667
                    oldMethod source = aString ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   668
                        oldMethod isInvalid ifFalse:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   669
                            silencio ifFalse:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   670
                                Transcript showCR:('    unchanged: ',aClass name,' ',compiler selector)
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   671
                            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   672
                            "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   673
                             same. however, category may be different
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   674
                            "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   675
                            (cat notNil and:[cat ~= oldMethod category]) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   676
                                oldMethod category:cat.
459
3a0a95c1a0e8 unchanged methods may have a new package id
Claus Gittinger <cg@exept.de>
parents: 439
diff changeset
   677
"/                                aClass updateRevisionString.
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   678
                                aClass addChangeRecordForMethodCategory:oldMethod category:cat.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   679
                                silencio ifFalse:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   680
                                    Transcript showCR:('    (category change only)')
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   681
                                ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   682
                            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   683
                            "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   684
                             and package may be too.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   685
                            "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   686
                            (pkg notNil and:[pkg ~~ oldMethod package]) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   687
                                oldMethod package:pkg.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   688
                                silencio ifFalse:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   689
                                    Transcript showCR:('    (package-id change only)')
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   690
                                ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   691
                            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   692
                            ^ oldMethod
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   693
                        ]
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   694
                    ]
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   695
                ]
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   696
            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   697
            tree := compiler parseMethodBody.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   698
            compiler tree:tree.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   699
        ]
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   700
    ].
7ad01559b262 Initial revision
claus
parents:
diff changeset
   701
7ad01559b262 Initial revision
claus
parents:
diff changeset
   702
    (compiler errorFlag or:[tree == #Error]) ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   703
        compiler showErrorMessageForClass:aClass.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   704
        ^ #Error
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   705
    ].
7ad01559b262 Initial revision
claus
parents:
diff changeset
   706
191
5c285632f2ea slightly faster lazy loading
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   707
    sel := compiler selector.
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   708
    "if no error and also no selector ..."
90
claus
parents: 85
diff changeset
   709
     sel isNil ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   710
        "... it was just a comment or other empty stuff"
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   711
        ^ nil
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   712
    ].
7ad01559b262 Initial revision
claus
parents:
diff changeset
   713
191
5c285632f2ea slightly faster lazy loading
Claus Gittinger <cg@exept.de>
parents: 187
diff changeset
   714
    lazy ifFalse:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   715
        "
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   716
         freak-out support for inline C-code...
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   717
        "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   718
        ((compiler hasNonOptionalPrimitiveCode 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   719
        or:[(compiler hasPrimitiveCode and:[self canCreateMachineCode])
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   720
        or:[STCCompilation == #always and:[sel ~~ #doIt]]])
1046
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   721
        and:[(STCCompilation ~~ #never)
1049
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   722
        and:[NewPrimitives ~~ true]]) ifTrue:[
1108
b5da8c780241 do not install machine-code methods if install is false.
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
   723
            install ifFalse:[ ^ nil].
b5da8c780241 do not install machine-code methods if install is false.
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
   724
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   725
            newMethod := compiler 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   726
                            compileToMachineCode:aString 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   727
                            forClass:aClass 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   728
                            inCategory:cat 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   729
                            notifying:requestor
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   730
                            install:install 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   731
                            skipIfSame:skipIfSame 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   732
                            silent:silent.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   733
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   734
            newMethod == #Error ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   735
                compiler showErrorMessageForClass:aClass.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   736
                ^ #Error
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   737
            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   738
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   739
            (newMethod == #CannotLoad) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   740
                newMethod := compiler trappingStubMethodFor:aString inCategory:cat.
1118
01e9dcf336e5 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   741
                newMethod setPackage:pkg.
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   742
                keptOldCode := false.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   743
                install ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   744
                    "/
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   745
                    "/ be very careful with existing methods
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   746
                    "/ (otherwise, you could easily make your system unusable in systems which cannot load)
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   747
                    "/
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   748
                    sel notNil ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   749
                        oldMethod := aClass compiledMethodAt:sel 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   750
                    ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   751
                    (oldMethod notNil and:[oldMethod code ~= newMethod code]) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   752
                        answer := Dialog
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   753
                                     confirm:
649
06675201ca18 name the class/selector in the compilation-failed-dialog.
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   754
'installation of binary code for ''' , aClass name , '>>' , compiler selector , '''
06675201ca18 name the class/selector in the compilation-failed-dialog.
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   755
is not possible or disabled.
97
claus
parents: 96
diff changeset
   756
172
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   757
Shall I use the old methods functionality
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   758
or instead create a dummy trap method for it ?
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   759
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   760
Hint:
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   761
  if that method is needed by the system, you better leave the
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   762
  original functionality in the system.
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   763
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   764
Close this warnBox to abort the compilation.
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
   765
'
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   766
                                     yesLabel:'trap code'
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   767
                                     noLabel:'keep old'.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   768
                        answer isNil ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   769
                            ^ #Error
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   770
                        ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   771
                        answer == false ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   772
                            newMethod code:(oldMethod code).
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   773
                            keptOldCode := true.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   774
                        ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   775
                    ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   776
                    aClass addSelector:sel withMethod:newMethod
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   777
                ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   778
                Transcript show:'*** '.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   779
                sel notNil ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   780
                    Transcript show:(sel ,' ')
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   781
                ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   782
                keptOldCode ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   783
                    msg := 'not really compiled - method still shows previous behavior'.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   784
                ] ifFalse:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   785
                    msg := 'not compiled to machine code - created a stub instead.'.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   786
                ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   787
                Transcript showCR:msg.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   788
            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   789
            ^ newMethod
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   790
        ].
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   791
    ].
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   792
726
9f9ca909fc5e fixed stc-compilation==#never case.
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
   793
    compiler hasNonOptionalPrimitiveCode ifTrue:[
1046
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   794
        "/
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   795
        "/ generate a trapping method, if primitive code is present
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   796
        "/
1049
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   797
        NewPrimitives ~~ true ifTrue:[
1046
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   798
            newMethod := compiler trappingStubMethodFor:aString inCategory:cat.
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   799
            install ifTrue:[
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   800
                aClass addSelector:sel withMethod:newMethod.
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   801
            ].
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   802
            Transcript show:'*** '.
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   803
            sel notNil ifTrue:[
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   804
                Transcript show:(sel ,' ')
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   805
            ].
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   806
            Transcript showCR:'not compiled to machine code - created a stub instead.'.
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   807
            ^ newMethod
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   808
        ].
726
9f9ca909fc5e fixed stc-compilation==#never case.
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
   809
    ].
9f9ca909fc5e fixed stc-compilation==#never case.
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
   810
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   811
    "
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   812
     EXPERIMENTAL: quick loading
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   813
     only create a lazyMethod, which has no byteCode and will 
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   814
     compile itself when first called.
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   815
    "
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   816
    lazy ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   817
        newMethod := LazyMethod new.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   818
        (ClassCategoryReader sourceMode == #sourceReference) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   819
            sourceFile := ObjectMemory nameForSources.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   820
            sourceFile notNil ifTrue:[    
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   821
                sourceStream := sourceFile asFilename appendingWriteStream.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   822
            ]
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   823
        ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   824
        sourceStream isNil ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   825
            newMethod source:aString string.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   826
        ] ifFalse:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   827
            sourceStream setToEnd.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   828
            pos := sourceStream position.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   829
            sourceStream nextChunkPut:aString.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   830
            sourceStream close.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   831
            newMethod sourceFilename:sourceFile position:pos.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   832
        ].
1117
f03c007dadc6 methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   833
        newMethod setCategory:cat.
1054
035067e8b90f package of lazy methods
Claus Gittinger <cg@exept.de>
parents: 1051
diff changeset
   834
pkg := aClass  package.
035067e8b90f package of lazy methods
Claus Gittinger <cg@exept.de>
parents: 1051
diff changeset
   835
"/        aClass owningClass isNil ifTrue:[
035067e8b90f package of lazy methods
Claus Gittinger <cg@exept.de>
parents: 1051
diff changeset
   836
"/            pkg := Class packageQuerySignal query.
035067e8b90f package of lazy methods
Claus Gittinger <cg@exept.de>
parents: 1051
diff changeset
   837
"/        ] ifFalse:[
035067e8b90f package of lazy methods
Claus Gittinger <cg@exept.de>
parents: 1051
diff changeset
   838
"/            pkg := aClass owningClass package
035067e8b90f package of lazy methods
Claus Gittinger <cg@exept.de>
parents: 1051
diff changeset
   839
"/        ].
1117
f03c007dadc6 methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   840
        newMethod setPackage:pkg.
415
16ff7a17c08b fixes for packageQuery
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
   841
"/        Project notNil ifTrue:[
16ff7a17c08b fixes for packageQuery
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
   842
"/            newMethod package:(Project currentPackageName)
16ff7a17c08b fixes for packageQuery
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
   843
"/        ].
1013
148bbb9214a2 must set numArgs of lazyMethods.
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
   844
        newMethod numberOfArgs:sel numArgs.
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   845
        aClass addSelector:sel withLazyMethod:newMethod.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   846
        ^ newMethod
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   847
    ].
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   848
1047
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   849
    primNr := compiler primitiveNumber.
1049
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   850
    ((NewPrimitives == true) or:[primNr isNil]) ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   851
        "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   852
         produce symbolic code first
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   853
        "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   854
        symbolicCodeArray := compiler genSymbolicCode.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   855
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   856
        (symbolicCodeArray == #Error) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   857
            Transcript show:'    '.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   858
            sel notNil ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   859
                Transcript show:(sel ,' ')
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   860
            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   861
            Transcript showCR:'translation error'.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   862
            ^ #Error
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   863
        ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   864
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   865
        "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   866
         take this, producing bytecode 
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   867
         (someone willin' to make machine code :-)
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   868
        "
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   869
        ((compiler genByteCodeFrom:symbolicCodeArray) == #Error) ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   870
            Transcript show:'    '.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   871
             sel notNil ifTrue:[
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   872
                Transcript show:(sel ,' ')
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   873
            ].
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   874
            Transcript showCR:'relocation error - must be simplified'.
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   875
            ^ #Error
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   876
        ].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   877
    ].
7ad01559b262 Initial revision
claus
parents:
diff changeset
   878
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   879
    "
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   880
     finally create the new method-object
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   881
    "
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   882
    newMethod := compiler createMethod.
1049
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   883
    NewPrimitives == true ifTrue:[
1047
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   884
        newMethod byteCode:(compiler code).
1051
ad0f2dc7a33b rel5 migration
Claus Gittinger <cg@exept.de>
parents: 1050
diff changeset
   885
        primNr isNil ifTrue:[
ad0f2dc7a33b rel5 migration
Claus Gittinger <cg@exept.de>
parents: 1050
diff changeset
   886
            compiler hasNonOptionalPrimitiveCode ifTrue:[
ad0f2dc7a33b rel5 migration
Claus Gittinger <cg@exept.de>
parents: 1050
diff changeset
   887
                primNr := 0.
ad0f2dc7a33b rel5 migration
Claus Gittinger <cg@exept.de>
parents: 1050
diff changeset
   888
            ]
ad0f2dc7a33b rel5 migration
Claus Gittinger <cg@exept.de>
parents: 1050
diff changeset
   889
        ].
1047
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   890
        primNr notNil ifTrue:[
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   891
            newMethod setPrimitiveNumber:primNr
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   892
        ]
78
e320344c19b7 *** empty log message ***
claus
parents: 76
diff changeset
   893
    ] ifFalse:[
1047
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   894
        primNr notNil ifTrue:[
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   895
            newMethod code:(compiler checkForPrimitiveCode:primNr).
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   896
        ] ifFalse:[
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   897
            newMethod byteCode:(compiler code).
d0b95ceaffe3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   898
        ].
78
e320344c19b7 *** empty log message ***
claus
parents: 76
diff changeset
   899
    ].
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   900
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   901
    "
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   902
     if there where any corrections, install the updated source
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   903
    "
90
claus
parents: 85
diff changeset
   904
    (newSource := compiler correctedSource) notNil ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   905
        newMethod source:newSource string
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   906
    ] ifFalse:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   907
        newMethod source:aString string.
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   908
    ].
1117
f03c007dadc6 methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   909
    newMethod setCategory:cat.
974
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   910
    aClass owningClass isNil ifTrue:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   911
        pkg := Class packageQuerySignal query.
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   912
    ] ifFalse:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   913
        pkg := aClass owningClass package
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   914
    ].
1117
f03c007dadc6 methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
   915
    newMethod setPackage:pkg.
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   916
935
79690af8ffbd pass down returnable-context flag via method.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   917
    (compiler contextMustBeReturnable) ifTrue:[
79690af8ffbd pass down returnable-context flag via method.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   918
        newMethod contextMustBeReturnable:true
79690af8ffbd pass down returnable-context flag via method.
Claus Gittinger <cg@exept.de>
parents: 933
diff changeset
   919
    ].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   920
    install ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   921
        aClass addSelector:sel withMethod:newMethod
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   922
    ].
7ad01559b262 Initial revision
claus
parents:
diff changeset
   923
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   924
    silencio ifFalse:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   925
        Transcript showCR:('    compiled: ', aClass name,' ', sel)
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   926
    ].
7ad01559b262 Initial revision
claus
parents:
diff changeset
   927
7ad01559b262 Initial revision
claus
parents:
diff changeset
   928
    ^ newMethod
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   929
649
06675201ca18 name the class/selector in the compilation-failed-dialog.
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   930
    "Created: / 29.10.1995 / 19:59:36 / cg"
726
9f9ca909fc5e fixed stc-compilation==#never case.
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
   931
    "Modified: / 13.6.1998 / 13:51:31 / cg"
833
740fd0e90414 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 831
diff changeset
   932
    "Modified: / 19.3.1999 / 08:31:09 / stefan"
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   933
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   934
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   935
compile:methodText forClass:classToCompileFor notifying:requestor
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   936
    "compile a source-string for a method in classToCompileFor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   937
     Errors are forwarded to requestor.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   938
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   939
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   940
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   941
        compile:methodText
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   942
        forClass:classToCompileFor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   943
        inCategory:'others'
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   944
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   945
        install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   946
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   947
        silent:false
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   948
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   949
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   950
compile:textOrStream in:aClass notifying:requestor ifFail:exceptionBlock
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   951
    "name alias for ST-80 compatibility.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   952
     Returns the new method, #Error or nil."
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   953
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   954
    |m|
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   955
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   956
    m := self 
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   957
           compile:textOrStream
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   958
           forClass:aClass 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   959
           inCategory:'others'
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   960
           notifying:requestor 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   961
           install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   962
           skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   963
           silent:false.
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   964
    m == #Error ifTrue:[
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   965
        ^ exceptionBlock value
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   966
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   967
     ^ m
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   968
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   969
! !
7ad01559b262 Initial revision
claus
parents:
diff changeset
   970
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   971
!ByteCodeCompiler class methodsFor:'constants'!
15
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   972
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   973
byteCodeFor:aSymbol
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   974
    "returns the numeric code for some symbolic bytecodes."
15
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   975
25
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   976
    (aSymbol == #retNil) ifTrue:[^ 1].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   977
    (aSymbol == #retTrue) ifTrue:[^ 2].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   978
    (aSymbol == #retFalse) ifTrue:[^ 3].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   979
    (aSymbol == #ret0) ifTrue:[^ 4].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   980
    (aSymbol == #retTop) ifTrue:[^ 0].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   981
15
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   982
    (aSymbol == #push0) ifTrue:[^120].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   983
    (aSymbol == #push1) ifTrue:[^121].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   984
    (aSymbol == #push2) ifTrue:[^139].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   985
    (aSymbol == #pushMinus1) ifTrue:[^122].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   986
    (aSymbol == #pushNil) ifTrue:[^ 10].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   987
    (aSymbol == #pushTrue) ifTrue:[^ 11].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   988
    (aSymbol == #pushFalse) ifTrue:[^ 12].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   989
    (aSymbol == #pushSelf) ifTrue:[^ 15].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   990
    self error
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   991
! !
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   992
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   993
!ByteCodeCompiler class methodsFor:'stc compilation defaults'!
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   994
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   995
canCreateMachineCode
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   996
    "return true, if compilation to machine code is supported.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   997
     Currently, all SYSV4 and Linux systems do so;
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
   998
     REAL/IX and HPUX9.x do not (due to the need for dynamic loading 
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   999
     of object files, which is not supported by those).
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1000
     MIPS ULTRIX is almost finished, but not yet released.
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1001
     (late note - we no longer care for mips-ultrix)
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1002
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1003
     However, if no stc compiler is around (i.e. the demo distribution),
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1004
     there is no chance ..."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1005
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1006
    ObjectFileLoader isNil ifTrue:[^ false].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1007
    ObjectFileLoader canLoadObjectFiles ifFalse:[^ false].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1008
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1009
    "/ no chance, if no stc is available
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1010
    ^ self incrementalStcPath notNil
124
claus
parents: 120
diff changeset
  1011
claus
parents: 120
diff changeset
  1012
    "
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1013
     Compiler canCreateMachineCode     
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1014
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1015
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1016
    "Modified: / 13.9.1995 / 15:15:11 / claus"
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1017
    "Modified: / 3.9.1998 / 15:56:07 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1018
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1019
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1020
ccCompilationOptions
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1021
    "return the options used with cc compilation"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1022
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1023
    CCCompilationOptions isNil ifTrue:[^ ''].
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1024
    ^ CCCompilationOptions
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1025
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1026
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1027
     Compiler ccCompilationOptions
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1028
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1029
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1030
    "Modified: 5.11.1996 / 17:38:56 / cg"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1031
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1032
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1033
ccCompilationOptions:aString
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1034
    "define the compilation options 
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1035
     to be used when compiling to machine code.
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1036
     These are passed to cc. Can be set from your private.rc file."
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1037
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1038
    CCCompilationOptions := aString
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1039
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1040
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1041
     Compiler ccCompilationOptions:'-O'
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1042
     Compiler ccCompilationOptions:'-O -fPIC'
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1043
     Compiler ccCompilationOptions
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1044
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1045
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1046
    "Created: 5.11.1996 / 17:37:05 / cg"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1047
    "Modified: 5.11.1996 / 17:38:32 / cg"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1048
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1049
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1050
ccPath 
768
07fcee0355e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  1051
    "return the path to (name of) the cc command for incremental method compilation"
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1052
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1053
    CC isNil ifTrue:[
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1054
        OperatingSystem isMSDOSlike ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1055
            OperatingSystem getCCDefine = '__BORLANDC__' ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1056
                ^'bcc32'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1057
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1058
            ^'cl'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1059
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1060
        OperatingSystem getCCDefine = '__GNUC__' ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1061
            ^'gcc'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1062
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1063
        ^ 'cc'
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1064
    ].
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1065
    ^ CC
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1066
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1067
    "
772
bd6fcf9e44e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
  1068
     CC := nil
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1069
     Compiler ccPath     
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1070
     Compiler ccPath:'gcc'     
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1071
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1072
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1073
    "Modified: / 13.9.1995 / 15:15:04 / claus"
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  1074
    "Created: / 5.11.1996 / 17:35:40 / cg"
772
bd6fcf9e44e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
  1075
    "Modified: / 4.9.1998 / 15:48:40 / cg"
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1076
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1077
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1078
ccPath:aPathOrCommandName 
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1079
    "set the path to the cc command for incremental method compilation"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1080
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1081
    CC := aPathOrCommandName
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1082
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1083
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1084
     Compiler ccPath     
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1085
     Compiler ccPath:'gcc'     
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1086
     Compiler ccPath:'bcc32'     
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1087
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1088
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1089
    "Modified: / 13.9.1995 / 15:15:04 / claus"
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1090
    "Created: / 5.11.1996 / 17:38:11 / cg"
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1091
    "Modified: / 23.8.1998 / 13:58:57 / cg"
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1092
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  1093
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1094
incrementalStcPath 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1095
    "return the path to the stc command for incremental method compilation, 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1096
     or nil if not found."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1097
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1098
    |f|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1099
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1100
    STC notNil ifTrue:[
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1101
	^ STC
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1102
    ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1103
    (f := self stcPathOf:'stc') notNil ifTrue:[^ f].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1104
    ^ self stcPathOf:'demostc'
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1105
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1106
    "
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1107
     Compiler stcPath:'../../stc/stc'
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1108
     Compiler incrementalStcPath     
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1109
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1110
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1111
    "Created: 13.9.1995 / 14:36:36 / claus"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1112
    "Modified: 13.9.1995 / 15:15:04 / claus"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1113
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1114
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1115
stcCompilation
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1116
    "return the flag which controls compilation to machine code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1117
     If #always, methods are always compiled to machine code (which takes
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1118
     longer, but provides faster code). If #none, methods are never compiled
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1119
     to machine code, instead for non-primitive ones, compilation is to bytecode
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1120
     and for primitive ones, a trapping stub is generated.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1121
     Anything else lets the compiler compile to bytecode,
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1122
     except for methods containing primitive code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1123
     This can be set from your private.rc file or from a workspace
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1124
     for selective compilation to machine code."
124
claus
parents: 120
diff changeset
  1125
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1126
    ^ STCCompilation
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1127
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1128
    "
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1129
     Compiler stcCompilation
124
claus
parents: 120
diff changeset
  1130
    "
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1131
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1132
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1133
stcCompilation:how
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1134
    "set the flag which controls compilation to machine code.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1135
     If #always, methods are always compiled to machine code (which takes
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1136
     longer, but provides faster code). If #none, methods are never compiled
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1137
     to machine code, instead for non-primitive ones, compilation is to bytecode
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1138
     and for primitive ones, a trapping stub is generated.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1139
     Anything else lets the compiler compile to bytecode,
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1140
     except for methods containing primitive code.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1141
     This can be set from your private.rc file or from a workspace
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1142
     for selective compilation to machine code."
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1143
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1144
    |ret|
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1145
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1146
    ret := STCCompilation.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1147
    STCCompilation := how.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1148
    ^ ret
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1149
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1150
    "
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1151
     Compiler stcCompilation:#always
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1152
     Compiler stcCompilation:#never 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1153
     Compiler stcCompilation:#default 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1154
    "
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1155
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1156
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1157
stcCompilationDefines
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1158
    "return the defines used with stc compilation"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1159
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1160
    ^ STCCompilationDefines
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1161
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1162
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1163
stcCompilationDefines:aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1164
    "define the flags (for example, additional -D defines)
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1165
     to be used when compiling to machine code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1166
     These are passed to stc. Can be set from your private.rc file."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1167
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1168
    STCCompilationDefines := aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1169
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1170
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1171
     Compiler stcCompilationDefines:'-DVGL -DDEBUG'
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1172
     Compiler stcCompilationDefines:'-DWIN32'
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1173
    "
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1174
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1175
    "Modified: / 23.8.1998 / 14:00:40 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1176
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1177
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1178
stcCompilationIncludes
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1179
    "return the includes used with stc compilation"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1180
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1181
    ^ STCCompilationIncludes
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1182
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1183
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1184
stcCompilationIncludes:aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1185
    "define the include directories via additional -I flags.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1186
     These are passed to stc. Can be set in your private.rc file"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1187
586
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1188
    |libDir incDir|
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1189
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1190
    STCCompilationIncludes := aString.
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1191
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1192
    "/ if STX_LIBDIR is defined, and not in passed argument,
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1193
    "/ add it here.
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1194
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1195
    libDir := OperatingSystem getEnvironment:'STX_LIBDIR'.
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1196
    (libDir notNil and:[libDir asFilename exists]) ifTrue:[
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1197
	incDir := libDir asFilename construct:'include'.
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1198
	incDir exists ifTrue:[
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1199
	    (STCCompilationIncludes asCollectionOfWords includes:('-I' , incDir pathName)) ifFalse:[
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1200
		STCCompilationIncludes := aString , ' ' , ('-I' , incDir pathName).
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1201
	    ]
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1202
	]
586
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1203
    ]
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1204
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1205
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1206
     Compiler stcCompilationIncludes:'-I/usr/local/include -I../../include'
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1207
     Compiler stcCompilationIncludes:(Compiler stcCompilationIncludes , ' -I../../libxt')
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1208
    "
586
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1209
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
  1210
    "Modified: 18.7.1997 / 18:04:25 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1211
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1212
124
claus
parents: 120
diff changeset
  1213
stcCompilationOptions
claus
parents: 120
diff changeset
  1214
    "return the options used with stc compilation"
claus
parents: 120
diff changeset
  1215
claus
parents: 120
diff changeset
  1216
    ^ STCCompilationOptions
claus
parents: 120
diff changeset
  1217
!
claus
parents: 120
diff changeset
  1218
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1219
stcCompilationOptions:aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1220
    "define the compilation options 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1221
     to be used when compiling to machine code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1222
     These are passed to stc. Can be set from your private.rc file."
101
claus
parents: 98
diff changeset
  1223
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1224
    STCCompilationOptions := aString
101
claus
parents: 98
diff changeset
  1225
claus
parents: 98
diff changeset
  1226
    "
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1227
     Compiler stcCompilationOptions:'+optinline'
101
claus
parents: 98
diff changeset
  1228
    "
claus
parents: 98
diff changeset
  1229
!
claus
parents: 98
diff changeset
  1230
301
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1231
stcModulePath
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1232
    "return the path, where temporary modules are created"
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1233
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1234
    ^ STCModulePath
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1235
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1236
    "Created: 12.7.1996 / 12:15:26 / cg"
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1237
!
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1238
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1239
stcModulePath:aPath
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1240
    "set the path to the directory, where temporary modules are created"
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1241
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1242
    STCModulePath := aPath
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1243
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1244
    "Created: 12.7.1996 / 12:15:49 / cg"
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1245
!
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  1246
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1247
stcPath 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1248
    "return the path to the stc command, or nil if not found."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1249
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1250
    ^ STC ? (self stcPathOf:'stc')
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1251
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1252
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1253
     Compiler stcPath     
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1254
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1255
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1256
    "Modified: 13.9.1995 / 14:37:26 / claus"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1257
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1258
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1259
stcPath:aPath 
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1260
    "set the path to the stc command - useful if private stc is wanted"
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1261
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1262
    STC := aPath
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1263
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1264
    "
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1265
     Compiler stcPath:'../../stc/stc'     
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1266
     Compiler stcPath:'..\stc\stc'     
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1267
    "
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1268
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1269
    "Modified: / 13.9.1995 / 14:37:26 / claus"
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
  1270
    "Modified: / 23.8.1998 / 13:59:24 / cg"
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1271
!
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1272
120
claus
parents: 118
diff changeset
  1273
stcPathOf:command 
claus
parents: 118
diff changeset
  1274
    "return the path to an stc command, or nil if not found."
101
claus
parents: 98
diff changeset
  1275
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1276
    |f d reqdSuffix cmd|
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1277
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1278
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1279
    "/ care for executable suffix
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1280
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1281
    cmd := command.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1282
    OperatingSystem isMSDOSlike ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1283
	reqdSuffix := 'exe'
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1284
    ] ifFalse:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1285
	OperatingSystem isVMSlike ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1286
	    reqdSuffix := 'EXE'
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1287
	].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1288
    ].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1289
    reqdSuffix notNil ifTrue:[
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
  1290
	(f := cmd asFilename) suffix isEmpty ifTrue:[
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
  1291
	    cmd := (f withSuffix:reqdSuffix) name
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1292
	]
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1293
    ].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1294
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1295
    "/ for our convenience, also check in current
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1296
    "/ and parent directories; even if PATH does not
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1297
    "/ include them ...
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1298
    "/
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
  1299
    "/ look in current ...
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1300
    d := Filename currentDirectory.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1301
    (f := d construct:cmd) isExecutable ifTrue:[
101
claus
parents: 98
diff changeset
  1302
	^ f pathName
claus
parents: 98
diff changeset
  1303
    ].
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
  1304
    "/ look in ../stc ...
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1305
    d := d construct:'..'.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1306
    (f := (d construct:'stc') construct:cmd) isExecutable ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1307
	^ f pathName
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1308
    ].
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
  1309
    "/ look in ../../stc ...
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1310
    d := d construct:'..'.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1311
    (f := (d construct:'stc') construct:cmd) isExecutable ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1312
	^ f pathName
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1313
    ].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1314
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1315
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1316
    "/ ok, stc must be installed in some directory along the PATH
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
  1317
    "/
126
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
  1318
    ^ OperatingSystem pathOfCommand:command
97
claus
parents: 96
diff changeset
  1319
claus
parents: 96
diff changeset
  1320
    "
120
claus
parents: 118
diff changeset
  1321
     Compiler stcPathOf:'stc'     
claus
parents: 118
diff changeset
  1322
    "
claus
parents: 118
diff changeset
  1323
claus
parents: 118
diff changeset
  1324
    "Created: 13.9.1995 / 14:37:16 / claus"
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1325
! !
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1326
1021
7362dd1ebe9d category renamining
Claus Gittinger <cg@exept.de>
parents: 1013
diff changeset
  1327
!ByteCodeCompiler methodsFor:'Compatibility - ST80'!
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1328
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1329
compile:textOrStream in:aClass notifying:requestor ifFail:exceptionBlock
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1330
    "name alias for ST-80 compatibility"
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1331
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1332
    ^ self class
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1333
		compile:textOrStream
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1334
		in:aClass 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1335
		notifying:requestor 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1336
		ifFail:exceptionBlock
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1337
"/    |m|
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1338
"/
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1339
"/    m := self class 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1340
"/                compile:textOrStream 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1341
"/                forClass:aClass 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1342
"/                inCategory:'no category'
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1343
"/                notifying:requestor
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1344
"/                install:true 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1345
"/                skipIfSame:false
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1346
"/                silent:false.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1347
"/    m == #Error ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1348
"/        ^ exceptionBlock value
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1349
"/    ].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1350
"/     ^ m
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1351
! !
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1352
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1353
!ByteCodeCompiler methodsFor:'accessing'!
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1354
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1355
code
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
  1356
    "return the bytecode array - only valid after code-generation"
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1357
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1358
    ^ codeBytes
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1359
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1360
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1361
literalArray
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1362
    "return the literal array - only valid after parsing"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1363
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1364
    ^ litArray
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1365
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1366
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1367
maxStackDepth
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1368
    "return the stack-need of the method - only valid after code-generation"
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1369
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1370
    ^ maxStackDepth
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1371
!
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1372
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1373
methodClass
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1374
    ^ methodClass ? Method
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1375
!
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1376
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1377
methodClass:aClass
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1378
    methodClass := aClass
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1379
! !
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1380
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1381
!ByteCodeCompiler methodsFor:'code generation'!
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1382
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1383
absJumpFromJump:code
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1384
    "given a jump-symbolic code, return corresponding absolute jump"
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1385
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1386
    JumpToAbsJump isNil ifTrue:[
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1387
	JumpToAbsJump := IdentityDictionary new.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1388
	JumpToAbsJump at:#jump put:#jumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1389
	JumpToAbsJump at:#trueJump put:#trueJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1390
	JumpToAbsJump at:#falseJump put:#falseJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1391
	JumpToAbsJump at:#nilJump put:#nilJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1392
	JumpToAbsJump at:#notNilJump put:#notNilJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1393
	JumpToAbsJump at:#eqJump put:#eqJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1394
	JumpToAbsJump at:#notEqJump put:#notEqJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1395
	JumpToAbsJump at:#zeroJump put:#zeroJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1396
	JumpToAbsJump at:#notZeroJump put:#notZeroJumpabs.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1397
	JumpToAbsJump at:#makeBlock put:#makeBlockabs.
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1398
    ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1399
    ^ JumpToAbsJump at:code
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1400
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1401
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1402
addLiteral:anObject
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1403
    "add a literal to the literalArray - watch for and eliminate
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1404
     duplicates. return the index of the literal in the Array"
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1405
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1406
    |index "{ Class: SmallInteger }" class|
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1407
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1408
    litArray isNil ifTrue:[
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1409
	litArray := Array with:anObject.
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1410
	^ 1
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1411
    ].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1412
    index := litArray identityIndexOf:anObject.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1413
    (index == 0) ifTrue:[
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1414
	"
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1415
	 reuse constants if same value and same class
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1416
	"
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1417
	class := anObject class.
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1418
	((class == Float) 
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1419
	or:[class == Fraction
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1420
	or:[class == LargeInteger
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1421
	"or:[class == String] --only if literalString option has been added---" ]]) ifTrue:[
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1422
	    index := litArray indexOf:anObject.
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1423
	].
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1424
	((index == 0) or:[(litArray at:index) class ~~ class]) ifTrue:[
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1425
	    litArray := litArray copyWith:anObject.
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1426
	    ^ litArray size
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1427
	].
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1428
    ].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1429
    ^ index
632
0bf7c96b846b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 631
diff changeset
  1430
0bf7c96b846b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 631
diff changeset
  1431
    "Modified: / 12.11.1997 / 18:49:43 / cg"
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1432
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1433
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1434
addReloc:symIndex
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1435
    "remember to relocate offset at symIndex later ..."
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
  1436
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1437
    relocList isNil ifTrue:[
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1438
	relocList := OrderedCollection new.
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1439
    ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1440
    relocList add:symIndex
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1441
!
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1442
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1443
appendByte:aByte
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1444
    "append a byte to the code-Array, checking for byte-range (debug-only)"
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1445
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1446
    |idx "{Class: SmallInteger }"|
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1447
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1448
    idx := codeIndex.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1449
    (aByte between:0 and:255) ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1450
	codeBytes at:idx put:aByte.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1451
	codeIndex := idx + 1
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1452
    ] ifFalse:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1453
	self error:'byte range error'.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1454
	errorFlag := #Error
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1455
    ]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1456
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1457
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1458
appendByteCodeFor:codeSymbol
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1459
    "append the byteCode for an instructionSymbol to the code-Array"
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1460
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1461
    |idx "{Class: SmallInteger }"|
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1462
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1463
    idx := codeIndex.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1464
    codeBytes at:idx put:(self byteCodeFor:codeSymbol).
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1465
    codeIndex := idx + 1
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1466
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1467
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1468
appendEmptyByte
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1469
    "append an empty byte to the code-Array"
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
  1470
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1471
    |idx "{Class: SmallInteger }"|
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
  1472
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1473
    idx := codeIndex.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1474
    codeBytes at:idx put:0.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1475
    codeIndex := idx + 1
45
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1476
!
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1477
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1478
appendEmptyLong
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1479
    "append an empty long (4 bytes) to the code-Array"
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1480
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1481
    |idx "{Class: SmallInteger }"|
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1482
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1483
    idx := codeIndex.
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1484
    codeBytes at:idx put:0.
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1485
    codeBytes at:idx+1 put:0.
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1486
    codeBytes at:idx+2 put:0.
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1487
    codeBytes at:idx+3 put:0.
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1488
    codeIndex := idx + 4
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1489
!
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1490
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1491
appendEmptyShort
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1492
    "append an empty short (2 bytes) to the code-Array"
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1493
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1494
    |idx "{Class: SmallInteger }"|
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1495
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1496
    idx := codeIndex.
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1497
    codeBytes at:idx put:0.
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1498
    codeBytes at:idx+1 put:0.
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1499
    codeIndex := idx + 2
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1500
!
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1501
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1502
appendSignedByte:aByte
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1503
    "append a signedbyte (as in jump-offsets) to the code-Array,
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1504
     check range and report an error if invalid"
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1505
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1506
    |b   "{Class: SmallInteger }" 
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1507
     idx "{Class: SmallInteger }"|
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1508
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1509
    idx := codeIndex.
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1510
    b := aByte.
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1511
    (b >= 0) ifTrue:[
45
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1512
	(b > 127) ifTrue:[
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1513
	    self error:'jump-range error'.
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1514
	    errorFlag := #Error
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1515
	].
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1516
	codeBytes at:idx put:b
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1517
    ] ifFalse:[
45
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1518
	(b < -128) ifTrue:[
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1519
	    self error:'jump-range error'.
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1520
	    errorFlag := #Error
e8331ba8ad5d *** empty log message ***
claus
parents: 39
diff changeset
  1521
	].
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1522
	b := 256 + b
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1523
    ].
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1524
    codeBytes at:idx put:b.
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1525
    codeIndex := idx + 1
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1526
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1527
46
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1528
appendSignedWord:aWord
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1529
    "append a signed word to the code-Array,
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1530
     check range and report an error if invalid"
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1531
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1532
    |w   "{Class: SmallInteger }"|
46
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1533
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1534
    w := aWord.
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1535
    (w >= 0) ifTrue:[
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1536
	(w > 16r7FFFF) ifTrue:[
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1537
	    self error:'word-range error'.
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1538
	    errorFlag := #Error
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1539
	].
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1540
    ] ifFalse:[
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1541
	(w < 16r-8000) ifTrue:[
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1542
	    self error:'word-range error'.
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1543
	    errorFlag := #Error
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1544
	].
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1545
	w := (16r10000 + w).
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1546
    ].
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1547
    self appendWord:w
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1548
!
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1549
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1550
appendWord:aWord
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1551
    "append an unsigned word (low-high) to the code-Array, 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1552
     checking for word-range (debug-only)"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1553
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1554
    |idx "{Class: SmallInteger }"|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1555
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1556
    idx := codeIndex.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1557
    (aWord between:0 and:16rFFFF) ifTrue:[
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1558
	codeBytes at:idx put:(aWord bitAnd:16rFF).
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1559
	idx := idx + 1.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1560
	codeBytes at:idx put:(aWord bitShift:-8).
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1561
	codeIndex := idx + 1
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1562
    ] ifFalse:[
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1563
	self error:'word range error'.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1564
	errorFlag := #Error
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1565
    ]
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1566
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1567
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1568
byteCodeFor:aSymbol
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1569
    "given a symbolic instruction, return the corresponding bytecode.
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1570
     as a side-effect, leave number of bytes pushed/popped by this instr.
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1571
     in stackDelta, and, if the instruction needs extra arguments, leave
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1572
     this info in extra. Also lineno is set to true, if this code has line
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1573
     information and extraLiteral is set if any hidden send is performed by it."
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1574
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1575
    "standard bytecodes"
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1576
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1577
    (aSymbol == #pushNil) ifTrue:[stackDelta := 1. ^ 10].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1578
    (aSymbol == #pushTrue) ifTrue:[stackDelta := 1. ^ 11].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1579
    (aSymbol == #pushFalse) ifTrue:[stackDelta := 1. ^ 12].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1580
    (aSymbol == #pushLit) ifTrue:[stackDelta := 1. extra := #lit. ^ 14].
105
claus
parents: 104
diff changeset
  1581
    (aSymbol == #pushLitS) ifTrue:[stackDelta := 1. extra := #index. ^ 14].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1582
    (aSymbol == #pushSelf) ifTrue:[stackDelta := 1. ^ 15].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1583
    (aSymbol == #pushNum) ifTrue:[stackDelta := 1. extra := #number. ^ 16].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1584
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1585
    (aSymbol == #pushMethodArg) ifTrue:[stackDelta := 1. extra := #index. ^ 30].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1586
    (aSymbol == #pushMethodVar) ifTrue:[stackDelta := 1. extra := #index. ^ 31].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1587
    (aSymbol == #pushBlockArg) ifTrue:[stackDelta := 1. extra := #index. ^ 32].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1588
    (aSymbol == #pushBlockVar) ifTrue:[stackDelta := 1. extra := #index. ^ 33].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1589
    (aSymbol == #pushInstVar) ifTrue:[stackDelta := 1. extra := #index. ^ 34].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1590
    (aSymbol == #pushOuterBlockArg) ifTrue:[stackDelta := 1. extra := #indexLevel. ^ 42].
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1591
    (aSymbol == #pushOuterBlockVar) ifTrue:[stackDelta := 1. extra := #indexLevel. ^ 128].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1592
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1593
    (aSymbol == #retTop) ifTrue:[stackDelta := -1. ^ 0].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1594
    (aSymbol == #retSelf) ifTrue:[^5].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1595
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1596
    (aSymbol == #==) ifTrue:[stackDelta := -1. extraLiteral := aSymbol. ^ 45].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1597
    (aSymbol == #~~) ifTrue:[stackDelta := -1. extraLiteral := aSymbol. ^ 46].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1598
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1599
    (aSymbol == #falseJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 50].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1600
    (aSymbol == #trueJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 51].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1601
    (aSymbol == #nilJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 52].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1602
    (aSymbol == #notNilJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 53].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1603
    (aSymbol == #jump) ifTrue:[extra := #offset. ^ 54].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1604
    (aSymbol == #makeBlock) ifTrue:[stackDelta := 1. extra := #offsetNvarNarg. ^ 55].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1605
    (aSymbol == #zeroJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 56].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1606
    (aSymbol == #notZeroJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 57].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1607
    (aSymbol == #eqJump) ifTrue:[stackDelta := -2. extra := #offset. ^ 58].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1608
    (aSymbol == #notEqJump) ifTrue:[stackDelta := -2. extra := #offset. ^ 59].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1609
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1610
    (aSymbol == #lineno) ifTrue:[lineno := true. ^ 8].
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
  1611
    (aSymbol == #lineno16) ifTrue:[lineno := true. ^ 9].
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1612
106
claus
parents: 105
diff changeset
  1613
    (aSymbol == #send) ifTrue:[lineno := true. extra := #special. ^ 19].
claus
parents: 105
diff changeset
  1614
    (aSymbol == #superSend) ifTrue:[lineno := true. extra := #special. ^ 20].
claus
parents: 105
diff changeset
  1615
    (aSymbol == #hereSend) ifTrue:[lineno := true. extra := #special. ^ 20].
117
claus
parents: 111
diff changeset
  1616
    (aSymbol == #sendSelf) ifTrue:[lineno := true. extra := #special. ^ 13].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1617
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1618
    (aSymbol == #drop) ifTrue:[stackDelta := -1. ^ 18].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1619
    (aSymbol == #dup) ifTrue:[stackDelta := 1. ^ 47].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1620
117
claus
parents: 111
diff changeset
  1621
    (aSymbol == #storeMethodVar) ifTrue:[extra := #index. stackDelta := -1. ^ 37].
claus
parents: 111
diff changeset
  1622
    (aSymbol == #storeBlockVar) ifTrue:[extra := #index. stackDelta := -1. ^ 38].
claus
parents: 111
diff changeset
  1623
    (aSymbol == #storeInstVar) ifTrue:[extra := #index. stackDelta := -1. ^ 39].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1624
117
claus
parents: 111
diff changeset
  1625
    (aSymbol == #pushClassVarS) ifTrue:[stackDelta := 1. extra := #speciallitS. ^ 35].
356
bb3beb18de1f 6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
  1626
    (aSymbol == #pushGlobalS) ifTrue:[stackDelta := 1. extra := #speciallitS. ^ 36].
117
claus
parents: 111
diff changeset
  1627
claus
parents: 111
diff changeset
  1628
    (aSymbol == #storeClassVarS) ifTrue:[extra := #speciallitS.stackDelta := -1. ^ 40].
356
bb3beb18de1f 6empty slots in GLOBL/CLASSVAR bytecodes removed
Claus Gittinger <cg@exept.de>
parents: 350
diff changeset
  1629
    (aSymbol == #storeGlobalS) ifTrue:[extra := #speciallitS. stackDelta := -1. ^ 41].
247
fbb6e3b5764c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
  1630
    (aSymbol == #pushSpecialGlobal) ifTrue:[stackDelta := 1. extra := #index. ^ 200].
117
claus
parents: 111
diff changeset
  1631
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1632
    (aSymbol == #storeOuterBlockVar) ifTrue:[stackDelta := -1. extra := #indexLevel. ^ 129].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1633
117
claus
parents: 111
diff changeset
  1634
    (aSymbol == #pushClassInstVar) ifTrue:[stackDelta := 1. extra := #index. ^ 176].
claus
parents: 111
diff changeset
  1635
    (aSymbol == #storeClassInstVar) ifTrue:[extra := #index.stackDelta := -1. ^ 177].
105
claus
parents: 104
diff changeset
  1636
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1637
    "optimized bytecodes"
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1638
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1639
    (aSymbol == #retNil) ifTrue:[^ 1].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1640
    (aSymbol == #retTrue) ifTrue:[^ 2].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1641
    (aSymbol == #retFalse) ifTrue:[^ 3].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1642
    (aSymbol == #ret0) ifTrue:[^ 4].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1643
    (aSymbol == #retNum) ifTrue:[extra := #number. ^ 127].
25
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
  1644
    (aSymbol == #homeRetTop) ifTrue:[^ 7].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1645
46
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1646
    (aSymbol == #pushNum16) ifTrue:[stackDelta := 1. extra := #number16. ^ 17].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1647
    (aSymbol == #push0) ifTrue:[stackDelta := 1. ^120].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1648
    (aSymbol == #push1) ifTrue:[stackDelta := 1. ^121].
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
  1649
    (aSymbol == #push2) ifTrue:[stackDelta := 1. ^139].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1650
    (aSymbol == #pushMinus1) ifTrue:[stackDelta := 1. ^122].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1651
106
claus
parents: 105
diff changeset
  1652
    (aSymbol == #send0) ifTrue:[lineno := true. extra := #index. ^21].
claus
parents: 105
diff changeset
  1653
    (aSymbol == #send1) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^22].
claus
parents: 105
diff changeset
  1654
    (aSymbol == #send2) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^23].
claus
parents: 105
diff changeset
  1655
    (aSymbol == #send3) ifTrue:[lineno := true. extra := #index. stackDelta := -3. ^24].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1656
106
claus
parents: 105
diff changeset
  1657
    (aSymbol == #sendSelf0) ifTrue:[lineno := true. extra := #index. stackDelta := 1. ^180].
claus
parents: 105
diff changeset
  1658
    (aSymbol == #sendSelf1) ifTrue:[lineno := true. extra := #index. ^181].
claus
parents: 105
diff changeset
  1659
    (aSymbol == #sendSelf2) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^182].
claus
parents: 105
diff changeset
  1660
    (aSymbol == #sendSelf3) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^183].
claus
parents: 105
diff changeset
  1661
    (aSymbol == #sendSelfDrop0) ifTrue:[lineno := true. extra := #index. ^184].
claus
parents: 105
diff changeset
  1662
    (aSymbol == #sendSelfDrop1) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^185].
claus
parents: 105
diff changeset
  1663
    (aSymbol == #sendSelfDrop2) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^186].
claus
parents: 105
diff changeset
  1664
    (aSymbol == #sendSelfDrop3) ifTrue:[lineno := true. extra := #index. stackDelta := -3. ^187].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1665
106
claus
parents: 105
diff changeset
  1666
    (aSymbol == #sendDrop) ifTrue:[lineno := true. extra := #special. ^25].
claus
parents: 105
diff changeset
  1667
    (aSymbol == #sendDrop0) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^26].
claus
parents: 105
diff changeset
  1668
    (aSymbol == #sendDrop1) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^27].
claus
parents: 105
diff changeset
  1669
    (aSymbol == #sendDrop2) ifTrue:[lineno := true. extra := #index. stackDelta := -3. ^28].
claus
parents: 105
diff changeset
  1670
    (aSymbol == #sendDrop3) ifTrue:[lineno := true. extra := #index. stackDelta := -4. ^29].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1671
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1672
    (aSymbol == #pushMethodVar1) ifTrue:[stackDelta := 1. ^80].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1673
    (aSymbol == #pushMethodVar2) ifTrue:[stackDelta := 1. ^81].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1674
    (aSymbol == #pushMethodVar3) ifTrue:[stackDelta := 1. ^82].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1675
    (aSymbol == #pushMethodVar4) ifTrue:[stackDelta := 1. ^83].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1676
    (aSymbol == #pushMethodVar5) ifTrue:[stackDelta := 1. ^84].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1677
    (aSymbol == #pushMethodVar6) ifTrue:[stackDelta := 1. ^85].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1678
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1679
    (aSymbol == #pushMethodArg1) ifTrue:[stackDelta := 1. ^86].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1680
    (aSymbol == #pushMethodArg2) ifTrue:[stackDelta := 1. ^87].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1681
    (aSymbol == #pushMethodArg3) ifTrue:[stackDelta := 1. ^88].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1682
    (aSymbol == #pushMethodArg4) ifTrue:[stackDelta := 1. ^89].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1683
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1684
    (aSymbol == #pushInstVar1) ifTrue:[stackDelta := 1. ^90].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1685
    (aSymbol == #pushInstVar2) ifTrue:[stackDelta := 1. ^91].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1686
    (aSymbol == #pushInstVar3) ifTrue:[stackDelta := 1. ^92].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1687
    (aSymbol == #pushInstVar4) ifTrue:[stackDelta := 1. ^93].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1688
    (aSymbol == #pushInstVar5) ifTrue:[stackDelta := 1. ^94].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1689
    (aSymbol == #pushInstVar6) ifTrue:[stackDelta := 1. ^95].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1690
    (aSymbol == #pushInstVar7) ifTrue:[stackDelta := 1. ^96].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1691
    (aSymbol == #pushInstVar8) ifTrue:[stackDelta := 1. ^97].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1692
    (aSymbol == #pushInstVar9) ifTrue:[stackDelta := 1. ^98].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1693
    (aSymbol == #pushInstVar10) ifTrue:[stackDelta := 1. ^99].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1694
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1695
    (aSymbol == #storeMethodVar1) ifTrue:[stackDelta := -1. ^100].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1696
    (aSymbol == #storeMethodVar2) ifTrue:[stackDelta := -1. ^101].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1697
    (aSymbol == #storeMethodVar3) ifTrue:[stackDelta := -1. ^102].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1698
    (aSymbol == #storeMethodVar4) ifTrue:[stackDelta := -1. ^103].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1699
    (aSymbol == #storeMethodVar5) ifTrue:[stackDelta := -1. ^104].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1700
    (aSymbol == #storeMethodVar6) ifTrue:[stackDelta := -1. ^105].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1701
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1702
    (aSymbol == #storeInstVar1) ifTrue:[stackDelta := -1. ^110].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1703
    (aSymbol == #storeInstVar2) ifTrue:[stackDelta := -1. ^111].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1704
    (aSymbol == #storeInstVar3) ifTrue:[stackDelta := -1. ^112].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1705
    (aSymbol == #storeInstVar4) ifTrue:[stackDelta := -1. ^113].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1706
    (aSymbol == #storeInstVar5) ifTrue:[stackDelta := -1. ^114].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1707
    (aSymbol == #storeInstVar6) ifTrue:[stackDelta := -1. ^115].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1708
    (aSymbol == #storeInstVar7) ifTrue:[stackDelta := -1. ^116].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1709
    (aSymbol == #storeInstVar8) ifTrue:[stackDelta := -1. ^117].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1710
    (aSymbol == #storeInstVar9) ifTrue:[stackDelta := -1. ^118].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1711
    (aSymbol == #storeInstVar10) ifTrue:[stackDelta := -1. ^119].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1712
103
claus
parents: 102
diff changeset
  1713
    (aSymbol == #pushLit1) ifTrue:[stackDelta := 1. ^ 222].
claus
parents: 102
diff changeset
  1714
    (aSymbol == #pushLit2) ifTrue:[stackDelta := 1. ^ 223].
claus
parents: 102
diff changeset
  1715
    (aSymbol == #pushLit3) ifTrue:[stackDelta := 1. ^ 224].
claus
parents: 102
diff changeset
  1716
    (aSymbol == #pushLit4) ifTrue:[stackDelta := 1. ^ 225].
claus
parents: 102
diff changeset
  1717
    (aSymbol == #pushLit5) ifTrue:[stackDelta := 1. ^ 226].
claus
parents: 102
diff changeset
  1718
    (aSymbol == #pushLit6) ifTrue:[stackDelta := 1. ^ 227].
claus
parents: 102
diff changeset
  1719
    (aSymbol == #pushLit7) ifTrue:[stackDelta := 1. ^ 228].
claus
parents: 102
diff changeset
  1720
    (aSymbol == #pushLit8) ifTrue:[stackDelta := 1. ^ 229].
claus
parents: 102
diff changeset
  1721
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1722
    (aSymbol == #retMethodVar1) ifTrue:[^160].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1723
    (aSymbol == #retMethodVar2) ifTrue:[^161].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1724
    (aSymbol == #retMethodVar3) ifTrue:[^162].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1725
    (aSymbol == #retMethodVar4) ifTrue:[^163].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1726
    (aSymbol == #retMethodVar5) ifTrue:[^164].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1727
    (aSymbol == #retMethodVar6) ifTrue:[^165].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1728
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1729
    (aSymbol == #retInstVar1) ifTrue:[^166].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1730
    (aSymbol == #retInstVar2) ifTrue:[^167].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1731
    (aSymbol == #retInstVar3) ifTrue:[^168].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1732
    (aSymbol == #retInstVar4) ifTrue:[^169].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1733
    (aSymbol == #retInstVar5) ifTrue:[^170].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1734
    (aSymbol == #retInstVar6) ifTrue:[^171].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1735
    (aSymbol == #retInstVar7) ifTrue:[^172].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1736
    (aSymbol == #retInstVar8) ifTrue:[^173].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1737
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1738
    (aSymbol == #retMethodArg1) ifTrue:[^174].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1739
    (aSymbol == #retMethodArg2) ifTrue:[^175].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1740
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1741
    (aSymbol == #pushBlockArg1) ifTrue:[stackDelta := 1. ^140].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1742
    (aSymbol == #pushBlockArg2) ifTrue:[stackDelta := 1. ^141].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1743
    (aSymbol == #pushBlockArg3) ifTrue:[stackDelta := 1. ^142].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1744
    (aSymbol == #pushBlockArg4) ifTrue:[stackDelta := 1. ^143].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1745
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1746
    (aSymbol == #pushOuter1BlockArg) ifTrue:[stackDelta := 1. extra := #index. ^ 43].
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1747
    (aSymbol == #pushOuter2BlockArg) ifTrue:[stackDelta := 1. extra := #index. ^ 44].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1748
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1749
    (aSymbol == #=) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^130].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1750
    (aSymbol == #+) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^131].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1751
    (aSymbol == #~=) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^132].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1752
    (aSymbol == #-) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^133].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1753
    (aSymbol == #*) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^230].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1754
    (aSymbol == #class) ifTrue:[extraLiteral := aSymbol. ^134].
400
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1755
"/    (aSymbol == #x) ifTrue:[lineno := true. extraLiteral := aSymbol. ^106].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1756
"/    (aSymbol == #y) ifTrue:[lineno := true. extraLiteral := aSymbol. ^107].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1757
"/    (aSymbol == #width) ifTrue:[lineno := true. extraLiteral := aSymbol. ^108].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1758
"/    (aSymbol == #height) ifTrue:[lineno := true. extraLiteral := aSymbol. ^109].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1759
"/    (aSymbol == #origin) ifTrue:[lineno := true. extraLiteral := aSymbol. ^154].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1760
"/    (aSymbol == #extent) ifTrue:[lineno := true. extraLiteral := aSymbol. ^155].
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1761
    (aSymbol == #at:) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^135].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1762
    (aSymbol == #at:put:)ifTrue:[lineno := true. stackDelta := -2. extraLiteral := aSymbol. ^136].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1763
    (aSymbol == #bitAnd:) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^137].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1764
    (aSymbol == #bitOr:) ifTrue:[lineno := true. stackDelta := -1. extraLiteral := aSymbol. ^138].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1765
    (aSymbol == #plus1) ifTrue:[lineno := true. extraLiteral := #+. ^123].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1766
    (aSymbol == #minus1) ifTrue:[lineno := true. extraLiteral := #-. ^124].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1767
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1768
    (aSymbol == #incMethodVar) ifTrue:[lineno := true. extraLiteral := #+. extra := #index. ^125].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1769
    (aSymbol == #decMethodVar) ifTrue:[lineno := true. extraLiteral := #-. extra := #index. ^126].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1770
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1771
    (aSymbol == #eq0) ifTrue:[extraLiteral := #==. ^48].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1772
    (aSymbol == #ne0) ifTrue:[extraLiteral := #~~. ^49].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1773
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1774
    (aSymbol == #>) ifTrue:[lineno := true. extraLiteral := aSymbol. stackDelta := -1. ^ 145].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1775
    (aSymbol == #>=) ifTrue:[lineno := true. extraLiteral := aSymbol. stackDelta := -1. ^ 146].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1776
    (aSymbol == #<) ifTrue:[lineno := true. extraLiteral := aSymbol. stackDelta := -1. ^ 147].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1777
    (aSymbol == #<=) ifTrue:[lineno := true. extraLiteral := aSymbol. stackDelta := -1. ^ 148].
400
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1778
"/    (aSymbol == #next) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 149].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1779
"/    (aSymbol == #peek) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 150].
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1780
    (aSymbol == #value) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 151].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1781
    (aSymbol == #value:) ifTrue:[lineno := true. extraLiteral := aSymbol.  stackDelta := -1. ^ 152].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1782
    (aSymbol == #value:value:) ifTrue:[lineno := true. extraLiteral := aSymbol.  stackDelta := -2. ^ 178].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1783
    (aSymbol == #size) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 153].
400
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1784
"/    (aSymbol == #asInteger) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 158].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1785
"/    (aSymbol == #rounded) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 159].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1786
    (aSymbol == #mk0Block) ifTrue:[^ 156].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1787
    (aSymbol == #mkNilBlock) ifTrue:[^ 157].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1788
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1789
    (aSymbol == #gt0) ifTrue:[lineno := true. extraLiteral := #>. ^ 212].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1790
    (aSymbol == #pushgt0) ifTrue:[lineno := true. stackDelta := 1. extraLiteral := #>. ^ 208].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1791
    (aSymbol == #basicNew) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 211].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1792
    (aSymbol == #new) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 213].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1793
    (aSymbol == #basicNew:) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 214].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1794
    (aSymbol == #new:) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 215].
103
claus
parents: 102
diff changeset
  1795
217
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1796
    (aSymbol == #pushBlockVar1) ifTrue:[stackDelta := 1. ^ 232].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1797
    (aSymbol == #pushBlockVar2) ifTrue:[stackDelta := 1. ^ 233].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1798
    (aSymbol == #pushBlockVar3) ifTrue:[stackDelta := 1. ^ 234].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1799
    (aSymbol == #storeBlockVar1) ifTrue:[stackDelta := -1. ^ 235].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1800
    (aSymbol == #storeBlockVar2) ifTrue:[stackDelta := -1. ^ 236].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1801
    (aSymbol == #storeBlockVar3) ifTrue:[stackDelta := -1. ^ 237].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1802
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1803
    (aSymbol == #falseJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 190].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1804
    (aSymbol == #trueJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 191].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1805
    (aSymbol == #nilJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 192].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1806
    (aSymbol == #notNilJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 193].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1807
    (aSymbol == #jumpabs) ifTrue:[extra := #absoffset. ^ 194].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1808
    (aSymbol == #makeBlockabs) ifTrue:[stackDelta := 1. extra := #absoffsetNvarNarg. ^ 195].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1809
    (aSymbol == #zeroJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 196].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1810
    (aSymbol == #notZeroJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 197].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1811
    (aSymbol == #eqJumpabs) ifTrue:[stackDelta := -2. extra := #absoffset. ^ 198].
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1812
    (aSymbol == #notEqJumpabs) ifTrue:[stackDelta := -2. extra := #absoffset. ^ 199].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1813
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1814
    (aSymbol == #pushThisContext) ifTrue:[stackDelta := 1. ^ 144].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1815
425
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1816
    (aSymbol == #isNil) ifTrue:[extraLiteral := aSymbol. ^ 188].
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1817
    (aSymbol == #notNil) ifTrue:[extraLiteral := aSymbol. ^ 189].
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1818
    (aSymbol == #not) ifTrue:[extraLiteral := aSymbol. lineno := true. ^ 179].
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1819
    (aSymbol == #&) ifTrue:[extraLiteral := aSymbol. lineno := true. ^ 216].
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1820
    (aSymbol == #|) ifTrue:[extraLiteral := aSymbol. lineno := true. ^ 217].
76
55d64cb1ffea *** empty log message ***
claus
parents: 54
diff changeset
  1821
117
claus
parents: 111
diff changeset
  1822
    (aSymbol == #pushClassVarL) ifTrue:[stackDelta := 1. extra := #speciallitL. ^ 218].
claus
parents: 111
diff changeset
  1823
    (aSymbol == #pushGlobalL) ifTrue:[stackDelta := 1. extra := #speciallitL. ^ 218].
claus
parents: 111
diff changeset
  1824
    (aSymbol == #storeClassVarL) ifTrue:[extra := #speciallitL.stackDelta := -1. ^ 219].
claus
parents: 111
diff changeset
  1825
    (aSymbol == #storeGlobalL) ifTrue:[extra := #speciallitL. stackDelta := -1. ^ 219].
claus
parents: 111
diff changeset
  1826
    (aSymbol == #pushLitL) ifTrue:[stackDelta := 1. extra := #unsigned16. ^ 201].
claus
parents: 111
diff changeset
  1827
claus
parents: 111
diff changeset
  1828
    (aSymbol == #sendL) ifTrue:[lineno := true. extra := #specialL. ^ 205].
claus
parents: 111
diff changeset
  1829
    (aSymbol == #sendSelfL) ifTrue:[lineno := true. extra := #specialL. ^ 207].
claus
parents: 111
diff changeset
  1830
    (aSymbol == #sendDropL) ifTrue:[lineno := true. extra := #specialL. ^ 204].
claus
parents: 111
diff changeset
  1831
    (aSymbol == #superSendL) ifTrue:[lineno := true. extra := #specialL. ^ 206].
claus
parents: 111
diff changeset
  1832
    (aSymbol == #hereSendL) ifTrue:[lineno := true. extra := #specialL. ^ 206].
106
claus
parents: 105
diff changeset
  1833
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1834
    (aSymbol == #top) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1835
    (aSymbol == #bottom) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1836
    (aSymbol == #left) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1837
    (aSymbol == #right) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1838
400
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1839
    (aSymbol == #x) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1840
    (aSymbol == #y) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1841
    (aSymbol == #width) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1842
    (aSymbol == #height) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1843
    (aSymbol == #origin) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1844
    (aSymbol == #extent) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1845
    (aSymbol == #next) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1846
    (aSymbol == #peek) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1847
    (aSymbol == #asInteger) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1848
    (aSymbol == #rounded) ifTrue:[lineno := true. extraLiteral := aSymbol. extra := #specialSend. ^ 231].
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1849
217
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1850
    (aSymbol == #blockRef) ifTrue:[stackDelta := 0. ^ 238].
549
e403281da682 added #over code
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1851
    (aSymbol == #over) ifTrue:[stackDelta := 1. ^ 6].
217
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1852
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1853
    self error:'invalid code symbol'.
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1854
    errorFlag := #Error
117
claus
parents: 111
diff changeset
  1855
claus
parents: 111
diff changeset
  1856
    "Modified: 3.9.1995 / 12:58:47 / claus"
549
e403281da682 added #over code
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1857
    "Modified: 25.6.1997 / 11:47:26 / cg"
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1858
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1859
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1860
checkForCommonCode:symbolicCodeArray
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1861
    "hook to return the code for common code sequences.
212
ff39051e219f more constant folding options
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1862
     This reduces the in-memory number of byteArrays somewhat.
ff39051e219f more constant folding options
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1863
1095
8963fe0f984f comment
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
  1864
     Not yet fully implemented - just an idea ... there is certainly more to do here
212
ff39051e219f more constant folding options
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1865
     (does it make sense to scan all methods, collect code in a set and unify things
ff39051e219f more constant folding options
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1866
      automatically in the background - or upon request ?)"
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1867
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1868
    |sz insn1|
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1869
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1870
    (sz := symbolicCodeArray size) == 2 ifTrue:[
933
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1871
        "/
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1872
        "/ a very common sequence: return the first literal
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1873
        "/
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1874
        (insn1 := symbolicCodeArray at:1) == #pushLit1 ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1875
            (symbolicCodeArray at:2) == #retTop ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1876
                ^ #[222 0]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1877
            ]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1878
        ]
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1879
    ].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1880
    sz == 1 ifTrue:[
933
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1881
        "/
1095
8963fe0f984f comment
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
  1882
        "/ other common sequences: return the receiver, nil, true or false
933
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1883
        "/
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1884
        (insn1 := symbolicCodeArray at:1) == #retSelf ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1885
            ^ #[5]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1886
        ].
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1887
        insn1 == #retNil ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1888
            ^ #[1]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1889
        ].
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1890
        insn1 == #retTrue ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1891
            ^ #[2]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1892
        ].
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1893
        insn1 == #retFalse ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1894
            ^ #[3]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1895
        ].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1896
    ].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1897
    ^ nil
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1898
!
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1899
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1900
checkForPrimitiveCode:nr
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1901
    "return the code for an ST-80 primitive method.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1902
     Since many primitives available on ST-80 should also be available
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1903
     somewhere in ST/X, this may work for many primitive numbers.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1904
     However, more information is needed and more things to be added below.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1905
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1906
     This was added to allow emulation of (some) ST-80
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1907
     primitives (to fileIn RemoteInvocation & Monitor41 packages)"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1908
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1909
    |cls sel|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1910
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1911
    (nr == 75)  ifTrue:[ cls := Object. sel := #identityHash ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1912
    (nr == 110) ifTrue:[ cls := Object. sel := #==           ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1913
    (nr == 111) ifTrue:[ cls := Object. sel := #class        ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1914
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1915
     should add more here, to be able to fileIn ST-80 methods
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1916
     containing primitive calls (who gives me the numbers ... ?)
512
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1917
     mhmh - got some ..."
907
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1918
     "/ ST80:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1919
     "/
512
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1920
     "/           18 Number @
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1921
     "/           21 LargePositiveInteger +
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1922
     "/           22 LargePositiveInteger -
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1923
     "/           29 LargePositiveInteger *
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1924
     "/           30 LargePositiveInteger /
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1925
     "/           31 LargePositiveInteger \\ 
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1926
     "/           32 LargePositiveInteger // 
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1927
     "/           34 LargePositiveInteger bitAnd:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1928
     "/           35 LargePositiveInteger bitOr:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1929
     "/           36 LargePositiveInteger bitXor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1930
     "/           37 LargePositiveInteger bitShift:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1931
     "/           40 SmallInteger asFloat
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1932
     "/           41 Float +
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1933
     "/           42 Float -
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1934
     "/           49 Float *
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1935
     "/           50 Float / 
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1936
     "/           52 Float fractionPart
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1937
     "/           54 Float timesTwoPower:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1938
     "/           70 Behavior basicNew
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1939
     "/           71 Behavior basicNew:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1940
     "/           89 Behavior flushVMmethodCache
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1941
     "/           91 InputState primCursorLocPut:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1942
     "/           105 ByteArray replaceElementsFrom:to:withByteArray:startingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1943
     "/           223 ByteString =
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1944
     "/           306 ObjectMemory class sizesAtStartup
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1945
     "/           307 ObjectMemory class defaultSizesAtStartup
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1946
     "/           309 ObjectMemory class defaultThresholds
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1947
     "/           326 ObjectMemory class getMemoryUsageAndZeroFragmentationStatisticsIf:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1948
     "/           395 ExternalInterface ???
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1949
     "/           400 FormBitmap class newWidth:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1950
     "/           414 TwoByteString replaceElementsFrom:to:withTwoByteString:startingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1951
     "/           415 TwoByteString =
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1952
     "/           417 String trueCompare:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1953
     "/           418 ByteString nextIndexOf:from:to:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1954
     "/           419 ByteString prevIndexOf:from:to:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1955
     "/           422 WeakArray indexOf:replaceWith:startingAt:stoppingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1956
     "/           522 Behavior flushVMmethodCacheEntriesFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1957
     "/           524 Context nFromVPC:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1958
     "/           525 Context vFromNPC:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1959
     "/           532 Object shallowCopy
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1960
     "/           536 Behavior atomicAllInstances
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1961
     "/           537 Object allOwners
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1962
     "/           538 ObjectMemory class allObjects
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1963
     "/           546 UninterpretedBytes longAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1964
     "/           548 UninterpretedBytes floatAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1965
     "/           550 UninterpretedBytes longFloatAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1966
     "/           544 UninterpretedBytes unsignedLongAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1967
     "/           559 ByteArray replaceBytesFrom:to:with:startingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1968
     "/           560 Double class fromNumber:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1969
     "/           561 Double +
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1970
     "/           562 Double -
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1971
     "/           569 Double *
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1972
     "/           570 Double /
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1973
     "/           572 Double fractionPart
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1974
     "/           574 Double timesTwoPower:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1975
     "/           576 Double sin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1976
     "/           577 Double cos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1977
     "/           578 Double tan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1978
     "/           579 Double arcSin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1979
     "/           580 Double arcCos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1980
     "/           581 Double arcTan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1981
     "/           582 Double sqrt
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1982
     "/           583 Double ln
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1983
     "/           584 Double exp
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1984
     "/           585 Double raisedTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1985
     "/           587 Double floorLog10
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1986
     "/           588 Double asFloat
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1987
     "/           591 Float cos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1988
     "/           592 Float arcSin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1989
     "/           593 Float arcCos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1990
     "/           600 Float sin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1991
     "/           601 Float tan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1992
     "/           602 Float arcTan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1993
     "/           603 Float sqrt
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1994
     "/           604 Float ln
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1995
     "/           605 Float exp
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1996
     "/           606 Float raisedTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1997
     "/           609 Float floorLog10
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1998
     "/           610 Filename getDatesErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1999
     "/           614 DosFilename class getVolumes
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2000
     "/           615 UnixFilename primSetProtection:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2001
     "/           616 UnixFilename class primSetCreationMask:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2002
     "/           617 UnixFilename primGetProtectionErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2003
     "/           620 Filename listDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2004
     "/           621 Filename deleteErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2005
     "/           622 Filename isDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2006
     "/           623 Filename renameTo:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2007
     "/           624 Filename makeDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2008
     "/           625 Filename class defaultDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2009
     "/           626 Filename fileSizeErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2010
     "/           627 Filename isWritableErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2011
     "/           628 Filename setWritable:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2012
     "/           629 Filename existsErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2013
     "/           630 SocketAccessor setOptionsLevel:name:value:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2014
     "/           631 SocketAccessor getOptionsLevel:name:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2015
     "/           632 SocketAccessor primGetName
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2016
     "/           633 SocketAccessor primGetPeer
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2017
     "/           634 SocketAccessor atMark
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2018
     "/           637 UnixTtyAccessor primGetOptions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2019
     "/           638 UnixTtyAccessor setOptions:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2020
     "/           639 UnixRealTtyAccessor modemBits:mask:sendBreak:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2021
     "/           640 IPSocketAddress class primHostAddressByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2022
     "/           641 IPSocketAddress class netAddressByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2023
     "/           642 IPSocketAddress class protocolNumberByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2024
     "/           643 IPSocketAddress class servicePortByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2025
     "/           645 IPSocketAddress class primHostNameByAddress:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2026
     "/           646 IPSocketAddress class netNameByAddress:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2027
     "/           647 IPSocketAddress class protocolNameByNumber:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2028
     "/           648 IPSocketAddress class serviceNameByPort:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2029
     "/           649 SocketAccessor class getHostname
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2030
     "/           650 Filename primOpenFileNamed:direction:creation:errorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2031
     "/           651 IOAccessor primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2032
     "/           652 UnixPipeAccessor class primPipeErrorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2033
     "/           653 UnixPseudoTtyAccessor class primPtyErrorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2034
     "/           654 SocketAccessor class primPairErrorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2035
     "/           655 UnixRealTtyAccessor class primOpen:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2036
     "/           660 IOAccessor primReadInto:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2037
     "/           661 IOAccessor primWriteFrom:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2038
     "/           662 IOAccessor primSeekTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2039
     "/           664 IOAccessor truncateTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2040
     "/           665 DosDiskFileAccessor commit
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2041
     "/           666 IOAccessor primGetSize
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2042
     "/           667 MacDiskFileAccessor lock:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2043
     "/           669 UnixIOAccessor bytesForRead
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2044
     "/           670 SocketAccessor class primFamily:type:protocol:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2045
     "/           671 SocketAccessor primAccept
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2046
     "/           672 SocketAccessor bindTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2047
     "/           673 SocketAccessor listenFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2048
     "/           674 SocketAccessor primConnectTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2049
     "/           675 SocketAccessor primReceiveFrom:buffer:start:for:flags:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2050
     "/           676 SocketAccessor sendTo:buffer:start:for:flags:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2051
     "/           677 SocketAccessor shutdown:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2052
     "/           681 UnixProcess class primFork:arguments:environment:descriptors:errorTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2053
     "/           682 UnixProcess class reapOne
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2054
     "/           683 UnixProcess kill:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2055
     "/           690 CEnvironment class primEnvironment
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2056
     "/           697 OSErrorHolder class errorDescriptionFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2057
     "/           697 ErrorHolder class errorDescriptionFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2058
     "/           698 SocketAccessor class primInit:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2059
     "/           700 ParagraphEditor class getExternalSelectionOrNil:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2060
     "/           701 ParagraphEditor class putExternalSelection:with:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2061
     "/           705 Screen ringBell
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2062
     "/           706 Cursor class primOpenImage:mask:hotSpotX:hotSpotY:background:foreground:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2063
     "/           707 Cursor primBeCursor
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2064
     "/           708 Cursor primFreeCursor
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2065
     "/           772 SoundManager enumerateSoundsFrom:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2066
     "/           773 SoundManager playSoundFrom:sound:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2067
     "/           774 SoundManager simpleBeep:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2068
     "/           775 Pixmap primFromClipboard
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2069
     "/           776 Pixmap toClipboard
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2070
     "/           808 Context findNextMarkedUpTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2071
     "/           809 Context terminateTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2072
     "/           710 DosTtyAccessor class primOpen:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2073
     "/           711 DosTtyAccessor primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2074
     "/           712 DosTtyAccessor primReadInto:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2075
     "/           713 DosTtyAccessor primWriteFrom:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2076
     "/           714 DosTtyAccessor primGetOptions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2077
     "/           715 DosTtyAccessor primSetOptions:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2078
     "/           716 DosTtyAccessor setSem:forWrite:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2079
     "/           717 DosTtyAccessor modemBits:mask:sendBreak:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2080
     "/           750 MacFilename class getVolumes
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2081
     "/           752 MacFilename primSetCreator:type:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2082
     "/           754 MacIOAccessor class getAccessories
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2083
     "/           755 MacIOAccessor class runAccessory:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2084
     "/           756 MacOSFilename class getFileTypes:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2085
     "/           757 MacOSFilename putFileWithPrompt:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2086
     "/           758 MacOSFilename getFileInfoErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2087
     "/           759 MacOSFilename stringFromVRefErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2088
     "/           761 MacOSFilename class getStartupFilesErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2089
     "/           770 DosFilename printPSFileErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2090
     "/           771 DosFilename printTextFileErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2091
     "/           780 MacTtyAccessor class primOpen:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2092
     "/           781 MacTtyAccessor primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2093
     "/           782 MacTtyAccessor primReadInto:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2094
     "/           783 MacTtyAccessor primWriteFrom:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2095
     "/           786 MacTtyAccessor primGetOptions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2096
     "/           787 MacTtyAccessor setOptions:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2097
     "/           788 MacTtyAccessor primBreak:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2098
     "/           790 MacTtyAccessor primGetStatus
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2099
     "/           792 MacTtyAccessor setSem:forWrite:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2100
     "/           793 MacTtyAccessor primAssertDTR:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2101
     "/           794 MacTtyAccessor primGetSize
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2102
     "/           933 ByteArray copyBitsClippedStride:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2103
     "/           934 ByteArray tileBits32By32Stride:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2104
     "/           935 Screen dragShape:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2105
     "/           936 Screen resizeRectangle...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2106
     "/           937 Screen displayShape:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2107
     "/           938 Window resizeFromUserWithMinimum:maximum:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2108
     "/           940 Window primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2109
     "/           942 Window getDimensions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2110
     "/           943 Window moveTo:resize:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2111
     "/           944 Window primMap
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2112
     "/           945 Window class primNewAt:extent:min:max:windowType:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2113
     "/           946 Screen flush
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2114
     "/           947 Screen getScreenDimensions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2115
     "/           948 Window unmap
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2116
     "/           950 Screen sync
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2117
     "/           951 Window setIconMask:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2118
     "/           952 Window label:iconLabel:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2119
     "/           953 Window raise
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2120
     "/           954 Window lower
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2121
     "/           955 Screen queryStackingOrder
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2122
     "/           956 TextMeasurer primScanCharactersFrom:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2123
     "/           957 GraphicsContext displayMappedString:from:to:at:withMap:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2124
     "/           959 Window setBackgroundPixel:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2125
     "/           960 Screen class primOpen:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2126
     "/           965 UnmappableSurface contentsOfAreaOriginX:y:width:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2127
     "/           966 Window contentsOfAreaOriginX:y:width:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2128
     "/           967 Screen contentsOfAreaOriginX:y:width:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2129
     "/           970 Mask class primExtent:depth:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2130
     "/           971 Mask privateClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2131
     "/           976 GraphicsContext displayCharacterOfIndex:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2132
     "/           978 DeviceFont class listFonts
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2133
     "/           979 DeviceFont primLoadFont
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2134
     "/           980 DeviceFont primUnLoadFont
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2135
     "/           985 GraphicsContext displayLineFrom:to:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2136
     "/           986 GraphicsContext displayPolyline:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2137
     "/           987 GraphicsContext displayPolygon:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2138
     "/           988 GraphicsContext primDisplayRectangleOrigin:extent:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2139
     "/           989 GraphicsContext primDisplayRectangularBorderOrigin:extent:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2140
     "/           990 GraphicsContext primDisplayArcBBoxOrigin:extent:startAngle:sweepAngle:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2141
     "/           991 GraphicsContext primDisplayWedgeBBoxOrigin:extent:startAngle:sweepAngle:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2142
     "/           992 GraphicsContext displayMask:at:"
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2143
     "/           993 GraphicsContext displayUninterpretedImageBits:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2144
     "/           994 GraphicsContext primCopyRectangularAreaExtent:from:sourceOffset:destinationOffset:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2145
     "/           995 GraphicsContext primCopyMaskedArea:from:sourceOffset:destinationOffset:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2146
     "/           996 Screen deviceColormap
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2147
     "/           998 GraphicsContext displayUninterpretedMonoImageBits:foreground:background:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2148
907
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2149
     "/ Squeak:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2150
     "/
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2151
     "/             1 +
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2152
     "/             2 -
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2153
     "/             3 <
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2154
     "/             4 >
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2155
     "/             5 <=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2156
     "/             6 >=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2157
     "/             7 =
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2158
     "/             8 ~=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2159
     "/             9 *
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2160
     "/            10 /
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2161
     "/            11 mod:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2162
     "/            12 div:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2163
     "/            13 quo:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2164
     "/            14 bitAnd:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2165
     "/            15 bitOr:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2166
     "/            16 bitXor:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2167
     "/            17 bitShift:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2168
     "/            18 @
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2169
     "/            19
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2170
     "/            ...
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2171
     "/            39 fail - reserved/unimplemented
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2172
     "/            40 asFloat
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2173
     "/            41 Float +
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2174
     "/            42 Float -
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2175
     "/            43 Float <
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2176
     "/            44 Float >
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2177
     "/            45 Float <=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2178
     "/            46 Float >=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2179
     "/            47 Float =
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2180
     "/            48 Float ~=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2181
     "/            49 Float *
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2182
     "/            50 Float /
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2183
     "/            51 Float truncated
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2184
     "/            52 Float fractionalPart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2185
     "/            53 Float exponent
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2186
     "/            54 Float timeTwoPower
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2187
     "/            55 Float sqrt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2188
     "/            56 Float sine
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2189
     "/            57 Float arcTan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2190
     "/            58 Float logN
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2191
     "/            59 Float exp
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2192
     "/            60 at:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2193
     "/            61 at:put:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2194
     "/            62 size
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2195
     "/            63 stringAt:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2196
     "/            64 stringAt:put:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2197
     "/            65 next
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2198
     "/            66 nextPut:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2199
     "/            67 atEnd
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2200
     "/            68 objectAt:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2201
     "/            69 objectAt:put:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2202
     "/            70 new
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2203
     "/            71 new:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2204
     "/            72 becomeOneWay
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2205
     "/            73 instVarAt:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2206
     "/            74 instVarAtPut:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2207
     "/            75 asOop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2208
     "/            76 storeStackP
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2209
     "/            77 someInstance
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2210
     "/            78 nextInstance
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2211
     "/            79 newMethod
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2212
     "/            80 blockCopy
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2213
     "/            81 value
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2214
     "/            82 valueWithArgs
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2215
     "/            83 perform
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2216
     "/            84 performWithArgs
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2217
     "/            85 signal
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2218
     "/            86 wait
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2219
     "/            87 resume
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2220
     "/            88 suspend
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2221
     "/            89 flushCache
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2222
     "/            90 mousePoint
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2223
     "/            91 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2224
     "/            92 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2225
     "/            93 inputSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2226
     "/            94 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2227
     "/            95 inputWord
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2228
     "/            96 copyBits
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2229
     "/            97 snapShot
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2230
     "/            98 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2231
     "/            99 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2232
     "/           100 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2233
     "/           101 beCursor
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2234
     "/           102 beDisplay
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2235
     "/           103 scanCharacters
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2236
     "/           104 drawLoop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2237
     "/           105 stringReplace
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2238
     "/           106 screenSize
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2239
     "/           107 mouseButtons
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2240
     "/           108 kbdNext
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2241
     "/           109 kbdPeek
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2242
     "/           110 equivalent
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2243
     "/           111 class
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2244
     "/           112 bytesLeft
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2245
     "/           113 quit
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2246
     "/           114 exitToDebugger
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2247
     "/           115 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2248
     "/           116 flushCacheByMethod
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2249
     "/           117 externalCall
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2250
     "/           118 doPrimitiveWithArg
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2251
     "/           119 flushCacheSelective
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2252
     "/           120 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2253
     "/           121 imageName
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2254
     "/           122 noop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2255
     "/           123 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2256
     "/           124 lowSpaceSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2257
     "/           125 signalAtBytesLeft
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2258
     "/           126 deferDisplayUpdate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2259
     "/           127 showDisplayRect
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2260
     "/           128 arrayBecome
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2261
     "/           129 specialObjectsOop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2262
     "/           130 fullGC
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2263
     "/           131 incrementalGC
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2264
     "/           132 objectPointsTo
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2265
     "/           133 setInterruptKey
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2266
     "/           134 interruptSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2267
     "/           135 millisecondClock
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2268
     "/           136 signalAtMilliseconds
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2269
     "/           137 secondsClock
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2270
     "/           138 someObject
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2271
     "/           139 nextObject
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2272
     "/           140 beep
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2273
     "/           141 clipboardText
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2274
     "/           142 vmPath
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2275
     "/           143 shortAt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2276
     "/           144 shortAtPut
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2277
     "/           145 constantFill
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2278
     "/           146 readJoystick
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2279
     "/           147 warpBits
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2280
     "/           148 clone
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2281
     "/           149 getAttribute
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2282
     "/           150 fileAtEnd
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2283
     "/           151 fileClose
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2284
     "/           152 fileGetPosition
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2285
     "/           153 fileOpen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2286
     "/           154 fileRead
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2287
     "/           155 fileSetPosition
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2288
     "/           156 fileDelete
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2289
     "/           157 fileSize
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2290
     "/           158 fileWrite
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2291
     "/           159 fileRename
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2292
     "/           160 directoryCreate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2293
     "/           161 directoryDelimiter
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2294
     "/           162 directoryLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2295
     "/           163 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2296
     "/           164 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2297
     "/           165 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2298
     "/           166 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2299
     "/           167 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2300
     "/           168 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2301
     "/           169 directorySetMacType
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2302
     "/           170 soundStart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2303
     "/           171 soundStartWithSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2304
     "/           172 soundStop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2305
     "/           173 soundAvailableSpace
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2306
     "/           174 soundPlaySamples
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2307
     "/           175 soundPlaySilence
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2308
     "/           176 waveTableSoundmixSampleCountIntoStarrtingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2309
     "/           177 fmSoundmixSampleCountintostartingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2310
     "/           178 pluckedSoundmixSampleCountintostartingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2311
     "/           179 sampledSoundmixSampleCountintostartingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2312
     "/           180 fmSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2313
     "/           181 pluckedSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2314
     "/           182 sampledSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2315
     "/           183 reverbSoundapplyReverbTostartingAtcount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2316
     "/           184 loopedSampledSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2317
     "/           185 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2318
     "/           186 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2319
     "/           187 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2320
     "/           188 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2321
     "/           189 soundInsertSamples
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2322
     "/           190 soundStartRecording
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2323
     "/           191 soundStopRecording
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2324
     "/           192 soundGetRecordingSampleRate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2325
     "/           193 soundRecordSamples
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2326
     "/           194 soundSetRecordLevel
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2327
     "/           195 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2328
     "/           196 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2329
     "/           197 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2330
     "/           198 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2331
     "/           199 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2332
     "/           200 initializeNetwork
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2333
     "/           201 resolverStartNameLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2334
     "/           202 resolverNameLookupResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2335
     "/           203 resolverStartAddressLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2336
     "/           204 resolverAddressLookupResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2337
     "/           205 resolverAbortLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2338
     "/           206 resolverLocalAddress
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2339
     "/           207 resolverStatus
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2340
     "/           208 resolverError
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2341
     "/           209 socketCreate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2342
     "/           210 socketDestroy
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2343
     "/           211 socketConnectionStatus
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2344
     "/           212 socketError
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2345
     "/           213 socketLocalAddress
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2346
     "/           214 socketLocalPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2347
     "/           215 socketRemoteAddress
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2348
     "/           216 socketRemotePort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2349
     "/           217 socketConnectToPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2350
     "/           218 socketListenOnPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2351
     "/           219 socketCloseConnection
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2352
     "/           220 socketAbortConnection
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2353
     "/           221 socketReceiveDataBufCount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2354
     "/           222 socketReceiveDataAvailable
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2355
     "/           223 socketSendDataBufCount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2356
     "/           224 socketSendDone
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2357
     "/           225 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2358
     "/           226 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2359
     "/           227 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2360
     "/           228 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2361
     "/           229 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2362
     "/           230 relinquishProcessor
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2363
     "/           231 forceDisplayUpdate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2364
     "/           232 formPrint
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2365
     "/           233 setFullScreen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2366
     "/           234 bitmapdecompressfromByteArrayat
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2367
     "/           235 stringcomparewithcollated
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2368
     "/           236 sampledSoundconvert8bitSignedFromto16Bit
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2369
     "/           237 bitmapcompresstoByteArray
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2370
     "/           238 serialPortOpen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2371
     "/           239 serialPortClose
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2372
     "/           240 serialPortWrite
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2373
     "/           241 serialPortRead
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2374
     "/           242 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2375
     "/           243 stringtranslatefromtotable
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2376
     "/           244 stringfindFirstInStringinSetstartingAt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2377
     "/           245 stringindexOfAsciiinStringstartingAt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2378
     "/           246 stringfindSubstringinstartingAtmatchTable
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2379
     "/           247 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2380
     "/           248 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2381
     "/           249 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2382
     "/           250 clearProfile
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2383
     "/           251 dumpProfile
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2384
     "/           252 startProfiling
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2385
     "/           253 stopProfiling
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2386
     "/           254 vmParameter
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2387
     "/           255 instVarsPutFromStack
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2388
     "/           256 pushSelf
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2389
     "/           257 pushTrue
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2390
     "/           258 pushFalse
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2391
     "/           259 pushNil
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2392
     "/           260 pushMinusOne
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2393
     "/           261 pushZero
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2394
     "/           262 pushOne
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2395
     "/           263 pushTwo
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2396
     "/           264 loadInstVar
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2397
     "/           ..  loadInstVar
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2398
     "/           519 loadInstVar
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2399
     "/           520 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2400
     "/           521 MIDIClosePort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2401
     "/           522 MIDIGetClock
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2402
     "/           523 MIDIGetPortCount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2403
     "/           524 MIDIGetPortDirectionality
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2404
     "/           525 MIDIGetPortName
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2405
     "/           526 MIDIOpenPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2406
     "/           527 MIDIParameterGetOrSet
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2407
     "/           528 MIDIRead
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2408
     "/           529 MIDIWrite
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2409
     "/           530 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2410
     "/           ..  fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2411
     "/           539 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2412
     "/           540 asyncFileClose
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2413
     "/           541 asyncFileOpen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2414
     "/           542 asyncFileReadResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2415
     "/           543 asyncFileReadStart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2416
     "/           544 asyncFileWriteResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2417
     "/           545 asyncFileWriteStart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2418
     "/           546 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2419
     "/           .. 
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2420
     "/           700 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2421
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2422
    cls notNil ifTrue:[
907
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  2423
        ^ (cls compiledMethodAt:sel) code
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2424
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2425
    ^ nil
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2426
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2427
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2428
createMethod
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  2429
    |newMethod|
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2430
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2431
    newMethod := self methodClass new:(litArray size).
292
163651658aee Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 287
diff changeset
  2432
    litArray notNil ifTrue:[
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2433
        "/ fixup CheapBlocks method-field in literal array,
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2434
        litArray do:[:aLiteral |
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2435
            (aLiteral isMemberOf:CheapBlock) ifTrue:[
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2436
                aLiteral setMethod:newMethod.
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2437
            ]
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2438
        ].
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2439
        newMethod literals:litArray
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2440
    ].
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2441
594
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  2442
    newMethod numberOfVars:(self numberOfMethodVars + (maxNumTemp ? 0)).
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  2443
    newMethod numberOfArgs:(self numberOfMethodArgs).
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2444
    newMethod stackSize:(self maxStackDepth).
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2445
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2446
    primitiveResource notNil ifTrue:[
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  2447
        newMethod setResourceFlag
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2448
    ].
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2449
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2450
    ^ newMethod
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2451
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2452
    "Created: 18.5.1996 / 16:33:17 / cg"
292
163651658aee Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 287
diff changeset
  2453
    "Modified: 24.6.1996 / 12:32:50 / stefan"
594
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  2454
    "Modified: 1.8.1997 / 00:27:29 / cg"
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2455
!
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  2456
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2457
genByteCodeFrom:symbolicCodeArray
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2458
    "convert symbolicCode into bytecodes"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2459
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2460
    |symIndex    "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2461
     codeSize    "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2462
     symCodeSize "{Class: SmallInteger }"
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  2463
     index nextSym addr
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2464
     codeSymbol nargs needRetry
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  2465
     stackDepth relocInfo level nvars round|
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2466
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2467
    symbolicCodeArray isNil ifTrue:[^ self].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2468
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2469
    round := 0.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2470
    needRetry := true.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2471
    symCodeSize := symbolicCodeArray size.
192
5f5ecdcffc67 share common byteCodes - just an idea and more is needed for most compact code
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
  2472
    ShareCode ifTrue:[
512
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2473
	codeBytes := self checkForCommonCode:symbolicCodeArray.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2474
	codeBytes notNil ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2475
	    ^ self
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2476
	].
192
5f5ecdcffc67 share common byteCodes - just an idea and more is needed for most compact code
Claus Gittinger <cg@exept.de>
parents: 191
diff changeset
  2477
    ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2478
    codeSize := symCodeSize.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2479
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2480
    [needRetry] whileTrue:[
512
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2481
	stackDepth := 0.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2482
	maxStackDepth := 0.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2483
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2484
	codeBytes := ByteArray uninitializedNew:codeSize.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2485
	relocInfo := Array basicNew:(codeSize + 1).
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2486
	symIndex := 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2487
	codeIndex := 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2488
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2489
	needRetry := false.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2490
	round := round + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2491
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2492
	[symIndex <= symCodeSize] whileTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2493
	    relocInfo at:symIndex put:codeIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2494
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2495
	    codeSymbol := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2496
	    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2497
	    stackDelta := 0.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2498
	    extra := extraLiteral := nil.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2499
	    lineno := false.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2500
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2501
	    self appendByteCodeFor:codeSymbol.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2502
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2503
	    extraLiteral notNil ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2504
		self addLiteral:extraLiteral
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2505
	    ].
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2506
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2507
	    lineno ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2508
		self appendByte:((symbolicCodeArray at:symIndex) min:255).
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2509
		symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2510
		codeSymbol == #lineno16 ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2511
		    self appendByte:((symbolicCodeArray at:symIndex) min:255).
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2512
		    symIndex := symIndex + 1
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2513
		]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2514
	    ].
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2515
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2516
	    extra notNil ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2517
		nextSym := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2518
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2519
		(extra == #number) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2520
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2521
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2522
		    self appendSignedByte:index
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2523
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2524
		] ifFalse:[ (extra == #number16) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2525
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2526
		    symIndex := symIndex + 2.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2527
		    self appendSignedWord:index
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2528
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2529
		] ifFalse:[ (extra == #unsigned16) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2530
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2531
		    symIndex := symIndex + 2.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2532
		    self appendWord:index
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2533
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2534
		] ifFalse:[ (extra == #index) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2535
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2536
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2537
		    self appendByte:index
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2538
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2539
		] ifFalse:[ (extra == #lit) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2540
		    index := self addLiteral:nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2541
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2542
		    self appendByte:index
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2543
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2544
		] ifFalse:[ (extra == #speciallit) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2545
		    index := self addLiteral:nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2546
		    index > 255 ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2547
			self parseError:'too many globals (' , 
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2548
					(symbolicCodeArray at:symIndex) ,
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2549
					' index=' , index printString ,
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2550
					') in method - please simplify'.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2551
			^ #Error
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2552
		    ].
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2553
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2554
		    self appendByte:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2555
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2556
		] ifFalse:[ (extra == #speciallitS) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2557
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2558
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2559
		    self appendByte:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2560
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2561
		] ifFalse:[ (extra == #speciallitL) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2562
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2563
		    symIndex := symIndex + 2.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2564
		    self appendWord:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2565
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2566
		] ifFalse:[ (extra == #offset) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2567
		    relocInfo at:symIndex put:codeIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2568
		    self addReloc:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2569
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2570
		    self appendByte:0
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2571
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2572
		] ifFalse:[ (extra == #indexLevel) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2573
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2574
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2575
		    self appendByte:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2576
		    level := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2577
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2578
		    self appendByte:level
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2579
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2580
		] ifFalse:[ (extra == #offsetNvarNarg) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2581
		    relocInfo at:symIndex put:codeIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2582
		    self addReloc:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2583
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2584
		    self appendEmptyByte.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2585
		    nvars := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2586
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2587
		    self appendByte:nvars.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2588
		    level := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2589
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2590
		    self appendByte:level
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2591
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2592
		] ifFalse:[ (extra == #absoffset) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2593
		    relocInfo at:symIndex put:codeIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2594
		    self addReloc:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2595
		    addr := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2596
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2597
		    self appendByte:(addr bitAnd:16rFF).
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2598
		    self appendByte:((addr bitShift:-8) bitAnd:16rFF).
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2599
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2600
		] ifFalse:[ (extra == #absoffsetNvarNarg) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2601
		    relocInfo at:symIndex put:codeIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2602
		    self addReloc:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2603
		    addr := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2604
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2605
		    self appendByte:(addr bitAnd:16rFF).
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2606
		    self appendByte:((addr bitShift:-8) bitAnd:16rFF).
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2607
		    nvars := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2608
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2609
		    self appendByte:nvars.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2610
		    level := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2611
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2612
		    self appendByte:level
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2613
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2614
		] ifFalse:[ (extra == #special) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2615
		    ((codeSymbol == #send) 
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2616
		     or:[codeSymbol == #sendSelf
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2617
		     or:[codeSymbol == #superSend
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2618
		     or:[codeSymbol == #hereSend]]]) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2619
			index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2620
			symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2621
			nargs := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2622
			symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2623
			self appendByte:nargs.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2624
			self appendByte:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2625
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2626
			(codeSymbol == #superSend
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2627
			or:[codeSymbol == #hereSend]) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2628
			    index := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2629
			    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2630
			    self appendByte:index
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2631
			].
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2632
			stackDelta := nargs negated.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2633
			codeSymbol == #sendSelf ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2634
			    stackDelta := stackDelta + 1
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2635
			]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2636
		    ] ifFalse:[ (codeSymbol == #sendDrop) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2637
			index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2638
			symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2639
			nargs := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2640
			symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2641
			self appendByte:nargs.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2642
			self appendByte:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2643
			stackDelta := (nargs + 1) negated
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2644
		    ]]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2645
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2646
		] ifFalse:[ (extra == #specialL) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2647
		    ((codeSymbol == #sendL) 
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2648
		     or:[codeSymbol == #sendSelfL
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2649
		     or:[codeSymbol == #superSendL
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2650
		     or:[codeSymbol == #hereSendL]]]) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2651
			index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2652
			symIndex := symIndex + 2.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2653
			nargs := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2654
			symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2655
			self appendByte:nargs.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2656
			self appendWord:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2657
			(codeSymbol == #superSendL
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2658
			or:[codeSymbol == #hereSendL]) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2659
			    index := symbolicCodeArray at:symIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2660
			    symIndex := symIndex + 2.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2661
			    self appendWord:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2662
			].
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2663
			stackDelta := nargs negated.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2664
			codeSymbol == #sendSelfL ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2665
			    stackDelta := stackDelta + 1
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2666
			]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2667
		    ]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2668
		] ifFalse:[ (extra == #specialSend) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2669
		    index := nextSym.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2670
		    symIndex := symIndex + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2671
		    self appendByte:index.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2672
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2673
		] ifFalse:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2674
		    "/ self halt:'internal error'
475
5bce2cf3dadc new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 459
diff changeset
  2675
                
512
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2676
		]]]]]]]]]]]]]]]]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2677
	    ].
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2678
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2679
	    stackDepth := stackDepth + stackDelta.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2680
	    (stackDepth > maxStackDepth) ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2681
		maxStackDepth := stackDepth
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2682
	    ]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2683
	].
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2684
	relocInfo at:symIndex put:codeIndex.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2685
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2686
	needRetry ifFalse:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2687
	    "
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2688
	     now relocate - returns true if ok, false if we have to do it again
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2689
	     (when short jumps have been changed to long jumps)
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2690
	    "
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2691
	    relocList notNil ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2692
		needRetry := (self relocateWith:symbolicCodeArray relocInfo:relocInfo) not.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2693
		"
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2694
		 if returned with false, a relative jump was made into
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2695
		 an absolute jump - need to start over with one more byte space
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2696
		"
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2697
		needRetry ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2698
		    relocList := nil.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2699
		    codeSize := codeSize + 1.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2700
		]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2701
	    ]
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2702
	] ifTrue:[
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2703
	    'Compiler [info]: compiling again ...' infoPrintCR.
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  2704
	]
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2705
    ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2706
    "code printNL."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2707
    ^ errorFlag
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2708
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2709
    "Modified: 3.9.1995 / 12:59:43 / claus"
475
5bce2cf3dadc new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 459
diff changeset
  2710
    "Modified: 10.1.1997 / 15:17:51 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2711
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2712
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2713
genSpecialStatement:selector on:codeStream
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2714
        "/ generate: thisContext selector.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2715
    (StatementNode 
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2716
        expression:(UnaryNode receiver:(VariableNode type:#ThisContext context:contextToEvaluateIn)
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2717
                              selector:selector))
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2718
            codeForSideEffectOn:codeStream inBlock:nil for:self.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2719
!
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2720
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2721
genSymbolicCode
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2722
    "traverse the parse-tree producing symbolicCode - return the codeArray"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2723
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2724
    |codeStream code thisStatement lastStatement|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2725
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2726
    litArray := nil.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2727
    codeStream := WriteStream on:(OrderedCollection new:100).
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2728
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2729
    primitiveContextInfo notNil ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2730
        (primitiveContextInfo includes:('exception:' -> #unwind)) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2731
            self genSpecialStatement:#markForUnwind on:codeStream
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2732
        ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2733
        (primitiveContextInfo includes:('exception:' -> #handle)) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2734
            self genSpecialStatement:#markForHandle on:codeStream
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2735
        ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2736
        (primitiveContextInfo includes:('exception:' -> #raise)) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2737
            self genSpecialStatement:#markForRaise on:codeStream
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2738
        ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2739
    ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2740
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2741
    thisStatement := tree.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2742
    [thisStatement notNil] whileTrue:[
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2743
        lastStatement := thisStatement.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2744
        thisStatement codeForSideEffectOn:codeStream inBlock:nil for:self.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2745
        thisStatement := thisStatement nextStatement
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2746
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2747
    (lastStatement isNil or:[lastStatement isReturnNode not])
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2748
    ifTrue:[
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2749
        "not a return - add retSelf"
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2750
        "
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2751
         if the last statement was a send for side-effect,
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2752
         replace the previous drop by a retSelf.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2753
         In this case we have to keep an extra retSelf bacause
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2754
         it could be a jump target.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2755
        "
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2756
        (lastStatement notNil 
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2757
         and:[(code := codeStream contents) notNil
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2758
         and:[code size > 0
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2759
         and:[code last == #drop]]]) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2760
            codeStream backStep.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2761
            codeStream nextPut:#retSelf
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2762
        ]. 
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2763
        codeStream nextPut:#retSelf
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2764
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2765
    ^ codeStream contents
328
c63c54ff95d3 Optimize double #retSelf.
Stefan Vogel <sv@exept.de>
parents: 325
diff changeset
  2766
330
9b9a1ff67ba3 Bad change in previous version. Need extra bytecode as jump target.
Stefan Vogel <sv@exept.de>
parents: 328
diff changeset
  2767
    "Modified: 15.8.1996 / 17:35:02 / stefan"
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2768
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2769
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2770
hasLineNumber:sel
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2771
    "return true, if special send code needs lineNr"
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2772
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2773
    (sel == #==) ifTrue:[^ false].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2774
    (sel == #~~) ifTrue:[^ false].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2775
    (sel == #class) ifTrue:[^ false].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2776
    (sel == #isNil) ifTrue:[^ false].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2777
    (sel == #notNil) ifTrue:[^ false].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2778
    ^ true
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2779
!
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2780
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2781
isBuiltIn1ArgSelector:sel forReceiver:receiver
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2782
    "return true, if selector sel is built-in.
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2783
     (i.e. there is a single bytecode for it)"
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2784
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2785
    (sel == #at:)     ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2786
    (sel == #value:)  ifTrue:[^ true].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2787
    (sel == #bitAnd:) ifTrue:[^ true].
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2788
    (sel == #bitOr:)  ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2789
    (sel == #new:)    ifTrue:[^ true].
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2790
    (sel == #basicNew:) ifTrue:[
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2791
	"/ this one is critical - some redefine it
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2792
	receiver isGlobal ifTrue:[
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2793
	    (#('String' 'ByteArray' 'Array'
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2794
	      'Point' 'Rectangle' 'Object')
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2795
	    includes:receiver name) ifTrue:[^ true].
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2796
	].
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2797
    ].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2798
    ^ false
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2799
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2800
    "Created: 17.4.1996 / 22:33:13 / cg"
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2801
    "Modified: 4.6.1997 / 12:24:18 / cg"
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2802
!
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2803
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2804
isBuiltIn2ArgSelector:sel forReceiver:receiver
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2805
    "return true, if selector sel is built-in.
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2806
     (i.e. there is a single bytecode for it)"
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2807
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2808
    (sel == #at:put:) ifTrue:[^ true].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2809
    ^ false
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2810
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2811
    "Created: 17.4.1996 / 22:33:16 / cg"
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2812
!
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2813
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2814
isBuiltInBinarySelector:sel forReceiver:receiver
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2815
    "return true, if binary selector sel is built-in. 
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2816
     (i.e. there is a single bytecode for it)"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2817
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2818
    sel == #== ifTrue:[^ true].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2819
    sel == #~~ ifTrue:[^ true].
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2820
    sel == #=  ifTrue:[^ true].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2821
    sel == #~= ifTrue:[^ true].
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2822
    sel == #+  ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2823
    sel == #-  ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2824
    sel == #<  ifTrue:[^ true].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2825
    sel == #<= ifTrue:[^ true].
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2826
    sel == #>  ifTrue:[^ true].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2827
    sel == #>= ifTrue:[^ true].
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2828
    sel == #*  ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2829
    sel == #&  ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2830
    sel == #|  ifTrue:[^ true].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2831
    ^ false
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2832
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2833
    "Created: 17.4.1996 / 22:34:27 / cg"
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2834
    "Modified: 4.6.1997 / 12:24:00 / cg"
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2835
!
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2836
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2837
isBuiltInUnarySelector:sel forReceiver:receiver
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2838
    "return true, if unary selector sel is built-in. 
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2839
     (i.e. there is a single bytecode for it)"
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2840
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2841
    (sel == #value)  ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2842
    (sel == #class)  ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2843
    (sel == #size)   ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2844
    (sel == #isNil)  ifTrue:[^ true].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2845
    (sel == #notNil) ifTrue:[^ true].
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2846
    (sel == #not)    ifTrue:[^ true].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2847
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2848
    (sel == #new)    ifTrue:[^ true].
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2849
    (sel == #basicNew) ifTrue:[
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2850
	"/ this one is critical - some redefine it
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2851
	receiver isGlobal ifTrue:[
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2852
	    (#('String' 'ByteArray' 'Array'
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2853
	       'Point' 'Rectangle' 'Object')
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2854
	    includes:receiver name) ifTrue:[^ true].
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2855
	].
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2856
    ].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2857
    ^ false
253
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2858
759ba0ddb672 oops - must check for receiver when attempting built-in basicNew
Claus Gittinger <cg@exept.de>
parents: 247
diff changeset
  2859
    "Created: 17.4.1996 / 22:32:16 / cg"
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  2860
    "Modified: 4.6.1997 / 12:23:30 / cg"
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2861
!
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  2862
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2863
moveGlobalsToFront
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2864
    "move all global-literals to the front of the literal array.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2865
     This may be the last chance to compile the method, since
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2866
     for globals, the maximum literal index is 255 - while for normal
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2867
     literals its a stress-less 65535"
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2868
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2869
    litArray isNil ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2870
	^ self error:'oops compiler botch'.
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2871
    ].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2872
    litArray sort:[:a :b |   "a < b -> #(a b)"
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2873
		   (a isMemberOf:Symbol) ifFalse:[false]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2874
		   ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2875
		      (b isMemberOf:Symbol) ifFalse:[true]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2876
		      ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2877
			(a at:1) isUppercase ifFalse:[false]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2878
			ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2879
			  (b at:1) isUppercase ifFalse:[true]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2880
			  ifTrue:[a < b].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2881
			]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2882
		      ]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2883
		    ]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2884
		   ].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2885
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2886
"
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2887
    #(#A #c #B #D #E #a #b #F)
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2888
     sort:[:a :b |  
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2889
		   (a isMemberOf:Symbol) ifFalse:[false]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2890
		   ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2891
		      (b isMemberOf:Symbol) ifFalse:[true]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2892
		      ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2893
			(a at:1) isUppercase ifFalse:[false]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2894
			ifTrue:[
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2895
			  (b at:1) isUppercase ifFalse:[true]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2896
			  ifTrue:[(a < b)].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2897
			]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2898
		      ]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2899
		    ]
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2900
		   ].
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2901
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2902
"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2903
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2904
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2905
relocateWith:symbolicCodeArray relocInfo:relocInfo
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2906
    "helper for genByteCodeFrom - relocate code using relocInfo.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2907
     if relocation fails badly (due to long relative jumps) patch
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2908
     symbolicCode to use absolute jumps instead and return false
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2909
     (genByteCodeFrom will then try again). Otherwise return true.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2910
     Also, on the fly, jumps to jumps and jumps to return are handled."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2911
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2912
    |delta       "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2913
     codePos     "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2914
     opCodePos   "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2915
     codeOffset  "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2916
     symOffset 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2917
     opcode      "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2918
     dstOpcode jumpTarget
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2919
     jumpCode deleteSet|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2920
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2921
    deleteSet := OrderedCollection new.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2922
    relocList do:[:sIndex |
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2923
        "have to relocate symCode at sIndex ..." 
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2924
        symOffset := symbolicCodeArray at:sIndex.   "the target in the symbolic code"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2925
        codePos := relocInfo at:sIndex.             "position of the offet in byte code"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2926
        codeOffset := relocInfo at:symOffset.       "position of the target in byte code"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2927
        delta := codeOffset - codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2928
        opCodePos := codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2929
        opcode := codeBytes at:opCodePos.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2930
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2931
        (opcode between:190 and:199) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2932
            "an absolute jump/makeBlock"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2933
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2934
            codeBytes at:codePos put:(codeOffset bitAnd:16rFF).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2935
            codeBytes at:(codePos + 1) put:(codeOffset bitShift:-8)
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2936
        ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2937
            "get jump-code from long and vlong codes"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2938
            (opcode between:50 and:59) ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2939
                (opcode between:60 and:69) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2940
                    opcode := opcode - 10
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2941
                ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2942
                    (opcode between:70 and:79) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2943
                        opcode := opcode - 20
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2944
                    ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2945
                        self error:'invalid code to relocate'
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2946
                    ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2947
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2948
            ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2949
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2950
            "optimize jump to return and jump to jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2951
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2952
            (opcode == 54) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2953
                "a jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2954
                dstOpcode := symbolicCodeArray at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2955
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2956
                (#(retSelf retTop retNil retTrue retFalse ret0 "blockRetTop") includes:dstOpcode) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2957
                    "a jump to a return - put in the return instead jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2958
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2959
                    symbolicCodeArray at:(sIndex - 1) put:dstOpcode.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2960
                    symbolicCodeArray at:sIndex put:dstOpcode.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2961
                    codeBytes at:opCodePos put:(self byteCodeFor:dstOpcode).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2962
                    delta := 0.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2963
                    deleteSet add:sIndex.
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2964
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2965
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2966
'jump to return at: ' print. (sIndex - 1) printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2967
" 
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2968
                ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2969
                    (dstOpcode == #jump) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2970
                        "jump to jump to be done soon"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2971
                        jumpTarget := symbolicCodeArray at:(symOffset + 1).
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2972
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2973
'jump to jump at: ' print. (sIndex - 1) print.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2974
'  newTarget:' print. jumpTarget printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2975
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2976
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2977
                        symbolicCodeArray at:sIndex put:jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2978
                        symOffset := jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2979
                        codeOffset := relocInfo at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2980
                        delta := codeOffset - codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2981
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2982
                        "continue with new delta"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2983
                    ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2984
                ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2985
            ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2986
            (#(50 51 52 53 56 57 58 59) includes:opcode) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2987
                "a conditional jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2988
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2989
                dstOpcode := symbolicCodeArray at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2990
                (dstOpcode == #jump) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2991
                    "conditional jump to unconditional jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2992
                    jumpTarget := symbolicCodeArray at:(symOffset + 1).
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2993
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2994
'cond jump to jump at: ' print. (sIndex - 1) print.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2995
'  newTarget:' print. jumpTarget printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2996
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2997
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2998
                    symbolicCodeArray at:sIndex put:jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2999
                    symOffset := jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3000
                    codeOffset := relocInfo at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3001
                    delta := codeOffset - codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3002
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3003
                    "continue with new delta"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3004
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3005
            ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3006
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3007
            (delta >= 0) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3008
                (delta > 127) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3009
                    (opcode between:50 and:59) ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3010
                        self error:'invalid code to relocate'
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3011
                    ] ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3012
                        (delta > 255) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3013
                            "change jmp into vljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3014
                            codeBytes at:opCodePos put:(opcode + 20).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3015
                            delta := delta - 256 
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3016
                        ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3017
                            "change jmp into ljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3018
                            codeBytes at:opCodePos put:(opcode + 10).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3019
                            delta := delta - 128
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3020
                        ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3021
                        (delta > 127) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3022
                            "change symbolic into a jump absolute and fail"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3023
                            jumpCode := symbolicCodeArray at:(sIndex - 1).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3024
                            symbolicCodeArray at:(sIndex - 1) put:(self absJumpFromJump:jumpCode).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3025
                            symbolicCodeArray at:sIndex put:symOffset.
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3026
"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3027
'change short into abs jump' printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3028
"
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3029
                            deleteSet do:[:d | relocList remove:d].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3030
                            ^ false
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3031
                        ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3032
                    ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3033
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3034
                codeBytes at:codePos put:delta
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3035
            ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3036
                (delta < -128) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3037
                    (opcode between:50 and:59) ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3038
                        self error:'invalid code to relocate'
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3039
                    ] ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3040
                        (delta < -256) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3041
                            "change jmp into vljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3042
                            codeBytes at:opCodePos put:(opcode + 20).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3043
                            delta := delta + 256
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3044
                        ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3045
                            "change jmp into ljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3046
                            codeBytes at:opCodePos put:(opcode + 10).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3047
                            delta := delta + 128
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3048
                        ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3049
                        (delta < -128) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3050
                            "change symbolic into a jump absolute and fail"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3051
                            jumpCode := symbolicCodeArray at:(sIndex - 1).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3052
                            symbolicCodeArray at:(sIndex - 1) put:(self absJumpFromJump:jumpCode).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3053
                            symbolicCodeArray at:sIndex put:symOffset.
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3054
"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3055
'change short into abs jump' printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3056
"
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3057
                            deleteSet do:[:d | relocList remove:d].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3058
                            ^ false
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3059
                        ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3060
                    ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3061
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3062
                codeBytes at:codePos put:(256 + delta)
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3063
            ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3064
        ]
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3065
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3066
    (errorFlag == #Error) ifTrue:[
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  3067
        self error:'relocation range error'
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3068
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  3069
    ^ true
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  3070
!
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  3071
247
fbb6e3b5764c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
  3072
specialGlobalCodeFor:aSymbol
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3073
    "codeExtension for globals,
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3074
     which can be accessed by specialGlobal opCode"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3075
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3076
    |idx|
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3077
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3078
    idx := self specialGlobals identityIndexOf:aSymbol ifAbsent:nil.
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3079
    idx isNil ifTrue:[^ idx].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3080
    ^ idx - 1.
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3081
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3082
    "Modified: 4.6.1997 / 12:31:22 / cg"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3083
!
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3084
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3085
specialGlobals
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3086
    "list of globals which can be accessed by specialGlobal opCode; 
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3087
     adding any here requires a new VM (i.e. you cannot change it)"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3088
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3089
    ^ #(
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3090
	#Array                  "/ 0
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3091
	#String                 "/ 1
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3092
	#FloatArray             "/ 2
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3093
	#DoubleArray            "/ 3
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3094
	#Point                  "/ 4
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3095
	#Symbol                 "/ 5
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3096
	#Smalltalk              "/ 6
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3097
	#Processor              "/ 7
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3098
	#SmallInteger           "/ 8
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3099
	#Character              "/ 9
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3100
	#Float                  "/ 10
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3101
	#Process                "/ 11
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3102
	#Set                    "/ 12
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3103
	#IdentitySet            "/ 13
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3104
	#Dictionary             "/ 14
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3105
	#IdentityDictionary     "/ 15
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3106
	#Sempahore              "/ 16
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3107
	#OrderedCollection      "/ 17
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3108
       )
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3109
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3110
    "Created: 4.6.1997 / 12:17:47 / cg"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3111
    "Modified: 4.6.1997 / 12:31:35 / cg"
247
fbb6e3b5764c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
  3112
!
fbb6e3b5764c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
  3113
400
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  3114
specialSendCodeFor:sel
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3115
    "return the codeExtension for sends,
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3116
     which can be performed by specialSend opCode"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3117
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3118
    |idx|
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3119
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3120
    idx := self specialSends identityIndexOf:sel ifAbsent:nil.
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3121
    idx isNil ifTrue:[^ idx].
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3122
    ^ idx - 1.
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3123
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3124
    "Modified: 4.6.1997 / 12:31:08 / cg"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3125
!
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3126
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3127
specialSends
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3128
    "list of selectors which can be sent by specialSend opCode; 
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3129
     adding any here requires a new VM (i.e. you cannot change it)"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3130
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3131
    ^ #(
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3132
	#top                    "/ 0
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3133
	#bottom                 "/ 1
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3134
	#left                   "/ 2
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3135
	#right                  "/ 3
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3136
	#x                      "/ 4
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3137
	#y                      "/ 5
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3138
	#width                  "/ 6
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3139
	#height                 "/ 7
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3140
	#origin                 "/ 8
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3141
	#extent                 "/ 9
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3142
	#asInteger              "/ 10
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3143
	#rounded                "/ 11
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3144
	#next                   "/ 12
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3145
	#peek                   "/ 13
530
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3146
       )
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3147
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3148
    "Created: 4.6.1997 / 12:20:28 / cg"
1736f549e86d code cleanup & comments
Claus Gittinger <cg@exept.de>
parents: 512
diff changeset
  3149
    "Modified: 4.6.1997 / 12:31:56 / cg"
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  3150
! !
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3151
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3152
!ByteCodeCompiler methodsFor:'code generation helpers'!
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3153
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3154
addTempVar
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3155
    "add a temporary variable; return its position (1-based).
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3156
     Used when a block with args/locals is inlined."
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3157
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3158
    numTemp isNil ifTrue:[numTemp := maxNumTemp := 0].
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3159
    numTemp := numTemp + 1.
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3160
    maxNumTemp := maxNumTemp max:numTemp.
560
9311c79529d4 inline blocks withs args/vars
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  3161
    ^ numTemp + methodVars size
9311c79529d4 inline blocks withs args/vars
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  3162
9311c79529d4 inline blocks withs args/vars
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  3163
    "Modified: 26.6.1997 / 10:22:23 / cg"
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3164
!
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3165
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3166
removeTempVar
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3167
    "remove a temporary variable"
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3168
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3169
    numTemp := numTemp - 1
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3170
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3171
    "Created: 25.6.1997 / 14:03:00 / cg"
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3172
    "Modified: 25.6.1997 / 15:06:10 / cg"
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3173
! !
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3174
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3175
!ByteCodeCompiler methodsFor:'machine code generation'!
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3176
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3177
compileToMachineCode:aString forClass:aClass inCategory:cat 
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3178
                             notifying:requestor install:install skipIfSame:skipIfSame silent:silent
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3179
    "this is called to compile primitive code.
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3180
     This is EXPERIMENTAL and going to be changed to raise an error,
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3181
     an redefined in subclasses which can do it (either by direct compilation, or by calling
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3182
     the external stc do do it.
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3183
     For a description of the arguments, see compile:forClass....."
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3184
721
b98c67a8f4e8 must add cpuDefine to cflags.
Claus Gittinger <cg@exept.de>
parents: 704
diff changeset
  3185
    |stFileName stream handle address stcFlags cFlags def
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  3186
     command oFileName cFileName
1071
b721f58d0cd0 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
  3187
     initName oldMethod newMethod ok status className sep class stcPath ccPath 
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3188
     errorStream errorMessages eMsg m supers mP moduleFileName 
959
de1cf34bbace checkin from browser
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  3189
     dummyHandle f mapFileName libFileName pkg t s|
301
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  3190
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  3191
    (mP := STCModulePath asFilename) exists ifFalse:[
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  3192
       mP makeDirectory
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  3193
    ].
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3194
    (mP isDirectory and:[mP isReadable and:[mP isWritable]]) ifFalse:[
959
de1cf34bbace checkin from browser
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  3195
        self parseError:('no access to temporary module directory: ' , mP pathName) position:1.
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3196
        ^ #CannotLoad
301
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
  3197
    ].
959
de1cf34bbace checkin from browser
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  3198
    "/ create a small README there ...
de1cf34bbace checkin from browser
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  3199
    (t := mP construct:'README') exists ifFalse:[
de1cf34bbace checkin from browser
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  3200
        s := t writeStream.
960
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3201
        s nextPutAll:
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3202
'This temporary ST/X directory contains machine code for
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3203
accepted methods with embedded C-code 
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3204
(i.e. dynamic compiled code for inline-C methods).
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3205
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3206
Files here are not automatically removed, since ST/X 
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3207
cannot determine if any (other) snapshot image still 
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3208
requires a file here.
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3209
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3210
Please be careful when removing files here - a snapshot
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3211
image which was saved with accepted embedded C-code
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3212
may not be able to restart correctly if you remove a
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3213
required file.
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3214
Also, when you export a snapshot image for execution
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3215
on another machine, make certain that the required
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3216
module-files are also present there.
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3217
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3218
You should periodically clean dead entries here.
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3219
i.e. remove files, when you are certain that none
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3220
of your snapshot images refers to any module here.
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3221
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3222
See the launchers File-Modules dialog for a list of
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3223
modules which are still required by your running image.
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3224
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3225
With kind regards - your ST/X.
cdcc0151a13b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 959
diff changeset
  3226
'.
959
de1cf34bbace checkin from browser
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  3227
        s close.
de1cf34bbace checkin from browser
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
  3228
    ].
96
claus
parents: 95
diff changeset
  3229
172
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
  3230
    ObjectFileLoader isNil ifTrue:[^ #CannotLoad].
85ad12831217 give user a chance to choose between trapCode and original code if compilation to binary is not possible
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
  3231
    STCCompilation == #never ifTrue:[^ #CannotLoad].
120
claus
parents: 118
diff changeset
  3232
    (stcPath := self class incrementalStcPath) isNil ifTrue:[
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3233
        self parseError:'no stc compiler available - cannot create machine code' position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3234
        ^ #CannotLoad
120
claus
parents: 118
diff changeset
  3235
    ].
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  3236
    (ccPath := self class ccPath) isNil ifTrue:[
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3237
        self parseError:'no cc compiler available - cannot create machine code' position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3238
        ^ #CannotLoad
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3239
    ].
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  3240
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3241
    (ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3242
        self parseError:'no dynamic loader configured - cannot create machine code' position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3243
        ^ #CannotLoad
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
  3244
    ].
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  3245
298
118648c3b590 include the processID in the dynamic modules name;
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
  3246
    "/ generate a unique name, consisting of my processID and a sequence number
118648c3b590 include the processID in the dynamic modules name;
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
  3247
    "/ the processId is added to allow filein of modules from different
118648c3b590 include the processID in the dynamic modules name;
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
  3248
    "/ lifes
118648c3b590 include the processID in the dynamic modules name;
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
  3249
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3250
    SequenceNumber isNil ifTrue:[SequenceNumber := 0].
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  3251
    SequenceNumber := SequenceNumber + 1.
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3252
298
118648c3b590 include the processID in the dynamic modules name;
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
  3253
    initName := 'm_' , OperatingSystem getProcessId printString, '_' , SequenceNumber printString.
118648c3b590 include the processID in the dynamic modules name;
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
  3254
751
4f112db52253 added Verbose option;
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
  3255
    stFileName := (Filename currentDirectory construct:(initName , '.st')) name. 
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  3256
    stream := stFileName asFilename writeStream.
187
8aa7dd9bb1e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 182
diff changeset
  3257
    stream isNil ifTrue:[
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3258
        self parseError:'cannot create temporary sourcefile for compilation'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3259
        ^ #CannotLoad
187
8aa7dd9bb1e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 182
diff changeset
  3260
    ].
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3261
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3262
    [
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3263
        |definedClasses|
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3264
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3265
        definedClasses := IdentitySet new.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3266
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3267
        sep := stream class chunkSeparator.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3268
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3269
        class := aClass.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3270
        class isMeta ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3271
            class := aClass soleInstance
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3272
        ].
792
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3273
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3274
        Class fileOutNameSpaceQuerySignal answer:true
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3275
        do:[
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3276
            supers := class allSuperclasses.
925
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3277
            supers reverseDo:[:cls|
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3278
                true "cls ~~ Object" ifTrue:[
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3279
                    cls isLoaded ifFalse:[
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3280
                        stream close.
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3281
                        ^ #CannotLoad
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3282
                    ].
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3283
                    cls fileOutDefinitionOn:stream.
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3284
                    stream nextPut:sep; cr.
6fa294773f07 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 921
diff changeset
  3285
                    definedClasses add:cls.
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3286
                ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3287
            ].
792
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3288
            class fileOutDefinitionOn:stream.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3289
            stream nextPut:sep; cr.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3290
            definedClasses add:class.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3291
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3292
            class privateClassesSorted do:[:aPrivateClass |
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3293
                supers := aPrivateClass allSuperclasses.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3294
                supers notNil ifTrue:[
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3295
                    supers reverseDo:[:cls|
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3296
                        (definedClasses includes:cls) ifFalse:[
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3297
                            true "cls ~~ Object" ifTrue:[
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3298
                                cls isLoaded ifFalse:[
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3299
                                    stream close.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3300
                                    ^ #CannotLoad
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3301
                                ].
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3302
                                cls fileOutDefinitionOn:stream.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3303
                                stream nextPut:sep; cr.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3304
                                definedClasses add:cls.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3305
                            ]
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3306
                        ]
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3307
                    ]
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3308
                ].
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3309
                (definedClasses includes:aPrivateClass) ifFalse:[
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3310
                    aPrivateClass fileOutDefinitionOn:stream.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3311
                    stream nextPut:sep; cr.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3312
                    definedClasses add:aPrivateClass.
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3313
                ]
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3314
            ].
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3315
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3316
            class fileOutPrimitiveDefinitionsOn:stream.
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3317
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3318
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3319
        stream nextPut:sep.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3320
        className := class name.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3321
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3322
        stream nextPutAll:className.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3323
        aClass isMeta ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3324
            stream nextPutAll:' class'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3325
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3326
        stream nextPutAll:' methodsFor:'''; nextPutAll:cat; nextPutAll:''''.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3327
        stream nextPut:sep; cr.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3328
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3329
        stream nextPutLine:'"{ Line: 0 }"'; 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3330
               nextChunkPut:aString;
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3331
               space; nextPut:sep.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3332
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3333
        stream close.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3334
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3335
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3336
         call stc to compile it
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3337
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3338
        oFileName := stFileName asFilename withoutSuffix name , (ObjectFileLoader objectFileExtension).
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3339
        cFileName := (stFileName asFilename withSuffix:'c') name. 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3340
        mapFileName := (stFileName asFilename withSuffix:'map') name. 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3341
        libFileName := (stFileName asFilename withSuffix:'lib') name. 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3342
        oFileName asFilename delete.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3343
        cFileName asFilename delete.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3344
781
7de50bbbf651 no need to set stcFlags to -commonSymbols and +sharedLibCode
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  3345
        "/ stcFlags := '-commonSymbols +sharedLibCode +newIncremental -E:errorOutput -N' , initName .
7de50bbbf651 no need to set stcFlags to -commonSymbols and +sharedLibCode
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  3346
        stcFlags := '+newIncremental -E:errorOutput -N' , initName .
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3347
        cFlags := OperatingSystem getOSDefine.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3348
        cFlags isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3349
            cFlags := ''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3350
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3351
        (def := OperatingSystem getCPUDefine) notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3352
            cFlags := cFlags , ' ' , def
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3353
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3354
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3355
        STCCompilationDefines notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3356
            cFlags := cFlags , ' ' , STCCompilationDefines
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3357
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3358
        STCCompilationIncludes notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3359
            stcFlags := STCCompilationIncludes , ' ' , stcFlags.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3360
            cFlags := cFlags , ' ' , STCCompilationIncludes.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3361
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3362
        STCCompilationOptions notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3363
            stcFlags := STCCompilationOptions , ' ' , stcFlags
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3364
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3365
        CCCompilationOptions notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3366
            cFlags := cFlags , ' ' , CCCompilationOptions
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3367
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3368
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3369
        command := stcPath , ' ' , stcFlags , ' -C ' , stFileName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3370
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3371
        Verbose == true ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3372
            'executing: ' infoPrint. command infoPrintCR.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3373
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3374
        errorStream := 'errorOutput' asFilename writeStream.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3375
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3376
        self activityNotification:'compiling (stc)'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3377
        ok := OperatingSystem 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3378
                    executeCommand:command 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3379
                    inputFrom:nil
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3380
                    outputTo:errorStream
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3381
                    errorTo:errorStream
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3382
                    onError:[:stat| 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3383
                                status := stat.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3384
                                false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3385
                            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3386
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3387
        cFileName asFilename exists ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3388
            ok ifFalse:[
810
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3389
                'Compiler [info]: oops - system says stc failed - but c-file is there ...' infoPrintCR.
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3390
                ok := true
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3391
            ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3392
        ] ifFalse:[
810
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3393
            ok ifTrue:[
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3394
                'Compiler [info]: oops - system says stc ok - but no c-file is there ...' infoPrintCR.
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3395
            ].
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3396
            ok := false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3397
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3398
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3399
        ok ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3400
            "/ now compile to machine code
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3401
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3402
            command := ccPath , ' ' , cFlags , ' -c ' , cFileName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3403
            Verbose == true ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3404
                'executing: ' infoPrint. command infoPrintCR.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3405
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3406
            self activityNotification:'compiling (' , ccPath , ')'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3407
            ok := OperatingSystem 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3408
                        executeCommand:command 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3409
                        inputFrom:nil
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3410
                        outputTo:errorStream
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3411
                        errorTo:errorStream
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3412
                        onError:[:stat| 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3413
                                    status := stat.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3414
                                    false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3415
                                ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3416
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3417
            oFileName asFilename exists ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3418
                ok ifFalse:[
810
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3419
                    'Compiler [info]: system says compile failed - but o-file is there ...' infoPrintCR.
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3420
                    ok := true
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3421
                ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3422
            ] ifFalse:[
810
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3423
                ok ifTrue:[
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3424
                    'Compiler [info]: system says compile ok - but no o-file is there ...' infoPrintCR.
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3425
                ].
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3426
                ok := false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3427
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3428
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3429
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3430
        ok ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3431
            (status notNil and:[status couldNotExecute]) ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3432
                eMsg := 'oops, no STC - cannot create machine code'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3433
            ] ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3434
                errorStream := 'errorOutput' asFilename readStream.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3435
                errorStream notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3436
                    errorMessages := errorStream contents.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3437
                    errorStream close.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3438
                    errorMessages notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3439
                        errorMessages := errorMessages asStringCollection.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3440
                        errorMessages size > 20 ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3441
                            errorMessages := (errorMessages copyTo:20) copyWith:'... more messages skipped'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3442
                        ].
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3443
    "/                    errorMessages := errorMessages collect:[:line |
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3444
    "/                        (line startsWith:(stFileName , ':')) ifTrue:[
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3445
    "/                            'Line: ' , (line copyFrom:(stFileName size + 2))
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3446
    "/                        ] ifFalse:[
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3447
    "/                            line
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3448
    "/                        ]
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3449
    "/                      ].
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3450
                        errorMessages := errorMessages asString
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3451
                    ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3452
                ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3453
                errorMessages isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3454
                    errorMessages := ''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3455
                ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3456
                errorMessages isEmpty ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3457
                    eMsg := 'STC / CC error during compilation:\\unspecified error'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3458
                ] ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3459
                    eMsg := 'STC / CC error during compilation:\\',errorMessages
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3460
                ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3461
                eMsg := eMsg withCRs
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3462
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3463
            self activityNotification:'compilation failed'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3464
            self parseError:eMsg position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3465
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3466
            self activityNotification:''.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3467
            ^ #Error
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3468
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3469
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3470
        self activityNotification:''.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3471
        OperatingSystem removeFile:'errorOutput'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3472
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3473
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3474
         if required, make a shared or otherwise loadable object file for it
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3475
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3476
        self activityNotification:'linking'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3477
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3478
        oFileName := ObjectFileLoader createLoadableObjectFor:initName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3479
        oFileName isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3480
            "/ something went wrong
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3481
            self parseError:(ObjectFileLoader lastError) position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3482
            ^ #CannotLoad
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3483
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3484
        oFileName asFilename exists ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3485
            self parseError:'link failed - cannot create machine code' position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3486
            ^ #CannotLoad
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3487
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3488
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3489
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3490
         move it into the modules directory
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3491
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3492
        moduleFileName := (STCModulePath asFilename construct:(initName , '.' , (oFileName asFilename suffix))) name.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3493
        oFileName asFilename moveTo:moduleFileName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3494
        (moduleFileName asFilename exists 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3495
        and:[moduleFileName asFilename isReadable]) ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3496
            self parseError:'link failed - cannot move shared library module to ''modules'' directory' position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3497
            ^ #CannotLoad
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3498
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3499
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3500
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3501
         load the objectfile
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3502
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3503
        self activityNotification:'loading'.
781
7de50bbbf651 no need to set stcFlags to -commonSymbols and +sharedLibCode
Claus Gittinger <cg@exept.de>
parents: 773
diff changeset
  3504
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3505
        handle := ObjectFileLoader loadDynamicObject:moduleFileName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3506
        handle isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3507
            OperatingSystem removeFile:moduleFileName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3508
            self parseError:'dynamic load failed - cannot create machine code' position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3509
            ^ #CannotLoad
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3510
        ].
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3511
    "/    ('handle is ' , handle printString) infoPrintCR.
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3512
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3513
        "/ try libs to resolve symbols.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3514
        (ObjectFileLoader hasUndefinedSymbolsIn:handle) ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3515
            ObjectFileLoader searchedLibraries do:[:libName |
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3516
                (ObjectFileLoader hasUndefinedSymbolsIn:handle) ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3517
                    Transcript showCR:'   ... trying ' , libName , ' to resolve undefined symbols ...'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3518
                    dummyHandle := Array new:4.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3519
                    dummyHandle := ObjectFileLoader primLoadDynamicObject:libName into:dummyHandle.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3520
                    dummyHandle isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3521
                        Transcript showCR:'   ... load of library ' , libName , ' failed.'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3522
                    ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3523
                ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3524
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3525
            (ObjectFileLoader hasUndefinedSymbolsIn:handle) isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3526
                Transcript showCR:('LOADER: still undefined symbols in ',initName,'.').
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3527
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3528
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3529
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3530
        address := ObjectFileLoader getFunction:'__' , initName , '_Init' from:handle.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3531
        address isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3532
            address := ObjectFileLoader getFunction:'_' , initName , '_Init' from:handle.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3533
            address isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3534
                address := ObjectFileLoader getFunction:initName , '_Init' from:handle.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3535
                address isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3536
                    (ObjectFileLoader getListOfUndefinedSymbolsFrom:handle) size > 0 ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3537
                        ObjectFileLoader listUndefinedSymbolsIn:handle.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3538
                        eMsg := 'undefined symbols in primitive code'.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3539
                    ] ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3540
                        eMsg := initName , '_Init() lookup failed'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3541
                    ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3542
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3543
                    ObjectFileLoader unloadDynamicObject:handle.
599
9eaffb06df33 #createLoadableObjectFor: has been moved into ObjectFileLoader.
Stefan Vogel <sv@exept.de>
parents: 594
diff changeset
  3544
704
387a61fb1839 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
  3545
"/                OperatingSystem getSystemType = 'osf' ifTrue:[
387a61fb1839 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
  3546
"/                   OperatingSystem executeCommand:('nm -u ' , moduleFileName)
387a61fb1839 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
  3547
"/                ].
387a61fb1839 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 695
diff changeset
  3548
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3549
"/                    OperatingSystem removeFile:moduleFileName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3550
                    self parseError:(eMsg , ' - cannot create machine code') position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3551
                    ^ #CannotLoad
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3552
                ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3553
            ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3554
        ].
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3555
1071
b721f58d0cd0 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
  3556
        oldMethod := aClass compiledMethodAt:selector.
b721f58d0cd0 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
  3557
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3558
    "/    ('init at ' , address printString) infoPrintCR.
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3559
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3560
        m := ObjectFileLoader 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3561
            callInitFunctionAt:address 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3562
            specialInit:true
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3563
            forceOld:true 
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3564
            interruptable:false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3565
            argument:2
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3566
            identifyAs:handle
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3567
            returnsObject:true.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3568
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3569
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3570
         did it work ?
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3571
        "
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3572
        newMethod := aClass compiledMethodAt:selector.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3573
        newMethod notNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3574
            m ~~ newMethod ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3575
                'Compiler [warning]: loaded method installed itself in another class' errorPrintCR.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3576
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3577
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3578
            newMethod source:aString string.
946
f768a4b86f8d package setting fixed
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3579
974
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3580
            (aClass isNil or:[aClass owningClass isNil]) ifTrue:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3581
                (requestor respondsTo:#packageToInstall) ifFalse:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3582
                    pkg := Class packageQuerySignal query.
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3583
                ] ifTrue:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3584
                    pkg := requestor packageToInstall
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3585
                ].
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3586
            ] ifFalse:[
6ef9d2754f62 private class-methods always get the owners package as id
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
  3587
                pkg := aClass owningClass package
946
f768a4b86f8d package setting fixed
Claus Gittinger <cg@exept.de>
parents: 937
diff changeset
  3588
            ].
1118
01e9dcf336e5 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3589
            newMethod setPackage:pkg.
415
16ff7a17c08b fixes for packageQuery
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
  3590
"/            Project notNil ifTrue:[
16ff7a17c08b fixes for packageQuery
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
  3591
"/                newMethod package:(Project currentPackageName)
16ff7a17c08b fixes for packageQuery
Claus Gittinger <cg@exept.de>
parents: 412
diff changeset
  3592
"/            ].
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3593
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3594
    "/        aClass updateRevisionString.
1071
b721f58d0cd0 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
  3595
            aClass addChangeRecordForMethod:newMethod fromOld:oldMethod.
b721f58d0cd0 keep previousVersion of method in changeSet
Claus Gittinger <cg@exept.de>
parents: 1055
diff changeset
  3596
1113
f258bb0b394e when compiling machine code: must send a change notification
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  3597
            "/ kludge-sigh: must send change messages manually here (stc-loaded code does not do it)
f258bb0b394e when compiling machine code: must send a change notification
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  3598
            "/ see addMethod:... in ClassDescription
f258bb0b394e when compiling machine code: must send a change notification
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  3599
            aClass changed:#methodDictionary with:(Array with:selector with:oldMethod).
f258bb0b394e when compiling machine code: must send a change notification
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  3600
            Smalltalk changed:#methodInClass with:(Array with:aClass with:selector with:oldMethod).
f258bb0b394e when compiling machine code: must send a change notification
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  3601
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3602
            (silent or:[Smalltalk silentLoading == true]) ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3603
                Transcript showCR:('    compiled: ', className,' ',selector,' - machine code')
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3604
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3605
            ObjectMemory flushCaches.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3606
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3607
            handle method:newMethod.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3608
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3609
            "/ check for obsolete loaded objects and unload them
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3610
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3611
            ObjectFileLoader loadedObjectHandlesDo:[:anotherHandle |
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3612
                anotherHandle isMethodHandle ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3613
                    anotherHandle method isNil ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3614
                        ObjectFileLoader unloadObjectFile:anotherHandle pathName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3615
                        OperatingSystem removeFile:anotherHandle pathName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3616
                    ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3617
                ]
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3618
            ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3619
            ^ newMethod.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3620
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3621
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3622
        OperatingSystem removeFile:moduleFileName.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3623
        self parseError:'dynamic load failed' position:1.
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3624
        ^ #CannotLoad
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3625
    ] valueNowOrOnUnwindDo:[
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3626
        STCKeepSTIntermediate ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3627
            OperatingSystem removeFile:stFileName.
792
481f2cdc1fb1 when generating code for stc-compiled methods,
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  3628
            OperatingSystem removeFile:'errorOutput'.
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3629
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3630
        STCKeepOIntermediate == true ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3631
            (oFileName notNil and:[oFileName asFilename exists]) ifTrue:[oFileName asFilename delete].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3632
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3633
        STCKeepCIntermediate == true ifFalse:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3634
            (cFileName notNil and:[cFileName asFilename exists]) ifTrue:[cFileName asFilename delete].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3635
        ].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3636
        OperatingSystem isMSDOSlike ifTrue:[
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3637
"/            (mapFileName notNil and:[mapFileName asFilename exists]) ifTrue:[mapFileName asFilename delete].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3638
"/            (libFileName notNil and:[libFileName asFilename exists]) ifTrue:[libFileName asFilename delete].
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3639
        ].
407
a8c20d561cd6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 400
diff changeset
  3640
    ].
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3641
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3642
    "
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3643
     |m|
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3644
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3645
     Object subclass:#Test
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3646
            instanceVariableNames:''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3647
            classVariableNames:''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3648
            poolDictionaries:''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3649
            category:'tests'.
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3650
     m := ByteCodeCompiler
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3651
            compile:'foo ^ ''hello'''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3652
            forClass:Test
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3653
            inCategory:'tests'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3654
            notifying:nil
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3655
            install:false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3656
            skipIfSame:false.
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3657
     m inspect
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3658
    "
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3659
    "
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3660
     |m|
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3661
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3662
     Object subclass:#Test
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3663
            instanceVariableNames:''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3664
            classVariableNames:''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3665
            poolDictionaries:''
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3666
            category:'tests'.
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3667
     m := ByteCodeCompiler
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3668
            compileToMachineCode:'foo %{ RETURN (_MKSMALLINT(1)); %}'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3669
            forClass:Test
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3670
            inCategory:'tests'
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3671
            notifying:nil
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3672
            install:false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3673
            skipIfSame:false
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
  3674
            silent:false.
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3675
     m inspect
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3676
    "
120
claus
parents: 118
diff changeset
  3677
723
188be048b0b2 when generating machine code,
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
  3678
    "Modified: / 14.9.1995 / 22:33:04 / claus"
810
de5df7181204 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 792
diff changeset
  3679
    "Modified: / 15.2.1999 / 15:53:05 / cg"
833
740fd0e90414 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 831
diff changeset
  3680
    "Modified: / 19.3.1999 / 08:31:42 / stefan"
182
b8316f207380 added query for fileFormat; moved link-code from BCompiler to ObjFLoader
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3681
!
b8316f207380 added query for fileFormat; moved link-code from BCompiler to ObjFLoader
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
  3682
97
claus
parents: 96
diff changeset
  3683
trappingStubMethodFor:aString inCategory:cat
claus
parents: 96
diff changeset
  3684
    "return a stub method which traps and reports an error whenever
claus
parents: 96
diff changeset
  3685
     called."
claus
parents: 96
diff changeset
  3686
292
163651658aee Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 287
diff changeset
  3687
    |newMethod|
97
claus
parents: 96
diff changeset
  3688
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  3689
    newMethod := self methodClass new:(litArray size).
292
163651658aee Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 287
diff changeset
  3690
    litArray notNil ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
  3691
        newMethod literals:litArray
97
claus
parents: 96
diff changeset
  3692
    ].
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  3693
124
claus
parents: 120
diff changeset
  3694
    newMethod makeUncompiled.
594
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  3695
    newMethod numberOfVars:(self numberOfMethodVars).
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  3696
    newMethod numberOfArgs:(self numberOfMethodArgs).
682
784f564b4b7a make certain that methods source is always a string
ca
parents: 658
diff changeset
  3697
    newMethod source:aString string.
1117
f03c007dadc6 methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  3698
    newMethod setCategory:cat.
97
claus
parents: 96
diff changeset
  3699
    ^ newMethod
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  3700
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
  3701
    "Modified: / 1.8.1997 / 00:27:32 / cg"
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
  3702
    "Modified: / 18.3.1999 / 18:12:33 / stefan"
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3703
! !
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  3704
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3705
!ByteCodeCompiler methodsFor:'queries'!
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3706
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3707
numberOfTempVars
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3708
    "return the number of additional temporary variables which
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3709
     were created from inlined blocks (valid after parsing)"
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3710
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3711
    ^ maxNumTemp ? 0
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3712
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3713
    "Created: 25.6.1997 / 13:54:29 / cg"
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3714
    "Modified: 25.6.1997 / 15:21:34 / cg"
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3715
! !
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3716
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
  3717
!ByteCodeCompiler class methodsFor:'documentation'!
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  3718
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  3719
version
1118
01e9dcf336e5 method category: and package: now send change notifications.
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3720
    ^ '$Header: /cvs/stx/stx/libcomp/ByteCodeCompiler.st,v 1.178 2000-11-22 11:01:45 cg Exp $'
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  3721
! !
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  3722
ByteCodeCompiler initialize!