resin 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. data/amber/bin/amberc +10 -350
  2. data/amber/js/Benchfib.deploy.js +80 -89
  3. data/amber/js/Benchfib.js +80 -89
  4. data/amber/js/Canvas.deploy.js +558 -545
  5. data/amber/js/Canvas.js +563 -545
  6. data/amber/js/Compiler-AST.deploy.js +431 -243
  7. data/amber/js/Compiler-AST.js +487 -244
  8. data/amber/js/Compiler-Core.deploy.js +201 -1045
  9. data/amber/js/Compiler-Core.js +208 -1207
  10. data/amber/js/Compiler-Exceptions.deploy.js +37 -18
  11. data/amber/js/Compiler-Exceptions.js +42 -18
  12. data/amber/js/Compiler-IR.deploy.js +1071 -774
  13. data/amber/js/Compiler-IR.js +1194 -848
  14. data/amber/js/Compiler-Inlining.deploy.js +395 -373
  15. data/amber/js/Compiler-Inlining.js +395 -373
  16. data/amber/js/Compiler-Interpreter.deploy.js +1202 -0
  17. data/amber/js/Compiler-Interpreter.js +1631 -0
  18. data/amber/js/Compiler-Semantic.deploy.js +695 -600
  19. data/amber/js/Compiler-Semantic.js +721 -611
  20. data/amber/js/Compiler-Tests.deploy.js +699 -376
  21. data/amber/js/Compiler-Tests.js +834 -381
  22. data/amber/js/Compiler.deploy.js +8563 -1805
  23. data/amber/js/Compiler.js +11476 -2633
  24. data/amber/js/Examples.deploy.js +29 -29
  25. data/amber/js/Examples.js +29 -29
  26. data/amber/js/IDE.deploy.js +3292 -2649
  27. data/amber/js/IDE.js +3318 -2710
  28. data/amber/js/Importer-Exporter.deploy.js +393 -349
  29. data/amber/js/Importer-Exporter.js +398 -354
  30. data/amber/js/Kernel-Announcements.deploy.js +53 -44
  31. data/amber/js/Kernel-Announcements.js +55 -44
  32. data/amber/js/Kernel-Classes.deploy.js +566 -368
  33. data/amber/js/Kernel-Classes.js +660 -402
  34. data/amber/js/Kernel-Collections.deploy.js +1149 -1098
  35. data/amber/js/Kernel-Collections.js +1183 -1116
  36. data/amber/js/Kernel-Exceptions.deploy.js +173 -75
  37. data/amber/js/Kernel-Exceptions.js +215 -77
  38. data/amber/js/Kernel-Methods.deploy.js +530 -313
  39. data/amber/js/Kernel-Methods.js +632 -338
  40. data/amber/js/Kernel-Objects.deploy.js +1734 -1577
  41. data/amber/js/Kernel-Objects.js +1867 -1654
  42. data/amber/js/Kernel-Tests.deploy.js +1416 -973
  43. data/amber/js/Kernel-Tests.js +1495 -981
  44. data/amber/js/Kernel-Transcript.deploy.js +23 -24
  45. data/amber/js/Kernel-Transcript.js +25 -26
  46. data/amber/js/SUnit-Tests.deploy.js +402 -0
  47. data/amber/js/SUnit-Tests.js +518 -0
  48. data/amber/js/SUnit.deploy.js +535 -237
  49. data/amber/js/SUnit.js +634 -246
  50. data/amber/js/amber.js +90 -53
  51. data/amber/js/boot.js +441 -255
  52. data/amber/js/init.js +1 -3
  53. data/amber/js/lib/CodeMirror/codemirror.css +3 -0
  54. data/amber/js/lib/CodeMirror/codemirror.js +104 -55
  55. data/amber/js/lib/peg-0.7.0.min.js +9 -0
  56. data/amber/js/parser.js +1504 -802
  57. data/amber/js/parser.pegjs +170 -165
  58. data/amber/st/Canvas.st +6 -0
  59. data/amber/st/Compiler-AST.st +54 -3
  60. data/amber/st/Compiler-Core.st +6 -551
  61. data/amber/st/Compiler-Exceptions.st +4 -0
  62. data/amber/st/Compiler-IR.st +205 -87
  63. data/amber/st/Compiler-Interpreter.st +597 -0
  64. data/amber/st/Compiler-Semantic.st +46 -21
  65. data/amber/st/Compiler-Tests.st +254 -7
  66. data/amber/st/Compiler.st +3172 -1541
  67. data/amber/st/IDE.st +57 -93
  68. data/amber/st/Importer-Exporter.st +4 -7
  69. data/amber/st/Kernel-Announcements.st +8 -0
  70. data/amber/st/Kernel-Classes.st +149 -40
  71. data/amber/st/Kernel-Collections.st +43 -32
  72. data/amber/st/Kernel-Exceptions.st +70 -1
  73. data/amber/st/Kernel-Methods.st +165 -27
  74. data/amber/st/Kernel-Objects.st +215 -140
  75. data/amber/st/Kernel-Tests.st +195 -10
  76. data/amber/st/Kernel-Transcript.st +1 -3
  77. data/amber/st/SUnit-Tests.st +186 -0
  78. data/amber/st/SUnit.st +186 -14
  79. data/bin/resin +6 -0
  80. data/lib/resin/cli.rb +19 -0
  81. metadata +41 -25
  82. data/amber/js/lib/peg-0.6.2.min.js +0 -2
  83. data/bin/resin-compile +0 -6
  84. data/bin/runresin +0 -12
@@ -6,14 +6,15 @@ smalltalk.method({
6
6
  selector: "codeGeneratorClass",
7
7
  fn: function (){
8
8
  var self=this;
9
- var $1;
10
- if(($receiver = self["@codeGeneratorClass"]) == nil || $receiver == undefined){
9
+ return smalltalk.withContext(function($ctx1) {
10
+ $2=self["@codeGeneratorClass"];
11
+ if(($receiver = $2) == nil || $receiver == undefined){
11
12
  $1=(smalltalk.InliningCodeGenerator || InliningCodeGenerator);
12
13
  } else {
13
- $1=self["@codeGeneratorClass"];
14
+ $1=$2;
14
15
  };
15
16
  return $1;
16
- }
17
+ }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{}, smalltalk.Compiler)})}
17
18
  }),
18
19
  smalltalk.Compiler);
19
20
 
@@ -23,8 +24,8 @@ smalltalk.method({
23
24
  selector: "codeGeneratorClass:",
24
25
  fn: function (aClass){
25
26
  var self=this;
26
- self["@codeGeneratorClass"]=aClass;
27
- return self}
27
+ return smalltalk.withContext(function($ctx1) {
28
+ return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass}, smalltalk.Compiler)})}
28
29
  }),
29
30
  smalltalk.Compiler);
30
31
 
@@ -34,10 +35,10 @@ smalltalk.method({
34
35
  selector: "compile:",
35
36
  fn: function (aString){
36
37
  var self=this;
37
- var $1;
38
- $1=smalltalk.send(self,"_compileNode_",[smalltalk.send(self,"_parse_",[aString])]);
38
+ return smalltalk.withContext(function($ctx1) {
39
+ $1=_st(self)._compileNode_(_st(self)._parse_(aString));
39
40
  return $1;
40
- }
41
+ }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.Compiler)})}
41
42
  }),
42
43
  smalltalk.Compiler);
43
44
 
@@ -47,12 +48,12 @@ smalltalk.method({
47
48
  selector: "compile:forClass:",
48
49
  fn: function (aString,aClass){
49
50
  var self=this;
50
- var $1;
51
- smalltalk.send(self,"_currentClass_",[aClass]);
52
- smalltalk.send(self,"_source_",[aString]);
53
- $1=smalltalk.send(self,"_compile_",[aString]);
51
+ return smalltalk.withContext(function($ctx1) {
52
+ _st(self)._currentClass_(aClass);
53
+ _st(self)._source_(aString);
54
+ $1=_st(self)._compile_(aString);
54
55
  return $1;
55
- }
56
+ }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass}, smalltalk.Compiler)})}
56
57
  }),
57
58
  smalltalk.Compiler);
58
59
 
@@ -62,12 +63,12 @@ smalltalk.method({
62
63
  selector: "compileExpression:",
63
64
  fn: function (aString){
64
65
  var self=this;
65
- var $1;
66
- smalltalk.send(self,"_currentClass_",[(smalltalk.DoIt || DoIt)]);
67
- smalltalk.send(self,"_source_",[smalltalk.send(smalltalk.send("doIt ^[","__comma",[aString]),"__comma",["] value"])]);
68
- $1=smalltalk.send(self,"_compileNode_",[smalltalk.send(self,"_parse_",[smalltalk.send(self,"_source",[])])]);
66
+ return smalltalk.withContext(function($ctx1) {
67
+ _st(self)._currentClass_((smalltalk.DoIt || DoIt));
68
+ _st(self)._source_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
69
+ $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
69
70
  return $1;
70
- }
71
+ }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString}, smalltalk.Compiler)})}
71
72
  }),
72
73
  smalltalk.Compiler);
73
74
 
