VariableNode.st
author Claus Gittinger <cg@exept.de>
Fri, 31 Oct 2008 14:25:57 +0100
changeset 2125 aa85e7a4c503
parent 2116 83852100750d
child 2126 c2a51040dadc
permissions -rw-r--r--
eliminated undefinedVariable !
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     1
"
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
53
c5dd7abf8431 *** empty log message ***
claus
parents: 31
diff changeset
     3
	      All Rights Reserved
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     4
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    11
"
1076
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
    12
"{ Package: 'stx:libcomp' }"
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
    13
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    14
PrimaryNode subclass:#VariableNode
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    15
	instanceVariableNames:'name token index block'
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
    16
	classVariableNames:''
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
    17
	poolDictionaries:''
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
    18
	category:'System-Compiler-Support'
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    19
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    20
360
9b26a5a4da70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 356
diff changeset
    21
!VariableNode class methodsFor:'documentation'!
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    22
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    23
copyright
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    24
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    25
 COPYRIGHT (c) 1994 by Claus Gittinger
53
c5dd7abf8431 *** empty log message ***
claus
parents: 31
diff changeset
    26
	      All Rights Reserved
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    27
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    28
 This software is furnished under a license and may be used
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    29
 only in accordance with the terms of that license and with the
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    31
 be provided or otherwise made available to, or used by, any
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    32
 other person.  No title to or ownership of the software is
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    33
 hereby transferred.
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    34
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    35
!
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    36
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    37
documentation
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    38
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    39
    node for parse-trees, representing variables
261
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    40
    This is a helper class for the compiler.
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    41
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    42
    [author:]
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    43
        Claus Gittinger
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    44
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    45
! !
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    46
360
9b26a5a4da70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 356
diff changeset
    47
!VariableNode class methodsFor:'instance creation'!
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    48
1932
5df424cd0a3c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1918
diff changeset
    49
blockArgumentNamed:n
5df424cd0a3c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1918
diff changeset
    50
    ^ (self basicNew) type:#BlockArg name:n asSymbol
5df424cd0a3c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1918
diff changeset
    51
5df424cd0a3c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1918
diff changeset
    52
    "Created: / 22-10-2006 / 11:59:10 / cg"
5df424cd0a3c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1918
diff changeset
    53
!
5df424cd0a3c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1918
diff changeset
    54
1310
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
    55
globalNamed:n
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
    56
    ^ (self basicNew) type:#GlobalVariable name:n asSymbol
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
    57
!
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
    58
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    59
methodArgumentNamed:n
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    60
    ^ (self basicNew) type:#MethodArg name:n asSymbol
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    61
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    62
    "Created: / 06-08-2006 / 01:12:55 / cg"
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    63
!
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    64
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    65
methodLocalNamed:n
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    66
    ^ (self basicNew) type:#MethodVariable name:n asSymbol
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    67
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    68
    "Created: / 06-08-2006 / 13:43:41 / cg"
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    69
!
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
    70
98
claus
parents: 53
diff changeset
    71
type:t class:class name:n
claus
parents: 53
diff changeset
    72
    ^ (self basicNew) type:t class:class name:n
claus
parents: 53
diff changeset
    73
!
claus
parents: 53
diff changeset
    74
642
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
    75
type:t context:aContext
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
    76
    ^ (self basicNew) type:t context:aContext
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    77
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    78
    "Created: / 17.1.1998 / 04:00:35 / cg"
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    79
!
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    80
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
    81
type:t holder:holder name:n
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
    82
    ^ (self basicNew) type:t holder:holder name:n
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
    83
!
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
    84
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    85
type:t name:n
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    86
    ^ (self basicNew) type:t name:n
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    87
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    88
642
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
    89
type:t name:n context:aContext index:i
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
    90
    ^ (self basicNew) type:t name:n context:aContext index:i
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    91
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    92
    "Created: / 17.1.1998 / 02:40:32 / cg"
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    93
!
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    94
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    95
type:t name:n index:i selfClass:s
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    96
    ^ (self basicNew) type:t name:n index:i selfClass:s
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    97
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    98
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    99
type:t name:n index:i selfValue:s
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   100
    ^ (self basicNew) type:t name:n index:i selfValue:s
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   101
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   102
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   103
type:t name:n token:tok index:i
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   104
    ^ (self basicNew) type:t name:n token:tok index:i
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   105
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   106
574
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   107
type:t name:n token:tok index:i block:b from:codeBlock
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   108
    ^ (self basicNew) type:t name:n token:tok index:i block:b from:codeBlock
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   109
574
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   110
    "Modified: 2.7.1997 / 10:55:48 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   111
! !
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   112
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   113
!VariableNode methodsFor:'accessing'!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   114
577
efda2402cd70 oops - more fixes
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   115
block
efda2402cd70 oops - more fixes
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   116
    ^ block
efda2402cd70 oops - more fixes
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   117
efda2402cd70 oops - more fixes
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   118
    "Created: 2.7.1997 / 18:53:38 / cg"
efda2402cd70 oops - more fixes
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   119
!
efda2402cd70 oops - more fixes
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   120
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   121
index
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   122
    ^ index
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   123
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   124
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   125
name
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   126
    ^ name
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   127
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   128
875
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   129
token
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   130
    ^ token
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   131
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   132
    "Created: 2.7.1997 / 18:53:38 / cg"
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   133
!
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   134
869
c483b1e6a0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   135
type
c483b1e6a0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   136
    ^ type
c483b1e6a0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   137
!
c483b1e6a0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   138
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   139
type:t class:class name:n
2116
83852100750d leftOver halt.
Claus Gittinger <cg@exept.de>
parents: 2069
diff changeset
   140
    "/ type == #PoolVariable ifTrue:[self breakPoint:#cg].
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   141
    type := t.
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   142
    name := n.
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   143
    value := class
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   144
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   145
    "Modified: / 17.1.1998 / 04:03:55 / cg"
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   146
!
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   147
642
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
   148
