ByteCodeCompiler.st
author Claus Gittinger <cg@exept.de>
Mon, 07 Aug 2006 13:01:07 +0200
changeset 1790 a40965dae8cb
parent 1778 cdb6be2cc6ee
child 1792 87315c3bd290
permissions -rw-r--r--
tree compilation support
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'
1667
d8979b5429de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1666
diff changeset
    19
	classVariableNames:'JumpToAbsJump ShareCode ListCompiledMethods NewCodeSet
d8979b5429de *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1666
diff changeset
    20
		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
    21
	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
    22
	category:'System-Compiler'
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    23
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    24
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
    25
!ByteCodeCompiler class methodsFor:'documentation'!
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
    26
1030
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    27
byteCode
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    28
"
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    29
    TOS   - top of stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    30
    NOS   - next on stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    31
    uu    - byte-valued unsigned (0..16rFF)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    32
    uuuu  - twoByte-valued unsigned (0..16rFFFF); msb-first
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    33
    ll    - byte-valued literal index (0..16rFF)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    34
    nn    - byte-valued signed (-128..+127)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    35
    nnnn  - twoByte-valued signed (16r-8000 .. 16r7FFF)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    36
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    37
    Notes: 
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    38
        - bytecode optimized for space, not interpreter speed,
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    39
          since JITTER is assumed to be present and compensate for decoding
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    40
          overhead.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    41
        - number assignments due to backward compatible extensions of the
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    42
          bytecode set - reassignment & cleanup would be nice.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    43
        - codes marked with (*) make the minimal set; all others duplicate
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    44
          the functionality of a minimalSet code, but provides dense encoding
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    45
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    46
    definition of ST/X byteCode:
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    47
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    48
    *   00          RET_TOP         return TOS from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    49
        01          RET_NIL         return nil from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    50
        02          RET_TRUE        return true from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    51
        03          RET_FALSE       return false from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    52
        04          RET_0           return 0 (zero) from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    53
        05          RET_SELF        return the current receiver from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    54
    *   06          DUP_OVER        push NOS (used with inlined loops)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    55
    *   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
    56
        08 uu       LINENO          line number information dummy     
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    57
    *   09 uuuu     LINENO16        line number information dummy
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    58
        0A          PUSH_NIL        push nil onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    59
        0B          PUSH_TRUE       push true onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    60
        0C          PUSH_FALSE      push false onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    61
        0D          SEND_SELF       self-send
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    62
    *   0E ll       PUSH_LIT        push a literal
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    63
        0F          PUSH_SELF       push the current receiver onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    64
        10 nn       PUSH_NUM        push a byte-valued smallInteger onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    65
        11 nnnn     PUSH_NUM16      push a twoByte-valued smallInteger onto stack
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    66
    *   12          DROP            pop & forget
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    67
    *   13          SEND            send 
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    68
    *   14          SUPER_SEND      super-send (actually: directed send) 
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    69
        15          SEND0           send 0-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    70
        16          SEND1           send 1-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    71
        17          SEND2           send 2-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    72
        18          SEND3           send 3-arg message
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    73
        19          SEND_DROP       send & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    74
        1A          SEND0_DROP      send 0-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    75
        1B          SEND1_DROP      send 1-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    76
        1C          SEND2_DROP      send 2-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    77
        1D          SEND3_DROP      send 3-arg message & forget result
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    78
    *   1E          PUSH_MARG       push method arg
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    79
    *   1F          PUSH_MVAR       push method variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    80
    *   20          PUSH_BARG       push block arg
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    81
    *   21          PUSH_BVAR       push block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    82
    *   22          PUSH_IVAR       push instance variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    83
        23          PUSH_CVAR       -- obsolete -- no longer used.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    84
    *   24          PUSH_GLOB       push global
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    85
    *   25          STORE_MVAR      pop and store into method variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    86
    *   26          STORE_BVAR      pop and store into block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    87
    *   27          STORE_IVAR      pop and store into instance variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    88
        28          STORE_CVAR      -- obsolete -- no longer used.
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    89
    *   29          STORE_GLOB      pop and store into global
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    90
    *   2A          PUSH_OBARG      push outer block arg (n levels)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    91
        2B          PUSH_OBARG1     push outer block arg (1 level)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    92
        2C          PUSH_OBARG2     push outer block arg (2 levels)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    93
        2D          EQEQ            == -> pop a,b; push a==b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    94
        2E          NENE            ~~ -> pop a,b; push a~~b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    95
    *   2F          DUP             duplicate TOS
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    96
        30          EQEQ0           ==0 -> pop a; push a==0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    97
        31          NENE0           ~~0 -> pop a; push a~~0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    98
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
    99
        32          JMP_FALSE       pop; branch if false
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   100
        33          JMP_TRUE        pop; branch if true
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   101
        34          JMP_NIL         pop; branch if nil
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   102
        35          JMP_NOTNIL      pop; branch if not nil
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   103
        36          JMP             branch always
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   104
        37          MAKE_BLOCK      make a block
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   105
        38          JMP_ZERO        pop; branch if ==0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   106
        39          JMP_NOTZERO     pop; branch if ~~0
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   107
        3A          JMP_EQEQ        pop a,b; branch if a==b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   108
        3B          JMP_NENE        pop a,b; branch if a~~b
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   109
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   110
        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
   111
        ...          ...
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   112
        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
   113
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   114
        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
   115
        ...          ...
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   116
        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
   117
        
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   118
        50          PUSH_MVAR1      push method variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   119
        51          PUSH_MVAR2      push method variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   120
        52          PUSH_MVAR3      push method variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   121
        53          PUSH_MVAR4      push method variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   122
        54          PUSH_MVAR5      push method variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   123
        55          PUSH_MVAR6      push method variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   124
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   125
        56          PUSH_MARG1      push method arg 1
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   126
        57          PUSH_MARG2      push method arg 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   127
        58          PUSH_MARG3      push method arg 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   128
        59          PUSH_MARG4      push method arg 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   129
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   130
        5A          PUSH_IVAR1      push inst variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   131
        5B          PUSH_IVAR2      push inst variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   132
        5C          PUSH_IVAR3      push inst variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   133
        5D          PUSH_IVAR4      push inst variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   134
        5E          PUSH_IVAR5      push inst variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   135
        5F          PUSH_IVAR6      push inst variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   136
        60          PUSH_IVAR7      push inst variable 7
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   137
        61          PUSH_IVAR8      push inst variable 8
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   138
        62          PUSH_IVAR9      push inst variable 9
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   139
        63          PUSH_IVAR10     push inst variable 10
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   140
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   141
        64          STORE_MVAR1     pop and store into method variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   142
        65          STORE_MVAR2     pop and store into method variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   143
        66          STORE_MVAR3     pop and store into method variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   144
        67          STORE_MVAR4     pop and store into method variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   145
        68          STORE_MVAR5     pop and store into method variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   146
        69          STORE_MVAR6     pop and store into method variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   147
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   148
        6A          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   149
        6B          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   150
        6C          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   151
        6D          unused
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   152
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   153
        6E          STORE_IVAR1     pop and store into inst variable 1 (first variable)
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   154
        6F          STORE_IVAR2     pop and store into inst variable 2
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   155
        70          STORE_IVAR3     pop and store into inst variable 3
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   156
        71          STORE_IVAR4     pop and store into inst variable 4
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   157
        72          STORE_IVAR5     pop and store into inst variable 5
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   158
        73          STORE_IVAR6     pop and store into inst variable 6
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   159
        74          STORE_IVAR7     pop and store into inst variable 7
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   160
        75          STORE_IVAR8     pop and store into inst variable 8
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   161
        76          STORE_IVAR9     pop and store into inst variable 9
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   162
        77          STORE_IVAR10    pop and store into inst variable 10
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   163
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   164
        78          PUSH_0          push smallinteger 0 constant
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   165
        79          PUSH_1          push smallinteger 1 constant
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   166
        7A          PUSH_M1         push smallinteger -1 constant
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   167
1031
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   168
        7B          SEND_PLUS1      send '+ 1' to TOS; replace TOS by result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   169
        7C          SEND_MINUS1     send '- 1' to TOS; replace TOS by result
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   170
        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
   171
        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
   172
        7F nn       RET_NUM         return a smallInteger from current context
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   173
    *   80          PUSH_OBVAR      push outer block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   174
    *   81          STORE_OBVAR     pop and store into outer block variable
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   175
1031
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   176
        82          SEND_EQ         send #= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   177
        83          SEND_PLUS       send #+ 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   178
        84          SEND_NE         send #~= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   179
        85          SEND_MINUS      send #- 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   180
        86          SEND_CLASS      send #class 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   181
        87          SEND_AT         send #at:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   182
        88          SEND_ATPUT      send #at:put: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   183
        89          SEND_BITAND     send #bitAnd: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   184
        8A          SEND_BITOR      send #bitOr: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   185
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   186
        8B          PUSH_2          push constant 2
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   187
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   188
        8C          PUSH_BARG1      push block argument 1
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   189
        8D          PUSH_BARG2      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   190
        8E          PUSH_BARG3      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   191
        8F          PUSH_BARG4      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   192
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   193
    *   90          PUSH_CONTEXT    push thisContext
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   194
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   195
        91          SEND_GT         send > 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   196
        92          SEND_GE         send >= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   197
        93          SEND_LT         send < 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   198
        94          SEND_LE         send <= 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   199
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   200
        95          UNUSED_149      obsolete; was: send #next 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   201
        96          UNUSED_150      obsolete; was: send #peek 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   202
        97          SEND_VALUE      send #value 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   203
        98          SEND_VALUE1     send #value: 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   204
        99          SEND_SIZE       send #size 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   205
        9A          UNUSED_154      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   206
        9B          UNUSED_155      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   207
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   208
        9C          MK0BLOCK        make a 0-returning block     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   209
        9D          MKNILBLOCK      make a nil-returning block
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
        9E          UNUSED_158      obsolete; was: send #asInteger */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   212
        9F          UNUSED_159      obsolete; was: send #rounded */
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
        A0          RET_MVAR1       return method variable 1 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   215
        A1          RET_MVAR2       return method variable 2 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   216
        A2          RET_MVAR3       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   217
        A3          RET_MVAR4       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   218
        A4          RET_MVAR5       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   219
        A5          RET_MVAR6       return method variable 6 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   220
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   221
        A6          RET_IVAR1       return instance variable 1 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   222
        A7          RET_IVAR2       return instance variable 2 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   223
        A8          RET_IVAR3       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   224
        A9          RET_IVAR4       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   225
        AA          RET_IVAR5       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   226
        AB          RET_IVAR6       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   227
        AC          RET_IVAR7       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   228
        AD          RET_IVAR8       return instance variable 8 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   229
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   230
        AE          RET_MARG1       return method arg 1 from current context
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   231
        AF          RET_MARG2       return method arg 1 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
        B0          PUSH_CIVAR      obsolete; push class instance variable 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   234
        B1          STORE_CIVAR     obsolete; store top of stack in class instance variable 
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
        B2          SEND_VALUE2     send #value:value:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   237
        B3          SEND_NOT        send #not     
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
        B4          SEND_SELF0      send a 0-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   240
        B5          SEND_SELF1      send a 1-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   241
        B6          SEND_SELF2      send a 2-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   242
        B7          SEND_SELF3      send a 3-arg message to self 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   243
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   244
        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
   245
        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
   246
        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
   247
        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
   248
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   249
        BC          ISNIL           replace TOS by 'TOS isNil'     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   250
        BD          NOTNIL          replace TOS by 'TOS notNil'     
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
        BE uuuu     JMPA_FALSE      jumps to absolute offset (2 byte hi-lo) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   253
        BF uuuu     JMPA_TRUE       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   254
        C0 uuuu     JMPA_NIL        
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   255
        C1 uuuu     JMPA_NOTNIL     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   256
        C2 uuuu     JMPA            
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   257
        C3          MAKE_ABLOCK     
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   258
        C4 uuuu     JMPA_ZERO       
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   259
        C5 uuuu     JMPA_NOTZERO    
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   260
        C6 uuuu     JMPA_EQ         
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   261
        C7 uuuu     JMPA_NOTEQ      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   262
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   263
        C8 xx       PUSH_GSPECIAL   push a special global; xx specifies what:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   264
           00        Array   (push 'Smalltalk at:#Array'; i.e. the Array class)
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   265
           01        String  (push 'Smalltalk at:#String'; i.e. the String class)
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   266
           02        FloatArray
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   267
           03        DoubleArray
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   268
           04        Point
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   269
           05        Symbol
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   270
           06        Smalltalk
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   271
           07        Processor
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   272
           08        SmallInteger
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   273
           09        Character
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   274
           0A        Float
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   275
           0B        Process
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   276
           0C        Set
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   277
           0D        IdentitySet
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   278
           0E        Dictionary
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   279
           0F        IdentityDictionary
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   280
           10        Semaphore
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   281
           11        OrderedCollection
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   282
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   283
        C9 uuuu     PUSH_LLIT       push a literal (2-byte literal-number)
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   284
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   285
        CA nn       JMP_FALSE_L     jump if top is false (+127 .. -128) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   286
        CB nn       JMP_TRUE_L      jump if top is true 
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
        CC          UNUSED_204      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   289
        CD          LSEND_MSG       send with 16 bit literal index */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   290
        CE          LSUPERSEND_MSG  super send with 16 bit literal index */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   291
        CF          LSEND_SELF      self-send send with 16 bit literal index */
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   292
        D0          PUSH_GT0        push 'TOS > 0'; leaves original TOS as NOS
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   293
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   294
        D1          UNUSED_209      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   295
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   296
        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
   297
        D3          SEND_BASICNEW   top is class (receiver) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   298
        D4          SEND_GT0        replace TOS by result of send 'TOS > 0' 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   299
        D5          SEND_NEW        top is class (receiver) 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   300
        D6          SEND_BASICNEWN  top is class (receiver) and arg 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   301
        D7          SEND_NEWN       top is class (receiver) and arg
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   302
        D8          SEND_LOGAND     send & 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   303
        D9          SEND_LOGOR      send | 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   304
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   305
        DA uuuu     PUSH_LGLOB      push global variable word index literal 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   306
        DB uuuu     STORE_LGLOB     store global with word index literal 
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
        DC          UNUSED_220      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   309
        DE          UNUSED_221      
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
        DF          PUSH_LIT1       push 1st literal
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   312
        E0          PUSH_LIT2       push 2nd literal 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   313
        E1          PUSH_LIT3       push literal 3 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   314
        E2          PUSH_LIT4       push literal 4 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   315
        E3          PUSH_LIT5       push literal 5 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   316
        E4          PUSH_LIT6       push literal 6 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   317
        E5          PUSH_LIT7       push literal 7 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   318
        E6          PUSH_LIT8       push literal 8 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   319
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   320
        E7          SEND_MUL        send #* 
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   321
        E8 xx       SEND_SPECIAL    special send; as specified by xx:
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   322
           00         top           send #top
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   323
           01         bottom        send #bottom
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   324
           02         left          send #left
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   325
           03         right         send #right
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   326
           04         x             send #x
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   327
           05         y             send #y
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   328
           06         width         send #width
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   329
           07         height        send #height
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   330
           08         origin        send #origin
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   331
           09         extent        send #extent
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   332
           0A         asInteger     send #asInteger
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   333
           0B         rounded       send #rounded
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   334
           0C         next          send #next
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   335
           0D         peek          send #peek
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   336
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   337
        E9          PUSH_BVAR1      push block variable 1
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   338
        EA          PUSH_BVAR2      push block variable 2
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   339
        EB          PUSH_BVAR3      push block variable 3
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   340
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   341
        EC          STORE_BVAR1     store TOS in block variable 1 and drop
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   342
        ED          STORE_BVAR2     store TOS in block variable 2 and drop
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   343
        EE          STORE_BVAR3     store TOS in block variable 3 and drop
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   344
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   345
     *  EF          BLOCK_REF       internal - check if a block is referenced by TOS
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   346
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   347
        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
   348
        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
   349
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   350
        F2          UNUSED_242      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   351
        F3          UNUSED_243      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   352
        F4          UNUSED_244      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   353
        F5          UNUSED_245      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   354
        F6          UNUSED_246      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   355
        F7          UNUSED_247      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   356
        F8          UNUSED_248      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   357
        F9          UNUSED_249      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   358
        FA          UNUSED_250      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   359
        FB          UNUSED_251      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   360
        FC          UNUSED_252      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   361
        FD          UNUSED_253      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   362
        FE          UNUSED_254      
a6c0c0b7d355 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1030
diff changeset
   363
        FF          UNUSED_255      
1030
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   364
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   365
    [author:]
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   366
        Claus Gittinger
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
"
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   369
!
6ff51c965fd2 byteCodes commented
Claus Gittinger <cg@exept.de>
parents: 1021
diff changeset
   370
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   371
copyright
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   372
"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   373
 COPYRIGHT (c) 1989 by Claus Gittinger
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   374
	      All Rights Reserved
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
 This software is furnished under a license and may be used
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   377
 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
   378
 inclusion of the above copyright notice.   This software may not
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   379
 be provided or otherwise made available to, or used by, any
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   380
 other person.  No title to or ownership of the software is
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   381
 hereby transferred.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   382
"
135
aa4f7b8f121e uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 128
diff changeset
   383
!
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   384
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
   385
documentation
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
   386
"
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   387
    This class performs compilation into ByteCodes.
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   388
    First, parsing is done using superclass methods,
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   389
    then the parse-tree is converted into an array of symbolic codes
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   390
    and a relocation table; 
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   391
    these two are finally combined into a byteArray of the codes.
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   392
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   393
    (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
   394
     only - it may vanish in future releases)
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   395
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   396
    There are many dependencies to the run-time-system (especially the
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   397
    interpreter) in here - be careful when playing around ...
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   398
259
a469695d8d19 commentary
Claus Gittinger <cg@exept.de>
parents: 256
diff changeset
   399
    [Instance variables:]
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   400
1055
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   401
        codeBytes       <ByteArry>              bytecodes
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   402
        codeIndex       <SmallInteger>          next index to put into code array
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   403
        litArray        <OrderedCollection>     literals
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   404
        stackDelta      <SmallInteger>          return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   405
        extra           <Symbol>                return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   406
        lineno          <Boolean>               return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   407
        extraLiteral    <Symbol>                return value of byteCodeFor:
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   408
        maxStackDepth   <SmallInteger>          stack need of method
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   409
        relocList       <Array>                 used temporary for relocation
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   410
259
a469695d8d19 commentary
Claus Gittinger <cg@exept.de>
parents: 256
diff changeset
   411
    [Class variables:]