@@ -77,16 +78,17 @@ smalltalk.method({
77
78
  selector: "compileNode:",
78
79
  fn: function (aNode){
79
80
  var self=this;
80
- var $1;
81
- var generator;
82
- var result;
83
- generator=smalltalk.send(smalltalk.send(self,"_codeGeneratorClass",[]),"_new",[]);
84
- smalltalk.send(generator,"_source_",[smalltalk.send(self,"_source",[])]);
85
- $1=smalltalk.send(generator,"_currentClass_",[smalltalk.send(self,"_currentClass",[])]);
86
- result=smalltalk.send(generator,"_compileNode_",[aNode]);
87
- smalltalk.send(self,"_unknownVariables_",[[]]);
88
- return result;
89
- }
81
+ var generator,result;
82
+ return smalltalk.withContext(function($ctx1) {
83
+ generator=_st(_st(self)._codeGeneratorClass())._new();
84
+ $1=generator;
85
+ _st($1)._source_(_st(self)._source());
86
+ $2=_st($1)._currentClass_(_st(self)._currentClass());
87
+ result=_st(generator)._compileNode_(aNode);
88
+ _st(self)._unknownVariables_([]);
89
+ $3=result;
90
+ return $3;
91
+ }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result}, smalltalk.Compiler)})}
90
92
  }),
91
93
  smalltalk.Compiler);
92
94
 
@@ -96,8 +98,10 @@ smalltalk.method({
96
98
  selector: "currentClass",
97
99
  fn: function (){
98
100
  var self=this;
99
- return self["@currentClass"];
100
- }
101
+ return smalltalk.withContext(function($ctx1) {
102
+ $1=self["@currentClass"];
103
+ return $1;
104
+ }, function($ctx1) {$ctx1.fill(self,"currentClass",{}, smalltalk.Compiler)})}
101
105
  }),
102
106
  smalltalk.Compiler);
103
107
 
@@ -107,8 +111,8 @@ smalltalk.method({
107
111
  selector: "currentClass:",
108
112
  fn: function (aClass){
109
113
  var self=this;
110
- self["@currentClass"]=aClass;
111
- return self}
114
+ return smalltalk.withContext(function($ctx1) {
115
+ return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass}, smalltalk.Compiler)})}
112
116
  }),
113
117
  smalltalk.Compiler);
114
118
 
@@ -118,9 +122,8 @@ smalltalk.method({
118
122
  selector: "eval:",
119
123
  fn: function (aString){
120
124
  var self=this;
121
- return eval(aString);
122
- ;
123
- return self}
125
+ return smalltalk.withContext(function($ctx1) {
126
+ return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString}, smalltalk.Compiler)})}
124
127
  }),
125
128
  smalltalk.Compiler);
126
129
 
@@ -131,11 +134,13 @@ selector: "evaluateExpression:",
131
134
  fn: function (aString){
132
135
  var self=this;
133
136
  var result;
134
- smalltalk.send((smalltalk.DoIt || DoIt),"_addCompiledMethod_",[smalltalk.send(self,"_eval_",[smalltalk.send(self,"_compileExpression_",[aString])])]);
135
- result=smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt),"_new",[]),"_doIt",[]);
136
- smalltalk.send((smalltalk.DoIt || DoIt),"_removeCompiledMethod_",[smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt),"_methodDictionary",[]),"_at_",["doIt"])]);
137
- return result;
138
- }
137
+ return smalltalk.withContext(function($ctx1) {
138
+ _st((smalltalk.DoIt || DoIt))._addCompiledMethod_(_st(self)._eval_(_st(self)._compileExpression_(aString)));
139
+ result=_st(_st((smalltalk.DoIt || DoIt))._new())._doIt();
140
+ _st((smalltalk.DoIt || DoIt))._removeCompiledMethod_(_st(_st((smalltalk.DoIt || DoIt))._methodDictionary())._at_("doIt"));
141
+ $1=result;
142
+ return $1;
143
+ }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString,result:result}, smalltalk.Compiler)})}
139
144
  }),
140
145
  smalltalk.Compiler);
141
146
 
@@ -145,13 +150,10 @@ smalltalk.method({
145
150
  selector: "install:forClass:category:",
146
151
  fn: function (aString,aBehavior,anotherString){
147
152
  var self=this;
148
- var compiled;
149
- compiled=smalltalk.send(self,"_eval_",[smalltalk.send(self,"_compile_forClass_",[aString,aBehavior])]);
150
- smalltalk.send(compiled,"_category_",[anotherString]);
151
- smalltalk.send(aBehavior,"_addCompiledMethod_",[compiled]);
152
- smalltalk.send(self,"_setupClass_",[aBehavior]);
153
- return compiled;
154
- }
153
+ return smalltalk.withContext(function($ctx1) {
154
+ $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._installMethod_forClass_category_(_st(self)._eval_(_st(self)._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
155
+ return $1;
156
+ }, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString}, smalltalk.Compiler)})}
155
157
  }),
156
158
  smalltalk.Compiler);
157
159
 
@@ -161,10 +163,10 @@ smalltalk.method({
161
163
  selector: "parse:",
162
164
  fn: function (aString){
163
165
  var self=this;
164
- var $1;
165
- $1=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_parse_",[aString]);
166
+ return smalltalk.withContext(function($ctx1) {
167
+ $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._parse_(aString);
166
168
  return $1;
167
- }
169
+ }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString}, smalltalk.Compiler)})}
168
170
  }),
169
171
  smalltalk.Compiler);
170
172
 
@@ -174,10 +176,10 @@ smalltalk.method({
174
176
  selector: "parseExpression:",
175
177
  fn: function (aString){
176
178
  var self=this;
177
- var $1;
178
- $1=smalltalk.send(self,"_parse_",[smalltalk.send(smalltalk.send("doIt ^[","__comma",[aString]),"__comma",["] value"])]);
179
+ return smalltalk.withContext(function($ctx1) {
180
+ $1=_st(self)._parse_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
179
181
  return $1;
180
- }
182
+ }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString}, smalltalk.Compiler)})}
181
183
  }),
182
184
  smalltalk.Compiler);
183
185
 
@@ -187,17 +189,16 @@ smalltalk.method({
187
189
  selector: "recompile:",
188
190
  fn: function (aClass){
189
191
  var self=this;
190
- var $1;
191
- smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_do_",[(function(each){
192
- smalltalk.send(console,"_log_",[smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_name",[]),"__comma",[" >> "]),"__comma",[smalltalk.send(each,"_selector",[])])]);
193
- return smalltalk.send(self,"_install_forClass_category_",[smalltalk.send(each,"_source",[]),aClass,smalltalk.send(each,"_category",[])]);
194
- })]);
195
- smalltalk.send(self,"_setupClass_",[aClass]);
196
- $1=smalltalk.send(aClass,"_isMetaclass",[]);
192
+ return smalltalk.withContext(function($ctx1) {
193
+ _st(_st(aClass)._methodDictionary())._do_((function(each){
194
+ return smalltalk.withContext(function($ctx2) {
195
+ return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
196
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
197
+ $1=_st(aClass)._isMetaclass();
197
198
  if(! smalltalk.assert($1)){
198
- smalltalk.send(self,"_recompile_",[smalltalk.send(aClass,"_class",[])]);
199
+ _st(self)._recompile_(_st(aClass)._class());
199
200
  };
200
- return self}
201
+ return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass}, smalltalk.Compiler)})}
201
202
  }),
202
203
  smalltalk.Compiler);
203
204
 
@@ -207,28 +208,17 @@ smalltalk.method({
207
208
  selector: "recompileAll",
208
209
  fn: function (){
209
210
  var self=this;
210
- var $1;
211
- smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_classes",[]),"_do_",[(function(each){
212
- smalltalk.send((smalltalk.Transcript || Transcript),"_show_",[each]);
213
- $1=smalltalk.send((smalltalk.Transcript || Transcript),"_cr",[]);
214
- $1;
215
- return smalltalk.send((function(){
216
- return smalltalk.send(self,"_recompile_",[each]);
217
- }),"_valueWithTimeout_",[(100)]);
218
- })]);
219
- return self}
220
- }),
221
- smalltalk.Compiler);
222
-
223
- smalltalk.addMethod(
224
- "_setupClass_",
225
- smalltalk.method({
226
- selector: "setupClass:",
227
- fn: function (aClass){
228
- var self=this;
229
- smalltalk.init(aClass);
230
- ;
231
- return self}
211
+ return smalltalk.withContext(function($ctx1) {
212
+ _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
213
+ return smalltalk.withContext(function($ctx2) {
214
+ _st($1)._show_(each);
215
+ $2=_st($1)._cr();
216
+ $2;
217
+ return _st((function(){
218
+ return smalltalk.withContext(function($ctx3) {
219
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((100));
220
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
221
+ return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{}, smalltalk.Compiler)})}
232
222
  }),
233
223
  smalltalk.Compiler);
234
224
 
@@ -238,14 +228,15 @@ smalltalk.method({
238
228
  selector: "source",
239
229
  fn: function (){
240
230
  var self=this;
241
- var $1;
242
- if(($receiver = self["@source"]) == nil || $receiver == undefined){
231
+ return smalltalk.withContext(function($ctx1) {
232
+ $2=self["@source"];
233
+ if(($receiver = $2) == nil || $receiver == undefined){
243
234
  $1="";
244
235
  } else {
245
- $1=self["@source"];
236
+ $1=$2;
246
237
  };
247
238
  return $1;
248
- }
239
+ }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.Compiler)})}
249
240
  }),
250
241
  smalltalk.Compiler);
251
242
 
@@ -255,8 +246,8 @@ smalltalk.method({
255
246
  selector: "source:",
256
247
  fn: function (aString){
257
248
  var self=this;
258
- self["@source"]=aString;
259
- return self}
249
+ return smalltalk.withContext(function($ctx1) {
250
+ return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.Compiler)})}
260
251
  }),