type:t context:aContext
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   149
    type := t.
642
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
   150
    value := aContext.
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   151
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   152
    "Modified: / 17.1.1998 / 04:01:55 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   153
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   154
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   155
type:t holder:holder name:n
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   156
    type := t.
875
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   157
    token := holder.
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   158
    name := n
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   159
!
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   160
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   161
type:t name:n
98
claus
parents: 53
diff changeset
   162
    type := t.
claus
parents: 53
diff changeset
   163
    value := nil.
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   164
    name := n
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   165
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   166
642
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
   167
type:t name:n context:aContext index:i
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   168
    type := t.
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   169
    index := i.
642
de97c93c4f49 renamed con to aContext - stc has problems with it.
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
   170
    value := aContext.
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   171
    name := n
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   172
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   173
    "Created: / 17.1.1998 / 02:40:55 / cg"
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   174
    "Modified: / 17.1.1998 / 04:01:21 / cg"
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   175
!
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   176
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   177
type:t name:n index:i selfClass:s
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   178
    type := t.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   179
    index := i.
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   180
    value := s.
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   181
    name := n
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   182
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   183
    "Modified: / 17.1.1998 / 04:04:04 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   184
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   185
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   186
type:t name:n index:i selfValue:s
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   187
    type := t.
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   188
    index := i.
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   189
    value := s.
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   190
    name := n
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   191
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   192
    "Modified: / 17.1.1998 / 04:02:58 / cg"
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   193
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   194
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   195
type:t name:n token:tok index:i
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   196
    type := t.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   197
    index := i.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   198
    token := tok.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   199
    name := n
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   200
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   201
574
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   202
type:t name:n token:tok index:i block:variableBlock from:codeBlock
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   203
    type := t.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   204
    index := i.
574
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   205
    block := variableBlock.
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   206
    token := tok.
535
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   207
    name := n.
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   208
    (type == #BlockArg) ifTrue:[
574
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   209
        variableBlock blockArgAccessed:true.
535
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   210
    ].
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   211
574
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   212
    codeBlock ~~ variableBlock ifTrue:[
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   213
        codeBlock rememberOuterBlockVarAccess:self
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   214
    ]
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   215
574
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   216
    "Created: 2.7.1997 / 10:54:50 / cg"
993d1182782b fixed inlining of blocks where subBlocks
Claus Gittinger <cg@exept.de>
parents: 566
diff changeset
   217
    "Modified: 2.7.1997 / 11:12:58 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   218
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   219
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   220
type:t token:tok index:i block:b
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   221
    type := t.
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   222
    index := i.
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   223
    block := b.
535
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   224
    token := tok.
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   225
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   226
    (type == #BlockArg) ifTrue:[
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   227
        b blockArgAccessed:true.
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   228
    ].
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   229
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   230
    "Modified: 18.6.1997 / 11:41:05 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   231
! !
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   232
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   233
!VariableNode methodsFor:'code generation'!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   234
104
claus
parents: 103
diff changeset
   235
codeForSideEffectOn:aStream inBlock:b for:aCompiler
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   236
    "no code at all"
2066
9873763eb1f8 sharedPool access in doIts
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
   237
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   238
    ^ self
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   239
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   240
843
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   241
codeForSimpleReturnOn:aStream inBlock:b lineNumber:lineNrOrNil for:aCompiler
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   242
    |code idx|
843
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   243
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   244
    lineNrOrNil notNil ifTrue:[
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   245
        self codeLineNumber:lineNrOrNil on:aStream for:aCompiler
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   246
    ].
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   247
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   248
    (type == #InstanceVariable) ifTrue:[
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   249
        (index <= 8) ifTrue:[
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   250
            code := #( retInstVar1
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   251
                       retInstVar2
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   252
                       retInstVar3
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   253
                       retInstVar4
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   254
                       retInstVar5
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   255
                       retInstVar6
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   256
                       retInstVar7
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   257
                       retInstVar8) at:index.
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   258
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   259
            aStream nextPut:code.
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   260
            ^ self
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   261
        ].
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   262
    ].
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   263
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   264
    (type == #MethodVariable) ifTrue:[
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   265
        idx := index.
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   266
        idx isNil ifTrue:[ idx := self indexIn: aCompiler ].
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   267
        (idx <= 6) ifTrue:[
843
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   268
            code := #( retMethodVar1
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   269
                       retMethodVar2
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   270
                       retMethodVar3
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   271
                       retMethodVar4
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   272
                       retMethodVar5
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   273
                       retMethodVar6) at:idx.
843
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   274
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   275
            aStream nextPut:code.
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   276
            ^ self
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   277
        ].
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   278
    ].
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   279
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   280
    (type == #MethodArg) ifTrue:[
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   281
        idx := index.
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   282
        idx isNil ifTrue:[ idx := self indexIn: aCompiler ].
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   283
        (idx <= 2) ifTrue:[
843
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   284
            code := #(retMethodArg1
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   285
                      retMethodArg2) at:idx.
843
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   286
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   287
            aStream nextPut:code.
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   288
            ^ self
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   289
        ]
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   290
    ].
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   291
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   292
    "/ anything else must be pushed, then top rturned
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   293
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   294
    self codeOn:aStream inBlock:b for:aCompiler.
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   295
    aStream nextPut:#retTop
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   296
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   297
    "Modified: / 06-08-2006 / 22:59:28 / cg"