19
84a1ddf215a5 *** empty log message ***
claus
parents: 15
diff changeset
   412
1055
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   413
        JumpToAbsJump   <Dictionary>            internal table to map opcodes
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   414
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   415
        STCCompilationDefines                   passed to stc as command line arguments
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   416
        STCCompilationIncludes
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   417
        STCCompilationOptions
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   418
                        <String>                
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   419
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   420
        STCCompilation  <Symbol>                #always, #primitiveOnly or #never
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   421
                                                controls when stc compilation is wanted
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   422
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   423
        ShareCode       <Boolean>               reuse byteArrays for common (simple) code sequences
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   424
                                                This is normally a 'good' optimization,
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   425
                                                except if you plan to modify the byteCodes.
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   426
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   427
    [author:]
1055
8180d6decde6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1054
diff changeset
   428
        Claus Gittinger
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   429
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
   430
"
98
claus
parents: 97
diff changeset
   431
! !
claus
parents: 97
diff changeset
   432
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   433
!ByteCodeCompiler class methodsFor:'initialization'!
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   434
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   435
initialize
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   436
    Smalltalk vmMajorVersionNr >= 5 ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   437
        NewCodeSet := true.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   438
        NewPrimitives := true.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   439
    ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   440
        NewCodeSet := false.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   441
        NewPrimitives := false.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   442
    ].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   443
    ShareCode := true.
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
   444
    ListCompiledMethods := false.
1219
e5c891489441 support compilation restart (after a fix)
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   445
    RestartCompilationSignal := Signal new.
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
   446
1219
e5c891489441 support compilation restart (after a fix)
Claus Gittinger <cg@exept.de>
parents: 1216
diff changeset
   447
    "Modified: / 15.11.2001 / 17:20:51 / cg"
1046
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   448
!
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   449
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   450
newCodeSet
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   451
    ^ NewCodeSet 
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   452
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   453
!
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   454
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   455
newCodeSet:aBoolean
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   456
    NewCodeSet := aBoolean.
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   457
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   458
    "
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   459
     ByteCodeCompiler newCodeSet:true
8e5818442eb9 newCode (for rel5)
Claus Gittinger <cg@exept.de>
parents: 1031
diff changeset
   460
    "
1049
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   461
!
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   462
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   463
newPrimitives
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   464
    ^ NewPrimitives 
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   465
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   466
!
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   467
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   468
newPrimitives:aBoolean
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   469
    NewPrimitives := aBoolean.
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   470
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   471
    "
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   472
     ByteCodeCompiler newPrimitives:true
0b69b110f150 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
   473
    "
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   474
! !
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   475
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   476
!ByteCodeCompiler class methodsFor:'compiling methods'!
98
claus
parents: 97
diff changeset
   477
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   478
compile:methodText forClass:classToCompileFor
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   479
    "compile a source-string for a method in classToCompileFor.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   480
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   481
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   482
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   483
        compile:methodText
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   484
        forClass:classToCompileFor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   485
        inCategory:'others'
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   486
        notifying:nil
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   487
        install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   488
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   489
        silent:false
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   490
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
   491
7ad01559b262 Initial revision
claus
parents:
diff changeset
   492
compile:aString forClass:aClass inCategory:cat
7ad01559b262 Initial revision
claus
parents:
diff changeset
   493
    "compile a source-string for a method in classToCompileFor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   494
     The method will get cat as category.
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:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   499
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   500
        inCategory:cat
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
84
claus
parents: 78
diff changeset
   507
compile:aString forClass:aClass inCategory:cat notifying:requestor
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   508
    "compile a source-string for a method in classToCompileFor.
84
claus
parents: 78
diff changeset
   509
     errors are forwarded to requestor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   510
     The method will get cat as category.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   511
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   512
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   513
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   514
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   515
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   516
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   517
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   518
        install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   519
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   520
        silent:false
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   521
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
   522
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   523
compile:aString forClass:aClass inCategory:cat notifying:requestor install:install
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   524
    "compile a source-string for a method in classToCompileFor.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   525
     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
   526
     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
   527
     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
   528
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   529
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   530
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   531
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   532
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   533
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   534
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   535
        install:install
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   536
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   537
        silent:false
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   538
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   539
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   540
compile:aString forClass:aClass inCategory:cat notifying:requestor
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   541
                 install:install skipIfSame:skipIfSame
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   542
    "compile a source-string for a method in classToCompileFor.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   543
     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
   544
     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
   545
     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
   546
     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
   547
     methods source, this is a noop (for fast fileIn).
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   548
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   549
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   550
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   551
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   552
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   553
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   554
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   555
        install:install
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   556
        skipIfSame:skipIfSame
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   557
        silent:false
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   558
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   559
84
claus
parents: 78
diff changeset
   560
compile:aString forClass:aClass inCategory:cat notifying:requestor
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   561
                 install:install skipIfSame:skipIfSame silent:silent
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   562
    "compile a source-string for a method in aClass.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   563
     errors are forwarded to requestor.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   564
     The method will get cat as category.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   565
     if install is true, the method is installed in the class.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   566
     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
   567
     (used when filing in).
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   568
     if silent is true, no warnings are output.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   569
     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
   570
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   571
    ^ self
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   572
        compile:aString
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   573
        forClass:aClass
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   574
        inCategory:cat
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   575
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   576
        install:install
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   577
        skipIfSame:skipIfSame
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   578
        silent:silent
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   579
        foldConstants:true
230
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   580
!
54e13c76f143 allow constant folding to be turned off
Claus Gittinger <cg@exept.de>
parents: 217
diff changeset
   581
1221
2768cbe3be2b finished remove unused vars;
Claus Gittinger <cg@exept.de>
parents: 1219
diff changeset
   582