261
252
  smalltalk.Compiler);
262
253
 
@@ -266,8 +257,10 @@ smalltalk.method({
266
257
  selector: "unknownVariables",
267
258
  fn: function (){
268
259
  var self=this;
269
- return self["@unknownVariables"];
270
- }
260
+ return smalltalk.withContext(function($ctx1) {
261
+ $1=self["@unknownVariables"];
262
+ return $1;
263
+ }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{}, smalltalk.Compiler)})}
271
264
  }),
272
265
  smalltalk.Compiler);
273
266
 
@@ -277,8 +270,8 @@ smalltalk.method({
277
270
  selector: "unknownVariables:",
278
271
  fn: function (aCollection){
279
272
  var self=this;
280
- self["@unknownVariables"]=aCollection;
281
- return self}
273
+ return smalltalk.withContext(function($ctx1) {
274
+ return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection}, smalltalk.Compiler)})}
282
275
  }),
283
276
  smalltalk.Compiler);
284
277
 
@@ -289,8 +282,8 @@ smalltalk.method({
289
282
  selector: "recompile:",
290
283
  fn: function (aClass){
291
284
  var self=this;
292
- smalltalk.send(smalltalk.send(self,"_new",[]),"_recompile_",[aClass]);
293
- return self}
285
+ return smalltalk.withContext(function($ctx1) {
286
+ return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass}, smalltalk.Compiler.klass)})}
294
287
  }),
295
288
  smalltalk.Compiler.klass);
296
289
 
@@ -300,10 +293,10 @@ smalltalk.method({
300
293
  selector: "recompileAll",
301
294
  fn: function (){
302
295
  var self=this;
303
- smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_classes",[]),"_do_",[(function(each){
304
- return smalltalk.send(self,"_recompile_",[each]);
305
- })]);
306
- return self}
296
+ return smalltalk.withContext(function($ctx1) {
297
+ return smalltalk.withContext(function($ctx2) {
298
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
299
+ return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{}, smalltalk.Compiler.klass)})}
307
300
  }),
308
301
  smalltalk.Compiler.klass);
309
302
 
@@ -318,10 +311,10 @@ smalltalk.method({
318
311
  selector: "visit:",
319
312
  fn: function (aNode){
320
313
  var self=this;
321
- var $1;
322
- $1=smalltalk.send(aNode,"_accept_",[self]);
314
+ return smalltalk.withContext(function($ctx1) {
315
+ $1=_st(aNode)._accept_(self);
323
316
  return $1;
324
- }
317
+ }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode}, smalltalk.NodeVisitor)})}
325
318
  }),
326
319
  smalltalk.NodeVisitor);
327
320
 
@@ -331,12 +324,12 @@ smalltalk.method({
331
324
  selector: "visitAll:",
332
325
  fn: function (aCollection){
333
326
  var self=this;
334
- var $1;
335
- $1=smalltalk.send(aCollection,"_do_",[(function(each){
336
- return smalltalk.send(self,"_visit_",[each]);
337
- })]);
327
+ return smalltalk.withContext(function($ctx1) {
328
+ $1=_st(aCollection)._collect_((function(each){
329
+ return smalltalk.withContext(function($ctx2) {
330
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
338
331
  return $1;
339
- }
332
+ }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection}, smalltalk.NodeVisitor)})}
340
333
  }),
341
334
  smalltalk.NodeVisitor);
342
335
 
@@ -346,10 +339,10 @@ smalltalk.method({
346
339
  selector: "visitAssignmentNode:",
347
340
  fn: function (aNode){
348
341
  var self=this;
349
- var $1;
350
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
342
+ return smalltalk.withContext(function($ctx1) {
343
+ $1=_st(self)._visitNode_(aNode);
351
344
  return $1;
352
- }
345
+ }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
353
346
  }),
354
347
  smalltalk.NodeVisitor);
355
348
 
@@ -359,10 +352,10 @@ smalltalk.method({
359
352
  selector: "visitBlockNode:",
360
353
  fn: function (aNode){
361
354
  var self=this;
362
- var $1;
363
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
355
+ return smalltalk.withContext(function($ctx1) {
356
+ $1=_st(self)._visitNode_(aNode);
364
357
  return $1;
365
- }
358
+ }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
366
359
  }),
367
360
  smalltalk.NodeVisitor);
368
361
 
@@ -372,10 +365,10 @@ smalltalk.method({
372
365
  selector: "visitBlockSequenceNode:",
373
366
  fn: function (aNode){
374
367
  var self=this;
375
- var $1;
376
- $1=smalltalk.send(self,"_visitSequenceNode_",[aNode]);
368
+ return smalltalk.withContext(function($ctx1) {
369
+ $1=_st(self)._visitSequenceNode_(aNode);
377
370
  return $1;
378
- }
371
+ }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
379
372
  }),
380
373
  smalltalk.NodeVisitor);
381
374
 
@@ -385,10 +378,10 @@ smalltalk.method({
385
378
  selector: "visitCascadeNode:",
386
379
  fn: function (aNode){
387
380
  var self=this;
388
- var $1;
389
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
381
+ return smalltalk.withContext(function($ctx1) {
382
+ $1=_st(self)._visitNode_(aNode);
390
383
  return $1;
391
- }
384
+ }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
392
385
  }),
393
386
  smalltalk.NodeVisitor);
394
387
 
@@ -398,10 +391,10 @@ smalltalk.method({
398
391
  selector: "visitClassReferenceNode:",
399
392
  fn: function (aNode){
400
393
  var self=this;
401
- var $1;
402
- $1=smalltalk.send(self,"_visitVariableNode_",[aNode]);
394
+ return smalltalk.withContext(function($ctx1) {
395
+ $1=_st(self)._visitVariableNode_(aNode);
403
396
  return $1;
404
- }
397
+ }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
405
398
  }),
406
399
  smalltalk.NodeVisitor);
407
400
 
@@ -411,10 +404,10 @@ smalltalk.method({
411
404
  selector: "visitDynamicArrayNode:",
412
405
  fn: function (aNode){
413
406
  var self=this;
414
- var $1;
415
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
407
+ return smalltalk.withContext(function($ctx1) {
408
+ $1=_st(self)._visitNode_(aNode);
416
409
  return $1;
417
- }
410
+ }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
418
411
  }),
419
412
  smalltalk.NodeVisitor);
420
413
 
@@ -424,10 +417,10 @@ smalltalk.method({
424
417
  selector: "visitDynamicDictionaryNode:",
425
418
  fn: function (aNode){
426
419
  var self=this;
427
- var $1;
428
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
420
+ return smalltalk.withContext(function($ctx1) {
421
+ $1=_st(self)._visitNode_(aNode);
429
422
  return $1;
430
- }
423
+ }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
431
424
  }),
432
425
  smalltalk.NodeVisitor);
433
426
 
@@ -437,10 +430,10 @@ smalltalk.method({
437
430
  selector: "visitJSStatementNode:",
438
431
  fn: function (aNode){
439
432
  var self=this;
440
- var $1;
441
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
433
+ return smalltalk.withContext(function($ctx1) {
434
+ $1=_st(self)._visitNode_(aNode);
442
435
  return $1;
443
- }
436
+ }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
444
437
  }),
445
438
  smalltalk.NodeVisitor);
446
439
 
@@ -450,10 +443,10 @@ smalltalk.method({
450
443
  selector: "visitMethodNode:",
451
444
  fn: function (aNode){
452
445
  var self=this;
453
- var $1;
454
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
446
+ return smalltalk.withContext(function($ctx1) {
447
+ $1=_st(self)._visitNode_(aNode);
455
448
  return $1;
456
- }
449
+ }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
457
450
  }),
458
451
  smalltalk.NodeVisitor);
459
452
 
@@ -463,10 +456,10 @@ smalltalk.method({
463
456
  selector: "visitNode:",
464
457
  fn: function (aNode){
465
458
  var self=this;
466
- var $1;
467
- $1=smalltalk.send(self,"_visitAll_",[smalltalk.send(aNode,"_nodes",[])]);
459
+ return smalltalk.withContext(function($ctx1) {
460
+ $1=_st(self)._visitAll_(_st(aNode)._nodes());
468
461
  return $1;
469
- }
462
+ }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
470
463
  }),
471
464
  smalltalk.NodeVisitor);
472
465
 
@@ -476,10 +469,10 @@ smalltalk.method({
476
469
  selector: "visitReturnNode:",
477
470
  fn: function (aNode){
478
471
  var self=this;
479
- var $1;
480
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
472
+ return smalltalk.withContext(function($ctx1) {
473
+ $1=_st(self)._visitNode_(aNode);
481
474
  return $1;
482
- }
475
+ }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
483
476
  }),
484
477
  smalltalk.NodeVisitor);
485
478
 
@@ -489,10 +482,10 @@ smalltalk.method({
489
482
  selector: "visitSendNode:",
490
483
  fn: function (aNode){
491
484
  var self=this;
492
- var $1;
493
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
485
+ return smalltalk.withContext(function($ctx1) {
486
+ $1=_st(self)._visitNode_(aNode);
494
487
  return $1;
495
- }
488
+ }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
496
489
  }),
497
490
  smalltalk.NodeVisitor);
498
491
 