843
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   298
!
522c116f86d9 boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
   299
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   300
codeLoadOn:aStream type:type index:index inBlock:codeBlock for:aCompiler
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   301
    |theCode b deltaLevel litIndex specialGlobalIndex
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   302
     bvIdx bvTyp blocksCode selLitIdx |
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   303
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   304
    (type == #MethodArg) ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   305
        (index <= 4) ifTrue:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   306
            aStream nextPut:(#(pushMethodArg1
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   307
                               pushMethodArg2
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   308
                               pushMethodArg3 
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   309
                               pushMethodArg4) at:index).
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   310
            ^ self
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   311
        ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   312
        aStream nextPut:#pushMethodArg; nextPut:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   313
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   314
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   315
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   316
    (type == #MethodVariable) ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   317
        (index <= 6) ifTrue:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   318
            aStream nextPut:(#(pushMethodVar1
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   319
                               pushMethodVar2
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   320
                               pushMethodVar3
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   321
                               pushMethodVar4
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   322
                               pushMethodVar5
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   323
                               pushMethodVar6) at:index).
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   324
            ^ self
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   325
        ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   326
        aStream nextPut:#pushMethodVar; nextPut:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   327
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   328
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   329
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   330
    (type == #InstanceVariable) ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   331
        (index <= 10) ifTrue:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   332
            theCode := #(pushInstVar1 pushInstVar2 pushInstVar3
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   333
                         pushInstVar4 pushInstVar5 pushInstVar6
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   334
                         pushInstVar7 pushInstVar8 pushInstVar9
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   335
                         pushInstVar10) at:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   336
            aStream nextPut:theCode.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   337
            ^ self
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   338
        ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   339
        aStream nextPut:#pushInstVar; nextPut:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   340
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   341
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   342
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   343
    ((type == #BlockArg) 
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   344
    or:[type == #BlockVariable]) ifTrue:[
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   345
        "/ compiling for codeBlock; accessing variable in block.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   346
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   347
        bvIdx := index.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   348
        bvTyp := type.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   349
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   350
        "/ find the context where that variable is contained physically
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   351
        blocksCode := block.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   352
        [blocksCode notNil and:[blocksCode isInlineBlock]] whileTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   353
            blocksCode := blocksCode home
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   354
        ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   355
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   356
        "/ find deltaLevel from code-context to the containing block
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   357
        b := codeBlock.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   358
        deltaLevel := 0.
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   359
        [b notNil and:[b ~~ blocksCode]] whileTrue:[
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   360
            b isInlineBlock ifFalse:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   361
                deltaLevel := deltaLevel + 1
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   362
            ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   363
            b := b home
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   364
        ].
535
713142116e40 remember access to blockArgs
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
   365
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   366
        b isNil ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   367
            codeBlock isNil ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   368
                "/ a var of a block which is inlined in the method. 
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   369
                "/ Generate a pushMVAR
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   370
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   371
                bvIdx := block indexOfFirstTemp + index - 1.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   372
                type == #BlockVariable ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   373
                    bvIdx := bvIdx + block numArgs
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   374
                ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   375
                ^ self 
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   376
                    codeLoadOn:aStream
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   377
                    type:#MethodVariable
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   378
                    index:bvIdx
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   379
                    inBlock:codeBlock
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   380
                    for:aCompiler
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   381
            ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   382
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   383
            "/ a var of a block which is inlined in the outer block.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   384
            "/ Generate a pushBVAR
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   385
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   386
            bvIdx := block indexOfFirstTemp + index - 1.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   387
            type == #BlockVariable ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   388
                bvIdx := bvIdx + block numArgs
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   389
            ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   390
            bvTyp := #BlockVariable.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   391
        ] ifFalse:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   392
            block isInlineBlock ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   393
                "/ a var of a block which is inlined in another block.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   394
                "/ Generate a pushBVAR / pushOuterBVAR
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   395
                bvIdx := block indexOfFirstTemp + index - 1.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   396
                type == #BlockVariable ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   397
                    bvIdx := bvIdx + block numArgs
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   398
                ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   399
                bvTyp := #BlockVariable.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   400
            ]
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   401
        ].
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   402
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   403
        (bvTyp == #BlockVariable) ifTrue:[
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   404
            (deltaLevel == 0) ifTrue:[
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   405
                bvIdx <= 3 ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   406
                    aStream nextPut:(#(pushBlockVar1 pushBlockVar2 pushBlockVar3) at:bvIdx).
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   407
                    ^ self
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   408
                ].
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   409
                aStream nextPut:#pushBlockVar.
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   410
            ] ifFalse:[
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   411
                aStream nextPut:#pushOuterBlockVar; nextPut:deltaLevel.
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   412
            ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   413
        ] ifFalse:[
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   414
            (deltaLevel == 0) ifTrue:[
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   415
                (bvIdx <= 4) ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   416
                    aStream nextPut:(#(pushBlockArg1 pushBlockArg2 pushBlockArg3
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   417
                                       pushBlockArg4) at:bvIdx).
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   418
                    ^ self
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   419
                ].
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   420
                aStream nextPut:#pushBlockArg.
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   421
            ] ifFalse:[
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   422
                (deltaLevel == 1) ifTrue:[
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   423
                    aStream nextPut:#pushOuter1BlockArg
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   424
                ] ifFalse:[
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   425
                    (deltaLevel == 2) ifTrue:[
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   426
                        aStream nextPut:#pushOuter2BlockArg
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   427
                    ] ifFalse:[
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   428
                        aStream nextPut:#pushOuterBlockArg; nextPut:deltaLevel
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   429
                    ]
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   430
                ].
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   431
            ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   432
        ].
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   433
        aStream nextPut:bvIdx.
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   434
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   435
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   436
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   437
    (type == #GlobalVariable) ifTrue:[
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   438
        "for browsing, we put it into the literal-array; even if its a specal global"
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   439
        litIndex := aCompiler addLiteral:name asSymbol.
531
1d037c37e5a2 code cleanup
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   440
        specialGlobalIndex := aCompiler specialGlobalCodeFor:name.
1d037c37e5a2 code cleanup
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   441
        specialGlobalIndex notNil ifTrue:[
1d037c37e5a2 code cleanup
Claus Gittinger <cg@exept.de>
parents: 465
diff changeset
   442
            aStream nextPut:#pushSpecialGlobal; nextPut:specialGlobalIndex.
243
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   443
            ^ self
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   444
        ].
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   445
        self emitPushGlobalWithLiteralIndex:litIndex on:aStream for:aCompiler.
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   446
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   447
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   448
1553
1657d0843c64 sharedPools
ca
parents: 1462
diff changeset
   449
    ((type == #ClassVariable) or:[ type == #PoolVariable ]) ifTrue:[
1314
782d4cc1d588 slight code beautification: use classVarAt: / classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 1310
diff changeset
   450
        litIndex := aCompiler addLiteral:(value globalKeyForClassVar:name).
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   451
        litIndex <= 255 ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   452
            aStream nextPut:#pushClassVarS; nextPut:litIndex
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   453
        ] ifFalse:[
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   454
            litIndex <= 16rFFFF ifTrue:[
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   455
                aStream nextPut:#pushClassVarL; nextPut:litIndex; nextPut:0
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   456
            ] ifFalse:[
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   457
                aStream nextPut:#pushClassVarVL; nextPut:0; nextPut:litIndex; nextPut:0; nextPut:0; nextPut:0
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   458
            ].
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   459
        ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   460
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   461
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   462
360
9b26a5a4da70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 356
diff changeset
   463
    (type == #PrivateClass) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   464
        litIndex := aCompiler addLiteral:(value name , '::' , name) asSymbol.
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   465
        self emitPushGlobalWithLiteralIndex:litIndex on:aStream for:aCompiler.
360
9b26a5a4da70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 356
diff changeset
   466
        ^ self
9b26a5a4da70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 356
diff changeset
   467
    ].
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   468
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   469
    (type == #ClassInstanceVariable) ifTrue:[
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   470
        "theoretically, this allows for an instance method to access a classInstVar;
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   471
         However, the parser blocks this and we never arrive here."
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   472
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   473
        aStream nextPut:#pushClassInstVar; nextPut:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   474
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   475
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   476
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   477
    (type == #ThisContext) ifTrue:[
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   478
        aStream nextPut:#pushThisContext. 
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   479
        ^ self
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   480
    ].
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   481
1296
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   482
    (type == #WorkspaceVariable
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   483
    or:[type == #DoItTemporary]) ifTrue:[
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   484
        "/ this is done by keeping the valueHolder in the literalArray,
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   485
        "/ and coding a #value message here.
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   486
875
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   487
        litIndex := aCompiler addLiteral:token.
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   488
        self emitPushLiteralIndex:litIndex on:aStream for:aCompiler.
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   489
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   490
        selLitIdx := aCompiler addLiteral:#value.
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   491
        self emitSendLiteralIndex:selLitIdx numArgs:0 line:("lineNr ?" 1) on:aStream.
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   492
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   493
    ].
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   494
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   495
    "not reached"
1462
bf3d40b72bf3 Do not use #halt
Stefan Vogel <sv@exept.de>
parents: 1384
diff changeset
   496
    self error:'bad type'.
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   497
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   498
    "Created: / 25.6.1997 / 16:14:17 / cg"
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   499
    "Modified: / 17.1.1998 / 04:04:17 / cg"
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   500
!
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   501
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   502
codeOn:aStream inBlock:codeBlock for:aCompiler
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   503
    |idx|
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   504
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   505
    idx := (index isNil) 
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   506
            ifTrue:[ self indexIn: aCompiler ]
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   507
            ifFalse:[ index ].
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   508
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   509
    self
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   510
        codeLoadOn:aStream type:type index:idx inBlock:codeBlock for:aCompiler
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   511
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   512
    "Modified: / 06-08-2006 / 16:04:54 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   513
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   514
104
claus
parents: 103
diff changeset
   515
codeStoreOn:aStream inBlock:codeBlock valueNeeded:valueNeeded for:aCompiler
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   516
    |idx|
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   517
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   518
    idx := (index isNil) 
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   519
            ifTrue:[ self indexIn: aCompiler ]
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   520
            ifFalse:[ index ].
1821
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   521
    idx == 0 ifTrue:[
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   522
        self error
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   523
    ].
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   524
    self
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   525
        codeStoreOn:aStream type:type index:idx
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   526
        inBlock:codeBlock valueNeeded:valueNeeded for:aCompiler
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   527
1821
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   528
    "Modified: / 12-08-2006 / 15:54:52 / cg"
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   529
!
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   530
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   531
codeStoreOn:aStream type:type index:index inBlock:codeBlock valueNeeded:valueNeeded for:aCompiler
1296
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   532
    |theCode b deltaLevel litIndex bvIdx blocksCode selLitIdx|
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   533
1296
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   534
    "/ value to be stored is on TOP of stack.
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   535
    valueNeeded ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   536
        aStream nextPut:#dup
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   537
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   538
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   539
    (type == #MethodVariable) ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   540
        (index <= 6) ifTrue:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   541
            theCode := #(storeMethodVar1 storeMethodVar2
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   542
                         storeMethodVar3 storeMethodVar4
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   543
                         storeMethodVar5 storeMethodVar6) at:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   544
            aStream nextPut:theCode.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   545
            ^ self
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   546
        ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   547
        aStream nextPut:#storeMethodVar; nextPut:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   548
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   549
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   550
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   551
    (type == #InstanceVariable) ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   552
        (index <= 10) ifTrue:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   553
            theCode := #(storeInstVar1 storeInstVar2
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   554
                         storeInstVar3 storeInstVar4
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   555
                         storeInstVar5 storeInstVar6
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   556
                         storeInstVar7 storeInstVar8
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   557
                         storeInstVar9 storeInstVar10) at:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   558
            aStream nextPut:theCode.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   559
            ^ self
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   560
        ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   561
        aStream nextPut:#storeInstVar; nextPut:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   562
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   563
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   564
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   565
    (type == #BlockVariable) ifTrue:[
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   566
        bvIdx := index.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   567
        
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   568
        "/ find the context where that variable is contained physically
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   569
        blocksCode := block.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   570
        [blocksCode notNil and:[blocksCode isInlineBlock]] whileTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   571
            blocksCode := blocksCode home
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   572
        ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   573
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   574
        "find deltaLevel to block, where variable was defined"
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   575
        b := codeBlock.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   576
        deltaLevel := 0.
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   577
        [b notNil and:[b ~~ blocksCode]] whileTrue:[
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   578
            b isInlineBlock ifFalse:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   579
                deltaLevel := deltaLevel + 1
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   580
            ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   581
            b := b home
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   582
        ].
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   583
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   584
        b isNil ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   585
            codeBlock isNil ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   586
                "/ a block which is inlined in the method. 
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   587
                "/ Generate a pushMVAR
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   588
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   589
                bvIdx := block indexOfFirstTemp + index - 1.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   590
                bvIdx := bvIdx + block numArgs.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   591
                ^ self
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   592
                    codeStoreOn:aStream 
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   593
                    type:#MethodVariable index:bvIdx 
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   594
                    inBlock:codeBlock 
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   595
                    valueNeeded:false       "/ already dupped if value is needed
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   596
                    for:aCompiler
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   597
            ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   598
            "/ a var of a block which is inlined in the outer block.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   599
            "/ Generate a pushBVAR
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   600
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   601
            bvIdx := block indexOfFirstTemp + index - 1.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   602
            bvIdx := bvIdx + block numArgs.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   603
        ] ifFalse:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   604
            block isInlineBlock ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   605
                "/ a var of a block which is inlined in another block.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   606
                "/ Generate a pushBVAR / pushOuterBVAR
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   607
                bvIdx := block indexOfFirstTemp + index - 1.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   608
                bvIdx := bvIdx + block numArgs.
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   609
            ]
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   610
        ].
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   611
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   612
        (deltaLevel == 0) ifTrue:[
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   613
            bvIdx <= 3 ifTrue:[
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   614
                aStream nextPut:(#(storeBlockVar1 storeBlockVar2 storeBlockVar3) at:bvIdx).
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   615
                ^ self
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   616
            ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   617
            aStream nextPut:#storeBlockVar
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   618
        ] ifFalse:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   619
            aStream nextPut:#storeOuterBlockVar; nextPut:deltaLevel
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   620
        ].
559
42cf4afd99b3 inline blocks withs args
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   621
        aStream nextPut:bvIdx.
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   622
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   623
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   624
117
claus
parents: 106
diff changeset
   625
    (type == #GlobalVariable) ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   626
        litIndex := aCompiler addLiteral:name asSymbol.
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   627
        self emitStoreGlobalWithLiteralIndex:litIndex on:aStream for:aCompiler.
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   628
        ^ self
117
claus
parents: 106
diff changeset
   629
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   630
1553
1657d0843c64 sharedPools
ca
parents: 1462
diff changeset
   631
    ((type == #ClassVariable) or:[type == #PoolVariable]) ifTrue:[
1314
782d4cc1d588 slight code beautification: use classVarAt: / classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 1310
diff changeset
   632
        litIndex := aCompiler addLiteral:(value globalKeyForClassVar:name).
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   633
        litIndex < 256 ifTrue:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   634
            aStream nextPut:#storeClassVarS; nextPut:litIndex
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   635
        ] ifFalse:[
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   636
            aStream nextPut:#storeClassVarL; nextPut:litIndex; nextPut:0
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   637
        ].
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   638
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   639
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   640
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   641
    (type == #ClassInstanceVariable) ifTrue:[
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   642
        aStream nextPut:#storeClassInstVar; nextPut:index.
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   643
        ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   644
    ].
554
d5e548c4d49d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
   645
1296
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   646
    (type == #WorkspaceVariable
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   647
    or:[type == #DoItTemporary]) ifTrue:[
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   648
        "/ this is done by keeping the valueHolder in the literalArray,
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   649
        "/ and coding a #value: message here.
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   650
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   651
        litIndex := aCompiler addLiteral:token.
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   652
        self emitPushLiteralIndex:litIndex on:aStream for:aCompiler.
1296
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   653
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   654
        "/ need to exchange top 2 items (sigh - there is no exch instruction)
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   655
        "/ now, we have:
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   656
        "/   TOS:  holder
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   657
        "/   NOS:  value
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   658
        "/
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   659
        "/ for the send, I need them as:
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   660
        "/   TOS:  value
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   661
        "/   NOS:  holder
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   662
        aStream nextPut:#over.
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   663
        "/ now, we have:
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   664
        "/   TOS:  value
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   665
        "/   NOS:  holder
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   666
        "/         value
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   667
        selLitIdx := aCompiler addLiteral:#'value:'.
1808
29b197bc6939 some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents: 1784
diff changeset
   668
        self emitSendLiteralIndex:selLitIdx numArgs:1 line:("lineNr ?" 1) on:aStream.
1296
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   669
        "/ now, we have:
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   670
        "/   TOS:  retVal from value:
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   671
        "/   NOS:  value
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   672
        aStream nextPut:#drop.
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   673
        aStream nextPut:#drop.
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   674
        ^ self
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   675
    ].
7c535a2cd7ff WorkspaceVars
Claus Gittinger <cg@exept.de>
parents: 1179
diff changeset
   676
1821
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   677
    (type == #MethodArg) ifTrue:[
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   678
        aStream nextPut:#storeLocal; nextPut:index-1.
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   679
        ^ self
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   680
    ].
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   681
106
claus
parents: 104
diff changeset
   682
    "not reached"
941
0ae34d664798 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 875
diff changeset
   683
    self error:'bad assignment'
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   684
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   685
    "Created: / 25-06-1997 / 16:14:40 / cg"
1821
7cfd8464cace *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1808
diff changeset
   686
    "Modified: / 12-08-2006 / 15:53:23 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   687
! !
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   688
1035
8848672cb893 category rename
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
   689
!VariableNode methodsFor:'enumerating'!
539
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   690
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   691
nodeDo:anEnumerator
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   692
    "helper for parse tree walking"
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   693
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   694
    ^ anEnumerator doVariable:self name:name
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   695
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   696
    "Created: 19.6.1997 / 16:41:35 / cg"
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   697
! !
69a1cd05c7d6 added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
   698
1035
8848672cb893 category rename
Claus Gittinger <cg@exept.de>
parents: 980
diff changeset
   699
!VariableNode methodsFor:'evaluation'!
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   700
1384
0db9682870d9 evaluate -> evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 1320
diff changeset
   701
evaluateIn:anEnvironment
980
1818e8c13e2a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   702
    |nameSym|
1818e8c13e2a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   703
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   704
    (type == #ContextVariable) ifTrue:[
1137
43db3cacab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   705
"/        value method isWrapped ifTrue:[^ nil].
1178
f8065fd945a8 care for wrapped methods context
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   706
        index > value size ifTrue:[
f8065fd945a8 care for wrapped methods context
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   707
            "/ this can happen ,if a wrapped method is not yet entered
f8065fd945a8 care for wrapped methods context
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   708
            ^ nil
f8065fd945a8 care for wrapped methods context
Claus Gittinger <cg@exept.de>
parents: 1137
diff changeset
   709
        ].
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   710
        ^ value at:index
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   711
    ].
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   712
    (type == #MethodVariable
1384
0db9682870d9 evaluate -> evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 1320
diff changeset
   713
    or:[type == #MethodArg
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   714
    or:[type == #BlockArg
1384
0db9682870d9 evaluate -> evaluateIn:
Claus Gittinger <cg@exept.de>
parents: 1320
diff changeset
   715
    or:[type == #BlockVariable]]]) ifTrue:[
420
ad567fb4e732 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   716
        ^ token variableValue
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   717
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   718
    (type == #InstanceVariable) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   719
        ^ value instVarAt:index
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   720
    ].
1088
029b67b39d1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   721
    (type == #JavaVariable) ifTrue:[
029b67b39d1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   722
        nameSym := name asSymbolIfInterned.
029b67b39d1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   723
        nameSym notNil ifTrue:[
029b67b39d1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   724
            ^ JAVA at:name
029b67b39d1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   725
        ].
2125
aa85e7a4c503 eliminated undefinedVariable !
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
   726
        ^ Parser::UndefinedVariableError raiseRequestWith:name errorString:('undefined: ',name).
1088
029b67b39d1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   727
    ].
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   728
    (type == #GlobalVariable) ifTrue:[
980
1818e8c13e2a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   729
        nameSym := name asSymbolIfInterned.
1818e8c13e2a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   730
        nameSym notNil ifTrue:[
1818e8c13e2a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   731
            (Smalltalk includesKey:nameSym) ifTrue:[
1818e8c13e2a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   732
                ^ Smalltalk at:name
1818e8c13e2a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   733
            ]
420
ad567fb4e732 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   734
        ].
2125
aa85e7a4c503 eliminated undefinedVariable !
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
   735
        ^ Parser::UndefinedVariableError raiseRequestWith:name errorString:('undefined: ',name).
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   736
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   737
    (type == #ClassVariable) ifTrue:[
1314
782d4cc1d588 slight code beautification: use classVarAt: / classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 1310
diff changeset
   738
        ^ value classVarAt:name asSymbol
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   739
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   740
    (type == #ClassInstanceVariable) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   741
        ^ value instVarAt:index
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   742
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   743
    (type == #ThisContext) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   744
        value notNil ifTrue:[
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   745
            ^ value
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   746
        ].
420
ad567fb4e732 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   747
        ^ thisContext
ad567fb4e732 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   748
    ].
ad567fb4e732 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   749
    (type == #PrivateClass) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   750
        ^ value privateClassesAt:name asSymbol
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   751
    ].
1918
e02187d205c0 poolvars in a doIT
fm
parents: 1821
diff changeset
   752
    (type == #PoolVariable) ifTrue:[
e02187d205c0 poolvars in a doIT
fm
parents: 1821
diff changeset
   753
        ^ value classVarAt:name asSymbol
e02187d205c0 poolvars in a doIT
fm
parents: 1821
diff changeset
   754
    ].
719
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   755
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   756
    "/ synthetic; for evaluation only
1179
b411ceb395f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   757
    (type == #EvaluationContextLocal
b411ceb395f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   758
    or:[type == #EvaluationContextVar
b411ceb395f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   759
    or:[type == #EvaluationContextArg]]) ifTrue:[
719
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   760
        ^ token variableValue
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   761
    ].
1179
b411ceb395f8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1178
diff changeset
   762
1092
77de350f525c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   763
    "/ synthetic; for evaluation only
1606
eaf685612275 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
   764
    ((type == #WorkspaceVariable) or:[type == #DoItTemporary]) ifTrue:[
1092
77de350f525c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   765
        ^ token value
77de350f525c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1088
diff changeset
   766
    ].
719
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   767
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   768
    "not reached"
1320
5d004fcfd006 Use #error: insead of #halt.
Stefan Vogel <sv@exept.de>
parents: 1314
diff changeset
   769
    self error:'internal error - bad variable type:' , type mayProceed:true.
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   770
    ^ value
420
ad567fb4e732 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   771
1918
e02187d205c0 poolvars in a doIT
fm
parents: 1821
diff changeset
   772
    "Modified: / 26-09-1999 / 13:04:42 / cg"
e02187d205c0 poolvars in a doIT
fm
parents: 1821
diff changeset
   773
    "Modified: / 11-09-2006 / 14:22:38 / User"
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   774
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   775
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   776
store:aValue
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   777
    (type == #ContextVariable) ifTrue:[
1137
43db3cacab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   778
"/        value method isWrapped ifTrue:[
43db3cacab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   779
"/            self warn:'The method has not yet been entered (in breakpoint stub)\Please perform a singleStep first' withCRs.
43db3cacab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   780
"/            ^ aValue
43db3cacab5f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
   781
"/        ].
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   782
        value at:index put:aValue. ^ aValue
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   783
    ].
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   784
    (type == #MethodVariable
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   785
    or:[type == #BlockVariable]) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   786
        token value:aValue. ^ aValue
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   787
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   788
    (type == #InstanceVariable) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   789
        ^ value instVarAt:index put:aValue
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   790
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   791
    (type == #GlobalVariable) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   792
        ^ Smalltalk at:name put:aValue
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   793
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   794
    (type == #ClassVariable) ifTrue:[
1314
782d4cc1d588 slight code beautification: use classVarAt: / classVarAt:put:
Claus Gittinger <cg@exept.de>
parents: 1310
diff changeset
   795
        ^ value classVarAt:name asSymbol put:aValue
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   796
    ].
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   797
    (type == #ClassInstanceVariable) ifTrue:[
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   798
        ^ value instVarAt:index put:aValue
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   799
    ].
719
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   800
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   801
    "/ synthetic; for evaluation only
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   802
    (type == #EvaluationContextLocal) ifTrue:[
875
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   803
        token value:aValue. ^ aValue
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   804
    ].
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   805
    (type == #WorkspaceVariable) ifTrue:[
2561654973eb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 872
diff changeset
   806
        token value:aValue. ^ aValue
719
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   807
    ].
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   808
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   809
    "not reached"
1320
5d004fcfd006 Use #error: insead of #halt.
Stefan Vogel <sv@exept.de>
parents: 1314
diff changeset
   810
    self error:'bad variable node type' mayProceed:true.
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   811
    ^ aValue
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   812
719
9ccbae6ba13e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   813
    "Modified: / 16.5.1998 / 18:35:03 / cg"
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   814
! !
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   815
1080
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 1076
diff changeset
   816
!VariableNode methodsFor:'printing & storing'!
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   817
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   818
displayString
612
2748896a66c8 comments
Claus Gittinger <cg@exept.de>
parents: 577
diff changeset
   819
    "return a string for display in inspectors etc."
2748896a66c8 comments
Claus Gittinger <cg@exept.de>
parents: 577
diff changeset
   820
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   821
    ^ 'Variable(' , self printString , ')'
612
2748896a66c8 comments
Claus Gittinger <cg@exept.de>
parents: 577
diff changeset
   822
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   823
    "Modified: / 06-08-2006 / 15:45:18 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   824
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   825
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   826
printOn:aStream indent:i
98
claus
parents: 53
diff changeset
   827
641
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   828
    "/ actually only a debug-check
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   829
    (
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   830
    type == #ContextVariable              
e18daf10662c added support for context-vars (for evaluation in the debuggers code-frame)
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   831
    or:[type == #MethodArg            
98
claus
parents: 53
diff changeset
   832
    or:[type == #MethodVariable
claus
parents: 53
diff changeset
   833
    or:[type == #InstanceVariable
claus
parents: 53
diff changeset
   834
    or:[type == #BlockArg
claus
parents: 53
diff changeset
   835
    or:[type == #GlobalVariable
1088
029b67b39d1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   836
    or:[type == #JavaVariable
98
claus
parents: 53
diff changeset
   837
    or:[type == #ClassVariable
2066
9873763eb1f8 sharedPool access in doIts
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
   838
    or:[type == #PoolVariable
98
claus
parents: 53
diff changeset
   839
    or:[type == #BlockVariable
465
67e5205a81cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 420
diff changeset
   840
    or:[type == #PrivateClass
872
7cf38a8125e6 support for workspace variables.
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   841
    or:[type == #WorkspaceVariable
1101
84db57980ac5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1092
diff changeset
   842
    or:[type == #EvaluationContextArg
720
6b3d43ba7273 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   843
    or:[type == #EvaluationContextLocal
2066
9873763eb1f8 sharedPool access in doIts
Claus Gittinger <cg@exept.de>
parents: 1997
diff changeset
   844
    or:[type == #ClassInstanceVariable]]]]]]]]]]]]]]) ifTrue:[
465
67e5205a81cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 420
diff changeset
   845
        aStream nextPutAll:name. ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   846
    ].
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   847
    (type == #ThisContext) ifTrue:[
465
67e5205a81cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 420
diff changeset
   848
        aStream nextPutAll:'thisContext'. ^ self
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   849
    ].
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   850
    "not reached"
1320
5d004fcfd006 Use #error: insead of #halt.
Stefan Vogel <sv@exept.de>
parents: 1314
diff changeset
   851
    self error:'bad variable node type' mayProceed:true.
465
67e5205a81cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 420
diff changeset
   852
720
6b3d43ba7273 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 719
diff changeset
   853
    "Modified: / 17.5.1998 / 00:17:12 / cg"
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
   854
! !
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   855
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   856
!VariableNode methodsFor:'queries'!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   857
243
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   858
canReuseAsArg:anotherNode
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   859
    anotherNode isVariable ifTrue:[
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   860
        anotherNode type ~~ type ifTrue:[^ false].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   861
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   862
        (type == #ThisContext) ifTrue:[^ true].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   863
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   864
        index notNil ifTrue:[
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   865
            anotherNode index ~~ index ifTrue:[^ false].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   866
        ].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   867
        (type == #MethodArg) ifTrue:[^ true].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   868
        (type == #MethodVariable) ifTrue:[^ true].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   869
        (type == #InstanceVariable) ifTrue:[^ true].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   870
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   871
        name notNil ifTrue:[
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   872
            anotherNode name ~~ name ifTrue:[^ false].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   873
        ].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   874
        (type == #GlobalVariable) ifTrue:[^ true].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   875
        (type == #ClassVariable) ifTrue:[^ true].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   876
    ].
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   877
    ^ false
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   878
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   879
    "Created: 14.4.1996 / 00:46:18 / cg"
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   880
    "Modified: 14.4.1996 / 00:55:25 / cg"
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   881
!
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   882
1784
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   883
indexIn: aCompiler
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   884
    (type == #MethodVariable) ifTrue:[
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   885
        ^ aCompiler methodVars indexOf:name.
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   886
    ].
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   887
    (type == #MethodArg) ifTrue:[
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   888
        ^ aCompiler methodArgs indexOf:name.
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   889
    ].
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   890
    ^ index
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   891
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   892
    "Created: / 06-08-2006 / 16:03:56 / cg"
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   893
!
4380f89e1a91 allow for lazy index of locals and arguments.
Claus Gittinger <cg@exept.de>
parents: 1606
diff changeset
   894
566
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   895
isArgument
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   896
    "return true, if this is a node for an argument (block or method)"
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   897
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   898
    ^ (type == #MethodArg) or:[type == #BlockArg]
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   899
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   900
    "Created: 27.6.1997 / 13:07:05 / cg"
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   901
    "Modified: 27.6.1997 / 13:07:19 / cg"
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   902
!
90969df02c85 added #isArgument query
Claus Gittinger <cg@exept.de>
parents: 559
diff changeset
   903
1076
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   904
isClassVariable
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   905
    ^ type == #ClassVariable
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   906
!
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   907
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   908
isGlobal
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   909
    "return true, if this is a node for a global variable"
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   910
789
d9bbb0970239 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   911
d9bbb0970239 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   912
    ^ (type == #GlobalVariable) 
d9bbb0970239 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   913
      and:[name isSymbol
d9bbb0970239 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   914
      and:[Smalltalk includesKey:name]]
d9bbb0970239 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   915
d9bbb0970239 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   916
    "Modified: / 19.10.1998 / 19:43:04 / cg"
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   917
!
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   918
1997
4ec97f7ce416 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   919
isGlobalNamed:nameWanted
1996
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   920
    "return true, if this is a node for a particular global variable"
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   921
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   922
    ^ (type == #GlobalVariable) 
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   923
      and:[name = nameWanted
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   924
      and:[name isSymbol
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   925
      and:[Smalltalk includesKey:name]]]
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   926
1997
4ec97f7ce416 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1996
diff changeset
   927
    "Created: / 05-03-2007 / 13:35:07 / cg"
1996
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   928
!
6d70e53e9f14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1932
diff changeset
   929
1310
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   930
isGlobalVariable
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   931
    ^ type == #GlobalVariable
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   932
!
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   933
1076
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   934
isInstanceVariable
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   935
    ^ type == #InstanceVariable
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   936
!
b393dc61463e added #isClassVariable and #isInstanceVariable
Claus Gittinger <cg@exept.de>
parents: 1035
diff changeset
   937
218
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   938
isLocal
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   939
    "return true, if this is a node for a local (block or method) variable"
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   940
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   941
    ^ (type == #MethodVariable) or:[type == #BlockVariable]
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   942
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   943
    "Created: 1.3.1996 / 00:03:53 / cg"
748b4c509a51 use new BlockVar instructions
Claus Gittinger <cg@exept.de>
parents: 199
diff changeset
   944
    "Modified: 1.3.1996 / 00:04:46 / cg"
243
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   945
!
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   946
1310
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   947
isMethodArg
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   948
    ^ type == #MethodArg
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   949
!
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   950
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   951
isMethodVariable
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   952
    ^ type == #MethodVariable
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   953
!
feb30ab0c221 better variabletype queries.
Claus Gittinger <cg@exept.de>
parents: 1296
diff changeset
   954
965
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   955
isUndeclared
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   956
    type == #PrivateClass ifTrue:[
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   957
        ^ (Smalltalk includesKey:(value name , '::' , name) asSymbol) not
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   958
    ].
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   959
    type == #GlobalVariable ifTrue:[
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   960
        ^ (Smalltalk includesKey:name) not
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   961
    ].
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   962
    ^ false
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   963
!
5f893e013e73 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 941
diff changeset
   964
243
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   965
isVariable
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   966
    "return true, if this is a node for a variable"
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   967
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   968
    ^ true
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   969
cdc1424ddaac use dup if possible when pushing args / faster access to common globals
Claus Gittinger <cg@exept.de>
parents: 218
diff changeset
   970
    "Created: 14.4.1996 / 00:46:32 / cg"
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   971
! !
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   972
360
9b26a5a4da70 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 356
diff changeset
   973
!VariableNode class methodsFor:'documentation'!
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   974
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   975
version
2125
aa85e7a4c503 eliminated undefinedVariable !
Claus Gittinger <cg@exept.de>
parents: 2116
diff changeset
   976
    ^ '$Header: /cvs/stx/stx/libcomp/VariableNode.st,v 1.74 2008-10-31 13:25:57 cg Exp $'
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   977
! !