compile:aStringArg forClass:aClassArg inCategory:cat notifying:requestor
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
   583
                 install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   584
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   585
    "the basic workhorse method for compiling:
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   586
     compile a source-string for a method in classToCompileFor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   587
     errors are forwarded to requestor 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   588
     (report on Transcript and return #Error, if requestor is nil).
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   589
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   590
     The new method will get cat as category. 
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   591
     If install is true, the method will go into the classes method-table, 
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   592
     otherwise the method is simply returned (for anonymous methods).
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   593
     If skipIsSame is true, and the source is the same as an existing
20
f8dd8ba75205 *** empty log message ***
claus
parents: 19
diff changeset
   594
     methods source, this is a noop (for fast fileIn).
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   595
     The argument, silent controls if errors are to be reported.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   596
     Returns the method, #Error or nil."
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   597
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
   598
    ^ self new
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
   599
        compile:aStringArg forClass:aClassArg inCategory:cat notifying:requestor
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
   600
        install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   601
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   602
1466
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   603
compile:methodText forClass:classToCompileFor install:doInstall
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   604
    "compile a source-string for a method in classToCompileFor.
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   605
     The install-argument controls if the method is to be installed into the
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   606
     classes method-dictionary, or just to be compiled and a method object to be returned.
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   607
     Returns the new method, #Error or nil."
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   608
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   609
    ^ self 
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   610
        compile:methodText
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   611
        forClass:classToCompileFor
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   612
        inCategory:'others'
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   613
        notifying:nil
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   614
        install:doInstall
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   615
        skipIfSame:false
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   616
        silent:false
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   617
!
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
   618
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   619
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
   620
    "compile a source-string for a method in classToCompileFor.
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   621
     Errors are forwarded to requestor.
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   622
     Returns the new method, #Error or nil."
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   623
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   624
    ^ self 
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   625
        compile:methodText
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   626
        forClass:classToCompileFor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   627
        inCategory:'others'
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   628
        notifying:requestor
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   629
        install:true
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   630
        skipIfSame:false
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   631
        silent:false
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   632
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   633
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   634
compile:textOrStream in:aClass notifying:requestor ifFail:exceptionBlock
890
bc5c9b3bf477 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 833
diff changeset
   635
    "name alias for ST-80 compatibility.
1201
d38dbc8f2961 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
   636
     Returns the new method, or the value from exceptionBlock."
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   637
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   638
    ^ self new compile:textOrStream in:aClass notifying:requestor ifFail:exceptionBlock
1549
dd2913f2fbb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
   639
!
dd2913f2fbb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
   640
dd2913f2fbb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1508
diff changeset
   641
stcCompileMethod:aMethod
1661
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   642
    ParserFlags 
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   643
        withSTCCompilation:#always 
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   644
        do:[
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   645
            self  
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   646
                compile:(aMethod source)
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   647
                forClass:(aMethod mclass)
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   648
                inCategory:(aMethod category)
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   649
        ].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   650
! !
7ad01559b262 Initial revision
claus
parents:
diff changeset
   651
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   652
!ByteCodeCompiler class methodsFor:'constants'!
15
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   653
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   654
byteCodeFor:aSymbol
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   655
    "returns the numeric code for some symbolic bytecodes."
15
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   656
25
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   657
    (aSymbol == #retNil) ifTrue:[^ 1].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   658
    (aSymbol == #retTrue) ifTrue:[^ 2].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   659
    (aSymbol == #retFalse) ifTrue:[^ 3].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   660
    (aSymbol == #ret0) ifTrue:[^ 4].
1402
2cf2b7e79168 Fix typos
Stefan Vogel <sv@exept.de>
parents: 1378
diff changeset
   661
    (aSymbol == #retSelf) ifTrue:[^5].
1300
be5542fc877e more bytecodes in #byteCodeFor class method
Stefan Vogel <sv@exept.de>
parents: 1280
diff changeset
   662
    (aSymbol == #retNum) ifTrue:[^ 127].
25
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   663
    (aSymbol == #retTop) ifTrue:[^ 0].
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
   664
1300
be5542fc877e more bytecodes in #byteCodeFor class method
Stefan Vogel <sv@exept.de>
parents: 1280
diff changeset
   665
    (aSymbol == #mk0Block) ifTrue:[^ 156].
be5542fc877e more bytecodes in #byteCodeFor class method
Stefan Vogel <sv@exept.de>
parents: 1280
diff changeset
   666
    (aSymbol == #mkNilBlock) ifTrue:[^ 157].
be5542fc877e more bytecodes in #byteCodeFor class method
Stefan Vogel <sv@exept.de>
parents: 1280
diff changeset
   667
15
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   668
    (aSymbol == #push0) ifTrue:[^120].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   669
    (aSymbol == #push1) ifTrue:[^121].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   670
    (aSymbol == #push2) ifTrue:[^139].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   671
    (aSymbol == #pushMinus1) ifTrue:[^122].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   672
    (aSymbol == #pushNil) ifTrue:[^ 10].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   673
    (aSymbol == #pushTrue) ifTrue:[^ 11].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   674
    (aSymbol == #pushFalse) ifTrue:[^ 12].
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   675
    (aSymbol == #pushSelf) ifTrue:[^ 15].
1402
2cf2b7e79168 Fix typos
Stefan Vogel <sv@exept.de>
parents: 1378
diff changeset
   676
    self error:'unknown instruction'.
15
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   677
! !
992c3d87edbf *** empty log message ***
claus
parents: 13
diff changeset
   678
1324
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
   679
!ByteCodeCompiler class methodsFor:'defaults'!
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
   680
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   681
allowExtensionsToPrivateClasses
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   682
    ^ ParserFlags allowExtensionsToPrivateClasses
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   683
!
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   684
1324
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
   685
defaultMethodCategory
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
   686
    "/ ^ '** As yet uncategorized **'.
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
   687
    ^ '* uncategorized *'
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
   688
! !
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
   689
1414
613ec963af7c method category rename
Claus Gittinger <cg@exept.de>
parents: 1402
diff changeset
   690
!ByteCodeCompiler class methodsFor:'private-utilities'!
1280
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   691
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   692
stringWithSimpleCRs:aString
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   693
    |src dst ch|
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   694
1496
7f31982d2933 replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents: 1479
diff changeset
   695
    dst := String writeStream.
1280
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   696
    src := aString readStream.
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   697
    [src atEnd] whileFalse:[
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   698
        ch := src next. 
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   699
        ch = Character return ifTrue:[
1367
32b899ef3347 *** empty log message ***
penk
parents: 1365
diff changeset
   700
            src peek == Character linefeed ifTrue:[
1280
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   701
                src next.
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   702
            ].
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   703
            ch := Character cr.
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   704
        ].
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   705
        dst nextPut:ch
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   706
    ].
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   707
    ^ dst contents
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   708
! !
73fa8c2f6b1c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   709
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
   710
!ByteCodeCompiler class methodsFor:'stc compilation defaults'!
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   711
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   712
canCreateMachineCode
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   713
    "return true, if compilation to machine code is supported.
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   714
     Currently, all SYSV4, Linux and WinNT/XP systems do so;
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   715
     REAL/IX and HPUX9.x do not 
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   716
        (due to the need for dynamic loading of object files, which is not supported by those).
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   717
     MIPS ULTRIX is almost finished, but not yet released.
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   718
     (late note - we no longer care for REAL/IX, HPUX9.x and MIPS ULTRIX)"
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   719
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   720
    ^ ObjectFileLoader notNil and:[ ObjectFileLoader canLoadObjectFiles ].
124
claus
parents: 120
diff changeset
   721
claus
parents: 120
diff changeset
   722
    "
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   723
     Compiler canCreateMachineCode     
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   724
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   725
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
   726
    "Modified: / 13.9.1995 / 15:15:11 / claus"
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
   727
    "Modified: / 3.9.1998 / 15:56:07 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   728
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   729
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   730
ccCompilationOptions
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   731
    "return the options used with cc compilation"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   732
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   733
    ^ ParserFlags ccCompilationOptions
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   734
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   735
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   736
     Compiler ccCompilationOptions
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   737
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   738
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   739
    "Modified: 5.11.1996 / 17:38:56 / cg"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   740
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   741
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   742
ccCompilationOptions:aString
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   743
    "define the compilation options 
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   744
     to be used when compiling to machine code.
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   745
     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
   746
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   747
    ParserFlags ccCompilationOptions:aString
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   748
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   749
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   750
     Compiler ccCompilationOptions:'-O'
742
73b6a9c187f3 ask ObjectFileLoader for objectFile extension
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   751
     Compiler ccCompilationOptions:'-O -fPIC'
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   752
     Compiler ccCompilationOptions
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   753
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   754
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   755
    "Created: 5.11.1996 / 17:37:05 / cg"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   756
    "Modified: 5.11.1996 / 17:38:32 / cg"
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   757
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   758
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   759
ccPath 
768
07fcee0355e3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
   760
    "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
   761
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   762
    ^ ParserFlags ccPath
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   763
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   764
    "
772
bd6fcf9e44e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
   765
     CC := nil
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   766
     Compiler ccPath     
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   767
     Compiler ccPath:'gcc'     
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   768
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   769
769
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
   770
    "Modified: / 13.9.1995 / 15:15:04 / claus"
cabe7bdb46ec changes for WIN32 machineCode generation & loading
Claus Gittinger <cg@exept.de>
parents: 768
diff changeset
   771
    "Created: / 5.11.1996 / 17:35:40 / cg"
772
bd6fcf9e44e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 769
diff changeset
   772
    "Modified: / 4.9.1998 / 15:48:40 / cg"
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   773
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   774
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   775
ccPath:aPathOrCommandName 
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   776
    "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
   777
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   778
    ParserFlags ccPath:aPathOrCommandName
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   779
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   780
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   781
     Compiler ccPath     
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   782
     Compiler ccPath:'gcc'     
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   783
     Compiler ccPath:'bcc32'     
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   784
    "
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   785
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   786
    "Modified: / 13.9.1995 / 15:15:04 / claus"
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   787
    "Created: / 5.11.1996 / 17:38:11 / cg"
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   788
    "Modified: / 23.8.1998 / 13:58:57 / cg"
411
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   789
!
d4ca24ab1f4c more control over cc command;
Claus Gittinger <cg@exept.de>
parents: 410
diff changeset
   790
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   791
stcCompilation
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   792
    "return the flag which controls compilation to machine code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   793
     If #always, methods are always compiled to machine code (which takes
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   794
     longer, but provides faster code). If #none, methods are never compiled
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   795
     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
   796
     and for primitive ones, a trapping stub is generated.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   797
     Anything else lets the compiler compile to bytecode,
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   798
     except for methods containing primitive code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   799
     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
   800
     for selective compilation to machine code."
124
claus
parents: 120
diff changeset
   801
1661
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   802
    ^ ParserFlags stcCompilation
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   803
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   804
    "
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   805
     Compiler stcCompilation
124
claus
parents: 120
diff changeset
   806
    "
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   807
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   808
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   809
stcCompilation:how
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   810
    "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
   811
     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
   812
     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
   813
     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
   814
     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
   815
     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
   816
     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
   817
     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
   818
     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
   819
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   820
    |ret|
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   821
1661
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   822
    ret := ParserFlags stcCompilation.
6b500fab2c0b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1625
diff changeset
   823
    ParserFlags stcCompilation:how.
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   824
    ^ ret
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   825
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   826
    "
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   827
     Compiler stcCompilation:#always
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   828
     Compiler stcCompilation:#never 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   829
     Compiler stcCompilation:#default 
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   830
    "
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   831
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   832
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   833
stcCompilationDefines
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   834
    "return the defines used with stc compilation"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   835
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   836
    ^ ParserFlags stcCompilationDefines
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   837
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   838
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   839
stcCompilationDefines:aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   840
    "define the flags (for example, additional -D defines)
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   841
     to be used when compiling to machine code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   842
     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
   843
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   844
    ParserFlags stcCompilationDefines:aString
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   845
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   846
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   847
     Compiler stcCompilationDefines:'-DVGL -DDEBUG'
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   848
     Compiler stcCompilationDefines:'-DWIN32'
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   849
    "
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   850
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   851
    "Modified: / 23.8.1998 / 14:00:40 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   852
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   853
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   854
stcCompilationIncludes
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   855
    "return the includes used with stc compilation"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   856
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   857
    ^ ParserFlags stcCompilationIncludes
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   858
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   859
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   860
stcCompilationIncludes:aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   861
    "define the include directories via additional -I flags.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   862
     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
   863
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   864
    ParserFlags stcCompilationIncludes:aString
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   865
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   866
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   867
     Compiler stcCompilationIncludes:'-I/usr/local/include -I../../include'
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   868
     Compiler stcCompilationIncludes:(Compiler stcCompilationIncludes , ' -I../../libxt')
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   869
    "
586
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
   870
e9ef451f36d0 automatically include STX_LIBDIR in -I-list
Claus Gittinger <cg@exept.de>
parents: 560
diff changeset
   871
    "Modified: 18.7.1997 / 18:04:25 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   872
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   873
124
claus
parents: 120
diff changeset
   874
stcCompilationOptions
claus
parents: 120
diff changeset
   875
    "return the options used with stc compilation"
claus
parents: 120
diff changeset
   876
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   877
    ^ ParserFlags stcCompilationOptions
124
claus
parents: 120
diff changeset
   878
!
claus
parents: 120
diff changeset
   879
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   880
stcCompilationOptions:aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   881
    "define the compilation options 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   882
     to be used when compiling to machine code.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   883
     These are passed to stc. Can be set from your private.rc file."
101
claus
parents: 98
diff changeset
   884
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   885
    ParserFlags stcCompilationOptions:aString
101
claus
parents: 98
diff changeset
   886
claus
parents: 98
diff changeset
   887
    "
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   888
     Compiler stcCompilationOptions:'+optinline'
101
claus
parents: 98
diff changeset
   889
    "
claus
parents: 98
diff changeset
   890
!
claus
parents: 98
diff changeset
   891
301
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   892
stcModulePath
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   893
    "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
   894
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   895
    ^ ParserFlags stcModulePath
301
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   896
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   897
    "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
   898
!
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   899
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   900
stcModulePath:aPath
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   901
    "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
   902
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   903
    ParserFlags stcModulePath:aPath
301
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   904
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   905
    "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
   906
!
5c0add6f00e2 create temporary method object files in an extra directory;
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   907
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   908
stcPath 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   909
    "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
   910
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   911
    ^ ParserFlags stcPath
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   912
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   913
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   914
     Compiler stcPath     
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   915
    "
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   916
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   917
    "Modified: 13.9.1995 / 14:37:26 / claus"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   918
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   919
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   920
stcPath:aPath 
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   921
    "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
   922
1666
750da2bec865 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1661
diff changeset
   923
    ParserFlags stcPath:aPath
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   924
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   925
    "
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   926
     Compiler stcPath:'../../stc/stc'     
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   927
     Compiler stcPath:'..\stc\stc'     
695
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   928
    "
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   929
773
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   930
    "Modified: / 13.9.1995 / 14:37:26 / claus"
1e2375488d3b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 772
diff changeset
   931
    "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
   932
!
90e875507838 allow change of the stc path
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
   933
120
claus
parents: 118
diff changeset
   934
stcPathOf:command 
claus
parents: 118
diff changeset
   935
    "return the path to an stc command, or nil if not found."
101
claus
parents: 98
diff changeset
   936
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   937
    |f d reqdSuffix cmd|
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   938
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   939
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   940
    "/ care for executable suffix
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   941
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   942
    cmd := command.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   943
    OperatingSystem isMSDOSlike ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   944
	reqdSuffix := 'exe'
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   945
    ] ifFalse:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   946
	OperatingSystem isVMSlike ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   947
	    reqdSuffix := 'EXE'
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   948
	].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   949
    ].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   950
    reqdSuffix notNil ifTrue:[
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   951
	(f := cmd asFilename) suffix isEmpty ifTrue:[
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   952
	    cmd := (f withSuffix:reqdSuffix) name
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   953
	]
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   954
    ].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   955
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   956
    "/ for our convenience, also check in current
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   957
    "/ and parent directories; even if PATH does not
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   958
    "/ include them ...
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   959
    "/
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   960
    "/ look in current ...
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   961
    d := Filename currentDirectory.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   962
    (f := d construct:cmd) isExecutable ifTrue:[
101
claus
parents: 98
diff changeset
   963
	^ f pathName
claus
parents: 98
diff changeset
   964
    ].
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   965
    "/ look in ../stc ...
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   966
    d := d construct:'..'.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   967
    (f := (d construct:'stc') construct:cmd) isExecutable ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   968
	^ f pathName
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   969
    ].
658
fff35b3c95e2 stcPathOf: fixed
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   970
    "/ look in ../../stc ...
623
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   971
    d := d construct:'..'.
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   972
    (f := (d construct:'stc') construct:cmd) isExecutable ifTrue:[
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   973
	^ f pathName
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   974
    ].
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   975
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   976
    "/
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   977
    "/ ok, stc must be installed in some directory along the PATH
6dd4e417ddb8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 611
diff changeset
   978
    "/
126
Claus Gittinger <cg@exept.de>
parents: 125
diff changeset
   979
    ^ OperatingSystem pathOfCommand:command
97
claus
parents: 96
diff changeset
   980
claus
parents: 96
diff changeset
   981
    "
120
claus
parents: 118
diff changeset
   982
     Compiler stcPathOf:'stc'     
claus
parents: 118
diff changeset
   983
    "
claus
parents: 118
diff changeset
   984
claus
parents: 118
diff changeset
   985
    "Created: 13.9.1995 / 14:37:16 / claus"
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   986
! !
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
   987
1417
7e97dd2df5ca method category rename
Claus Gittinger <cg@exept.de>
parents: 1414
diff changeset
   988
!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
   989
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   990
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
   991
    "name alias for ST-80 compatibility"
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
   992
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   993
    ^ self 
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   994
           compile:textOrStream
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   995
           forClass:aClass 
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   996
           inCategory:'others'
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   997
           notifying:requestor 
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   998
           install:true
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
   999
           skipIfSame:false
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1000
           silent:false
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1001
           foldConstants:true
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  1002
           ifFail:exceptionBlock.
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1003
! !
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1004
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1005
!ByteCodeCompiler methodsFor:'accessing'!
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1006
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1007
code
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
  1008
    "return the bytecode array - only valid after code-generation"
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1009
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  1010
    ^ codeBytes
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1011
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1012
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1013
literalArray
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1014
    "return the literal array - only valid after parsing"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1015
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1016
    ^ litArray
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1017
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1018
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1019
maxStackDepth
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1020
    "return the stack-need of the method - only valid after code-generation"
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1021
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1022
    ^ maxStackDepth
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1023
!
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1024
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1025
methodClass
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1026
    ^ methodClass ? Method
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1027
!
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1028
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1029
methodClass:aClass
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1030
    methodClass := aClass
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1031
! !
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1032
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1033
!ByteCodeCompiler methodsFor:'code generation'!
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1034
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1035
byteCodeFor:aSymbol
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1036
    "given a symbolic instruction, return the corresponding bytecode.
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1037
     as a side-effect, leave number of bytes pushed/popped by this instr.
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1038
     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
  1039
     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
  1040
     information and extraLiteral is set if any hidden send is performed by it."
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1041
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1042
    "standard bytecodes"
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1043
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1044
    (aSymbol == #pushNil) ifTrue:[stackDelta := 1. ^ 10].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1045
    (aSymbol == #pushTrue) ifTrue:[stackDelta := 1. ^ 11].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1046
    (aSymbol == #pushFalse) ifTrue:[stackDelta := 1. ^ 12].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1047
    (aSymbol == #pushLit) ifTrue:[stackDelta := 1. extra := #lit. ^ 14].
105
claus
parents: 104
diff changeset
  1048
    (aSymbol == #pushLitS) ifTrue:[stackDelta := 1. extra := #index. ^ 14].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1049
    (aSymbol == #pushSelf) ifTrue:[stackDelta := 1. ^ 15].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1050
    (aSymbol == #pushNum) ifTrue:[stackDelta := 1. extra := #number. ^ 16].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1051
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1052
    (aSymbol == #pushMethodArg) ifTrue:[stackDelta := 1. extra := #index. ^ 30].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1053
    (aSymbol == #pushMethodVar) ifTrue:[stackDelta := 1. extra := #index. ^ 31].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1054
    (aSymbol == #pushBlockArg) ifTrue:[stackDelta := 1. extra := #index. ^ 32].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1055
    (aSymbol == #pushBlockVar) ifTrue:[stackDelta := 1. extra := #index. ^ 33].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1056
    (aSymbol == #pushInstVar) ifTrue:[stackDelta := 1. extra := #index. ^ 34].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1057
    (aSymbol == #pushOuterBlockArg) ifTrue:[stackDelta := 1. extra := #indexLevel. ^ 42].
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1058
    (aSymbol == #pushOuterBlockVar) ifTrue:[stackDelta := 1. extra := #indexLevel. ^ 128].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1059
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1060
    (aSymbol == #retTop) ifTrue:[stackDelta := -1. ^ 0].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1061
    (aSymbol == #retSelf) ifTrue:[^5].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1062
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1063
    (aSymbol == #==) ifTrue:[stackDelta := -1. extraLiteral := aSymbol. ^ 45].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1064
    (aSymbol == #~~) ifTrue:[stackDelta := -1. extraLiteral := aSymbol. ^ 46].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1065
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1066
    (aSymbol == #falseJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 50].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1067
    (aSymbol == #trueJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 51].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1068
    (aSymbol == #nilJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 52].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1069
    (aSymbol == #notNilJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 53].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1070
    (aSymbol == #jump) ifTrue:[extra := #offset. ^ 54].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1071
    (aSymbol == #makeBlock) ifTrue:[stackDelta := 1. extra := #offsetNvarNarg. ^ 55].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1072
    (aSymbol == #zeroJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 56].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1073
    (aSymbol == #notZeroJump) ifTrue:[stackDelta := -1. extra := #offset. ^ 57].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1074
    (aSymbol == #eqJump) ifTrue:[stackDelta := -2. extra := #offset. ^ 58].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1075
    (aSymbol == #notEqJump) ifTrue:[stackDelta := -2. extra := #offset. ^ 59].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1076
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1077
    (aSymbol == #lineno) ifTrue:[lineno := true. ^ 8].
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
  1078
    (aSymbol == #lineno16) ifTrue:[lineno := true. ^ 9].
54
86c5b39c2eca *** empty log message ***
claus
parents: 49
diff changeset
  1079
106
claus
parents: 105
diff changeset
  1080
    (aSymbol == #send) ifTrue:[lineno := true. extra := #special. ^ 19].
claus
parents: 105
diff changeset
  1081
    (aSymbol == #superSend) ifTrue:[lineno := true. extra := #special. ^ 20].
claus
parents: 105
diff changeset
  1082
    (aSymbol == #hereSend) ifTrue:[lineno := true. extra := #special. ^ 20].
117
claus
parents: 111
diff changeset
  1083
    (aSymbol == #sendSelf) ifTrue:[lineno := true. extra := #special. ^ 13].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1084
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1085
    (aSymbol == #drop) ifTrue:[stackDelta := -1. ^ 18].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1086
    (aSymbol == #dup) ifTrue:[stackDelta := 1. ^ 47].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1087
117
claus
parents: 111
diff changeset
  1088
    (aSymbol == #storeMethodVar) ifTrue:[extra := #index. stackDelta := -1. ^ 37].
claus
parents: 111
diff changeset
  1089
    (aSymbol == #storeBlockVar) ifTrue:[extra := #index. stackDelta := -1. ^ 38].
claus
parents: 111
diff changeset
  1090
    (aSymbol == #storeInstVar) ifTrue:[extra := #index. stackDelta := -1. ^ 39].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1091
117
claus
parents: 111
diff changeset
  1092
    (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
  1093
    (aSymbol == #pushGlobalS) ifTrue:[stackDelta := 1. extra := #speciallitS. ^ 36].
117
claus
parents: 111
diff changeset
  1094
claus
parents: 111
diff changeset
  1095
    (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
  1096
    (aSymbol == #storeGlobalS) ifTrue:[extra := #speciallitS. stackDelta := -1. ^ 41].
247
fbb6e3b5764c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
  1097
    (aSymbol == #pushSpecialGlobal) ifTrue:[stackDelta := 1. extra := #index. ^ 200].
117
claus
parents: 111
diff changeset
  1098
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1099
    (aSymbol == #storeOuterBlockVar) ifTrue:[stackDelta := -1. extra := #indexLevel. ^ 129].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1100
117
claus
parents: 111
diff changeset
  1101
    (aSymbol == #pushClassInstVar) ifTrue:[stackDelta := 1. extra := #index. ^ 176].
claus
parents: 111
diff changeset
  1102
    (aSymbol == #storeClassInstVar) ifTrue:[extra := #index.stackDelta := -1. ^ 177].
105
claus
parents: 104
diff changeset
  1103
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1104
    "optimized bytecodes"
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1105
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1106
    (aSymbol == #retNil) ifTrue:[^ 1].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1107
    (aSymbol == #retTrue) ifTrue:[^ 2].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1108
    (aSymbol == #retFalse) ifTrue:[^ 3].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1109
    (aSymbol == #ret0) ifTrue:[^ 4].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1110
    (aSymbol == #retNum) ifTrue:[extra := #number. ^ 127].
25
865d6cfaf90d changed bytecodes
claus
parents: 20
diff changeset
  1111
    (aSymbol == #homeRetTop) ifTrue:[^ 7].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1112
46
a8c1e932ed6a 16bit literal offsets
claus
parents: 45
diff changeset
  1113
    (aSymbol == #pushNum16) ifTrue:[stackDelta := 1. extra := #number16. ^ 17].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1114
    (aSymbol == #push0) ifTrue:[stackDelta := 1. ^120].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1115
    (aSymbol == #push1) ifTrue:[stackDelta := 1. ^121].
3
b63b8a6b71fb *** empty log message ***
claus
parents: 1
diff changeset
  1116
    (aSymbol == #push2) ifTrue:[stackDelta := 1. ^139].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1117
    (aSymbol == #pushMinus1) ifTrue:[stackDelta := 1. ^122].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1118
106
claus
parents: 105
diff changeset
  1119
    (aSymbol == #send0) ifTrue:[lineno := true. extra := #index. ^21].
claus
parents: 105
diff changeset
  1120
    (aSymbol == #send1) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^22].
claus
parents: 105
diff changeset
  1121
    (aSymbol == #send2) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^23].
claus
parents: 105
diff changeset
  1122
    (aSymbol == #send3) ifTrue:[lineno := true. extra := #index. stackDelta := -3. ^24].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1123
106
claus
parents: 105
diff changeset
  1124
    (aSymbol == #sendSelf0) ifTrue:[lineno := true. extra := #index. stackDelta := 1. ^180].
claus
parents: 105
diff changeset
  1125
    (aSymbol == #sendSelf1) ifTrue:[lineno := true. extra := #index. ^181].
claus
parents: 105
diff changeset
  1126
    (aSymbol == #sendSelf2) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^182].
claus
parents: 105
diff changeset
  1127
    (aSymbol == #sendSelf3) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^183].
claus
parents: 105
diff changeset
  1128
    (aSymbol == #sendSelfDrop0) ifTrue:[lineno := true. extra := #index. ^184].
claus
parents: 105
diff changeset
  1129
    (aSymbol == #sendSelfDrop1) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^185].
claus
parents: 105
diff changeset
  1130
    (aSymbol == #sendSelfDrop2) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^186].
claus
parents: 105
diff changeset
  1131
    (aSymbol == #sendSelfDrop3) ifTrue:[lineno := true. extra := #index. stackDelta := -3. ^187].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1132
106
claus
parents: 105
diff changeset
  1133
    (aSymbol == #sendDrop) ifTrue:[lineno := true. extra := #special. ^25].
claus
parents: 105
diff changeset
  1134
    (aSymbol == #sendDrop0) ifTrue:[lineno := true. extra := #index. stackDelta := -1. ^26].
claus
parents: 105
diff changeset
  1135
    (aSymbol == #sendDrop1) ifTrue:[lineno := true. extra := #index. stackDelta := -2. ^27].
claus
parents: 105
diff changeset
  1136
    (aSymbol == #sendDrop2) ifTrue:[lineno := true. extra := #index. stackDelta := -3. ^28].
claus
parents: 105
diff changeset
  1137
    (aSymbol == #sendDrop3) ifTrue:[lineno := true. extra := #index. stackDelta := -4. ^29].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1138
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1139
    (aSymbol == #pushMethodVar1) ifTrue:[stackDelta := 1. ^80].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1140
    (aSymbol == #pushMethodVar2) ifTrue:[stackDelta := 1. ^81].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1141
    (aSymbol == #pushMethodVar3) ifTrue:[stackDelta := 1. ^82].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1142
    (aSymbol == #pushMethodVar4) ifTrue:[stackDelta := 1. ^83].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1143
    (aSymbol == #pushMethodVar5) ifTrue:[stackDelta := 1. ^84].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1144
    (aSymbol == #pushMethodVar6) ifTrue:[stackDelta := 1. ^85].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1145
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1146
    (aSymbol == #pushMethodArg1) ifTrue:[stackDelta := 1. ^86].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1147
    (aSymbol == #pushMethodArg2) ifTrue:[stackDelta := 1. ^87].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1148
    (aSymbol == #pushMethodArg3) ifTrue:[stackDelta := 1. ^88].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1149
    (aSymbol == #pushMethodArg4) ifTrue:[stackDelta := 1. ^89].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1150
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1151
    (aSymbol == #pushInstVar1) ifTrue:[stackDelta := 1. ^90].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1152
    (aSymbol == #pushInstVar2) ifTrue:[stackDelta := 1. ^91].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1153
    (aSymbol == #pushInstVar3) ifTrue:[stackDelta := 1. ^92].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1154
    (aSymbol == #pushInstVar4) ifTrue:[stackDelta := 1. ^93].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1155
    (aSymbol == #pushInstVar5) ifTrue:[stackDelta := 1. ^94].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1156
    (aSymbol == #pushInstVar6) ifTrue:[stackDelta := 1. ^95].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1157
    (aSymbol == #pushInstVar7) ifTrue:[stackDelta := 1. ^96].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1158
    (aSymbol == #pushInstVar8) ifTrue:[stackDelta := 1. ^97].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1159
    (aSymbol == #pushInstVar9) ifTrue:[stackDelta := 1. ^98].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1160
    (aSymbol == #pushInstVar10) ifTrue:[stackDelta := 1. ^99].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1161
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1162
    (aSymbol == #storeMethodVar1) ifTrue:[stackDelta := -1. ^100].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1163
    (aSymbol == #storeMethodVar2) ifTrue:[stackDelta := -1. ^101].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1164
    (aSymbol == #storeMethodVar3) ifTrue:[stackDelta := -1. ^102].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1165
    (aSymbol == #storeMethodVar4) ifTrue:[stackDelta := -1. ^103].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1166
    (aSymbol == #storeMethodVar5) ifTrue:[stackDelta := -1. ^104].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1167
    (aSymbol == #storeMethodVar6) ifTrue:[stackDelta := -1. ^105].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1168
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1169
    (aSymbol == #storeInstVar1) ifTrue:[stackDelta := -1. ^110].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1170
    (aSymbol == #storeInstVar2) ifTrue:[stackDelta := -1. ^111].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1171
    (aSymbol == #storeInstVar3) ifTrue:[stackDelta := -1. ^112].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1172
    (aSymbol == #storeInstVar4) ifTrue:[stackDelta := -1. ^113].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1173
    (aSymbol == #storeInstVar5) ifTrue:[stackDelta := -1. ^114].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1174
    (aSymbol == #storeInstVar6) ifTrue:[stackDelta := -1. ^115].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1175
    (aSymbol == #storeInstVar7) ifTrue:[stackDelta := -1. ^116].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1176
    (aSymbol == #storeInstVar8) ifTrue:[stackDelta := -1. ^117].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1177
    (aSymbol == #storeInstVar9) ifTrue:[stackDelta := -1. ^118].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1178
    (aSymbol == #storeInstVar10) ifTrue:[stackDelta := -1. ^119].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1179
103
claus
parents: 102
diff changeset
  1180
    (aSymbol == #pushLit1) ifTrue:[stackDelta := 1. ^ 222].
claus
parents: 102
diff changeset
  1181
    (aSymbol == #pushLit2) ifTrue:[stackDelta := 1. ^ 223].
claus
parents: 102
diff changeset
  1182
    (aSymbol == #pushLit3) ifTrue:[stackDelta := 1. ^ 224].
claus
parents: 102
diff changeset
  1183
    (aSymbol == #pushLit4) ifTrue:[stackDelta := 1. ^ 225].
claus
parents: 102
diff changeset
  1184
    (aSymbol == #pushLit5) ifTrue:[stackDelta := 1. ^ 226].
claus
parents: 102
diff changeset
  1185
    (aSymbol == #pushLit6) ifTrue:[stackDelta := 1. ^ 227].
claus
parents: 102
diff changeset
  1186
    (aSymbol == #pushLit7) ifTrue:[stackDelta := 1. ^ 228].
claus
parents: 102
diff changeset
  1187
    (aSymbol == #pushLit8) ifTrue:[stackDelta := 1. ^ 229].
claus
parents: 102
diff changeset
  1188
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1189
    (aSymbol == #retMethodVar1) ifTrue:[^160].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1190
    (aSymbol == #retMethodVar2) ifTrue:[^161].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1191
    (aSymbol == #retMethodVar3) ifTrue:[^162].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1192
    (aSymbol == #retMethodVar4) ifTrue:[^163].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1193
    (aSymbol == #retMethodVar5) ifTrue:[^164].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1194
    (aSymbol == #retMethodVar6) ifTrue:[^165].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1195
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1196
    (aSymbol == #retInstVar1) ifTrue:[^166].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1197
    (aSymbol == #retInstVar2) ifTrue:[^167].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1198
    (aSymbol == #retInstVar3) ifTrue:[^168].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1199
    (aSymbol == #retInstVar4) ifTrue:[^169].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1200
    (aSymbol == #retInstVar5) ifTrue:[^170].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1201
    (aSymbol == #retInstVar6) ifTrue:[^171].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1202
    (aSymbol == #retInstVar7) ifTrue:[^172].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1203
    (aSymbol == #retInstVar8) ifTrue:[^173].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1204
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1205
    (aSymbol == #retMethodArg1) ifTrue:[^174].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1206
    (aSymbol == #retMethodArg2) ifTrue:[^175].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1207
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1208
    (aSymbol == #pushBlockArg1) ifTrue:[stackDelta := 1. ^140].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1209
    (aSymbol == #pushBlockArg2) ifTrue:[stackDelta := 1. ^141].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1210
    (aSymbol == #pushBlockArg3) ifTrue:[stackDelta := 1. ^142].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1211
    (aSymbol == #pushBlockArg4) ifTrue:[stackDelta := 1. ^143].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1212
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1213
    (aSymbol == #pushOuter1BlockArg) ifTrue:[stackDelta := 1. extra := #index. ^ 43].
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1214
    (aSymbol == #pushOuter2BlockArg) ifTrue:[stackDelta := 1. extra := #index. ^ 44].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1215
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1216
    (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
  1217
    (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
  1218
    (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
  1219
    (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
  1220
    (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
  1221
    (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
  1222
"/    (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
  1223
"/    (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
  1224
"/    (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
  1225
"/    (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
  1226
"/    (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
  1227
"/    (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
  1228
    (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
  1229
    (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
  1230
    (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
  1231
    (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
  1232
    (aSymbol == #plus1) ifTrue:[lineno := true. extraLiteral := #+. ^123].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1233
    (aSymbol == #minus1) ifTrue:[lineno := true. extraLiteral := #-. ^124].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1234
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1235
    (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
  1236
    (aSymbol == #decMethodVar) ifTrue:[lineno := true. extraLiteral := #-. extra := #index. ^126].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1237
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1238
    (aSymbol == #eq0) ifTrue:[extraLiteral := #==. ^48].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1239
    (aSymbol == #ne0) ifTrue:[extraLiteral := #~~. ^49].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1240
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1241
    (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
  1242
    (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
  1243
    (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
  1244
    (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
  1245
"/    (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
  1246
"/    (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
  1247
    (aSymbol == #value) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 151].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1248
    (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
  1249
    (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
  1250
    (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
  1251
"/    (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
  1252
"/    (aSymbol == #rounded) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 159].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1253
    (aSymbol == #mk0Block) ifTrue:[^ 156].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1254
    (aSymbol == #mkNilBlock) ifTrue:[^ 157].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1255
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1256
    (aSymbol == #gt0) ifTrue:[lineno := true. extraLiteral := #>. ^ 212].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1257
    (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
  1258
    (aSymbol == #basicNew) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 211].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1259
    (aSymbol == #new) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 213].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1260
    (aSymbol == #basicNew:) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 214].
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1261
    (aSymbol == #new:) ifTrue:[lineno := true. extraLiteral := aSymbol. ^ 215].
103
claus
parents: 102
diff changeset
  1262
217
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1263
    (aSymbol == #pushBlockVar1) ifTrue:[stackDelta := 1. ^ 232].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1264
    (aSymbol == #pushBlockVar2) ifTrue:[stackDelta := 1. ^ 233].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1265
    (aSymbol == #pushBlockVar3) ifTrue:[stackDelta := 1. ^ 234].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1266
    (aSymbol == #storeBlockVar1) ifTrue:[stackDelta := -1. ^ 235].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1267
    (aSymbol == #storeBlockVar2) ifTrue:[stackDelta := -1. ^ 236].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1268
    (aSymbol == #storeBlockVar3) ifTrue:[stackDelta := -1. ^ 237].
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1269
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1270
    (aSymbol == #falseJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 190].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1271
    (aSymbol == #trueJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 191].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1272
    (aSymbol == #nilJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 192].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1273
    (aSymbol == #notNilJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 193].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1274
    (aSymbol == #jumpabs) ifTrue:[extra := #absoffset. ^ 194].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1275
    (aSymbol == #makeBlockabs) ifTrue:[stackDelta := 1. extra := #absoffsetNvarNarg. ^ 195].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1276
    (aSymbol == #zeroJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 196].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1277
    (aSymbol == #notZeroJumpabs) ifTrue:[stackDelta := -1. extra := #absoffset. ^ 197].
1
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1278
    (aSymbol == #eqJumpabs) ifTrue:[stackDelta := -2. extra := #absoffset. ^ 198].
77da9f5728e5 *** empty log message ***
claus
parents: 0
diff changeset
  1279
    (aSymbol == #notEqJumpabs) ifTrue:[stackDelta := -2. extra := #absoffset. ^ 199].
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1280
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1281
    (aSymbol == #pushThisContext) ifTrue:[stackDelta := 1. ^ 144].
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1282
1466
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  1283
    (aSymbol == #isNil) ifTrue:["extraLiteral := aSymbol. -- could be synthetic" ^ 188].
c05b6aa03a47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1459
diff changeset
  1284
    (aSymbol == #notNil) ifTrue:["extraLiteral := aSymbol. -- could be synthetic" ^ 189].
425
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1285
    (aSymbol == #not) ifTrue:[extraLiteral := aSymbol. lineno := true. ^ 179].
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1286
    (aSymbol == #&) ifTrue:[extraLiteral := aSymbol. lineno := true. ^ 216].
b046a32edb08 remember &, | and not in literal array
Claus Gittinger <cg@exept.de>
parents: 415
diff changeset
  1287
    (aSymbol == #|) ifTrue:[extraLiteral := aSymbol. lineno := true. ^ 217].
76
55d64cb1ffea *** empty log message ***
claus
parents: 54
diff changeset
  1288
117
claus
parents: 111
diff changeset
  1289
    (aSymbol == #pushClassVarL) ifTrue:[stackDelta := 1. extra := #speciallitL. ^ 218].
claus
parents: 111
diff changeset
  1290
    (aSymbol == #pushGlobalL) ifTrue:[stackDelta := 1. extra := #speciallitL. ^ 218].
claus
parents: 111
diff changeset
  1291
    (aSymbol == #storeClassVarL) ifTrue:[extra := #speciallitL.stackDelta := -1. ^ 219].
claus
parents: 111
diff changeset
  1292
    (aSymbol == #storeGlobalL) ifTrue:[extra := #speciallitL. stackDelta := -1. ^ 219].
claus
parents: 111
diff changeset
  1293
    (aSymbol == #pushLitL) ifTrue:[stackDelta := 1. extra := #unsigned16. ^ 201].
claus
parents: 111
diff changeset
  1294
claus
parents: 111
diff changeset
  1295
    (aSymbol == #sendL) ifTrue:[lineno := true. extra := #specialL. ^ 205].
claus
parents: 111
diff changeset
  1296
    (aSymbol == #sendSelfL) ifTrue:[lineno := true. extra := #specialL. ^ 207].
claus
parents: 111
diff changeset
  1297
    (aSymbol == #sendDropL) ifTrue:[lineno := true. extra := #specialL. ^ 204].
claus
parents: 111
diff changeset
  1298
    (aSymbol == #superSendL) ifTrue:[lineno := true. extra := #specialL. ^ 206].
claus
parents: 111
diff changeset
  1299
    (aSymbol == #hereSendL) ifTrue:[lineno := true. extra := #specialL. ^ 206].
106
claus
parents: 105
diff changeset
  1300
246
abf09d4821fe new code for faster global pushes
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
  1301
    (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
  1302
    (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
  1303
    (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
  1304
    (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
  1305
400
e5cfc008be47 bytecode changes - some more are now special-send codes
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
  1306
    (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
  1307
    (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
  1308
    (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
  1309
    (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
  1310
    (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
  1311
    (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
  1312
    (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
  1313
    (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
  1314
    (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
  1315
    (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
  1316
217
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1317
    (aSymbol == #blockRef) ifTrue:[stackDelta := 0. ^ 238].
549
e403281da682 added #over code
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1318
    (aSymbol == #over) ifTrue:[stackDelta := 1. ^ 6].
217
eba0ee7232aa new opcodes
Claus Gittinger <cg@exept.de>
parents: 215
diff changeset
  1319
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1320
    self error:'invalid code symbol'.
7ad01559b262 Initial revision
claus
parents:
diff changeset
  1321
    errorFlag := #Error
117
claus
parents: 111
diff changeset
  1322
claus
parents: 111
diff changeset
  1323
    "Modified: 3.9.1995 / 12:58:47 / claus"
549
e403281da682 added #over code
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1324
    "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
  1325
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  1326
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1327
checkForCommonCode:symbolicCodeArray
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1328
    "hook to return the code for common code sequences.
212
ff39051e219f more constant folding options
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1329
     This reduces the in-memory number of byteArrays somewhat.
ff39051e219f more constant folding options
Claus Gittinger <cg@exept.de>
parents: 211
diff changeset
  1330
1095
8963fe0f984f comment
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
  1331
     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
  1332
     (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
  1333
      automatically in the background - or upon request ?)"
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1334
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1335
    |sz insn1|
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1336
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1337
    (sz := symbolicCodeArray size) == 2 ifTrue:[
933
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1338
        "/
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1339
        "/ a very common sequence: return the first literal
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1340
        "/
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1341
        (insn1 := symbolicCodeArray at:1) == #pushLit1 ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1342
            (symbolicCodeArray at:2) == #retTop ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1343
                ^ #[222 0]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1344
            ]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1345
        ]
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1346
    ].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1347
    sz == 1 ifTrue:[
933
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1348
        "/
1095
8963fe0f984f comment
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
  1349
        "/ other common sequences: return the receiver, nil, true or false
933
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1350
        "/
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1351
        (insn1 := symbolicCodeArray at:1) == #retSelf ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1352
            ^ #[5]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1353
        ].
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1354
        insn1 == #retNil ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1355
            ^ #[1]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1356
        ].
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1357
        insn1 == #retTrue ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1358
            ^ #[2]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1359
        ].
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1360
        insn1 == #retFalse ifTrue:[
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1361
            ^ #[3]
dd77b70be831 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
  1362
        ].
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1363
    ].
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  1364
    ^ nil
199
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1365
!
1b3b350a3f59 moved bytecode query methods into compiler;
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
  1366
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1367
checkForPrimitiveCode:nr
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1368
    "return the code for an ST-80 primitive method.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1369
     Since many primitives available on ST-80 should also be available
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1370
     somewhere in ST/X, this may work for many primitive numbers.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1371
     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
  1372
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1373
     This was added to allow emulation of (some) ST-80
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1374
     primitives (to fileIn RemoteInvocation & Monitor41 packages)"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1375
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1376
    |cls sel|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1377
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1378
    (nr == 75)  ifTrue:[ cls := Object. sel := #identityHash ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1379
    (nr == 110) ifTrue:[ cls := Object. sel := #==           ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1380
    (nr == 111) ifTrue:[ cls := Object. sel := #class        ].
1228
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1381
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1382
    "
1228
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1383
     should add more here, to be able to fileIn ST-80 and Squeak methods
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1384
     containing primitive calls (who gives me the numbers ... ?)
512
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1385
     mhmh - got some ..."
1228
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1386
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1387
     "/ ST80 and Squeak common:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1388
     "/            18 Number @
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1389
     "/            41 Float +
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1390
     "/            42 Float -
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1391
     "/            49 Float *
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1392
     "/            50 Float /
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1393
     "/            52 Float fractionPart
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1394
     "/            54 Float timesTwoPower:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1395
907
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1396
     "/ ST80:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1397
     "/
1228
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1398
     "/            18 Number @
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1399
     "/            21 LargePositiveInteger +
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1400
     "/            22 LargePositiveInteger -
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1401
     "/            29 LargePositiveInteger *
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1402
     "/            30 LargePositiveInteger /
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1403
     "/            31 LargePositiveInteger \\ 
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1404
     "/            32 LargePositiveInteger // 
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1405
     "/            34 LargePositiveInteger bitAnd:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1406
     "/            35 LargePositiveInteger bitOr:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1407
     "/            36 LargePositiveInteger bitXor:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1408
     "/            37 LargePositiveInteger bitShift:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1409
     "/            40 SmallInteger asFloat
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1410
     "/            41 Float +
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1411
     "/            42 Float -
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1412
     "/            49 Float *
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1413
     "/            50 Float / 
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1414
     "/            52 Float fractionPart
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1415
     "/            54 Float timesTwoPower:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1416
     "/            70 Behavior basicNew
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1417
     "/            71 Behavior basicNew:
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1418
     "/            89 Behavior flushVMmethodCache
5ee632d481f2 comment
Claus Gittinger <cg@exept.de>
parents: 1223
diff changeset
  1419
     "/            91 InputState primCursorLocPut:
512
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1420
     "/           105 ByteArray replaceElementsFrom:to:withByteArray:startingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1421
     "/           223 ByteString =
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1422
     "/           306 ObjectMemory class sizesAtStartup
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1423
     "/           307 ObjectMemory class defaultSizesAtStartup
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1424
     "/           309 ObjectMemory class defaultThresholds
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1425
     "/           326 ObjectMemory class getMemoryUsageAndZeroFragmentationStatisticsIf:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1426
     "/           395 ExternalInterface ???
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1427
     "/           400 FormBitmap class newWidth:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1428
     "/           414 TwoByteString replaceElementsFrom:to:withTwoByteString:startingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1429
     "/           415 TwoByteString =
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1430
     "/           417 String trueCompare:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1431
     "/           418 ByteString nextIndexOf:from:to:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1432
     "/           419 ByteString prevIndexOf:from:to:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1433
     "/           422 WeakArray indexOf:replaceWith:startingAt:stoppingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1434
     "/           522 Behavior flushVMmethodCacheEntriesFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1435
     "/           524 Context nFromVPC:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1436
     "/           525 Context vFromNPC:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1437
     "/           532 Object shallowCopy
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1438
     "/           536 Behavior atomicAllInstances
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1439
     "/           537 Object allOwners
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1440
     "/           538 ObjectMemory class allObjects
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1441
     "/           546 UninterpretedBytes longAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1442
     "/           548 UninterpretedBytes floatAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1443
     "/           550 UninterpretedBytes longFloatAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1444
     "/           544 UninterpretedBytes unsignedLongAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1445
     "/           559 ByteArray replaceBytesFrom:to:with:startingAt:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1446
     "/           560 Double class fromNumber:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1447
     "/           561 Double +
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1448
     "/           562 Double -
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1449
     "/           569 Double *
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1450
     "/           570 Double /
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1451
     "/           572 Double fractionPart
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1452
     "/           574 Double timesTwoPower:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1453
     "/           576 Double sin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1454
     "/           577 Double cos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1455
     "/           578 Double tan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1456
     "/           579 Double arcSin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1457
     "/           580 Double arcCos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1458
     "/           581 Double arcTan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1459
     "/           582 Double sqrt
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1460
     "/           583 Double ln
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1461
     "/           584 Double exp
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1462
     "/           585 Double raisedTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1463
     "/           587 Double floorLog10
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1464
     "/           588 Double asFloat
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1465
     "/           591 Float cos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1466
     "/           592 Float arcSin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1467
     "/           593 Float arcCos
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1468
     "/           600 Float sin
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1469
     "/           601 Float tan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1470
     "/           602 Float arcTan
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1471
     "/           603 Float sqrt
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1472
     "/           604 Float ln
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1473
     "/           605 Float exp
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1474
     "/           606 Float raisedTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1475
     "/           609 Float floorLog10
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1476
     "/           610 Filename getDatesErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1477
     "/           614 DosFilename class getVolumes
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1478
     "/           615 UnixFilename primSetProtection:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1479
     "/           616 UnixFilename class primSetCreationMask:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1480
     "/           617 UnixFilename primGetProtectionErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1481
     "/           620 Filename listDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1482
     "/           621 Filename deleteErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1483
     "/           622 Filename isDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1484
     "/           623 Filename renameTo:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1485
     "/           624 Filename makeDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1486
     "/           625 Filename class defaultDirectoryErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1487
     "/           626 Filename fileSizeErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1488
     "/           627 Filename isWritableErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1489
     "/           628 Filename setWritable:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1490
     "/           629 Filename existsErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1491
     "/           630 SocketAccessor setOptionsLevel:name:value:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1492
     "/           631 SocketAccessor getOptionsLevel:name:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1493
     "/           632 SocketAccessor primGetName
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1494
     "/           633 SocketAccessor primGetPeer
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1495
     "/           634 SocketAccessor atMark
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1496
     "/           637 UnixTtyAccessor primGetOptions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1497
     "/           638 UnixTtyAccessor setOptions:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1498
     "/           639 UnixRealTtyAccessor modemBits:mask:sendBreak:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1499
     "/           640 IPSocketAddress class primHostAddressByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1500
     "/           641 IPSocketAddress class netAddressByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1501
     "/           642 IPSocketAddress class protocolNumberByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1502
     "/           643 IPSocketAddress class servicePortByName:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1503
     "/           645 IPSocketAddress class primHostNameByAddress:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1504
     "/           646 IPSocketAddress class netNameByAddress:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1505
     "/           647 IPSocketAddress class protocolNameByNumber:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1506
     "/           648 IPSocketAddress class serviceNameByPort:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1507
     "/           649 SocketAccessor class getHostname
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1508
     "/           650 Filename primOpenFileNamed:direction:creation:errorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1509
     "/           651 IOAccessor primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1510
     "/           652 UnixPipeAccessor class primPipeErrorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1511
     "/           653 UnixPseudoTtyAccessor class primPtyErrorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1512
     "/           654 SocketAccessor class primPairErrorInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1513
     "/           655 UnixRealTtyAccessor class primOpen:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1514
     "/           660 IOAccessor primReadInto:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1515
     "/           661 IOAccessor primWriteFrom:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1516
     "/           662 IOAccessor primSeekTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1517
     "/           664 IOAccessor truncateTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1518
     "/           665 DosDiskFileAccessor commit
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1519
     "/           666 IOAccessor primGetSize
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1520
     "/           667 MacDiskFileAccessor lock:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1521
     "/           669 UnixIOAccessor bytesForRead
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1522
     "/           670 SocketAccessor class primFamily:type:protocol:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1523
     "/           671 SocketAccessor primAccept
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1524
     "/           672 SocketAccessor bindTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1525
     "/           673 SocketAccessor listenFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1526
     "/           674 SocketAccessor primConnectTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1527
     "/           675 SocketAccessor primReceiveFrom:buffer:start:for:flags:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1528
     "/           676 SocketAccessor sendTo:buffer:start:for:flags:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1529
     "/           677 SocketAccessor shutdown:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1530
     "/           681 UnixProcess class primFork:arguments:environment:descriptors:errorTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1531
     "/           682 UnixProcess class reapOne
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1532
     "/           683 UnixProcess kill:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1533
     "/           690 CEnvironment class primEnvironment
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1534
     "/           697 OSErrorHolder class errorDescriptionFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1535
     "/           697 ErrorHolder class errorDescriptionFor:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1536
     "/           698 SocketAccessor class primInit:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1537
     "/           700 ParagraphEditor class getExternalSelectionOrNil:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1538
     "/           701 ParagraphEditor class putExternalSelection:with:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1539
     "/           705 Screen ringBell
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1540
     "/           706 Cursor class primOpenImage:mask:hotSpotX:hotSpotY:background:foreground:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1541
     "/           707 Cursor primBeCursor
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1542
     "/           708 Cursor primFreeCursor
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1543
     "/           772 SoundManager enumerateSoundsFrom:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1544
     "/           773 SoundManager playSoundFrom:sound:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1545
     "/           774 SoundManager simpleBeep:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1546
     "/           775 Pixmap primFromClipboard
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1547
     "/           776 Pixmap toClipboard
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1548
     "/           808 Context findNextMarkedUpTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1549
     "/           809 Context terminateTo:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1550
     "/           710 DosTtyAccessor class primOpen:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1551
     "/           711 DosTtyAccessor primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1552
     "/           712 DosTtyAccessor primReadInto:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1553
     "/           713 DosTtyAccessor primWriteFrom:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1554
     "/           714 DosTtyAccessor primGetOptions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1555
     "/           715 DosTtyAccessor primSetOptions:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1556
     "/           716 DosTtyAccessor setSem:forWrite:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1557
     "/           717 DosTtyAccessor modemBits:mask:sendBreak:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1558
     "/           750 MacFilename class getVolumes
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1559
     "/           752 MacFilename primSetCreator:type:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1560
     "/           754 MacIOAccessor class getAccessories
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1561
     "/           755 MacIOAccessor class runAccessory:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1562
     "/           756 MacOSFilename class getFileTypes:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1563
     "/           757 MacOSFilename putFileWithPrompt:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1564
     "/           758 MacOSFilename getFileInfoErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1565
     "/           759 MacOSFilename stringFromVRefErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1566
     "/           761 MacOSFilename class getStartupFilesErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1567
     "/           770 DosFilename printPSFileErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1568
     "/           771 DosFilename printTextFileErrInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1569
     "/           780 MacTtyAccessor class primOpen:errInto:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1570
     "/           781 MacTtyAccessor primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1571
     "/           782 MacTtyAccessor primReadInto:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1572
     "/           783 MacTtyAccessor primWriteFrom:startingAt:for:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1573
     "/           786 MacTtyAccessor primGetOptions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1574
     "/           787 MacTtyAccessor setOptions:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1575
     "/           788 MacTtyAccessor primBreak:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1576
     "/           790 MacTtyAccessor primGetStatus
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1577
     "/           792 MacTtyAccessor setSem:forWrite:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1578
     "/           793 MacTtyAccessor primAssertDTR:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1579
     "/           794 MacTtyAccessor primGetSize
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1580
     "/           933 ByteArray copyBitsClippedStride:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1581
     "/           934 ByteArray tileBits32By32Stride:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1582
     "/           935 Screen dragShape:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1583
     "/           936 Screen resizeRectangle...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1584
     "/           937 Screen displayShape:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1585
     "/           938 Window resizeFromUserWithMinimum:maximum:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1586
     "/           940 Window primClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1587
     "/           942 Window getDimensions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1588
     "/           943 Window moveTo:resize:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1589
     "/           944 Window primMap
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1590
     "/           945 Window class primNewAt:extent:min:max:windowType:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1591
     "/           946 Screen flush
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1592
     "/           947 Screen getScreenDimensions
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1593
     "/           948 Window unmap
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1594
     "/           950 Screen sync
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1595
     "/           951 Window setIconMask:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1596
     "/           952 Window label:iconLabel:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1597
     "/           953 Window raise
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1598
     "/           954 Window lower
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1599
     "/           955 Screen queryStackingOrder
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1600
     "/           956 TextMeasurer primScanCharactersFrom:...
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1601
     "/           957 GraphicsContext displayMappedString:from:to:at:withMap:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1602
     "/           959 Window setBackgroundPixel:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1603
     "/           960 Screen class primOpen:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1604
     "/           965 UnmappableSurface contentsOfAreaOriginX:y:width:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1605
     "/           966 Window contentsOfAreaOriginX:y:width:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1606
     "/           967 Screen contentsOfAreaOriginX:y:width:height:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1607
     "/           970 Mask class primExtent:depth:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1608
     "/           971 Mask privateClose
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1609
     "/           976 GraphicsContext displayCharacterOfIndex:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1610
     "/           978 DeviceFont class listFonts
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1611
     "/           979 DeviceFont primLoadFont
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1612
     "/           980 DeviceFont primUnLoadFont
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1613
     "/           985 GraphicsContext displayLineFrom:to:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1614
     "/           986 GraphicsContext displayPolyline:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1615
     "/           987 GraphicsContext displayPolygon:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1616
     "/           988 GraphicsContext primDisplayRectangleOrigin:extent:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1617
     "/           989 GraphicsContext primDisplayRectangularBorderOrigin:extent:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1618
     "/           990 GraphicsContext primDisplayArcBBoxOrigin:extent:startAngle:sweepAngle:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1619
     "/           991 GraphicsContext primDisplayWedgeBBoxOrigin:extent:startAngle:sweepAngle:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1620
     "/           992 GraphicsContext displayMask:at:"
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1621
     "/           993 GraphicsContext displayUninterpretedImageBits:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1622
     "/           994 GraphicsContext primCopyRectangularAreaExtent:from:sourceOffset:destinationOffset:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1623
     "/           995 GraphicsContext primCopyMaskedArea:from:sourceOffset:destinationOffset:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1624
     "/           996 Screen deviceColormap
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1625
     "/           998 GraphicsContext displayUninterpretedMonoImageBits:foreground:background:at:
fed48886aff9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
  1626
907
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1627
     "/ Squeak:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1628
     "/
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1629
     "/             1 +
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1630
     "/             2 -
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1631
     "/             3 <
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1632
     "/             4 >
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1633
     "/             5 <=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1634
     "/             6 >=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1635
     "/             7 =
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1636
     "/             8 ~=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1637
     "/             9 *
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1638
     "/            10 /
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1639
     "/            11 mod:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1640
     "/            12 div:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1641
     "/            13 quo:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1642
     "/            14 bitAnd:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1643
     "/            15 bitOr:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1644
     "/            16 bitXor:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1645
     "/            17 bitShift:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1646
     "/            18 @
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1647
     "/            19
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1648
     "/            ...
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1649
     "/            39 fail - reserved/unimplemented
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1650
     "/            40 asFloat
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1651
     "/            41 Float +
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1652
     "/            42 Float -
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1653
     "/            43 Float <
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1654
     "/            44 Float >
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1655
     "/            45 Float <=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1656
     "/            46 Float >=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1657
     "/            47 Float =
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1658
     "/            48 Float ~=
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1659
     "/            49 Float *
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1660
     "/            50 Float /
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1661
     "/            51 Float truncated
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1662
     "/            52 Float fractionalPart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1663
     "/            53 Float exponent
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1664
     "/            54 Float timeTwoPower
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1665
     "/            55 Float sqrt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1666
     "/            56 Float sine
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1667
     "/            57 Float arcTan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1668
     "/            58 Float logN
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1669
     "/            59 Float exp
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1670
     "/            60 at:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1671
     "/            61 at:put:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1672
     "/            62 size
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1673
     "/            63 stringAt:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1674
     "/            64 stringAt:put:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1675
     "/            65 next
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1676
     "/            66 nextPut:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1677
     "/            67 atEnd
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1678
     "/            68 objectAt:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1679
     "/            69 objectAt:put:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1680
     "/            70 new
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1681
     "/            71 new:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1682
     "/            72 becomeOneWay
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1683
     "/            73 instVarAt:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1684
     "/            74 instVarAtPut:
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1685
     "/            75 asOop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1686
     "/            76 storeStackP
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1687
     "/            77 someInstance
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1688
     "/            78 nextInstance
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1689
     "/            79 newMethod
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1690
     "/            80 blockCopy
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1691
     "/            81 value
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1692
     "/            82 valueWithArgs
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1693
     "/            83 perform
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1694
     "/            84 performWithArgs
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1695
     "/            85 signal
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1696
     "/            86 wait
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1697
     "/            87 resume
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1698
     "/            88 suspend
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1699
     "/            89 flushCache
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1700
     "/            90 mousePoint
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1701
     "/            91 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1702
     "/            92 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1703
     "/            93 inputSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1704
     "/            94 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1705
     "/            95 inputWord
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1706
     "/            96 copyBits
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1707
     "/            97 snapShot
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1708
     "/            98 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1709
     "/            99 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1710
     "/           100 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1711
     "/           101 beCursor
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1712
     "/           102 beDisplay
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1713
     "/           103 scanCharacters
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1714
     "/           104 drawLoop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1715
     "/           105 stringReplace
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1716
     "/           106 screenSize
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1717
     "/           107 mouseButtons
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1718
     "/           108 kbdNext
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1719
     "/           109 kbdPeek
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1720
     "/           110 equivalent
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1721
     "/           111 class
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1722
     "/           112 bytesLeft
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1723
     "/           113 quit
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1724
     "/           114 exitToDebugger
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1725
     "/           115 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1726
     "/           116 flushCacheByMethod
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1727
     "/           117 externalCall
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1728
     "/           118 doPrimitiveWithArg
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1729
     "/           119 flushCacheSelective
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1730
     "/           120 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1731
     "/           121 imageName
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1732
     "/           122 noop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1733
     "/           123 fail/unimplemented/reserved
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1734
     "/           124 lowSpaceSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1735
     "/           125 signalAtBytesLeft
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1736
     "/           126 deferDisplayUpdate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1737
     "/           127 showDisplayRect
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1738
     "/           128 arrayBecome
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1739
     "/           129 specialObjectsOop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1740
     "/           130 fullGC
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1741
     "/           131 incrementalGC
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1742
     "/           132 objectPointsTo
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1743
     "/           133 setInterruptKey
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1744
     "/           134 interruptSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1745
     "/           135 millisecondClock
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1746
     "/           136 signalAtMilliseconds
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1747
     "/           137 secondsClock
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1748
     "/           138 someObject
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1749
     "/           139 nextObject
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1750
     "/           140 beep
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1751
     "/           141 clipboardText
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1752
     "/           142 vmPath
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1753
     "/           143 shortAt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1754
     "/           144 shortAtPut
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1755
     "/           145 constantFill
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1756
     "/           146 readJoystick
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1757
     "/           147 warpBits
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1758
     "/           148 clone
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1759
     "/           149 getAttribute
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1760
     "/           150 fileAtEnd
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1761
     "/           151 fileClose
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1762
     "/           152 fileGetPosition
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1763
     "/           153 fileOpen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1764
     "/           154 fileRead
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1765
     "/           155 fileSetPosition
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1766
     "/           156 fileDelete
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1767
     "/           157 fileSize
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1768
     "/           158 fileWrite
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1769
     "/           159 fileRename
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1770
     "/           160 directoryCreate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1771
     "/           161 directoryDelimiter
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1772
     "/           162 directoryLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1773
     "/           163 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1774
     "/           164 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1775
     "/           165 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1776
     "/           166 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1777
     "/           167 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1778
     "/           168 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1779
     "/           169 directorySetMacType
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1780
     "/           170 soundStart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1781
     "/           171 soundStartWithSemaphore
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1782
     "/           172 soundStop
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1783
     "/           173 soundAvailableSpace
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1784
     "/           174 soundPlaySamples
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1785
     "/           175 soundPlaySilence
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1786
     "/           176 waveTableSoundmixSampleCountIntoStarrtingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1787
     "/           177 fmSoundmixSampleCountintostartingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1788
     "/           178 pluckedSoundmixSampleCountintostartingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1789
     "/           179 sampledSoundmixSampleCountintostartingAtpan
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1790
     "/           180 fmSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1791
     "/           181 pluckedSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1792
     "/           182 sampledSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1793
     "/           183 reverbSoundapplyReverbTostartingAtcount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1794
     "/           184 loopedSampledSoundmixSampleCountintostartingAtleftVolrightVol
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1795
     "/           185 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1796
     "/           186 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1797
     "/           187 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1798
     "/           188 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1799
     "/           189 soundInsertSamples
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1800
     "/           190 soundStartRecording
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1801
     "/           191 soundStopRecording
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1802
     "/           192 soundGetRecordingSampleRate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1803
     "/           193 soundRecordSamples
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1804
     "/           194 soundSetRecordLevel
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1805
     "/           195 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1806
     "/           196 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1807
     "/           197 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1808
     "/           198 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1809
     "/           199 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1810
     "/           200 initializeNetwork
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1811
     "/           201 resolverStartNameLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1812
     "/           202 resolverNameLookupResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1813
     "/           203 resolverStartAddressLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1814
     "/           204 resolverAddressLookupResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1815
     "/           205 resolverAbortLookup
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1816
     "/           206 resolverLocalAddress
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1817
     "/           207 resolverStatus
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1818
     "/           208 resolverError
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1819
     "/           209 socketCreate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1820
     "/           210 socketDestroy
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1821
     "/           211 socketConnectionStatus
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1822
     "/           212 socketError
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1823
     "/           213 socketLocalAddress
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1824
     "/           214 socketLocalPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1825
     "/           215 socketRemoteAddress
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1826
     "/           216 socketRemotePort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1827
     "/           217 socketConnectToPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1828
     "/           218 socketListenOnPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1829
     "/           219 socketCloseConnection
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1830
     "/           220 socketAbortConnection
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1831
     "/           221 socketReceiveDataBufCount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1832
     "/           222 socketReceiveDataAvailable
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1833
     "/           223 socketSendDataBufCount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1834
     "/           224 socketSendDone
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1835
     "/           225 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1836
     "/           226 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1837
     "/           227 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1838
     "/           228 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1839
     "/           229 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1840
     "/           230 relinquishProcessor
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1841
     "/           231 forceDisplayUpdate
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1842
     "/           232 formPrint
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1843
     "/           233 setFullScreen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1844
     "/           234 bitmapdecompressfromByteArrayat
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1845
     "/           235 stringcomparewithcollated
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1846
     "/           236 sampledSoundconvert8bitSignedFromto16Bit
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1847
     "/           237 bitmapcompresstoByteArray
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1848
     "/           238 serialPortOpen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1849
     "/           239 serialPortClose
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1850
     "/           240 serialPortWrite
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1851
     "/           241 serialPortRead
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1852
     "/           242 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1853
     "/           243 stringtranslatefromtotable
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1854
     "/           244 stringfindFirstInStringinSetstartingAt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1855
     "/           245 stringindexOfAsciiinStringstartingAt
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1856
     "/           246 stringfindSubstringinstartingAtmatchTable
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1857
     "/           247 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1858
     "/           248 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1859
     "/           249 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1860
     "/           250 clearProfile
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1861
     "/           251 dumpProfile
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1862
     "/           252 startProfiling
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1863
     "/           253 stopProfiling
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1864
     "/           254 vmParameter
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1865
     "/           255 instVarsPutFromStack
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1866
     "/           256 pushSelf
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1867
     "/           257 pushTrue
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1868
     "/           258 pushFalse
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1869
     "/           259 pushNil
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1870
     "/           260 pushMinusOne
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1871
     "/           261 pushZero
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1872
     "/           262 pushOne
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1873
     "/           263 pushTwo
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1874
     "/           264 loadInstVar
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1875
     "/           ..  loadInstVar
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1876
     "/           519 loadInstVar
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1877
     "/           520 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1878
     "/           521 MIDIClosePort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1879
     "/           522 MIDIGetClock
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1880
     "/           523 MIDIGetPortCount
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1881
     "/           524 MIDIGetPortDirectionality
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1882
     "/           525 MIDIGetPortName
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1883
     "/           526 MIDIOpenPort
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1884
     "/           527 MIDIParameterGetOrSet
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1885
     "/           528 MIDIRead
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1886
     "/           529 MIDIWrite
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1887
     "/           530 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1888
     "/           ..  fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1889
     "/           539 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1890
     "/           540 asyncFileClose
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1891
     "/           541 asyncFileOpen
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1892
     "/           542 asyncFileReadResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1893
     "/           543 asyncFileReadStart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1894
     "/           544 asyncFileWriteResult
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1895
     "/           545 asyncFileWriteStart
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1896
     "/           546 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1897
     "/           .. 
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1898
     "/           700 fail
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1899
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1900
    cls notNil ifTrue:[
907
683b46536bc6 comment
Claus Gittinger <cg@exept.de>
parents: 890
diff changeset
  1901
        ^ (cls compiledMethodAt:sel) code
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1902
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1903
    ^ nil
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1904
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1905
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1906
createMethod
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1907
    |newMethod|
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1908
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1909
    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
  1910
    litArray notNil ifTrue:[
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1911
        "/ fixup CheapBlocks method-field in literal array,
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1912
        litArray do:[:aLiteral |
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1913
            (aLiteral isMemberOf:CheapBlock) ifTrue:[
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1914
                aLiteral setMethod:newMethod.
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1915
            ]
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1916
        ].
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1917
        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
  1918
    ].
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1919
594
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  1920
    newMethod numberOfVars:(self numberOfMethodVars + (maxNumTemp ? 0)).
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  1921
    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
  1922
    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
  1923
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1924
    primitiveResource notNil ifTrue:[
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  1925
        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
  1926
    ].
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1927
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1928
    ^ newMethod
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1929
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1930
    "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
  1931
    "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
  1932
    "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
  1933
!
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  1934
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1935
genByteCodeFrom:symbolicCodeArray
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1936
    "convert symbolicCode into bytecodes"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1937
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1938
    |symIndex    "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1939
     codeSize    "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1940
     symCodeSize "{Class: SmallInteger }"
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1941
     index nextSym addr
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1942
     codeSymbol nargs needRetry
429
ffc4e2ab5581 cleanup
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1943
     stackDepth relocInfo level nvars round|
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1944
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1945
    symbolicCodeArray isNil ifTrue:[^ self].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1946
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1947
    round := 0.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1948
    needRetry := true.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1949
    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
  1950
    ShareCode ifTrue:[
1133
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1951
        codeBytes := self checkForCommonCode:symbolicCodeArray.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1952
        codeBytes notNil ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1953
            ^ self
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1954
        ].
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
  1955
    ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1956
    codeSize := symCodeSize.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1957
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1958
    [needRetry] whileTrue:[
1133
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1959
        stackDepth := 0.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1960
        maxStackDepth := 0.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1961
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1962
        codeBytes := ByteArray uninitializedNew:codeSize.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1963
        relocInfo := Array basicNew:(codeSize + 1).
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1964
        symIndex := 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1965
        codeIndex := 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1966
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1967
        needRetry := false.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1968
        round := round + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1969
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1970
        [symIndex <= symCodeSize] whileTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1971
            relocInfo at:symIndex put:codeIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1972
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1973
            codeSymbol := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1974
            symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1975
            stackDelta := 0.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1976
            extra := extraLiteral := nil.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1977
            lineno := false.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1978
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1979
            self appendByteCodeFor:codeSymbol.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1980
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1981
            extraLiteral notNil ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1982
                self addLiteral:extraLiteral
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1983
            ].
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1984
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1985
            lineno ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1986
                self appendByte:((symbolicCodeArray at:symIndex) min:255).
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1987
                symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1988
                codeSymbol == #lineno16 ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1989
                    self appendByte:((symbolicCodeArray at:symIndex) min:255).
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1990
                    symIndex := symIndex + 1
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1991
                ]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1992
            ].
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1993
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1994
            extra notNil ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1995
                nextSym := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1996
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1997
                (extra == #number) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1998
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  1999
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2000
                    self appendSignedByte:index
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2001
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2002
                ] ifFalse:[ (extra == #number16) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2003
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2004
                    symIndex := symIndex + 2.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2005
                    self appendSignedWord:index
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2006
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2007
                ] ifFalse:[ (extra == #unsigned16) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2008
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2009
                    symIndex := symIndex + 2.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2010
                    self appendWord:index
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2011
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2012
                ] ifFalse:[ (extra == #index) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2013
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2014
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2015
                    self appendByte:index
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2016
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2017
                ] ifFalse:[ (extra == #lit) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2018
                    index := self addLiteral:nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2019
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2020
                    self appendByte:index
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2021
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2022
                ] ifFalse:[ (extra == #speciallit) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2023
                    index := self addLiteral:nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2024
                    index > 255 ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2025
                        self parseError:'too many globals (' , 
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2026
                                        (symbolicCodeArray at:symIndex) ,
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2027
                                        ' index=' , index printString ,
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2028
                                        ') in method - please simplify'.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2029
                        ^ #Error
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2030
                    ].
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2031
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2032
                    self appendByte:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2033
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2034
                ] ifFalse:[ (extra == #speciallitS) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2035
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2036
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2037
                    self appendByte:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2038
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2039
                ] ifFalse:[ (extra == #speciallitL) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2040
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2041
                    symIndex := symIndex + 2.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2042
                    self appendWord:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2043
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2044
                ] ifFalse:[ (extra == #offset) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2045
                    relocInfo at:symIndex put:codeIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2046
                    self addReloc:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2047
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2048
                    self appendByte:0
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2049
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2050
                ] ifFalse:[ (extra == #indexLevel) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2051
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2052
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2053
                    self appendByte:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2054
                    level := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2055
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2056
                    self appendByte:level
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2057
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2058
                ] ifFalse:[ (extra == #offsetNvarNarg) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2059
                    relocInfo at:symIndex put:codeIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2060
                    self addReloc:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2061
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2062
                    self appendEmptyByte.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2063
                    nvars := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2064
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2065
                    self appendByte:nvars.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2066
                    level := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2067
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2068
                    self appendByte:level
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2069
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2070
                ] ifFalse:[ (extra == #absoffset) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2071
                    relocInfo at:symIndex put:codeIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2072
                    self addReloc:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2073
                    addr := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2074
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2075
                    self appendByte:(addr bitAnd:16rFF).
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2076
                    self appendByte:((addr bitShift:-8) bitAnd:16rFF).
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2077
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2078
                ] ifFalse:[ (extra == #absoffsetNvarNarg) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2079
                    relocInfo at:symIndex put:codeIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2080
                    self addReloc:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2081
                    addr := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2082
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2083
                    self appendByte:(addr bitAnd:16rFF).
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2084
                    self appendByte:((addr bitShift:-8) bitAnd:16rFF).
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2085
                    nvars := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2086
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2087
                    self appendByte:nvars.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2088
                    level := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2089
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2090
                    self appendByte:level
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2091
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2092
                ] ifFalse:[ (extra == #special) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2093
                    ((codeSymbol == #send) 
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2094
                     or:[codeSymbol == #sendSelf
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2095
                     or:[codeSymbol == #superSend
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2096
                     or:[codeSymbol == #hereSend]]]) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2097
                        index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2098
                        symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2099
                        nargs := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2100
                        symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2101
                        self appendByte:nargs.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2102
                        self appendByte:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2103
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2104
                        (codeSymbol == #superSend
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2105
                        or:[codeSymbol == #hereSend]) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2106
                            index := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2107
                            symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2108
                            self appendByte:index
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2109
                        ].
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2110
                        stackDelta := nargs negated.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2111
                        codeSymbol == #sendSelf ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2112
                            stackDelta := stackDelta + 1
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2113
                        ]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2114
                    ] ifFalse:[ (codeSymbol == #sendDrop) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2115
                        index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2116
                        symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2117
                        nargs := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2118
                        symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2119
                        self appendByte:nargs.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2120
                        self appendByte:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2121
                        stackDelta := (nargs + 1) negated
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2122
                    ]]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2123
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2124
                ] ifFalse:[ (extra == #specialL) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2125
                    ((codeSymbol == #sendL) 
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2126
                     or:[codeSymbol == #sendDropL
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2127
                     or:[codeSymbol == #sendSelfL
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2128
                     or:[codeSymbol == #superSendL
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2129
                     or:[codeSymbol == #hereSendL]]]]) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2130
                        index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2131
                        symIndex := symIndex + 2.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2132
                        nargs := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2133
                        symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2134
                        self appendByte:nargs.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2135
                        self appendWord:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2136
                        (codeSymbol == #superSendL
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2137
                        or:[codeSymbol == #hereSendL]) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2138
                            index := symbolicCodeArray at:symIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2139
                            symIndex := symIndex + 2.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2140
                            self appendWord:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2141
                        ].
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2142
                        stackDelta := nargs negated.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2143
                        codeSymbol == #sendSelfL ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2144
                            stackDelta := stackDelta + 1
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2145
                        ]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2146
                    ]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2147
                ] ifFalse:[ (extra == #specialSend) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2148
                    index := nextSym.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2149
                    symIndex := symIndex + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2150
                    self appendByte:index.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2151
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2152
                ] ifFalse:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2153
                    "/ self halt:'internal error'
475
5bce2cf3dadc new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 459
diff changeset
  2154
                
1133
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2155
                ]]]]]]]]]]]]]]]]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2156
            ].
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2157
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2158
            stackDepth := stackDepth + stackDelta.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2159
            (stackDepth > maxStackDepth) ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2160
                maxStackDepth := stackDepth
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2161
            ]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2162
        ].
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2163
        relocInfo at:symIndex put:codeIndex.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2164
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2165
        needRetry ifFalse:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2166
            "
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2167
             now relocate - returns true if ok, false if we have to do it again
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2168
             (when short jumps have been changed to long jumps)
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2169
            "
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2170
            relocList notNil ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2171
                needRetry := (self relocateWith:symbolicCodeArray relocInfo:relocInfo) not.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2172
                "
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2173
                 if returned with false, a relative jump was made into
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2174
                 an absolute jump - need to start over with one more byte space
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2175
                "
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2176
                needRetry ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2177
                    relocList := nil.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2178
                    codeSize := codeSize + 1.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2179
                ]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2180
            ]
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2181
        ] ifTrue:[
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2182
            'Compiler [info]: compiling again ...' infoPrintCR.
417b28013c87 checkin from browser
tm
parents: 1128
diff changeset
  2183
        ]
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2184
    ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2185
    "code printNL."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2186
    ^ errorFlag
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2187
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2188
    "Modified: 3.9.1995 / 12:59:43 / claus"
475
5bce2cf3dadc new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 459
diff changeset
  2189
    "Modified: 10.1.1997 / 15:17:51 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2190
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2191
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2192
genSpecialStatement:selector on:codeStream
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2193
    "/ generate: thisContext selector (to force a context).
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2194
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2195
    (StatementNode 
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2196
        expression:(UnaryNode receiver:(VariableNode type:#ThisContext context:contextToEvaluateIn)
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2197
                              selector:selector))
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2198
            codeForSideEffectOn:codeStream inBlock:nil for:self.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2199
!
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2200
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2201
genSymbolicCode
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2202
    "traverse the parse-tree producing symbolicCode - return the codeArray"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2203
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2204
    |codeStream code thisStatement lastStatement|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2205
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2206
    litArray := nil.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2207
    codeStream := WriteStream on:(OrderedCollection new:100).
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2208
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2209
    primitiveContextInfo notNil ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2210
        (primitiveContextInfo includes:('exception:' -> #unwind)) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2211
            self genSpecialStatement:#markForUnwind on:codeStream
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2212
        ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2213
        (primitiveContextInfo includes:('exception:' -> #handle)) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2214
            self genSpecialStatement:#markForHandle on:codeStream
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2215
        ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2216
        (primitiveContextInfo includes:('exception:' -> #raise)) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2217
            self genSpecialStatement:#markForRaise on:codeStream
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2218
        ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2219
    ].
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2220
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2221
    self startCodeGenerationHookOn:codeStream.
1312
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2222
    self generateVariables:methodVars on:codeStream.
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2223
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2224
    (tree isKindOf:MethodNode) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2225
        "kludge for VW compat."
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2226
        tree codeForSideEffectOn:codeStream inBlock:nil for:self.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2227
        lastStatement := tree statements last.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2228
    ] ifFalse:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2229
        thisStatement := tree.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2230
        [thisStatement notNil] whileTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2231
            lastStatement := thisStatement.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2232
            thisStatement codeForSideEffectOn:codeStream inBlock:nil for:self.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2233
            thisStatement := thisStatement nextStatement
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2234
        ].
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2235
    ].
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2236
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2237
    (lastStatement isNil or:[lastStatement isReturnNode not])
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2238
    ifTrue:[
937
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2239
        "not a return - add retSelf"
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2240
        "
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2241
         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
  2242
         replace the previous drop by a retSelf.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2243
         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
  2244
         it could be a jump target.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2245
        "
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2246
        (lastStatement notNil 
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2247
         and:[(code := codeStream contents) notNil
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2248
         and:[code size > 0
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2249
         and:[code last == #drop]]]) ifTrue:[
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2250
            codeStream backStep.
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2251
            codeStream nextPut:#retSelf
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2252
        ]. 
21ca5ab983b7 support exception handle/raise/unwind pragmas
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  2253
        codeStream nextPut:#retSelf
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2254
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2255
    ^ codeStream contents
328
c63c54ff95d3 Optimize double #retSelf.
Stefan Vogel <sv@exept.de>
parents: 325
diff changeset
  2256
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2257
    "Modified: / 15-08-1996 / 17:35:02 / stefan"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2258
    "Modified: / 06-08-2006 / 15:03:14 / cg"
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2259
!
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  2260
1312
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2261
generateVariables:varCollection on:codeStream
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2262
    varCollection isNil ifTrue:[^ self].
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2263
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2264
    varCollection do:[:eachVar |
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2265
        eachVar type notNil ifTrue:[
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2266
            "/ generate code to set it up.
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2267
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2268
            (AssignmentNode
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2269
                variable:(self nodeForMethodVariable:eachVar name)
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2270
                expression:(eachVar expressionForSetup)) 
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2271
                    codeForSideEffectOn:codeStream inBlock:nil for:self.
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2272
        ]
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2273
    ]
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2274
!
3393e713d8e8 preps for special variables
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
  2275
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2276
relocateWith:symbolicCodeArray relocInfo:relocInfo
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2277
    "helper for genByteCodeFrom - relocate code using relocInfo.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2278
     if relocation fails badly (due to long relative jumps) patch
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2279
     symbolicCode to use absolute jumps instead and return false
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2280
     (genByteCodeFrom will then try again). Otherwise return true.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2281
     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
  2282
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2283
    |delta       "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2284
     codePos     "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2285
     opCodePos   "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2286
     codeOffset  "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2287
     symOffset 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2288
     opcode      "{Class: SmallInteger }"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2289
     dstOpcode jumpTarget
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2290
     jumpCode deleteSet|
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2291
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2292
    deleteSet := OrderedCollection new.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2293
    relocList do:[:sIndex |
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2294
        "have to relocate symCode at sIndex ..." 
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2295
        symOffset := symbolicCodeArray at:sIndex.   "the target in the symbolic code"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2296
        codePos := relocInfo at:sIndex.             "position of the offet in byte code"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2297
        codeOffset := relocInfo at:symOffset.       "position of the target in byte code"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2298
        delta := codeOffset - codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2299
        opCodePos := codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2300
        opcode := codeBytes at:opCodePos.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2301
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2302
        (opcode between:190 and:199) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2303
            "an absolute jump/makeBlock"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2304
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2305
            codeBytes at:codePos put:(codeOffset bitAnd:16rFF).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2306
            codeBytes at:(codePos + 1) put:(codeOffset bitShift:-8)
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2307
        ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2308
            "get jump-code from long and vlong codes"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2309
            (opcode between:50 and:59) ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2310
                (opcode between:60 and:69) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2311
                    opcode := opcode - 10
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2312
                ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2313
                    (opcode between:70 and:79) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2314
                        opcode := opcode - 20
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2315
                    ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2316
                        self error:'invalid code to relocate'
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2317
                    ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2318
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2319
            ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2320
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2321
            "optimize jump to return and jump to jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2322
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2323
            (opcode == 54) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2324
                "a jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2325
                dstOpcode := symbolicCodeArray at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2326
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2327
                (#(retSelf retTop retNil retTrue retFalse ret0 "blockRetTop") includes:dstOpcode) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2328
                    "a jump to a return - put in the return instead jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2329
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2330
                    symbolicCodeArray at:(sIndex - 1) put:dstOpcode.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2331
                    symbolicCodeArray at:sIndex put:dstOpcode.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2332
                    codeBytes at:opCodePos put:(self byteCodeFor:dstOpcode).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2333
                    delta := 0.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2334
                    deleteSet add:sIndex.
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2335
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2336
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2337
'jump to return at: ' print. (sIndex - 1) printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2338
" 
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2339
                ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2340
                    (dstOpcode == #jump) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2341
                        "jump to jump to be done soon"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2342
                        jumpTarget := symbolicCodeArray at:(symOffset + 1).
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2343
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2344
'jump to jump at: ' print. (sIndex - 1) print.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2345
'  newTarget:' print. jumpTarget printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2346
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2347
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2348
                        symbolicCodeArray at:sIndex put:jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2349
                        symOffset := jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2350
                        codeOffset := relocInfo at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2351
                        delta := codeOffset - codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2352
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2353
                        "continue with new delta"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2354
                    ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2355
                ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2356
            ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2357
            (#(50 51 52 53 56 57 58 59) includes:opcode) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2358
                "a conditional jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2359
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2360
                dstOpcode := symbolicCodeArray at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2361
                (dstOpcode == #jump) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2362
                    "conditional jump to unconditional jump"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2363
                    jumpTarget := symbolicCodeArray at:(symOffset + 1).
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2364
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2365
'cond jump to jump at: ' print. (sIndex - 1) print.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2366
'  newTarget:' print. jumpTarget printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2367
" 
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2368
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2369
                    symbolicCodeArray at:sIndex put:jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2370
                    symOffset := jumpTarget.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2371
                    codeOffset := relocInfo at:symOffset.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2372
                    delta := codeOffset - codePos - 1.
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2373
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2374
                    "continue with new delta"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2375
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2376
            ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2377
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2378
            (delta >= 0) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2379
                (delta > 127) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2380
                    (opcode between:50 and:59) ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2381
                        self error:'invalid code to relocate'
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2382
                    ] ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2383
                        (delta > 255) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2384
                            "change jmp into vljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2385
                            codeBytes at:opCodePos put:(opcode + 20).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2386
                            delta := delta - 256 
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2387
                        ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2388
                            "change jmp into ljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2389
                            codeBytes at:opCodePos put:(opcode + 10).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2390
                            delta := delta - 128
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2391
                        ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2392
                        (delta > 127) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2393
                            "change symbolic into a jump absolute and fail"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2394
                            jumpCode := symbolicCodeArray at:(sIndex - 1).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2395
                            symbolicCodeArray at:(sIndex - 1) put:(self absJumpFromJump:jumpCode).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2396
                            symbolicCodeArray at:sIndex put:symOffset.
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2397
"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2398
'change short into abs jump' printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2399
"
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2400
                            deleteSet do:[:d | relocList remove:d].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2401
                            ^ false
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2402
                        ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2403
                    ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2404
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2405
                codeBytes at:codePos put:delta
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2406
            ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2407
                (delta < -128) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2408
                    (opcode between:50 and:59) ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2409
                        self error:'invalid code to relocate'
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2410
                    ] ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2411
                        (delta < -256) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2412
                            "change jmp into vljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2413
                            codeBytes at:opCodePos put:(opcode + 20).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2414
                            delta := delta + 256
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2415
                        ] ifFalse:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2416
                            "change jmp into ljmp ..."
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2417
                            codeBytes at:opCodePos put:(opcode + 10).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2418
                            delta := delta + 128
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2419
                        ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2420
                        (delta < -128) ifTrue:[
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2421
                            "change symbolic into a jump absolute and fail"
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2422
                            jumpCode := symbolicCodeArray at:(sIndex - 1).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2423
                            symbolicCodeArray at:(sIndex - 1) put:(self absJumpFromJump:jumpCode).
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2424
                            symbolicCodeArray at:sIndex put:symOffset.
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2425
"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2426
'change short into abs jump' printNL.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2427
"
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2428
                            deleteSet do:[:d | relocList remove:d].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2429
                            ^ false
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2430
                        ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2431
                    ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2432
                ].
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2433
                codeBytes at:codePos put:(256 + delta)
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2434
            ]
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2435
        ]
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2436
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2437
    (errorFlag == #Error) ifTrue:[
1050
c6306361ec19 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2438
        self error:'relocation range error'
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2439
    ].
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2440
    ^ true
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
  2441
! !
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  2442
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2443
!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
  2444
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2445
absJumpFromJump:code
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2446
    "given a jump-symbolic code, return corresponding absolute jump"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2447
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2448
    JumpToAbsJump isNil ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2449
	JumpToAbsJump := IdentityDictionary new.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2450
	JumpToAbsJump at:#jump put:#jumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2451
	JumpToAbsJump at:#trueJump put:#trueJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2452
	JumpToAbsJump at:#falseJump put:#falseJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2453
	JumpToAbsJump at:#nilJump put:#nilJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2454
	JumpToAbsJump at:#notNilJump put:#notNilJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2455
	JumpToAbsJump at:#eqJump put:#eqJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2456
	JumpToAbsJump at:#notEqJump put:#notEqJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2457
	JumpToAbsJump at:#zeroJump put:#zeroJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2458
	JumpToAbsJump at:#notZeroJump put:#notZeroJumpabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2459
	JumpToAbsJump at:#makeBlock put:#makeBlockabs.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2460
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2461
    ^ JumpToAbsJump at:code
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2462
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2463
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2464
addLiteral:anObject
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2465
    "add a literal to the literalArray - watch for and eliminate
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2466
     duplicates. return the index of the literal in the Array"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2467
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2468
    |index "{ Class: SmallInteger }" oldLit class|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2469
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2470
    litArray isNil ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2471
        litArray := Array with:anObject.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2472
        ^ 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2473
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2474
    index := litArray identityIndexOf:anObject.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2475
    (index == 0) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2476
        "
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2477
         reuse constants if same value and same class
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2478
        "
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2479
        class := anObject class.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2480
        ((class == Float) 
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2481
        or:[class == Fraction
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2482
        or:[class == LargeInteger
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2483
        "or:[class == String] --only if literalString option has been added---" ]]) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2484
            index := litArray indexOf:anObject.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2485
            index ~~ 0 ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2486
                oldLit := litArray at:index.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2487
                oldLit class == class ifFalse:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2488
                    index := 0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2489
                ] ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2490
                    "/ dont mess up negative with positive zeros
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2491
                    anObject = 0.0 ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2492
                        anObject isNegativeZero ~~ oldLit isNegativeZero ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2493
                            index := 0
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2494
                        ]
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2495
                    ]
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2496
                ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2497
            ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2498
        ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2499
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2500
        "
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2501
         reuse empty collection literals
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2502
        "
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2503
        ((class == String) or:[class == Array or:[class == ByteArray]]) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2504
            anObject size == 0 ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2505
                index := litArray indexOf:anObject.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2506
            ]
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2507
        ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2508
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2509
        (index == 0) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2510
            litArray := litArray copyWith:anObject.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2511
            ^ litArray size
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2512
        ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2513
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2514
    ^ index
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2515
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2516
    "Modified: / 12.11.1997 / 18:49:43 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2517
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2518
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2519
addReloc:symIndex
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2520
    "remember to relocate offset at symIndex later ..."
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2521
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2522
    relocList isNil ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2523
	relocList := OrderedCollection new.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2524
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2525
    relocList add:symIndex
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2526
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2527
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2528
addTempVar
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2529
    "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
  2530
     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
  2531
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2532
    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
  2533
    numTemp := numTemp + 1.
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2534
    maxNumTemp := maxNumTemp max:numTemp.
560
9311c79529d4 inline blocks withs args/vars
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2535
    ^ numTemp + methodVars size
9311c79529d4 inline blocks withs args/vars
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2536
9311c79529d4 inline blocks withs args/vars
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2537
    "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
  2538
!
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2539
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2540
appendByte:aByte
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2541
    "append a byte to the code-Array, checking for byte-range (debug-only)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2542
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2543
    |idx "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2544
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2545
    idx := codeIndex.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2546
    (aByte between:0 and:255) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2547
	codeBytes at:idx put:aByte.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2548
	codeIndex := idx + 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2549
    ] ifFalse:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2550
	self error:'byte range error'.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2551
	errorFlag := #Error
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2552
    ]
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2553
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2554
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2555
appendByteCodeFor:codeSymbol
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2556
    "append the byteCode for an instructionSymbol to the code-Array"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2557
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2558
    |idx "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2559
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2560
    idx := codeIndex.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2561
    codeBytes at:idx put:(self byteCodeFor:codeSymbol).
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2562
    codeIndex := idx + 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2563
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2564
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2565
appendEmptyByte
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2566
    "append an empty byte to the code-Array"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2567
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2568
    |idx "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2569
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2570
    idx := codeIndex.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2571
    codeBytes at:idx put:0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2572
    codeIndex := idx + 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2573
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2574
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2575
appendEmptyLong
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2576
    "append an empty long (4 bytes) to the code-Array"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2577
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2578
    |idx "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2579
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2580
    idx := codeIndex.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2581
    codeBytes at:idx put:0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2582
    codeBytes at:idx+1 put:0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2583
    codeBytes at:idx+2 put:0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2584
    codeBytes at:idx+3 put:0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2585
    codeIndex := idx + 4
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2586
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2587
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2588
appendEmptyShort
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2589
    "append an empty short (2 bytes) to the code-Array"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2590
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2591
    |idx "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2592
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2593
    idx := codeIndex.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2594
    codeBytes at:idx put:0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2595
    codeBytes at:idx+1 put:0.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2596
    codeIndex := idx + 2
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2597
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2598
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2599
appendSignedByte:aByte
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2600
    "append a signedbyte (as in jump-offsets) to the code-Array,
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2601
     check range and report an error if invalid"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2602
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2603
    |b   "{Class: SmallInteger }" 
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2604
     idx "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2605
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2606
    idx := codeIndex.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2607
    b := aByte.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2608
    (b >= 0) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2609
	(b > 127) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2610
	    self error:'jump-range error'.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2611
	    errorFlag := #Error
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2612
	].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2613
	codeBytes at:idx put:b
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2614
    ] ifFalse:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2615
	(b < -128) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2616
	    self error:'jump-range error'.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2617
	    errorFlag := #Error
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2618
	].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2619
	b := 256 + b
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2620
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2621
    codeBytes at:idx put:b.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2622
    codeIndex := idx + 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2623
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2624
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2625
appendSignedWord:aWord
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2626
    "append a signed word to the code-Array,
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2627
     check range and report an error if invalid"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2628
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2629
    |w   "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2630
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2631
    w := aWord.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2632
    (w >= 0) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2633
	(w > 16r7FFFF) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2634
	    self error:'word-range error'.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2635
	    errorFlag := #Error
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2636
	].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2637
    ] ifFalse:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2638
	(w < 16r-8000) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2639
	    self error:'word-range error'.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2640
	    errorFlag := #Error
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2641
	].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2642
	w := (16r10000 + w).
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2643
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2644
    self appendWord:w
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2645
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2646
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2647
appendWord:aWord
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2648
    "append an unsigned word (low-high) to the code-Array, 
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2649
     checking for word-range (debug-only)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2650
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2651
    |idx "{Class: SmallInteger }"|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2652
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2653
    idx := codeIndex.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2654
    (aWord between:0 and:16rFFFF) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2655
	codeBytes at:idx put:(aWord bitAnd:16rFF).
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2656
	idx := idx + 1.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2657
	codeBytes at:idx put:(aWord bitShift:-8).
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2658
	codeIndex := idx + 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2659
    ] ifFalse:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2660
	self error:'word range error'.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2661
	errorFlag := #Error
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2662
    ]
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2663
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2664
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2665
removeTempVar
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2666
    "remove a temporary variable"
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2667
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2668
    numTemp := numTemp - 1
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2669
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2670
    "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
  2671
    "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
  2672
! !
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  2673
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2674
!ByteCodeCompiler methodsFor:'code generation-hooks'!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2675
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2676
startCodeGenerationHookOn:codeStream
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2677
    "intentionally left blank - hook for subclasses"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2678
! !
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  2679
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2680
!ByteCodeCompiler methodsFor:'compilation'!
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2681
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2682
compile:aStringArg forClass:aClassArg inCategory:cat notifying:requestor
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2683
                 install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2684
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2685
    ^ self
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2686
        compile:aStringArg forClass:aClassArg inCategory:cat notifying:requestor
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2687
        install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2688
        ifFail:[ #Error ]
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2689
!
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2690
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2691
compile:sourceCodeStringArg forClass:aClassArg inCategory:cat notifying:requestor
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2692
                install:install skipIfSame:skipIfSame silent:silent foldConstants:fold
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2693
                ifFail:failBlock
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2694
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2695
    "the basic workhorse method for compiling:
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2696
     compile a source-string for a method in classToCompileFor.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2697
     errors are forwarded to requestor 
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2698
     (report on Transcript and return the value of failBlock, if requestor is nil).
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2699
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2700
     The new method will get cat as category. 
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2701
     If install is true, the method will go into the classes method-table, 
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2702
     otherwise the method is simply returned (for anonymous methods).
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2703
     If skipIsSame is true, and the source is the same as an existing
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2704
     methods source, this is a noop (for fast fileIn).
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2705
     The argument, silent controls if errors are to be reported.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2706
     Returns the method, #Error or nil."
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2707
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2708
    |newMethod tree symbolicCodeArray oldMethod silencio 
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2709
     sourceFile sourceStream newSource primNr pos keptOldCode answer
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2710
     aClass sourceCodeString hasErrorInMethodHeader oldCategory newCategory oldPackage newPackage|
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2711
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2712
    aClass := aClassArg.
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2713
    sourceCodeString := sourceCodeStringArg.
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2714
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2715
    sourceCodeString isNil ifTrue:[^ nil].
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2716
    silencio := silent 
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2717
                or:[Smalltalk silentLoading == true
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2718
                or:[ListCompiledMethods == false]].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2719
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2720
    RestartCompilationSignal handle:[:ex |
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2721
        "/ class could have changed ...
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2722
        aClass := self classToCompileFor.
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2723
        sourceCodeString := self correctedSource ? sourceCodeStringArg.
1369
2304dd8c3173 recompilation after correct-by-deleting unused local
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
  2724
        methodArgs := methodArgNames := methodVars := methodVarNames := nil.
2304dd8c3173 recompilation after correct-by-deleting unused local
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
  2725
        usedInstVars := usedClassVars := usedVars := nil.
2304dd8c3173 recompilation after correct-by-deleting unused local
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
  2726
        modifiedInstVars := modifiedClassVars := modifiedGlobals := nil.
2304dd8c3173 recompilation after correct-by-deleting unused local
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
  2727
        currentBlock := nil.
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2728
        ex restart
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2729
    ] do:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2730
        "create a compiler, let it parse and create the parsetree"
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2731
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2732
        self source:(ReadStream on:sourceCodeString string).
1369
2304dd8c3173 recompilation after correct-by-deleting unused local
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
  2733
        self nextToken.
2304dd8c3173 recompilation after correct-by-deleting unused local
Claus Gittinger <cg@exept.de>
parents: 1367
diff changeset
  2734
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2735
        self setClassToCompileFor:aClass.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2736
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2737
        self parseForCode.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2738
        fold ifFalse:[self foldConstants:nil].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2739
        self notifying:requestor.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2740
        silent ifTrue:[
1365
19b74038d133 ignoreErrors / ignoreWarnings are not getters.
penk
parents: 1363
diff changeset
  2741
    "/        self ignoreErrors:true.
19b74038d133 ignoreErrors / ignoreWarnings are not getters.
penk
parents: 1363
diff changeset
  2742
            self ignoreWarnings:true.
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2743
            self warnUndeclared:false.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2744
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2745
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2746
        hasErrorInMethodHeader := (self parseMethodSpec == #Error).
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2747
        hasErrorInMethodHeader ifTrue:[
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2748
            self parseError:'syntax error in method specification'.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2749
            tree := #Error.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2750
        ] ifFalse:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2751
            tree := self parseMethodBody.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2752
            self checkForEndOfInput.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2753
            self tree:tree.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2754
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2755
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2756
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2757
    hasErrorInMethodHeader ifTrue:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2758
        self showErrorMessageForClass:aClass.
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2759
        ^ failBlock value.
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2760
    ].
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2761
1378
01bd44f4360c allow compiling a method for a nil class
Claus Gittinger <cg@exept.de>
parents: 1376
diff changeset
  2762
    (aClass notNil and:[selector notNil]) ifTrue:[
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2763
        oldMethod := aClass compiledMethodAt:selector.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2764
        oldMethod notNil ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2765
            oldCategory := oldMethod category.
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2766
            oldPackage  := oldMethod package.
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2767
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2768
    ].
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2769
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2770
    (aClass notNil and:[aClass owningClass notNil
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2771
     and:[parserFlags allowExtensionsToPrivateClasses not]]) ifTrue:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2772
        "inherit private classe's package from owning class"
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2773
        newPackage := aClass owningClass package
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2774
    ] ifFalse:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2775
        (requestor respondsTo:#packageToInstall) ifTrue:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2776
            "if there is an requestor who knows about the package, use it"
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2777
            newPackage := requestor packageToInstall         
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2778
        ] ifFalse:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2779
            "if noone answers our package query, do not use the default 
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2780
             but use an existing method's package instead"
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2781
            (oldPackage isNil or:[Class packageQuerySignal isHandled]) ifTrue:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2782
                newPackage := Class packageQuerySignal query.
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2783
            ] ifFalse:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2784
                newPackage := oldPackage.
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2785
            ].
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2786
        ].
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2787
    ].
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2788
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2789
    newCategory := cat.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2790
    newCategory isNil ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2791
        newCategory := oldCategory ? '* As yet uncategorized *'.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2792
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2793
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2794
    "check if same source"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2795
    (skipIfSame and:[oldMethod notNil and:[oldMethod source = sourceCodeString]]) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2796
        oldMethod isInvalid ifFalse:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2797
            silencio ifFalse:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2798
                Transcript showCR:('    unchanged: ',aClass name,' ',selector)
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2799
            ].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2800
            "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2801
             same. however, category may be different
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2802
            "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2803
            (newCategory ~= oldCategory) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2804
                oldMethod category:newCategory.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2805
"/                                aClass updateRevisionString.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2806
                aClass addChangeRecordForMethodCategory:oldMethod category:newCategory.
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2807
                silencio ifFalse:[
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2808
                    Transcript showCR:('    (category change only)')
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2809
                ].
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2810
            ].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2811
            "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2812
             and package may be too.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2813
            "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2814
            (newPackage notNil and:[newPackage ~~ oldPackage]) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2815
                oldMethod package:newPackage.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2816
                silencio ifFalse:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2817
                    Transcript showCR:('    (package-id change only)')
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2818
                ].
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2819
            ].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2820
            ^ oldMethod
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2821
        ]
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2822
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2823
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2824
    (self errorFlag or:[tree == #Error]) ifTrue:[
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2825
        "error in method body"
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2826
        self showErrorMessageForClass:aClass.
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2827
        ^ failBlock value
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2828
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2829
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2830
    "if no error and also no selector ..."
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2831
    selector isNil ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2832
        "... it was just a comment or other empty stuff"
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2833
        ^ nil
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2834
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2835
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2836
    "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2837
     freak-out support for inline C-code...
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2838
    "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2839
    ((self hasNonOptionalPrimitiveCode 
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2840
      or:[(self hasPrimitiveCode and:[self class canCreateMachineCode])
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2841
      or:[ParserFlags stcCompilation == #always and:[selector ~~ #doIt]]])
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2842
     and:[(ParserFlags stcCompilation ~~ #never)
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2843
     and:[NewPrimitives ~~ true]]) ifTrue:[
1671
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2844
        Parser::ParseError handle:[:ex |
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2845
            self parseError:(ex description) position:1.
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2846
            newMethod := #Error.
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2847
        ] do:[
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2848
            newMethod := 
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2849
                (STCCompilerInterface new
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2850
                        originator:self;
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2851
                        parserFlags:parserFlags)
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2852
                    compileToMachineCode:sourceCodeString 
1671
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2853
                    forClass:aClass
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2854
                    selector:selector
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2855
                    inCategory:cat 
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2856
                    notifying:requestor 
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2857
                    install:install 
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2858
                    skipIfSame:skipIfSame 
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2859
                    silent:silent.
72ab58229e8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1667
diff changeset
  2860
        ].
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2861
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2862
        newMethod == #Error ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2863
            self showErrorMessageForClass:aClass.
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2864
            ^ failBlock value
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2865
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2866
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2867
        (newMethod == #CannotLoad) ifTrue:[
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2868
            newMethod := self trappingStubMethodFor:sourceCodeString inCategory:newCategory.
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2869
            newMethod setPackage:newPackage.
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2870
            keptOldCode := false.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2871
            install ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2872
                "/
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2873
                "/ be very careful with existing methods
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2874
                "/ (otherwise, you could easily make your system unusable in systems which cannot load)
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2875
                "/
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2876
                (oldMethod notNil and:[oldMethod code ~= newMethod code]) ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2877
                    answer := Dialog
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2878
                                 confirm:
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2879
'installation of binary code for ''' , aClass name , '>>' , selector , '''
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2880
is not possible or disabled.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2881
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2882
Shall I use the old methods functionality
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2883
or instead create a dummy trap method for it ?
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2884
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2885
Hint:
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2886
  if that method is needed by the system, you better leave the
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2887
  original functionality in the system.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2888
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2889
Close this warnBox to abort the compilation.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2890
'
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2891
                                 yesLabel:'trap code'
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2892
                                 noLabel:'keep old'.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2893
                    answer isNil ifTrue:[
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2894
                        ^ failBlock value
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2895
                    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2896
                    answer == false ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2897
                        newMethod code:(oldMethod code).
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2898
                        keptOldCode := true.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2899
                    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2900
                ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2901
                aClass addSelector:selector withMethod:newMethod
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2902
            ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2903
            self showErrorNotification:(keptOldCode 
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2904
                                            ifTrue:'not really compiled - method still shows previous behavior'
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2905
                                            ifFalse:'not compiled to machine code - created a stub instead.')
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2906
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2907
        ^ newMethod
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2908
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2909
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2910
    self hasNonOptionalPrimitiveCode ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2911
        "/
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2912
        "/ generate a trapping method, if primitive code is present
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2913
        "/
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2914
        NewPrimitives ifFalse:[
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2915
            newMethod := self trappingStubMethodFor:sourceCodeString inCategory:newCategory.
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2916
            install ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2917
                aClass addSelector:selector withMethod:newMethod.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2918
            ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2919
            self showErrorNotification:'not compiled to machine code - created a stub instead.'.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2920
            ^ newMethod
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2921
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2922
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2923
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2924
    primNr := self primitiveNumber.
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2925
    (NewPrimitives or:[primNr isNil]) ifTrue:[
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2926
        "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2927
         produce symbolic code first
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2928
        "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2929
        symbolicCodeArray := self genSymbolicCode.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2930
        (symbolicCodeArray == #Error) ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2931
            self showErrorNotification:'translation error'.
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2932
            ^ failBlock value
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2933
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2934
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2935
        "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2936
         take this, producing bytecode 
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2937
         (someone willin' to make machine code :-)
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2938
        "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2939
        ((self genByteCodeFrom:symbolicCodeArray) == #Error) ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2940
            self showErrorNotification:'relocation error - code must be simplified'.
1459
f6ea05913a60 compatible interface
Claus Gittinger <cg@exept.de>
parents: 1417
diff changeset
  2941
            ^ failBlock value
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2942
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2943
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2944
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2945
    "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2946
     finally create the new method-object
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2947
    "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2948
    newMethod := self createMethod.
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2949
    NewPrimitives ifTrue:[
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2950
        newMethod byteCode:(self code).
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2951
        primNr isNil ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2952
            self hasNonOptionalPrimitiveCode ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2953
                primNr := 0.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2954
            ]
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2955
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2956
        primNr notNil ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2957
            newMethod setPrimitiveNumber:primNr
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2958
        ]
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2959
    ] ifFalse:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2960
        primNr notNil ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2961
            newMethod code:(self checkForPrimitiveCode:primNr).
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2962
        ] ifFalse:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2963
            newMethod byteCode:(self code).
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2964
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2965
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2966
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2967
    "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2968
     if there where any corrections, install the updated source
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2969
    "
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2970
    (newSource := self correctedSource) isNil ifTrue:[
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2971
        newSource := sourceCodeString string.
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2972
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2973
    (newSource includes:Character return) ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2974
        "/ see if it contains crlf's or only cr's
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2975
        newSource := self class stringWithSimpleCRs:newSource
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2976
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2977
    newMethod source:newSource.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2978
    newMethod setCategory:newCategory.
1730
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2979
    newMethod setPackage:newPackage.
f8121ec9a7dd Keep package when recompiling an existant method and no explicit
Stefan Vogel <sv@exept.de>
parents: 1671
diff changeset
  2980
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2981
    (self contextMustBeReturnable) ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2982
        newMethod contextMustBeReturnable:true
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2983
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2984
    install ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2985
        aClass addSelector:selector withMethod:newMethod
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2986
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2987
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2988
    silencio ifFalse:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2989
        Transcript showCR:('    compiled: ', aClass name,' ', selector)
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2990
    ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2991
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2992
    ^ newMethod
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2993
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2994
    "Created: / 29-10-1995 / 19:59:36 / cg"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2995
    "Modified: / 19-03-1999 / 08:31:09 / stefan"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  2996
    "Modified: / 03-08-2006 / 15:35:45 / cg"
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2997
!
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  2998
1778
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  2999
compile:methodText forClass:aBehavior install:doInstall
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3000
    "compile a source-string for a method in classToCompileFor.
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3001
     The install-argument controls if the method is to be installed into the
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3002
     classes method-dictionary, or just to be compiled and a method object to be returned.
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3003
     Returns the new method, #Error or nil."
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3004
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3005
    ^ self 
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3006
        compile:methodText
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3007
        forClass:aBehavior
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3008
        inCategory:'others'
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3009
        notifying:nil
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3010
        install:doInstall
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3011
        skipIfSame:false
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3012
        silent:false
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3013
        foldConstants:true
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3014
        ifFail:[ #Error ]
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3015
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3016
    "Created: / 17-07-2006 / 18:44:53 / cg"
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3017
!
cdb6be2cc6ee *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1738
diff changeset
  3018
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3019
compileTree:aTree forClass:aClassArg  
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3020
    |newMethod symbolicCodeArray oldMethod silencio 
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3021
     sourceFile sourceStream newSource primNr pos keptOldCode answer
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3022
     aClass sourceCodeString hasErrorInMethodHeader oldCategory newCategory oldPackage newPackage|
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3023
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3024
    aClass := aClassArg.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3025
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3026
    self tree:aTree.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3027
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3028
    newMethod := self createMethod.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3029
    newMethod byteCode:(self code).
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3030
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3031
    (self contextMustBeReturnable) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3032
        newMethod contextMustBeReturnable:true
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3033
    ].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3034
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3035
    ^ newMethod
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3036
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3037
    "Modified: / 19-03-1999 / 08:31:09 / stefan"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3038
    "Created: / 06-08-2006 / 03:25:39 / cg"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3039
!
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3040
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3041
compileTree:aMethodNode forClass:aClassArg ifFail:failBlock 
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3042
    |newMethod symbolicCodeArray aClass prev|
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3043
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3044
    aClass := aClassArg.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3045
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3046
    self tree:aMethodNode.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3047
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3048
    selector := aMethodNode selector.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3049
    methodArgs := aMethodNode arguments ? #().
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3050
    methodArgNames := methodArgs collect:[:eachVar | eachVar name].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3051
    methodVars := aMethodNode locals ? #().
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3052
    methodVarNames := methodVars collect:[:eachVar | eachVar name].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3053
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3054
    "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3055
     produce symbolic code first
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3056
    "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3057
    symbolicCodeArray := self genSymbolicCode.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3058
    (symbolicCodeArray == #Error) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3059
        self showErrorNotification:'translation error'.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3060
        ^ failBlock value
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3061
    ].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3062
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3063
    "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3064
     take this, producing bytecode 
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3065
     (someone willin' to make machine code :-)
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3066
    "
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3067
    ((self genByteCodeFrom:symbolicCodeArray) == #Error) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3068
        self showErrorNotification:'relocation error - code must be simplified'.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3069
        ^ failBlock value
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3070
    ].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3071
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3072
    newMethod := self createMethod.
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3073
    newMethod byteCode:(self code).
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3074
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3075
    (self contextMustBeReturnable) ifTrue:[
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3076
        newMethod contextMustBeReturnable:true
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3077
    ].
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3078
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3079
    ^ newMethod
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3080
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3081
    "Modified: / 19-03-1999 / 08:31:09 / stefan"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3082
    "Created: / 06-08-2006 / 03:26:27 / cg"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3083
    "Modified: / 06-08-2006 / 15:14:26 / cg"
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3084
!
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3085
1363
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3086
showErrorNotification:message
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3087
        Transcript show:'***'.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3088
        selector notNil ifTrue:[
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3089
            Transcript show:(selector ,' ')
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3090
        ].
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3091
        Transcript showCR:message.
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3092
! !
2ce77081f79a separated instance creation from parsing
penk
parents: 1343
diff changeset
  3093
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3094
!ByteCodeCompiler methodsFor:'machine code generation'!
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3095
97
claus
parents: 96
diff changeset
  3096
trappingStubMethodFor:aString inCategory:cat
claus
parents: 96
diff changeset
  3097
    "return a stub method which traps and reports an error whenever
claus
parents: 96
diff changeset
  3098
     called."
claus
parents: 96
diff changeset
  3099
292
163651658aee Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents: 287
diff changeset
  3100
    |newMethod|
97
claus
parents: 96
diff changeset
  3101
1094
745ec90c42c9 allow parametrizing the method class
Claus Gittinger <cg@exept.de>
parents: 1071
diff changeset
  3102
    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
  3103
    litArray notNil ifTrue:[
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
  3104
        newMethod literals:litArray
97
claus
parents: 96
diff changeset
  3105
    ].
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  3106
124
claus
parents: 120
diff changeset
  3107
    newMethod makeUncompiled.
594
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  3108
    newMethod numberOfVars:(self numberOfMethodVars).
11ae33ac9b34 finally replaced all sends of #numberOfMethodVars with #numerOfVars
Claus Gittinger <cg@exept.de>
parents: 586
diff changeset
  3109
    newMethod numberOfArgs:(self numberOfMethodArgs).
682
784f564b4b7a make certain that methods source is always a string
ca
parents: 658
diff changeset
  3110
    newMethod source:aString string.
1117
f03c007dadc6 methods send category-change notifications themself
Claus Gittinger <cg@exept.de>
parents: 1113
diff changeset
  3111
    newMethod setCategory:cat.
97
claus
parents: 96
diff changeset
  3112
    ^ newMethod
277
0b599e23a936 set resourceFlag if method has a <resource> definition (prepare for fast search)
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
  3113
831
9ad749e60f55 Use #query instead of #raise when invoking QuerySignals
Stefan Vogel <sv@exept.de>
parents: 810
diff changeset
  3114
    "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
  3115
    "Modified: / 18.3.1999 / 18:12:33 / stefan"
49
02660b790c3e *** empty log message ***
claus
parents: 46
diff changeset
  3116
! !
128
61eb0b356b89 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
  3117
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3118
!ByteCodeCompiler methodsFor:'queries'!
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3119
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3120
hasLineNumber:sel
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3121
    "return true, if special send code needs lineNr"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3122
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3123
    (sel == #==) ifTrue:[^ false].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3124
    (sel == #~~) ifTrue:[^ false].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3125
    (sel == #class) ifTrue:[^ false].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3126
    (sel == #isNil) ifTrue:[^ false].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3127
    (sel == #notNil) ifTrue:[^ false].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3128
    ^ true
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3129
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3130
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3131
isBuiltIn1ArgSelector:sel forReceiver:receiver
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3132
    "return true, if selector sel is built-in.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3133
     (i.e. there is a single bytecode for it)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3134
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3135
    (sel == #at:)     ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3136
    (sel == #value:)  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3137
    (sel == #bitAnd:) ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3138
    (sel == #bitOr:)  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3139
    (sel == #new:)    ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3140
    (sel == #basicNew:) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3141
	"/ this one is critical - some redefine it
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3142
	receiver isGlobal ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3143
	    (#('String' 'ByteArray' 'Array'
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3144
	      'Point' 'Rectangle' 'Object')
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3145
	    includes:receiver name) ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3146
	].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3147
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3148
    ^ false
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3149
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3150
    "Created: 17.4.1996 / 22:33:13 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3151
    "Modified: 4.6.1997 / 12:24:18 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3152
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3153
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3154
isBuiltIn2ArgSelector:sel forReceiver:receiver
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3155
    "return true, if selector sel is built-in.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3156
     (i.e. there is a single bytecode for it)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3157
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3158
    (sel == #at:put:) ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3159
    ^ false
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3160
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3161
    "Created: 17.4.1996 / 22:33:16 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3162
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3163
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3164
isBuiltInBinarySelector:sel forReceiver:receiver
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3165
    "return true, if binary selector sel is built-in. 
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3166
     (i.e. there is a single bytecode for it)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3167
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3168
    sel == #== ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3169
    sel == #~~ ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3170
    sel == #=  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3171
    sel == #~= ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3172
    sel == #+  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3173
    sel == #-  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3174
    sel == #<  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3175
    sel == #<= ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3176
    sel == #>  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3177
    sel == #>= ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3178
    sel == #*  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3179
    sel == #&  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3180
    sel == #|  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3181
    ^ false
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3182
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3183
    "Created: 17.4.1996 / 22:34:27 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3184
    "Modified: 4.6.1997 / 12:24:00 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3185
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3186
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3187
isBuiltInUnarySelector:sel forReceiver:receiver
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3188
    "return true, if unary selector sel is built-in. 
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3189
     (i.e. there is a single bytecode for it)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3190
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3191
    (sel == #value)  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3192
    (sel == #class)  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3193
    (sel == #size)   ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3194
    (sel == #isNil)  ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3195
    (sel == #notNil) ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3196
    (sel == #not)    ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3197
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3198
    (sel == #new)    ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3199
    (sel == #basicNew) ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3200
	"/ this one is critical - some redefine it
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3201
	receiver isGlobal ifTrue:[
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3202
	    (#('String' 'ByteArray' 'Array'
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3203
	       'Point' 'Rectangle' 'Object')
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3204
	    includes:receiver name) ifTrue:[^ true].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3205
	].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3206
    ].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3207
    ^ false
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3208
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3209
    "Created: 17.4.1996 / 22:32:16 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3210
    "Modified: 4.6.1997 / 12:23:30 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3211
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3212
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3213
numberOfTempVars
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3214
    "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
  3215
     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
  3216
558
e7ecd861b86f preps to move vars of inlined blocks to outer context
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3217
    ^ maxNumTemp ? 0
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3218
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3219
    "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
  3220
    "Modified: 25.6.1997 / 15:21:34 / cg"
1738
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3221
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3222
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3223
specialGlobalCodeFor:aSymbol
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3224
    "codeExtension for globals,
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3225
     which can be accessed by specialGlobal opCode"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3226
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3227
    |idx|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3228
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3229
    idx := self specialGlobals identityIndexOf:aSymbol ifAbsent:nil.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3230
    idx isNil ifTrue:[^ idx].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3231
    ^ idx - 1.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3232
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3233
    "Modified: 4.6.1997 / 12:31:22 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3234
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3235
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3236
specialGlobals
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3237
    "list of globals which can be accessed by specialGlobal opCode; 
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3238
     adding any here requires a new VM (i.e. you cannot change it)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3239
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3240
    ^ #(
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3241
	#Array                  "/ 0
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3242
	#String                 "/ 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3243
	#FloatArray             "/ 2
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3244
	#DoubleArray            "/ 3
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3245
	#Point                  "/ 4
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3246
	#Symbol                 "/ 5
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3247
	#Smalltalk              "/ 6
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3248
	#Processor              "/ 7
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3249
	#SmallInteger           "/ 8
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3250
	#Character              "/ 9
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3251
	#Float                  "/ 10
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3252
	#Process                "/ 11
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3253
	#Set                    "/ 12
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3254
	#IdentitySet            "/ 13
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3255
	#Dictionary             "/ 14
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3256
	#IdentityDictionary     "/ 15
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3257
	#Sempahore              "/ 16
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3258
	#OrderedCollection      "/ 17
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3259
       )
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3260
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3261
    "Created: 4.6.1997 / 12:17:47 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3262
    "Modified: 4.6.1997 / 12:31:35 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3263
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3264
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3265
specialSendCodeFor:sel
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3266
    "return the codeExtension for sends,
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3267
     which can be performed by specialSend opCode"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3268
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3269
    |idx|
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3270
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3271
    idx := self specialSends identityIndexOf:sel ifAbsent:nil.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3272
    idx isNil ifTrue:[^ idx].
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3273
    ^ idx - 1.
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3274
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3275
    "Modified: 4.6.1997 / 12:31:08 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3276
!
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3277
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3278
specialSends
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3279
    "list of selectors which can be sent by specialSend opCode; 
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3280
     adding any here requires a new VM (i.e. you cannot change it)"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3281
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3282
    ^ #(
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3283
	#top                    "/ 0
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3284
	#bottom                 "/ 1
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3285
	#left                   "/ 2
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3286
	#right                  "/ 3
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3287
	#x                      "/ 4
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3288
	#y                      "/ 5
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3289
	#width                  "/ 6
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3290
	#height                 "/ 7
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3291
	#origin                 "/ 8
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3292
	#extent                 "/ 9
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3293
	#asInteger              "/ 10
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3294
	#rounded                "/ 11
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3295
	#next                   "/ 12
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3296
	#peek                   "/ 13
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3297
       )
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3298
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3299
    "Created: 4.6.1997 / 12:20:28 / cg"
48362e8eb2d4 hooks for instrumenting compiler
Claus Gittinger <cg@exept.de>
parents: 1730
diff changeset
  3300
    "Modified: 4.6.1997 / 12:31:56 / cg"
556
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3301
! !
4a3775ada5d2 preps to move variables of inlined blocks into outer context
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3302
372
98da4d230a8d prepare support for 16-bit lineNumbers
Claus Gittinger <cg@exept.de>
parents: 357
diff changeset
  3303
!ByteCodeCompiler class methodsFor:'documentation'!
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  3304
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  3305
version
1790
a40965dae8cb tree compilation support
Claus Gittinger <cg@exept.de>
parents: 1778
diff changeset
  3306
    ^ '$Header: /cvs/stx/stx/libcomp/ByteCodeCompiler.st,v 1.238 2006-08-07 11:01:07 cg Exp $'
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  3307
! !
1324
fb29e5557fd6 default method category
Claus Gittinger <cg@exept.de>
parents: 1312
diff changeset
  3308
209
b858b6a6880f compare categoryStrings equal before writing a change record
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
  3309
ByteCodeCompiler initialize!