@@ -502,10 +495,10 @@ smalltalk.method({
502
495
  selector: "visitSequenceNode:",
503
496
  fn: function (aNode){
504
497
  var self=this;
505
- var $1;
506
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
498
+ return smalltalk.withContext(function($ctx1) {
499
+ $1=_st(self)._visitNode_(aNode);
507
500
  return $1;
508
- }
501
+ }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
509
502
  }),
510
503
  smalltalk.NodeVisitor);
511
504
 
@@ -515,10 +508,10 @@ smalltalk.method({
515
508
  selector: "visitValueNode:",
516
509
  fn: function (aNode){
517
510
  var self=this;
518
- var $1;
519
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
511
+ return smalltalk.withContext(function($ctx1) {
512
+ $1=_st(self)._visitNode_(aNode);
520
513
  return $1;
521
- }
514
+ }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
522
515
  }),
523
516
  smalltalk.NodeVisitor);
524
517
 
@@ -528,10 +521,10 @@ smalltalk.method({
528
521
  selector: "visitVariableNode:",
529
522
  fn: function (aNode){
530
523
  var self=this;
531
- var $1;
532
- $1=smalltalk.send(self,"_visitNode_",[aNode]);
524
+ return smalltalk.withContext(function($ctx1) {
525
+ $1=_st(self)._visitNode_(aNode);
533
526
  return $1;
534
- }
527
+ }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.NodeVisitor)})}
535
528
  }),
536
529
  smalltalk.NodeVisitor);
537
530
 
@@ -544,20 +537,22 @@ smalltalk.method({
544
537
  selector: "classNameFor:",
545
538
  fn: function (aClass){
546
539
  var self=this;
547
- var $2,$3,$1;
548
- $2=smalltalk.send(aClass,"_isMetaclass",[]);
549
- if(smalltalk.assert($2)){
550
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_instanceClass",[]),"_name",[]),"__comma",[".klass"]);
551
- } else {
552
- $3=smalltalk.send(aClass,"_isNil",[]);
553
- if(smalltalk.assert($3)){
554
- $1="nil";
540
+ return smalltalk.withContext(function($ctx1) {
541
+ $2=_st(aClass)._isMetaclass();
542
+ $3=(function(){
543
+ return smalltalk.withContext(function($ctx2) {
544
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
545
+ $4=(function(){
546
+ return smalltalk.withContext(function($ctx2) {
547
+ if(smalltalk.assert($5)){
548
+ return "nil";
555
549
  } else {
556
- $1=smalltalk.send(aClass,"_name",[]);
557
- };
550
+ return _st(aClass)._name();
558
551
  };
552
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
553
+ $1=_st($2)._ifTrue_ifFalse_($3,$4);
559
554
  return $1;
560
- }
555
+ }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass}, smalltalk.AbstractCodeGenerator)})}
561
556
  }),
562
557
  smalltalk.AbstractCodeGenerator);
563
558
 
@@ -567,8 +562,8 @@ smalltalk.method({
567
562
  selector: "compileNode:",
568
563
  fn: function (aNode){
569
564
  var self=this;
570
- smalltalk.send(self,"_subclassResponsibility",[]);
571
- return self}
565
+ return smalltalk.withContext(function($ctx1) {
566
+ return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode}, smalltalk.AbstractCodeGenerator)})}
572
567
  }),
573
568
  smalltalk.AbstractCodeGenerator);
574
569
 
@@ -578,8 +573,10 @@ smalltalk.method({
578
573
  selector: "currentClass",
579
574
  fn: function (){
580
575
  var self=this;
581
- return self["@currentClass"];
582
- }
576
+ return smalltalk.withContext(function($ctx1) {
577
+ $1=self["@currentClass"];
578
+ return $1;
579
+ }, function($ctx1) {$ctx1.fill(self,"currentClass",{}, smalltalk.AbstractCodeGenerator)})}
583
580
  }),
584
581
  smalltalk.AbstractCodeGenerator);
585
582
 
@@ -589,8 +586,8 @@ smalltalk.method({
589
586
  selector: "currentClass:",
590
587
  fn: function (aClass){
591
588
  var self=this;
592
- self["@currentClass"]=aClass;
593
- return self}
589
+ return smalltalk.withContext(function($ctx1) {
590
+ return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass}, smalltalk.AbstractCodeGenerator)})}
594
591
  }),
595
592
  smalltalk.AbstractCodeGenerator);
596
593
 
@@ -600,8 +597,8 @@ smalltalk.method({
600
597
  selector: "pseudoVariables",
601
598
  fn: function (){
602
599
  var self=this;
603
- return ["self", "super", "true", "false", "nil", "thisContext"];
604
- }
600
+ return smalltalk.withContext(function($ctx1) {
601
+ }, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{}, smalltalk.AbstractCodeGenerator)})}
605
602
  }),
606
603
  smalltalk.AbstractCodeGenerator);
607
604
 
@@ -611,15 +608,15 @@ smalltalk.method({
611
608
  selector: "safeVariableNameFor:",
612
609
  fn: function (aString){
613
610
  var self=this;
614
- var $2,$1;
615
- $2=smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_reservedWords",[]),"_includes_",[aString]);
611
+ return smalltalk.withContext(function($ctx1) {
612
+ $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(aString);
616
613
  if(smalltalk.assert($2)){
617
- $1=smalltalk.send(aString,"__comma",["_"]);
614
+ $1=_st(aString).__comma("_");
618
615
  } else {
619
616
  $1=aString;
620
617
  };
621
618
  return $1;
622
- }
619
+ }, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString}, smalltalk.AbstractCodeGenerator)})}
623
620
  }),
624
621
  smalltalk.AbstractCodeGenerator);
625
622
 
@@ -629,14 +626,15 @@ smalltalk.method({
629
626
  selector: "source",
630
627
  fn: function (){
631
628
  var self=this;
632
- var $1;
633
- if(($receiver = self["@source"]) == nil || $receiver == undefined){
629
+ return smalltalk.withContext(function($ctx1) {
630
+ $2=self["@source"];
631
+ if(($receiver = $2) == nil || $receiver == undefined){
634
632
  $1="";
635
633
  } else {
636
- $1=self["@source"];
634
+ $1=$2;
637
635
  };
638
636
  return $1;
639
- }
637
+ }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.AbstractCodeGenerator)})}
640
638
  }),
641
639
  smalltalk.AbstractCodeGenerator);
642
640
 
@@ -646,8 +644,8 @@ smalltalk.method({
646
644
  selector: "source:",
647
645
  fn: function (aString){
648
646
  var self=this;
649
- self["@source"]=aString;
650
- return self}
647
+ return smalltalk.withContext(function($ctx1) {
648
+ return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.AbstractCodeGenerator)})}
651
649
  }),
652
650
  smalltalk.AbstractCodeGenerator);
653
651
 
@@ -660,17 +658,16 @@ smalltalk.method({
660
658
  selector: "compileNode:",
661
659
  fn: function (aNode){
662
660
  var self=this;
663
- var $2,$3,$1;
664
- var ir;
665
- var stream;
666
- smalltalk.send(smalltalk.send(self,"_semanticAnalyzer",[]),"_visit_",[aNode]);
667
- ir=smalltalk.send(smalltalk.send(self,"_translator",[]),"_visit_",[aNode]);
668
- $2=smalltalk.send(self,"_irTranslator",[]);
669
- smalltalk.send($2,"_visit_",[ir]);
670
- $3=smalltalk.send($2,"_contents",[]);
661
+ var ir,stream;
662
+ return smalltalk.withContext(function($ctx1) {
663
+ _st(_st(self)._semanticAnalyzer())._visit_(aNode);
664
+ ir=_st(_st(self)._translator())._visit_(aNode);
665
+ $2=_st(self)._irTranslator();
666
+ _st($2)._visit_(ir);
667
+ $3=_st($2)._contents();
671
668
  $1=$3;
672
669
  return $1;
673
- }
670
+ }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream}, smalltalk.CodeGenerator)})}
674
671
  }),
675
672
  smalltalk.CodeGenerator);
676
673
 
@@ -680,10 +677,10 @@ smalltalk.method({
680
677
  selector: "irTranslator",
681
678
  fn: function (){
682
679
  var self=this;
683
- var $1;
684
- $1=smalltalk.send((smalltalk.IRJSTranslator || IRJSTranslator),"_new",[]);
680
+ return smalltalk.withContext(function($ctx1) {
681
+ $1=_st((smalltalk.IRJSTranslator || IRJSTranslator))._new();
685
682
  return $1;
686
- }
683
+ }, function($ctx1) {$ctx1.fill(self,"irTranslator",{}, smalltalk.CodeGenerator)})}
687
684
  }),
688
685
  smalltalk.CodeGenerator);
689
686
 
@@ -693,10 +690,10 @@ smalltalk.method({
693
690
  selector: "semanticAnalyzer",
694
691
  fn: function (){
695
692
  var self=this;
696
- var $1;
697
- $1=smalltalk.send((smalltalk.SemanticAnalyzer || SemanticAnalyzer),"_on_",[smalltalk.send(self,"_currentClass",[])]);
693
+ return smalltalk.withContext(function($ctx1) {
694
+ $1=_st((smalltalk.SemanticAnalyzer || SemanticAnalyzer))._on_(_st(self)._currentClass());
698
695
  return $1;
699
- }
696
+ }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{}, smalltalk.CodeGenerator)})}
700
697
  }),
701
698
  smalltalk.CodeGenerator);
702
699
 
@@ -706,857 +703,16 @@ smalltalk.method({
706
703
  selector: "translator",
707
704
  fn: function (){
708
705
  var self=this;
709
- var $2,$3,$1;
710
- $2=smalltalk.send((smalltalk.IRASTTranslator || IRASTTranslator),"_new",[]);
711
- smalltalk.send($2,"_source_",[smalltalk.send(self,"_source",[])]);
712
- smalltalk.send($2,"_theClass_",[smalltalk.send(self,"_currentClass",[])]);
713
- $3=smalltalk.send($2,"_yourself",[]);
706
+ return smalltalk.withContext(function($ctx1) {
707
+ $2=_st((smalltalk.IRASTTranslator || IRASTTranslator))._new();
708
+ _st($2)._source_(_st(self)._source());
709
+ _st($2)._theClass_(_st(self)._currentClass());
710
+ $3=_st($2)._yourself();
714
711
  $1=$3;
715
712
  return $1;
716
- }
713
+ }, function($ctx1) {$ctx1.fill(self,"translator",{}, smalltalk.CodeGenerator)})}
717
714
  }),
718
715
  smalltalk.CodeGenerator);
719
716
 
720
717
 
721
718
 
722
- smalltalk.addClass('FunCodeGenerator', smalltalk.AbstractCodeGenerator, ['stream', 'nestedBlocks', 'earlyReturn', 'currentSelector', 'unknownVariables', 'tempVariables', 'messageSends', 'referencedClasses', 'classReferenced', 'argVariables'], 'Compiler-Core');
723
- smalltalk.addMethod(
724
- "_argVariables",
725
- smalltalk.method({
726
- selector: "argVariables",
727
- fn: function (){
728
- var self=this;
729
- var $1;
730
- $1=smalltalk.send(self["@argVariables"],"_copy",[]);
731
- return $1;
732
- }
733
- }),
734
- smalltalk.FunCodeGenerator);
735
-
736
- smalltalk.addMethod(
737
- "_checkClass_for_",
738
- smalltalk.method({
739
- selector: "checkClass:for:",
740
- fn: function (aClassName,receiver){
741
- var self=this;
742
- smalltalk.send(self["@stream"],"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((($receiver = ","__comma",[receiver]),"__comma",[").klass === smalltalk."]),"__comma",[aClassName]),"__comma",[") ? "])]);
743
- return self}
744
- }),
745
- smalltalk.FunCodeGenerator);
746
-
747
- smalltalk.addMethod(
748
- "_compileNode_",
749
- smalltalk.method({
750
- selector: "compileNode:",
751
- fn: function (aNode){
752
- var self=this;
753
- var $1;
754
- self["@stream"]=smalltalk.send("","_writeStream",[]);
755
- smalltalk.send(self,"_visit_",[aNode]);
756
- $1=smalltalk.send(self["@stream"],"_contents",[]);
757
- return $1;
758
- }
759
- }),
760
- smalltalk.FunCodeGenerator);
761
-
762
- smalltalk.addMethod(
763
- "_initialize",
764
- smalltalk.method({
765
- selector: "initialize",
766
- fn: function (){
767
- var self=this;
768
- smalltalk.send(self,"_initialize",[],smalltalk.AbstractCodeGenerator);
769
- self["@stream"]=smalltalk.send("","_writeStream",[]);
770
- self["@unknownVariables"]=[];
771
- self["@tempVariables"]=[];
772
- self["@argVariables"]=[];
773
- self["@messageSends"]=[];
774
- self["@classReferenced"]=[];
775
- return self}
776
- }),
777
- smalltalk.FunCodeGenerator);
778
-
779
- smalltalk.addMethod(
780
- "_inline_receiver_argumentNodes_",
781
- smalltalk.method({
782
- selector: "inline:receiver:argumentNodes:",
783
- fn: function (aSelector,receiver,aCollection){
784
- var self=this;
785
- var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16;
786
- var inlined;
787
- inlined=false;
788
- $1=smalltalk.send(aSelector,"__eq",["ifFalse:"]);
789
- if(smalltalk.assert($1)){
790
- $2=smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]);
791
- if(smalltalk.assert($2)){
792
- smalltalk.send(self,"_checkClass_for_",["Boolean",receiver]);
793
- smalltalk.send(self["@stream"],"_nextPutAll_",["(! $receiver ? "]);
794
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
795
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : nil)"]);
796
- inlined=true;
797
- inlined;
798
- };
799
- };
800
- $3=smalltalk.send(aSelector,"__eq",["ifTrue:"]);
801
- if(smalltalk.assert($3)){
802
- $4=smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]);
803
- if(smalltalk.assert($4)){
804
- smalltalk.send(self,"_checkClass_for_",["Boolean",receiver]);
805
- smalltalk.send(self["@stream"],"_nextPutAll_",["($receiver ? "]);
806
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
807
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : nil)"]);
808
- inlined=true;
809
- inlined;
810
- };
811
- };
812
- $5=smalltalk.send(aSelector,"__eq",["ifTrue:ifFalse:"]);
813
- if(smalltalk.assert($5)){
814
- $6=smalltalk.send(smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]),"_and_",[(function(){
815
- return smalltalk.send(smalltalk.send(aCollection,"_second",[]),"_isBlockNode",[]);
816
- })]);
817
- if(smalltalk.assert($6)){
818
- smalltalk.send(self,"_checkClass_for_",["Boolean",receiver]);
819
- smalltalk.send(self["@stream"],"_nextPutAll_",["($receiver ? "]);
820
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
821
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : "]);
822
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_second",[])]);
823
- smalltalk.send(self["@stream"],"_nextPutAll_",["())"]);
824
- inlined=true;
825
- inlined;
826
- };
827
- };
828
- $7=smalltalk.send(aSelector,"__eq",["ifFalse:ifTrue:"]);
829
- if(smalltalk.assert($7)){
830
- $8=smalltalk.send(smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]),"_and_",[(function(){
831
- return smalltalk.send(smalltalk.send(aCollection,"_second",[]),"_isBlockNode",[]);
832
- })]);
833
- if(smalltalk.assert($8)){
834
- smalltalk.send(self,"_checkClass_for_",["Boolean",receiver]);
835
- smalltalk.send(self["@stream"],"_nextPutAll_",["(! $receiver ? "]);
836
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
837
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : "]);
838
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_second",[])]);
839
- smalltalk.send(self["@stream"],"_nextPutAll_",["())"]);
840
- inlined=true;
841
- inlined;
842
- };
843
- };
844
- $9=smalltalk.send(aSelector,"__eq",["<"]);
845
- if(smalltalk.assert($9)){
846
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
847
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver <"]);
848
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
849
- inlined=true;
850
- inlined;
851
- };
852
- $10=smalltalk.send(aSelector,"__eq",["<="]);
853
- if(smalltalk.assert($10)){
854
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
855
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver <="]);
856
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
857
- inlined=true;
858
- inlined;
859
- };
860
- $11=smalltalk.send(aSelector,"__eq",[">"]);
861
- if(smalltalk.assert($11)){
862
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
863
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver >"]);
864
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
865
- inlined=true;
866
- inlined;
867
- };
868
- $12=smalltalk.send(aSelector,"__eq",[">="]);
869
- if(smalltalk.assert($12)){
870
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
871
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver >="]);
872
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
873
- inlined=true;
874
- inlined;
875
- };
876
- $13=smalltalk.send(aSelector,"__eq",["+"]);
877
- if(smalltalk.assert($13)){
878
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
879
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver +"]);
880
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
881
- inlined=true;
882
- inlined;
883
- };
884
- $14=smalltalk.send(aSelector,"__eq",["-"]);
885
- if(smalltalk.assert($14)){
886
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
887
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver -"]);
888
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
889
- inlined=true;
890
- inlined;
891
- };
892
- $15=smalltalk.send(aSelector,"__eq",["*"]);
893
- if(smalltalk.assert($15)){
894
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
895
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver *"]);
896
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
897
- inlined=true;
898
- inlined;
899
- };
900
- $16=smalltalk.send(aSelector,"__eq",["/"]);
901
- if(smalltalk.assert($16)){
902
- smalltalk.send(self,"_checkClass_for_",["Number",receiver]);
903
- smalltalk.send(self["@stream"],"_nextPutAll_",["$receiver /"]);
904
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
905
- inlined=true;
906
- inlined;
907
- };
908
- return inlined;
909
- }
910
- }),
911
- smalltalk.FunCodeGenerator);
912
-
913
- smalltalk.addMethod(
914
- "_inlineLiteral_receiverNode_argumentNodes_",
915
- smalltalk.method({
916
- selector: "inlineLiteral:receiverNode:argumentNodes:",
917
- fn: function (aSelector,anObject,aCollection){
918
- var self=this;
919
- var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32;
920
- var inlined;
921
- inlined=false;
922
- $1=smalltalk.send(aSelector,"__eq",["whileTrue:"]);
923
- if(smalltalk.assert($1)){
924
- $2=smalltalk.send(smalltalk.send(anObject,"_isBlockNode",[]),"_and_",[(function(){
925
- return smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]);
926
- })]);
927
- if(smalltalk.assert($2)){
928
- smalltalk.send(self["@stream"],"_nextPutAll_",["(function(){while("]);
929
- smalltalk.send(self,"_visit_",[anObject]);
930
- smalltalk.send(self["@stream"],"_nextPutAll_",["()) {"]);
931
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
932
- smalltalk.send(self["@stream"],"_nextPutAll_",["()}})()"]);
933
- inlined=true;
934
- inlined;
935
- };
936
- };
937
- $3=smalltalk.send(aSelector,"__eq",["whileFalse:"]);
938
- if(smalltalk.assert($3)){
939
- $4=smalltalk.send(smalltalk.send(anObject,"_isBlockNode",[]),"_and_",[(function(){
940
- return smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]);
941
- })]);
942
- if(smalltalk.assert($4)){
943
- smalltalk.send(self["@stream"],"_nextPutAll_",["(function(){while(!"]);
944
- smalltalk.send(self,"_visit_",[anObject]);
945
- smalltalk.send(self["@stream"],"_nextPutAll_",["()) {"]);
946
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
947
- smalltalk.send(self["@stream"],"_nextPutAll_",["()}})()"]);
948
- inlined=true;
949
- inlined;
950
- };
951
- };
952
- $5=smalltalk.send(aSelector,"__eq",["whileTrue"]);
953
- if(smalltalk.assert($5)){
954
- $6=smalltalk.send(anObject,"_isBlockNode",[]);
955
- if(smalltalk.assert($6)){
956
- smalltalk.send(self["@stream"],"_nextPutAll_",["(function(){while("]);
957
- smalltalk.send(self,"_visit_",[anObject]);
958
- smalltalk.send(self["@stream"],"_nextPutAll_",["()) {}})()"]);
959
- inlined=true;
960
- inlined;
961
- };
962
- };
963
- $7=smalltalk.send(aSelector,"__eq",["whileFalse"]);
964
- if(smalltalk.assert($7)){
965
- $8=smalltalk.send(anObject,"_isBlockNode",[]);
966
- if(smalltalk.assert($8)){
967
- smalltalk.send(self["@stream"],"_nextPutAll_",["(function(){while(!"]);
968
- smalltalk.send(self,"_visit_",[anObject]);
969
- smalltalk.send(self["@stream"],"_nextPutAll_",["()) {}})()"]);
970
- inlined=true;
971
- inlined;
972
- };
973
- };
974
- $9=smalltalk.send(aSelector,"__eq",["+"]);
975
- if(smalltalk.assert($9)){
976
- $10=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
977
- if(smalltalk.assert($10)){
978
- smalltalk.send(self,"_visit_",[anObject]);
979
- smalltalk.send(self["@stream"],"_nextPutAll_",[" + "]);
980
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
981
- inlined=true;
982
- inlined;
983
- };
984
- };
985
- $11=smalltalk.send(aSelector,"__eq",["-"]);
986
- if(smalltalk.assert($11)){
987
- $12=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
988
- if(smalltalk.assert($12)){
989
- smalltalk.send(self,"_visit_",[anObject]);
990
- smalltalk.send(self["@stream"],"_nextPutAll_",[" - "]);
991
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
992
- inlined=true;
993
- inlined;
994
- };
995
- };
996
- $13=smalltalk.send(aSelector,"__eq",["*"]);
997
- if(smalltalk.assert($13)){
998
- $14=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
999
- if(smalltalk.assert($14)){
1000
- smalltalk.send(self,"_visit_",[anObject]);
1001
- smalltalk.send(self["@stream"],"_nextPutAll_",[" * "]);
1002
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1003
- inlined=true;
1004
- inlined;
1005
- };
1006
- };
1007
- $15=smalltalk.send(aSelector,"__eq",["/"]);
1008
- if(smalltalk.assert($15)){
1009
- $16=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
1010
- if(smalltalk.assert($16)){
1011
- smalltalk.send(self,"_visit_",[anObject]);
1012
- smalltalk.send(self["@stream"],"_nextPutAll_",[" / "]);
1013
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1014
- inlined=true;
1015
- inlined;
1016
- };
1017
- };
1018
- $17=smalltalk.send(aSelector,"__eq",["<"]);
1019
- if(smalltalk.assert($17)){
1020
- $18=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
1021
- if(smalltalk.assert($18)){
1022
- smalltalk.send(self,"_visit_",[anObject]);
1023
- smalltalk.send(self["@stream"],"_nextPutAll_",[" < "]);
1024
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1025
- inlined=true;
1026
- inlined;
1027
- };
1028
- };
1029
- $19=smalltalk.send(aSelector,"__eq",["<="]);
1030
- if(smalltalk.assert($19)){
1031
- $20=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
1032
- if(smalltalk.assert($20)){
1033
- smalltalk.send(self,"_visit_",[anObject]);
1034
- smalltalk.send(self["@stream"],"_nextPutAll_",[" <= "]);
1035
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1036
- inlined=true;
1037
- inlined;
1038
- };
1039
- };
1040
- $21=smalltalk.send(aSelector,"__eq",[">"]);
1041
- if(smalltalk.assert($21)){
1042
- $22=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
1043
- if(smalltalk.assert($22)){
1044
- smalltalk.send(self,"_visit_",[anObject]);
1045
- smalltalk.send(self["@stream"],"_nextPutAll_",[" > "]);
1046
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1047
- inlined=true;
1048
- inlined;
1049
- };
1050
- };
1051
- $23=smalltalk.send(aSelector,"__eq",[">="]);
1052
- if(smalltalk.assert($23)){
1053
- $24=smalltalk.send(self,"_isNode_ofClass_",[anObject,(smalltalk.Number || Number)]);
1054
- if(smalltalk.assert($24)){
1055
- smalltalk.send(self,"_visit_",[anObject]);
1056
- smalltalk.send(self["@stream"],"_nextPutAll_",[" >= "]);
1057
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1058
- inlined=true;
1059
- inlined;
1060
- };
1061
- };
1062
- $25=smalltalk.send(aSelector,"__eq",["ifNil:"]);
1063
- if(smalltalk.assert($25)){
1064
- $26=smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]);
1065
- if(smalltalk.assert($26)){
1066
- smalltalk.send(self["@stream"],"_nextPutAll_",["(($receiver = "]);
1067
- smalltalk.send(self,"_visit_",[anObject]);
1068
- smalltalk.send(self["@stream"],"_nextPutAll_",[") == nil || $receiver == undefined) ? "]);
1069
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1070
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : $receiver"]);
1071
- inlined=true;
1072
- inlined;
1073
- };
1074
- };
1075
- $27=smalltalk.send(aSelector,"__eq",["ifNotNil:"]);
1076
- if(smalltalk.assert($27)){
1077
- $28=smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]);
1078
- if(smalltalk.assert($28)){
1079
- smalltalk.send(self["@stream"],"_nextPutAll_",["(($receiver = "]);
1080
- smalltalk.send(self,"_visit_",[anObject]);
1081
- smalltalk.send(self["@stream"],"_nextPutAll_",[") != nil && $receiver != undefined) ? "]);
1082
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1083
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : nil"]);
1084
- inlined=true;
1085
- inlined;
1086
- };
1087
- };
1088
- $29=smalltalk.send(aSelector,"__eq",["ifNil:ifNotNil:"]);
1089
- if(smalltalk.assert($29)){
1090
- $30=smalltalk.send(smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]),"_and_",[(function(){
1091
- return smalltalk.send(smalltalk.send(aCollection,"_second",[]),"_isBlockNode",[]);
1092
- })]);
1093
- if(smalltalk.assert($30)){
1094
- smalltalk.send(self["@stream"],"_nextPutAll_",["(($receiver = "]);
1095
- smalltalk.send(self,"_visit_",[anObject]);
1096
- smalltalk.send(self["@stream"],"_nextPutAll_",[") == nil || $receiver == undefined) ? "]);
1097
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1098
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : "]);
1099
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_second",[])]);
1100
- smalltalk.send(self["@stream"],"_nextPutAll_",["()"]);
1101
- inlined=true;
1102
- inlined;
1103
- };
1104
- };
1105
- $31=smalltalk.send(aSelector,"__eq",["ifNotNil:ifNil:"]);
1106
- if(smalltalk.assert($31)){
1107
- $32=smalltalk.send(smalltalk.send(smalltalk.send(aCollection,"_first",[]),"_isBlockNode",[]),"_and_",[(function(){
1108
- return smalltalk.send(smalltalk.send(aCollection,"_second",[]),"_isBlockNode",[]);
1109
- })]);
1110
- if(smalltalk.assert($32)){
1111
- smalltalk.send(self["@stream"],"_nextPutAll_",["(($receiver = "]);
1112
- smalltalk.send(self,"_visit_",[anObject]);
1113
- smalltalk.send(self["@stream"],"_nextPutAll_",[") == nil || $receiver == undefined) ? "]);
1114
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_second",[])]);
1115
- smalltalk.send(self["@stream"],"_nextPutAll_",["() : "]);
1116
- smalltalk.send(self,"_visit_",[smalltalk.send(aCollection,"_first",[])]);
1117
- smalltalk.send(self["@stream"],"_nextPutAll_",["()"]);
1118
- inlined=true;
1119
- inlined;
1120
- };
1121
- };
1122
- return inlined;
1123
- }
1124
- }),
1125
- smalltalk.FunCodeGenerator);
1126
-
1127
- smalltalk.addMethod(
1128
- "_isNode_ofClass_",
1129
- smalltalk.method({
1130
- selector: "isNode:ofClass:",
1131
- fn: function (aNode,aClass){
1132
- var self=this;
1133
- var $1;
1134
- $1=smalltalk.send(smalltalk.send(aNode,"_isValueNode",[]),"_and_",[(function(){
1135
- return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode,"_value",[]),"_class",[]),"__eq",[aClass]),"_or_",[(function(){
1136
- return smalltalk.send(smalltalk.send(smalltalk.send(aNode,"_value",[]),"__eq",["self"]),"_and_",[(function(){
1137
- return smalltalk.send(smalltalk.send(self,"_currentClass",[]),"__eq",[aClass]);
1138
- })]);
1139
- })]);
1140
- })]);
1141
- return $1;
1142
- }
1143
- }),
1144
- smalltalk.FunCodeGenerator);
1145
-
1146
- smalltalk.addMethod(
1147
- "_knownVariables",
1148
- smalltalk.method({
1149
- selector: "knownVariables",
1150
- fn: function (){
1151
- var self=this;
1152
- var $2,$3,$1;
1153
- $2=smalltalk.send(self,"_pseudoVariables",[]);
1154
- smalltalk.send($2,"_addAll_",[smalltalk.send(self,"_tempVariables",[])]);
1155
- smalltalk.send($2,"_addAll_",[smalltalk.send(self,"_argVariables",[])]);
1156
- $3=smalltalk.send($2,"_yourself",[]);
1157
- $1=$3;
1158
- return $1;
1159
- }
1160
- }),
1161
- smalltalk.FunCodeGenerator);
1162
-
1163
- smalltalk.addMethod(
1164
- "_performOptimizations",
1165
- smalltalk.method({
1166
- selector: "performOptimizations",
1167
- fn: function (){
1168
- var self=this;
1169
- var $1;
1170
- $1=smalltalk.send(smalltalk.send(self,"_class",[]),"_performOptimizations",[]);
1171
- return $1;
1172
- }
1173
- }),
1174
- smalltalk.FunCodeGenerator);
1175
-
1176
- smalltalk.addMethod(
1177
- "_send_to_arguments_superSend_",
1178
- smalltalk.method({
1179
- selector: "send:to:arguments:superSend:",
1180
- fn: function (aSelector,aReceiver,aCollection,aBoolean){
1181
- var self=this;
1182
- var $1;
1183
- $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(str){
1184
- var tmp;
1185
- tmp=self["@stream"];
1186
- tmp;
1187
- smalltalk.send(str,"_nextPutAll_",["smalltalk.send("]);
1188
- smalltalk.send(str,"_nextPutAll_",[aReceiver]);
1189
- smalltalk.send(str,"_nextPutAll_",[smalltalk.send(smalltalk.send(", \x22","__comma",[smalltalk.send(aSelector,"_asSelector",[])]),"__comma",["\x22, ["])]);
1190
- self["@stream"]=str;
1191
- self["@stream"];
1192
- smalltalk.send(aCollection,"_do_separatedBy_",[(function(each){
1193
- return smalltalk.send(self,"_visit_",[each]);
1194
- }),(function(){
1195
- return smalltalk.send(self["@stream"],"_nextPutAll_",[", "]);
1196
- })]);
1197
- self["@stream"]=tmp;
1198
- self["@stream"];
1199
- smalltalk.send(str,"_nextPutAll_",["]"]);
1200
- if(smalltalk.assert(aBoolean)){
1201
- smalltalk.send(str,"_nextPutAll_",[smalltalk.send(smalltalk.send(", smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(self,"_currentClass",[])])]),"__comma",[".superclass || nil"])]);
1202
- };
1203
- return smalltalk.send(str,"_nextPutAll_",[")"]);
1204
- })]);
1205
- return $1;
1206
- }
1207
- }),
1208
- smalltalk.FunCodeGenerator);
1209
-
1210
- smalltalk.addMethod(
1211
- "_tempVariables",
1212
- smalltalk.method({
1213
- selector: "tempVariables",
1214
- fn: function (){
1215
- var self=this;
1216
- var $1;
1217
- $1=smalltalk.send(self["@tempVariables"],"_copy",[]);
1218
- return $1;
1219
- }
1220
- }),
1221
- smalltalk.FunCodeGenerator);
1222
-
1223
- smalltalk.addMethod(
1224
- "_unknownVariables",
1225
- smalltalk.method({
1226
- selector: "unknownVariables",
1227
- fn: function (){
1228
- var self=this;
1229
- var $1;
1230
- $1=smalltalk.send(self["@unknownVariables"],"_copy",[]);
1231
- return $1;
1232
- }
1233
- }),
1234
- smalltalk.FunCodeGenerator);
1235
-
1236
- smalltalk.addMethod(
1237
- "_visit_",
1238
- smalltalk.method({
1239
- selector: "visit:",
1240
- fn: function (aNode){
1241
- var self=this;
1242
- smalltalk.send(aNode,"_accept_",[self]);
1243
- return self}
1244
- }),
1245
- smalltalk.FunCodeGenerator);
1246
-
1247
- smalltalk.addMethod(
1248
- "_visitAssignmentNode_",
1249
- smalltalk.method({
1250
- selector: "visitAssignmentNode:",
1251
- fn: function (aNode){
1252
- var self=this;
1253
- smalltalk.send(self["@stream"],"_nextPutAll_",["("]);
1254
- smalltalk.send(self,"_visit_",[smalltalk.send(aNode,"_left",[])]);
1255
- smalltalk.send(self["@stream"],"_nextPutAll_",["="]);
1256
- smalltalk.send(self,"_visit_",[smalltalk.send(aNode,"_right",[])]);
1257
- smalltalk.send(self["@stream"],"_nextPutAll_",[")"]);
1258
- return self}
1259
- }),
1260
- smalltalk.FunCodeGenerator);
1261
-
1262
- smalltalk.addMethod(
1263
- "_visitBlockNode_",
1264
- smalltalk.method({
1265
- selector: "visitBlockNode:",
1266
- fn: function (aNode){
1267
- var self=this;
1268
- smalltalk.send(self["@stream"],"_nextPutAll_",["(function("]);
1269
- smalltalk.send(smalltalk.send(aNode,"_parameters",[]),"_do_separatedBy_",[(function(each){
1270
- smalltalk.send(self["@tempVariables"],"_add_",[each]);
1271
- return smalltalk.send(self["@stream"],"_nextPutAll_",[each]);
1272
- }),(function(){
1273
- return smalltalk.send(self["@stream"],"_nextPutAll_",[", "]);
1274
- })]);
1275
- smalltalk.send(self["@stream"],"_nextPutAll_",["){"]);
1276
- smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_do_",[(function(each){
1277
- return smalltalk.send(self,"_visit_",[each]);
1278
- })]);
1279
- smalltalk.send(self["@stream"],"_nextPutAll_",["})"]);
1280
- return self}
1281
- }),
1282
- smalltalk.FunCodeGenerator);
1283
-
1284
- smalltalk.addMethod(
1285
- "_visitBlockSequenceNode_",
1286
- smalltalk.method({
1287
- selector: "visitBlockSequenceNode:",
1288
- fn: function (aNode){
1289
- var self=this;
1290
- var $1,$2,$3;
1291
- var index;
1292
- self["@nestedBlocks"]=smalltalk.send(self["@nestedBlocks"],"__plus",[(1)]);
1293
- $1=smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_isEmpty",[]);
1294
- if(smalltalk.assert($1)){
1295
- smalltalk.send(self["@stream"],"_nextPutAll_",["return nil;"]);
1296
- } else {
1297
- smalltalk.send(smalltalk.send(aNode,"_temps",[]),"_do_",[(function(each){
1298
- var temp;
1299
- temp=smalltalk.send(self,"_safeVariableNameFor_",[each]);
1300
- temp;
1301
- smalltalk.send(self["@tempVariables"],"_add_",[temp]);
1302
- smalltalk.send(self["@stream"],"_nextPutAll_",[smalltalk.send(smalltalk.send("var ","__comma",[temp]),"__comma",["=nil;"])]);
1303
- $2=smalltalk.send(self["@stream"],"_lf",[]);
1304
- return $2;
1305
- })]);
1306
- index=(0);
1307
- index;
1308
- smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_do_",[(function(each){
1309
- index=smalltalk.send(index,"__plus",[(1)]);
1310
- index;
1311
- $3=smalltalk.send(index,"__eq",[smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_size",[])]);
1312
- if(smalltalk.assert($3)){
1313
- smalltalk.send(self["@stream"],"_nextPutAll_",["return "]);
1314
- };
1315
- smalltalk.send(self,"_visit_",[each]);
1316
- return smalltalk.send(self["@stream"],"_nextPutAll_",[";"]);
1317
- })]);
1318
- };
1319
- self["@nestedBlocks"]=smalltalk.send(self["@nestedBlocks"],"__minus",[(1)]);
1320
- return self}
1321
- }),
1322
- smalltalk.FunCodeGenerator);
1323
-
1324
- smalltalk.addMethod(
1325
- "_visitCascadeNode_",
1326
- smalltalk.method({
1327
- selector: "visitCascadeNode:",
1328
- fn: function (aNode){
1329
- var self=this;
1330
- var $1,$2;
1331
- var index;
1332
- index=(0);
1333
- $1=smalltalk.send(self["@tempVariables"],"_includes_",["$rec"]);
1334
- if(! smalltalk.assert($1)){
1335
- smalltalk.send(self["@tempVariables"],"_add_",["$rec"]);
1336
- };
1337
- smalltalk.send(self["@stream"],"_nextPutAll_",["(function($rec){"]);
1338
- smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_do_",[(function(each){
1339
- index=smalltalk.send(index,"__plus",[(1)]);
1340
- index;
1341
- $2=smalltalk.send(index,"__eq",[smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_size",[])]);
1342
- if(smalltalk.assert($2)){
1343
- smalltalk.send(self["@stream"],"_nextPutAll_",["return "]);
1344
- };
1345
- smalltalk.send(each,"_receiver_",[smalltalk.send(smalltalk.send((smalltalk.VariableNode || VariableNode),"_new",[]),"_value_",["$rec"])]);
1346
- smalltalk.send(self,"_visit_",[each]);
1347
- return smalltalk.send(self["@stream"],"_nextPutAll_",[";"]);
1348
- })]);
1349
- smalltalk.send(self["@stream"],"_nextPutAll_",["})("]);
1350
- smalltalk.send(self,"_visit_",[smalltalk.send(aNode,"_receiver",[])]);
1351
- smalltalk.send(self["@stream"],"_nextPutAll_",[")"]);
1352
- return self}
1353
- }),
1354
- smalltalk.FunCodeGenerator);
1355
-
1356
- smalltalk.addMethod(
1357
- "_visitClassReferenceNode_",
1358
- smalltalk.method({
1359
- selector: "visitClassReferenceNode:",
1360
- fn: function (aNode){
1361
- var self=this;
1362
- var $1;
1363
- $1=smalltalk.send(self["@referencedClasses"],"_includes_",[smalltalk.send(aNode,"_value",[])]);
1364
- if(! smalltalk.assert($1)){
1365
- smalltalk.send(self["@referencedClasses"],"_add_",[smalltalk.send(aNode,"_value",[])]);
1366
- };
1367
- smalltalk.send(self["@stream"],"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(smalltalk.","__comma",[smalltalk.send(aNode,"_value",[])]),"__comma",[" || "]),"__comma",[smalltalk.send(aNode,"_value",[])]),"__comma",[")"])]);
1368
- return self}
1369
- }),
1370
- smalltalk.FunCodeGenerator);
1371
-
1372
- smalltalk.addMethod(
1373
- "_visitDynamicArrayNode_",
1374
- smalltalk.method({
1375
- selector: "visitDynamicArrayNode:",
1376
- fn: function (aNode){
1377
- var self=this;
1378
- smalltalk.send(self["@stream"],"_nextPutAll_",["["]);
1379
- smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_do_separatedBy_",[(function(each){
1380
- return smalltalk.send(self,"_visit_",[each]);
1381
- }),(function(){
1382
- return smalltalk.send(self["@stream"],"_nextPutAll_",[","]);
1383
- })]);
1384
- smalltalk.send(self["@stream"],"_nextPutAll_",["]"]);
1385
- return self}
1386
- }),
1387
- smalltalk.FunCodeGenerator);
1388
-
1389
- smalltalk.addMethod(
1390
- "_visitDynamicDictionaryNode_",
1391
- smalltalk.method({
1392
- selector: "visitDynamicDictionaryNode:",
1393
- fn: function (aNode){
1394
- var self=this;
1395
- smalltalk.send(self["@stream"],"_nextPutAll_",["smalltalk.HashedCollection._fromPairs_(["]);
1396
- smalltalk.send(smalltalk.send(aNode,"_nodes",[]),"_do_separatedBy_",[(function(each){
1397
- return smalltalk.send(self,"_visit_",[each]);
1398
- }),(function(){
1399
- return smalltalk.send(self["@stream"],"_nextPutAll_",[","]);
1400
- })]);
1401
- smalltalk.send(self["@stream"],"_nextPutAll_",["])"]);
1402
- return self}
1403
- }),
1404
- smalltalk.FunCodeGenerator);
1405
-
1406
- smalltalk.addMethod(
1407
- "_visitFailure_",
1408
- smalltalk.method({
1409
- selector: "visitFailure:",
1410
- fn: function (aFailure){
1411
- var self=this;
1412
- smalltalk.send(self,"_error_",[smalltalk.send(aFailure,"_asString",[])]);
1413
- return self}
1414
- }),
1415
- smalltalk.FunCodeGenerator);
1416
-
1417
- smalltalk.addMethod(
1418
- "_visitJSStatementNode_",
1419
- smalltalk.method({
1420
- selector: "visitJSStatementNode:",
1421
- fn: function (aNode){
1422
- var self=this;
1423
- smalltalk.send(self["@stream"],"_nextPutAll_",[smalltalk.send(aNode,"_source",[])]);
1424
- return self}
1425
- }),
1426
- smalltalk.FunCodeGenerator);
1427
-
1428
- smalltalk.addMethod(
1429
- "_visitMethodNode_",
1430
- smalltalk.method({
1431
- selector: "visitMethodNode:",
1432
- fn: function (aNode) {
1433
- var self=this;
1434
- var str=nil;
1435
- var currentSelector=nil;
1436
- (self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []));
1437
- (self['@nestedBlocks']=(0));
1438
- (self['@earlyReturn']=false);
1439
- (self['@messageSends']=[]);
1440
- (self['@referencedClasses']=[]);
1441
- (self['@unknownVariables']=[]);
1442
- (self['@tempVariables']=[]);
1443
- (self['@argVariables']=[]);
1444
- (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aNode, "_selector", [])]), "__comma", ["\x22,"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
1445
- (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(self, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
1446
- smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
1447
- smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@argVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
1448
- (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
1449
- (str=self['@stream']);
1450
- (self['@stream']=smalltalk.send("", "_writeStream", []));
1451
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
1452
- ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})]));
1453
- smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
1454
- (self['@stream']=str);
1455
- (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["return self;"]);})(self['@stream']);
1456
- ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})]));
1457
- smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
1458
- (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@messageSends'], "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(self['@argVariables'], "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
1459
- smalltalk.send(self['@referencedClasses'], "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
1460
- smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
1461
- smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
1462
- return self;}
1463
- }),
1464
- smalltalk.FunCodeGenerator);
1465
-
1466
- smalltalk.addMethod(
1467
- "_visitReturnNode_",
1468
- smalltalk.method({
1469
- selector: "visitReturnNode:",
1470
- fn: function (aNode) {
1471
- var self=this;
1472
- ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@earlyReturn']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@earlyReturn']=true);})]));
1473
- ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));
1474
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
1475
- ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})]));
1476
- return self;}
1477
- }),
1478
- smalltalk.FunCodeGenerator);
1479
-
1480
- smalltalk.addMethod(
1481
- "_visitSendNode_",
1482
- smalltalk.method({
1483
- selector: "visitSendNode:",
1484
- fn: function (aNode) {
1485
- var self=this;
1486
- var str=nil;
1487
- var receiver=nil;
1488
- var superSend=nil;
1489
- var inlined=nil;
1490
- (str=self['@stream']);
1491
- ((($receiver = smalltalk.send(self['@messageSends'], "_includes_", [smalltalk.send(aNode, "_selector", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})]));
1492
- (self['@stream']=smalltalk.send("", "_writeStream", []));
1493
- smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
1494
- (superSend=smalltalk.send(smalltalk.send(self['@stream'], "_contents", []), "__eq", ["super"]));
1495
- (receiver=((($receiver = superSend).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "self";})() : (function(){return smalltalk.send(self['@stream'], "_contents", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "self";}), (function(){return smalltalk.send(self['@stream'], "_contents", []);})])));
1496
- (self['@stream']=str);
1497
- ((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));
1498
- return self;}
1499
- }),
1500
- smalltalk.FunCodeGenerator);
1501
-
1502
- smalltalk.addMethod(
1503
- "_visitSequenceNode_",
1504
- smalltalk.method({
1505
- selector: "visitSequenceNode:",
1506
- fn: function (aNode) {
1507
- var self=this;
1508
- smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
1509
- (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", ["=nil;"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);
1510
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);}), (function(){return smalltalk.send(self['@stream'], "_lf", []);})]);
1511
- return self;}
1512
- }),
1513
- smalltalk.FunCodeGenerator);
1514
-
1515
- smalltalk.addMethod(
1516
- "_visitValueNode_",
1517
- smalltalk.method({
1518
- selector: "visitValueNode:",
1519
- fn: function (aNode) {
1520
- var self=this;
1521
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
1522
- return self;}
1523
- }),
1524
- smalltalk.FunCodeGenerator);
1525
-
1526
- smalltalk.addMethod(
1527
- "_visitVariableNode_",
1528
- smalltalk.method({
1529
- selector: "visitVariableNode:",
1530
- fn: function (aNode) {
1531
- var self=this;
1532
- var varName=nil;
1533
- ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_currentClass", []), "_allInstanceVariableNames", []), "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);})() : (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);}), (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})]));
1534
- return self;}
1535
- }),
1536
- smalltalk.FunCodeGenerator);
1537
-
1538
-
1539
- smalltalk.FunCodeGenerator.klass.iVarNames = ['performOptimizations'];
1540
- smalltalk.addMethod(
1541
- "_performOptimizations",
1542
- smalltalk.method({
1543
- selector: "performOptimizations",
1544
- fn: function () {
1545
- var self=this;
1546
- return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
1547
- return self;}
1548
- }),
1549
- smalltalk.FunCodeGenerator.klass);
1550
-
1551
- smalltalk.addMethod(
1552
- "_performOptimizations_",
1553
- smalltalk.method({
1554
- selector: "performOptimizations:",
1555
- fn: function (aBoolean) {
1556
- var self=this;
1557
- (self['@performOptimizations']=aBoolean);
1558
- return self;}
1559
- }),
1560
- smalltalk.FunCodeGenerator.klass);
1561
-
1562
-