resin 0.2.2 → 0.2.3

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 (117) hide show
  1. data/amber/css/amber-normalize.css +73 -73
  2. data/amber/css/amber-normalize.less +1 -1
  3. data/amber/css/amber.css +106 -106
  4. data/amber/css/helios.css +242 -0
  5. data/amber/images/hsplitter.png +0 -0
  6. data/amber/images/vsplitter.png +0 -0
  7. data/amber/js/Benchfib.deploy.js +116 -38
  8. data/amber/js/Benchfib.js +120 -42
  9. data/amber/js/Canvas.deploy.js +674 -403
  10. data/amber/js/Canvas.js +682 -411
  11. data/amber/js/Compiler-AST.deploy.js +1150 -0
  12. data/amber/js/Compiler-AST.js +1591 -0
  13. data/amber/js/Compiler-Core.deploy.js +1562 -0
  14. data/amber/js/Compiler-Core.js +1972 -0
  15. data/amber/js/Compiler-Exceptions.deploy.js +114 -0
  16. data/amber/js/Compiler-Exceptions.js +161 -0
  17. data/amber/js/Compiler-IR.deploy.js +2326 -0
  18. data/amber/js/Compiler-IR.js +3146 -0
  19. data/amber/js/Compiler-Inlining.deploy.js +1147 -0
  20. data/amber/js/Compiler-Inlining.js +1514 -0
  21. data/amber/js/Compiler-Semantic.deploy.js +1207 -0
  22. data/amber/js/Compiler-Semantic.js +1628 -0
  23. data/amber/js/Compiler-Tests.deploy.js +646 -60
  24. data/amber/js/Compiler-Tests.js +843 -82
  25. data/amber/js/Compiler.deploy.js +1097 -159
  26. data/amber/js/Compiler.js +1414 -161
  27. data/amber/js/Examples.deploy.js +31 -15
  28. data/amber/js/Examples.js +33 -17
  29. data/amber/js/Helios-Announcements.deploy.js +127 -0
  30. data/amber/js/Helios-Announcements.js +157 -0
  31. data/amber/js/Helios-Browser.deploy.js +1473 -0
  32. data/amber/js/Helios-Browser.js +1953 -0
  33. data/amber/js/Helios-Commands.deploy.js +403 -0
  34. data/amber/js/Helios-Commands.js +563 -0
  35. data/amber/js/Helios-Core.deploy.js +1070 -0
  36. data/amber/js/Helios-Core.js +1445 -0
  37. data/amber/js/Helios-Environments.deploy.js +132 -0
  38. data/amber/js/Helios-Environments.js +179 -0
  39. data/amber/js/Helios-Inspector.deploy.js +855 -0
  40. data/amber/js/Helios-Inspector.js +1155 -0
  41. data/amber/js/Helios-KeyBindings.deploy.js +753 -0
  42. data/amber/js/Helios-KeyBindings.js +1023 -0
  43. data/amber/js/Helios-Layout.deploy.js +383 -0
  44. data/amber/js/Helios-Layout.js +523 -0
  45. data/amber/js/Helios-Workspace.deploy.js +799 -0
  46. data/amber/js/Helios-Workspace.js +1074 -0
  47. data/amber/js/IDE.deploy.js +2541 -1490
  48. data/amber/js/IDE.js +2721 -1660
  49. data/amber/js/Importer-Exporter.deploy.js +671 -0
  50. data/amber/js/Importer-Exporter.js +816 -0
  51. data/amber/js/Kernel-Announcements.deploy.js +137 -20
  52. data/amber/js/Kernel-Announcements.js +176 -22
  53. data/amber/js/Kernel-Classes.deploy.js +555 -168
  54. data/amber/js/Kernel-Classes.js +662 -205
  55. data/amber/js/Kernel-Collections.deploy.js +1403 -618
  56. data/amber/js/Kernel-Collections.js +1545 -690
  57. data/amber/js/Kernel-Exceptions.deploy.js +109 -45
  58. data/amber/js/Kernel-Exceptions.js +123 -49
  59. data/amber/js/Kernel-Methods.deploy.js +196 -81
  60. data/amber/js/Kernel-Methods.js +214 -89
  61. data/amber/js/Kernel-Objects.deploy.js +1542 -1117
  62. data/amber/js/Kernel-Objects.js +1593 -1148
  63. data/amber/js/Kernel-Tests.deploy.js +1725 -772
  64. data/amber/js/Kernel-Tests.js +2301 -1123
  65. data/amber/js/Kernel-Transcript.deploy.js +23 -25
  66. data/amber/js/Kernel-Transcript.js +24 -26
  67. data/amber/js/SUnit.deploy.js +204 -131
  68. data/amber/js/SUnit.js +222 -139
  69. data/amber/js/Spaces.deploy.js +240 -0
  70. data/amber/js/Spaces.js +326 -0
  71. data/amber/js/amber.js +26 -7
  72. data/amber/js/boot.js +65 -47
  73. data/amber/js/init.js +1 -1
  74. data/amber/js/lib/CodeMirror/amber.css +21 -21
  75. data/amber/js/lib/CodeMirror/codemirror.css +119 -13
  76. data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
  77. data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
  78. data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
  79. data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
  80. data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
  81. data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
  82. data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
  83. data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
  84. data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
  85. data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
  86. data/amber/st/Compiler-AST.st +505 -0
  87. data/amber/st/Compiler-Core.st +835 -0
  88. data/amber/st/Compiler-Exceptions.st +87 -0
  89. data/amber/st/Compiler-IR.st +1097 -0
  90. data/amber/st/Compiler-Inlining.st +650 -0
  91. data/amber/st/Compiler-Semantic.st +558 -0
  92. data/amber/st/Compiler-Tests.st +285 -381
  93. data/amber/st/Compiler.st +725 -2
  94. data/amber/st/Helios-Announcements.st +104 -0
  95. data/amber/st/Helios-Browser.st +708 -0
  96. data/amber/st/Helios-Commands.st +223 -0
  97. data/amber/st/Helios-Core.st +532 -0
  98. data/amber/st/Helios-Environments.st +98 -0
  99. data/amber/st/Helios-Inspector.st +367 -0
  100. data/amber/st/Helios-KeyBindings.st +337 -0
  101. data/amber/st/Helios-Layout.st +199 -0
  102. data/amber/st/Helios-Workspace.st +367 -0
  103. data/amber/st/IDE.st +75 -53
  104. data/amber/st/Importer-Exporter.st +386 -0
  105. data/amber/st/Kernel-Announcements.st +92 -0
  106. data/amber/st/Kernel-Classes.st +137 -15
  107. data/amber/st/Kernel-Collections.st +137 -47
  108. data/amber/st/Kernel-Exceptions.st +14 -0
  109. data/amber/st/Kernel-Methods.st +9 -1
  110. data/amber/st/Kernel-Objects.st +29 -5
  111. data/amber/st/Kernel-Tests.st +545 -199
  112. data/amber/st/SUnit.st +10 -0
  113. data/amber/st/Spaces.st +142 -0
  114. data/lib/resin/app.rb +1 -1
  115. metadata +86 -31
  116. data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
  117. data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
@@ -0,0 +1,1147 @@
1
+ smalltalk.addPackage('Compiler-Inlining', {});
2
+ smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler-Inlining');
3
+ smalltalk.addMethod(
4
+ "_accept_",
5
+ smalltalk.method({
6
+ selector: "accept:",
7
+ fn: function (aVisitor){
8
+ var self=this;
9
+ var $1;
10
+ $1=smalltalk.send(aVisitor,"_visitIRInlinedAssignment_",[self]);
11
+ return $1;
12
+ }
13
+ }),
14
+ smalltalk.IRInlinedAssignment);
15
+
16
+ smalltalk.addMethod(
17
+ "_isInlined",
18
+ smalltalk.method({
19
+ selector: "isInlined",
20
+ fn: function (){
21
+ var self=this;
22
+ return true;
23
+ }
24
+ }),
25
+ smalltalk.IRInlinedAssignment);
26
+
27
+
28
+
29
+ smalltalk.addClass('IRInlinedClosure', smalltalk.IRClosure, [], 'Compiler-Inlining');
30
+ smalltalk.addMethod(
31
+ "_accept_",
32
+ smalltalk.method({
33
+ selector: "accept:",
34
+ fn: function (aVisitor){
35
+ var self=this;
36
+ smalltalk.send(aVisitor,"_visitIRInlinedClosure_",[self]);
37
+ return self}
38
+ }),
39
+ smalltalk.IRInlinedClosure);
40
+
41
+ smalltalk.addMethod(
42
+ "_isInlined",
43
+ smalltalk.method({
44
+ selector: "isInlined",
45
+ fn: function (){
46
+ var self=this;
47
+ return true;
48
+ }
49
+ }),
50
+ smalltalk.IRInlinedClosure);
51
+
52
+
53
+
54
+ smalltalk.addClass('IRInlinedReturn', smalltalk.IRReturn, [], 'Compiler-Inlining');
55
+ smalltalk.addMethod(
56
+ "_accept_",
57
+ smalltalk.method({
58
+ selector: "accept:",
59
+ fn: function (aVisitor){
60
+ var self=this;
61
+ var $1;
62
+ $1=smalltalk.send(aVisitor,"_visitIRInlinedReturn_",[self]);
63
+ return $1;
64
+ }
65
+ }),
66
+ smalltalk.IRInlinedReturn);
67
+
68
+ smalltalk.addMethod(
69
+ "_isInlined",
70
+ smalltalk.method({
71
+ selector: "isInlined",
72
+ fn: function (){
73
+ var self=this;
74
+ return true;
75
+ }
76
+ }),
77
+ smalltalk.IRInlinedReturn);
78
+
79
+
80
+
81
+ smalltalk.addClass('IRInlinedNonLocalReturn', smalltalk.IRInlinedReturn, [], 'Compiler-Inlining');
82
+ smalltalk.addMethod(
83
+ "_accept_",
84
+ smalltalk.method({
85
+ selector: "accept:",
86
+ fn: function (aVisitor){
87
+ var self=this;
88
+ var $1;
89
+ $1=smalltalk.send(aVisitor,"_visitIRInlinedNonLocalReturn_",[self]);
90
+ return $1;
91
+ }
92
+ }),
93
+ smalltalk.IRInlinedNonLocalReturn);
94
+
95
+ smalltalk.addMethod(
96
+ "_isInlined",
97
+ smalltalk.method({
98
+ selector: "isInlined",
99
+ fn: function (){
100
+ var self=this;
101
+ return true;
102
+ }
103
+ }),
104
+ smalltalk.IRInlinedNonLocalReturn);
105
+
106
+
107
+
108
+ smalltalk.addClass('IRInlinedSend', smalltalk.IRSend, [], 'Compiler-Inlining');
109
+ smalltalk.addMethod(
110
+ "_accept_",
111
+ smalltalk.method({
112
+ selector: "accept:",
113
+ fn: function (aVisitor){
114
+ var self=this;
115
+ smalltalk.send(aVisitor,"_visitInlinedSend_",[self]);
116
+ return self}
117
+ }),
118
+ smalltalk.IRInlinedSend);
119
+
120
+ smalltalk.addMethod(
121
+ "_isInlined",
122
+ smalltalk.method({
123
+ selector: "isInlined",
124
+ fn: function (){
125
+ var self=this;
126
+ return true;
127
+ }
128
+ }),
129
+ smalltalk.IRInlinedSend);
130
+
131
+
132
+
133
+ smalltalk.addClass('IRInlinedIfFalse', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
134
+ smalltalk.addMethod(
135
+ "_accept_",
136
+ smalltalk.method({
137
+ selector: "accept:",
138
+ fn: function (aVisitor){
139
+ var self=this;
140
+ smalltalk.send(aVisitor,"_visitIRInlinedIfFalse_",[self]);
141
+ return self}
142
+ }),
143
+ smalltalk.IRInlinedIfFalse);
144
+
145
+
146
+
147
+ smalltalk.addClass('IRInlinedIfNilIfNotNil', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
148
+ smalltalk.addMethod(
149
+ "_accept_",
150
+ smalltalk.method({
151
+ selector: "accept:",
152
+ fn: function (aVisitor){
153
+ var self=this;
154
+ smalltalk.send(aVisitor,"_visitIRInlinedIfNilIfNotNil_",[self]);
155
+ return self}
156
+ }),
157
+ smalltalk.IRInlinedIfNilIfNotNil);
158
+
159
+
160
+
161
+ smalltalk.addClass('IRInlinedIfTrue', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
162
+ smalltalk.addMethod(
163
+ "_accept_",
164
+ smalltalk.method({
165
+ selector: "accept:",
166
+ fn: function (aVisitor){
167
+ var self=this;
168
+ smalltalk.send(aVisitor,"_visitIRInlinedIfTrue_",[self]);
169
+ return self}
170
+ }),
171
+ smalltalk.IRInlinedIfTrue);
172
+
173
+
174
+
175
+ smalltalk.addClass('IRInlinedIfTrueIfFalse', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
176
+ smalltalk.addMethod(
177
+ "_accept_",
178
+ smalltalk.method({
179
+ selector: "accept:",
180
+ fn: function (aVisitor){
181
+ var self=this;
182
+ smalltalk.send(aVisitor,"_visitIRInlinedIfTrueIfFalse_",[self]);
183
+ return self}
184
+ }),
185
+ smalltalk.IRInlinedIfTrueIfFalse);
186
+
187
+
188
+
189
+ smalltalk.addClass('IRInlinedSequence', smalltalk.IRBlockSequence, [], 'Compiler-Inlining');
190
+ smalltalk.addMethod(
191
+ "_accept_",
192
+ smalltalk.method({
193
+ selector: "accept:",
194
+ fn: function (aVisitor){
195
+ var self=this;
196
+ smalltalk.send(aVisitor,"_visitIRInlinedSequence_",[self]);
197
+ return self}
198
+ }),
199
+ smalltalk.IRInlinedSequence);
200
+
201
+ smalltalk.addMethod(
202
+ "_isInlined",
203
+ smalltalk.method({
204
+ selector: "isInlined",
205
+ fn: function (){
206
+ var self=this;
207
+ return true;
208
+ }
209
+ }),
210
+ smalltalk.IRInlinedSequence);
211
+
212
+
213
+
214
+ smalltalk.addClass('IRInliner', smalltalk.IRVisitor, [], 'Compiler-Inlining');
215
+ smalltalk.addMethod(
216
+ "_assignmentInliner",
217
+ smalltalk.method({
218
+ selector: "assignmentInliner",
219
+ fn: function (){
220
+ var self=this;
221
+ var $2,$3,$1;
222
+ $2=smalltalk.send((smalltalk.IRAssignmentInliner || IRAssignmentInliner),"_new",[]);
223
+ smalltalk.send($2,"_translator_",[self]);
224
+ $3=smalltalk.send($2,"_yourself",[]);
225
+ $1=$3;
226
+ return $1;
227
+ }
228
+ }),
229
+ smalltalk.IRInliner);
230
+
231
+ smalltalk.addMethod(
232
+ "_nonLocalReturnInliner",
233
+ smalltalk.method({
234
+ selector: "nonLocalReturnInliner",
235
+ fn: function (){
236
+ var self=this;
237
+ var $2,$3,$1;
238
+ $2=smalltalk.send((smalltalk.IRNonLocalReturnInliner || IRNonLocalReturnInliner),"_new",[]);
239
+ smalltalk.send($2,"_translator_",[self]);
240
+ $3=smalltalk.send($2,"_yourself",[]);
241
+ $1=$3;
242
+ return $1;
243
+ }
244
+ }),
245
+ smalltalk.IRInliner);
246
+
247
+ smalltalk.addMethod(
248
+ "_returnInliner",
249
+ smalltalk.method({
250
+ selector: "returnInliner",
251
+ fn: function (){
252
+ var self=this;
253
+ var $2,$3,$1;
254
+ $2=smalltalk.send((smalltalk.IRReturnInliner || IRReturnInliner),"_new",[]);
255
+ smalltalk.send($2,"_translator_",[self]);
256
+ $3=smalltalk.send($2,"_yourself",[]);
257
+ $1=$3;
258
+ return $1;
259
+ }
260
+ }),
261
+ smalltalk.IRInliner);
262
+
263
+ smalltalk.addMethod(
264
+ "_sendInliner",
265
+ smalltalk.method({
266
+ selector: "sendInliner",
267
+ fn: function (){
268
+ var self=this;
269
+ var $2,$3,$1;
270
+ $2=smalltalk.send((smalltalk.IRSendInliner || IRSendInliner),"_new",[]);
271
+ smalltalk.send($2,"_translator_",[self]);
272
+ $3=smalltalk.send($2,"_yourself",[]);
273
+ $1=$3;
274
+ return $1;
275
+ }
276
+ }),
277
+ smalltalk.IRInliner);
278
+
279
+ smalltalk.addMethod(
280
+ "_shouldInlineAssignment_",
281
+ smalltalk.method({
282
+ selector: "shouldInlineAssignment:",
283
+ fn: function (anIRAssignment){
284
+ var self=this;
285
+ var $1;
286
+ $1=smalltalk.send(smalltalk.send(smalltalk.send(anIRAssignment,"_isInlined",[]),"_not",[]),"_and_",[(function(){
287
+ return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(anIRAssignment,"_instructions",[]),"_last",[]),"_isSend",[]),"_and_",[(function(){
288
+ return smalltalk.send(self,"_shouldInlineSend_",[smalltalk.send(smalltalk.send(anIRAssignment,"_instructions",[]),"_last",[])]);
289
+ })]);
290
+ })]);
291
+ return $1;
292
+ }
293
+ }),
294
+ smalltalk.IRInliner);
295
+
296
+ smalltalk.addMethod(
297
+ "_shouldInlineReturn_",
298
+ smalltalk.method({
299
+ selector: "shouldInlineReturn:",
300
+ fn: function (anIRReturn){
301
+ var self=this;
302
+ var $1;
303
+ $1=smalltalk.send(smalltalk.send(smalltalk.send(anIRReturn,"_isInlined",[]),"_not",[]),"_and_",[(function(){
304
+ return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(anIRReturn,"_instructions",[]),"_first",[]),"_isSend",[]),"_and_",[(function(){
305
+ return smalltalk.send(self,"_shouldInlineSend_",[smalltalk.send(smalltalk.send(anIRReturn,"_instructions",[]),"_first",[])]);
306
+ })]);
307
+ })]);
308
+ return $1;
309
+ }
310
+ }),
311
+ smalltalk.IRInliner);
312
+
313
+ smalltalk.addMethod(
314
+ "_shouldInlineSend_",
315
+ smalltalk.method({
316
+ selector: "shouldInlineSend:",
317
+ fn: function (anIRSend){
318
+ var self=this;
319
+ var $1;
320
+ $1=smalltalk.send(smalltalk.send(smalltalk.send(anIRSend,"_isInlined",[]),"_not",[]),"_and_",[(function(){
321
+ return smalltalk.send((smalltalk.IRSendInliner || IRSendInliner),"_shouldInline_",[anIRSend]);
322
+ })]);
323
+ return $1;
324
+ }
325
+ }),
326
+ smalltalk.IRInliner);
327
+
328
+ smalltalk.addMethod(
329
+ "_transformNonLocalReturn_",
330
+ smalltalk.method({
331
+ selector: "transformNonLocalReturn:",
332
+ fn: function (anIRNonLocalReturn){
333
+ var self=this;
334
+ var $1,$2,$3,$4;
335
+ var localReturn;
336
+ $1=smalltalk.send(smalltalk.send(anIRNonLocalReturn,"_scope",[]),"_canInlineNonLocalReturns",[]);
337
+ if(smalltalk.assert($1)){
338
+ smalltalk.send(smalltalk.send(smalltalk.send(anIRNonLocalReturn,"_scope",[]),"_methodScope",[]),"_removeNonLocalReturn_",[smalltalk.send(anIRNonLocalReturn,"_scope",[])]);
339
+ $2=smalltalk.send((smalltalk.IRReturn || IRReturn),"_new",[]);
340
+ smalltalk.send($2,"_scope_",[smalltalk.send(anIRNonLocalReturn,"_scope",[])]);
341
+ $3=smalltalk.send($2,"_yourself",[]);
342
+ localReturn=$3;
343
+ localReturn;
344
+ smalltalk.send(smalltalk.send(anIRNonLocalReturn,"_instructions",[]),"_do_",[(function(each){
345
+ return smalltalk.send(localReturn,"_add_",[each]);
346
+ })]);
347
+ smalltalk.send(anIRNonLocalReturn,"_replaceWith_",[localReturn]);
348
+ return localReturn;
349
+ };
350
+ $4=smalltalk.send(self,"_visitIRNonLocalReturn_",[anIRNonLocalReturn],smalltalk.IRVisitor);
351
+ return $4;
352
+ }
353
+ }),
354
+ smalltalk.IRInliner);
355
+
356
+ smalltalk.addMethod(
357
+ "_visitIRAssignment_",
358
+ smalltalk.method({
359
+ selector: "visitIRAssignment:",
360
+ fn: function (anIRAssignment){
361
+ var self=this;
362
+ var $2,$1;
363
+ $2=smalltalk.send(self,"_shouldInlineAssignment_",[anIRAssignment]);
364
+ if(smalltalk.assert($2)){
365
+ $1=smalltalk.send(smalltalk.send(self,"_assignmentInliner",[]),"_inlineAssignment_",[anIRAssignment]);
366
+ } else {
367
+ $1=smalltalk.send(self,"_visitIRAssignment_",[anIRAssignment],smalltalk.IRVisitor);
368
+ };
369
+ return $1;
370
+ }
371
+ }),
372
+ smalltalk.IRInliner);
373
+
374
+ smalltalk.addMethod(
375
+ "_visitIRNonLocalReturn_",
376
+ smalltalk.method({
377
+ selector: "visitIRNonLocalReturn:",
378
+ fn: function (anIRNonLocalReturn){
379
+ var self=this;
380
+ var $2,$1;
381
+ $2=smalltalk.send(self,"_shouldInlineReturn_",[anIRNonLocalReturn]);
382
+ if(smalltalk.assert($2)){
383
+ $1=smalltalk.send(smalltalk.send(self,"_nonLocalReturnInliner",[]),"_inlineReturn_",[anIRNonLocalReturn]);
384
+ } else {
385
+ $1=smalltalk.send(self,"_transformNonLocalReturn_",[anIRNonLocalReturn]);
386
+ };
387
+ return $1;
388
+ }
389
+ }),
390
+ smalltalk.IRInliner);
391
+
392
+ smalltalk.addMethod(
393
+ "_visitIRReturn_",
394
+ smalltalk.method({
395
+ selector: "visitIRReturn:",
396
+ fn: function (anIRReturn){
397
+ var self=this;
398
+ var $2,$1;
399
+ $2=smalltalk.send(self,"_shouldInlineReturn_",[anIRReturn]);
400
+ if(smalltalk.assert($2)){
401
+ $1=smalltalk.send(smalltalk.send(self,"_returnInliner",[]),"_inlineReturn_",[anIRReturn]);
402
+ } else {
403
+ $1=smalltalk.send(self,"_visitIRReturn_",[anIRReturn],smalltalk.IRVisitor);
404
+ };
405
+ return $1;
406
+ }
407
+ }),
408
+ smalltalk.IRInliner);
409
+
410
+ smalltalk.addMethod(
411
+ "_visitIRSend_",
412
+ smalltalk.method({
413
+ selector: "visitIRSend:",
414
+ fn: function (anIRSend){
415
+ var self=this;
416
+ var $2,$1;
417
+ $2=smalltalk.send(self,"_shouldInlineSend_",[anIRSend]);
418
+ if(smalltalk.assert($2)){
419
+ $1=smalltalk.send(smalltalk.send(self,"_sendInliner",[]),"_inlineSend_",[anIRSend]);
420
+ } else {
421
+ $1=smalltalk.send(self,"_visitIRSend_",[anIRSend],smalltalk.IRVisitor);
422
+ };
423
+ return $1;
424
+ }
425
+ }),
426
+ smalltalk.IRInliner);
427
+
428
+
429
+
430
+ smalltalk.addClass('IRInliningJSTranslator', smalltalk.IRJSTranslator, [], 'Compiler-Inlining');
431
+ smalltalk.addMethod(
432
+ "_visitIRInlinedAssignment_",
433
+ smalltalk.method({
434
+ selector: "visitIRInlinedAssignment:",
435
+ fn: function (anIRInlinedAssignment){
436
+ var self=this;
437
+ smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedAssignment,"_instructions",[]),"_last",[])]);
438
+ return self}
439
+ }),
440
+ smalltalk.IRInliningJSTranslator);
441
+
442
+ smalltalk.addMethod(
443
+ "_visitIRInlinedClosure_",
444
+ smalltalk.method({
445
+ selector: "visitIRInlinedClosure:",
446
+ fn: function (anIRInlinedClosure){
447
+ var self=this;
448
+ smalltalk.send(smalltalk.send(anIRInlinedClosure,"_instructions",[]),"_do_",[(function(each){
449
+ return smalltalk.send(self,"_visit_",[each]);
450
+ })]);
451
+ return self}
452
+ }),
453
+ smalltalk.IRInliningJSTranslator);
454
+
455
+ smalltalk.addMethod(
456
+ "_visitIRInlinedIfFalse_",
457
+ smalltalk.method({
458
+ selector: "visitIRInlinedIfFalse:",
459
+ fn: function (anIRInlinedIfFalse){
460
+ var self=this;
461
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutIf_with_",[(function(){
462
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",["! smalltalk.assert("]);
463
+ smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfFalse,"_instructions",[]),"_first",[])]);
464
+ return smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",[")"]);
465
+ }),(function(){
466
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfFalse,"_instructions",[]),"_last",[])]);
467
+ })]);
468
+ return self}
469
+ }),
470
+ smalltalk.IRInliningJSTranslator);
471
+
472
+ smalltalk.addMethod(
473
+ "_visitIRInlinedIfNil_",
474
+ smalltalk.method({
475
+ selector: "visitIRInlinedIfNil:",
476
+ fn: function (anIRInlinedIfNil){
477
+ var self=this;
478
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutIf_with_",[(function(){
479
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",["($receiver = "]);
480
+ smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfNil,"_instructions",[]),"_first",[])]);
481
+ return smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",[") == nil || $receiver == undefined"]);
482
+ }),(function(){
483
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfNil,"_instructions",[]),"_last",[])]);
484
+ })]);
485
+ return self}
486
+ }),
487
+ smalltalk.IRInliningJSTranslator);
488
+
489
+ smalltalk.addMethod(
490
+ "_visitIRInlinedIfNilIfNotNil_",
491
+ smalltalk.method({
492
+ selector: "visitIRInlinedIfNilIfNotNil:",
493
+ fn: function (anIRInlinedIfNilIfNotNil){
494
+ var self=this;
495
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutIfElse_with_with_",[(function(){
496
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",["($receiver = "]);
497
+ smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfNilIfNotNil,"_instructions",[]),"_first",[])]);
498
+ return smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",[") == nil || $receiver == undefined"]);
499
+ }),(function(){
500
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfNilIfNotNil,"_instructions",[]),"_second",[])]);
501
+ }),(function(){
502
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfNilIfNotNil,"_instructions",[]),"_third",[])]);
503
+ })]);
504
+ return self}
505
+ }),
506
+ smalltalk.IRInliningJSTranslator);
507
+
508
+ smalltalk.addMethod(
509
+ "_visitIRInlinedIfTrue_",
510
+ smalltalk.method({
511
+ selector: "visitIRInlinedIfTrue:",
512
+ fn: function (anIRInlinedIfTrue){
513
+ var self=this;
514
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutIf_with_",[(function(){
515
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",["smalltalk.assert("]);
516
+ smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfTrue,"_instructions",[]),"_first",[])]);
517
+ return smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",[")"]);
518
+ }),(function(){
519
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfTrue,"_instructions",[]),"_last",[])]);
520
+ })]);
521
+ return self}
522
+ }),
523
+ smalltalk.IRInliningJSTranslator);
524
+
525
+ smalltalk.addMethod(
526
+ "_visitIRInlinedIfTrueIfFalse_",
527
+ smalltalk.method({
528
+ selector: "visitIRInlinedIfTrueIfFalse:",
529
+ fn: function (anIRInlinedIfTrueIfFalse){
530
+ var self=this;
531
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutIfElse_with_with_",[(function(){
532
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",["smalltalk.assert("]);
533
+ smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfTrueIfFalse,"_instructions",[]),"_first",[])]);
534
+ return smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutAll_",[")"]);
535
+ }),(function(){
536
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfTrueIfFalse,"_instructions",[]),"_second",[])]);
537
+ }),(function(){
538
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedIfTrueIfFalse,"_instructions",[]),"_third",[])]);
539
+ })]);
540
+ return self}
541
+ }),
542
+ smalltalk.IRInliningJSTranslator);
543
+
544
+ smalltalk.addMethod(
545
+ "_visitIRInlinedNonLocalReturn_",
546
+ smalltalk.method({
547
+ selector: "visitIRInlinedNonLocalReturn:",
548
+ fn: function (anIRInlinedReturn){
549
+ var self=this;
550
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutStatementWith_",[(function(){
551
+ return smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedReturn,"_instructions",[]),"_last",[])]);
552
+ })]);
553
+ smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutNonLocalReturnWith_",[(function(){
554
+ })]);
555
+ return self}
556
+ }),
557
+ smalltalk.IRInliningJSTranslator);
558
+
559
+ smalltalk.addMethod(
560
+ "_visitIRInlinedReturn_",
561
+ smalltalk.method({
562
+ selector: "visitIRInlinedReturn:",
563
+ fn: function (anIRInlinedReturn){
564
+ var self=this;
565
+ smalltalk.send(self,"_visit_",[smalltalk.send(smalltalk.send(anIRInlinedReturn,"_instructions",[]),"_last",[])]);
566
+ return self}
567
+ }),
568
+ smalltalk.IRInliningJSTranslator);
569
+
570
+ smalltalk.addMethod(
571
+ "_visitIRInlinedSequence_",
572
+ smalltalk.method({
573
+ selector: "visitIRInlinedSequence:",
574
+ fn: function (anIRInlinedSequence){
575
+ var self=this;
576
+ smalltalk.send(smalltalk.send(anIRInlinedSequence,"_instructions",[]),"_do_",[(function(each){
577
+ return smalltalk.send(smalltalk.send(self,"_stream",[]),"_nextPutStatementWith_",[(function(){
578
+ return smalltalk.send(self,"_visit_",[each]);
579
+ })]);
580
+ })]);
581
+ return self}
582
+ }),
583
+ smalltalk.IRInliningJSTranslator);
584
+
585
+
586
+
587
+ smalltalk.addClass('IRSendInliner', smalltalk.Object, ['send', 'translator'], 'Compiler-Inlining');
588
+ smalltalk.addMethod(
589
+ "_ifFalse_",
590
+ smalltalk.method({
591
+ selector: "ifFalse:",
592
+ fn: function (anIRInstruction){
593
+ var self=this;
594
+ var $1;
595
+ $1=smalltalk.send(self,"_inlinedSend_with_",[smalltalk.send((smalltalk.IRInlinedIfFalse || IRInlinedIfFalse),"_new",[]),anIRInstruction]);
596
+ return $1;
597
+ }
598
+ }),
599
+ smalltalk.IRSendInliner);
600
+
601
+ smalltalk.addMethod(
602
+ "_ifFalse_ifTrue_",
603
+ smalltalk.method({
604
+ selector: "ifFalse:ifTrue:",
605
+ fn: function (anIRInstruction,anotherIRInstruction){
606
+ var self=this;
607
+ var $1;
608
+ $1=smalltalk.send(self,"_perform_withArguments_",[smalltalk.symbolFor("ifTrue:ifFalse:"),[anotherIRInstruction,anIRInstruction]]);
609
+ return $1;
610
+ }
611
+ }),
612
+ smalltalk.IRSendInliner);
613
+
614
+ smalltalk.addMethod(
615
+ "_ifNil_",
616
+ smalltalk.method({
617
+ selector: "ifNil:",
618
+ fn: function (anIRInstruction){
619
+ var self=this;
620
+ var $2,$3,$4,$5,$1;
621
+ $2=smalltalk.send((smalltalk.IRClosure || IRClosure),"_new",[]);
622
+ smalltalk.send($2,"_scope_",[smalltalk.send(smalltalk.send(anIRInstruction,"_scope",[]),"_copy",[])]);
623
+ $3=smalltalk.send((smalltalk.IRBlockSequence || IRBlockSequence),"_new",[]);
624
+ smalltalk.send($3,"_add_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_send",[]),"_instructions",[]),"_first",[])]);
625
+ $4=smalltalk.send($3,"_yourself",[]);
626
+ smalltalk.send($2,"_add_",[$4]);
627
+ $5=smalltalk.send($2,"_yourself",[]);
628
+ $1=smalltalk.send(self,"_inlinedSend_with_with_",[smalltalk.send((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil),"_new",[]),anIRInstruction,$5]);
629
+ return $1;
630
+ }
631
+ }),
632
+ smalltalk.IRSendInliner);
633
+
634
+ smalltalk.addMethod(
635
+ "_ifNil_ifNotNil_",
636
+ smalltalk.method({
637
+ selector: "ifNil:ifNotNil:",
638
+ fn: function (anIRInstruction,anotherIRInstruction){
639
+ var self=this;
640
+ var $1;
641
+ $1=smalltalk.send(self,"_inlinedSend_with_with_",[smalltalk.send((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil),"_new",[]),anIRInstruction,anotherIRInstruction]);
642
+ return $1;
643
+ }
644
+ }),
645
+ smalltalk.IRSendInliner);
646
+
647
+ smalltalk.addMethod(
648
+ "_ifNotNil_",
649
+ smalltalk.method({
650
+ selector: "ifNotNil:",
651
+ fn: function (anIRInstruction){
652
+ var self=this;
653
+ var $2,$3,$4,$5,$1;
654
+ $2=smalltalk.send((smalltalk.IRClosure || IRClosure),"_new",[]);
655
+ smalltalk.send($2,"_scope_",[smalltalk.send(smalltalk.send(anIRInstruction,"_scope",[]),"_copy",[])]);
656
+ $3=smalltalk.send((smalltalk.IRBlockSequence || IRBlockSequence),"_new",[]);
657
+ smalltalk.send($3,"_add_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_send",[]),"_instructions",[]),"_first",[])]);
658
+ $4=smalltalk.send($3,"_yourself",[]);
659
+ smalltalk.send($2,"_add_",[$4]);
660
+ $5=smalltalk.send($2,"_yourself",[]);
661
+ $1=smalltalk.send(self,"_inlinedSend_with_with_",[smalltalk.send((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil),"_new",[]),$5,anIRInstruction]);
662
+ return $1;
663
+ }
664
+ }),
665
+ smalltalk.IRSendInliner);
666
+
667
+ smalltalk.addMethod(
668
+ "_ifNotNil_ifNil_",
669
+ smalltalk.method({
670
+ selector: "ifNotNil:ifNil:",
671
+ fn: function (anIRInstruction,anotherIRInstruction){
672
+ var self=this;
673
+ var $1;
674
+ $1=smalltalk.send(self,"_inlinedSend_with_with_",[smalltalk.send((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil),"_new",[]),anotherIRInstruction,anIRInstruction]);
675
+ return $1;
676
+ }
677
+ }),
678
+ smalltalk.IRSendInliner);
679
+
680
+ smalltalk.addMethod(
681
+ "_ifTrue_",
682
+ smalltalk.method({
683
+ selector: "ifTrue:",
684
+ fn: function (anIRInstruction){
685
+ var self=this;
686
+ var $1;
687
+ $1=smalltalk.send(self,"_inlinedSend_with_",[smalltalk.send((smalltalk.IRInlinedIfTrue || IRInlinedIfTrue),"_new",[]),anIRInstruction]);
688
+ return $1;
689
+ }
690
+ }),
691
+ smalltalk.IRSendInliner);
692
+
693
+ smalltalk.addMethod(
694
+ "_ifTrue_ifFalse_",
695
+ smalltalk.method({
696
+ selector: "ifTrue:ifFalse:",
697
+ fn: function (anIRInstruction,anotherIRInstruction){
698
+ var self=this;
699
+ var $1;
700
+ $1=smalltalk.send(self,"_inlinedSend_with_with_",[smalltalk.send((smalltalk.IRInlinedIfTrueIfFalse || IRInlinedIfTrueIfFalse),"_new",[]),anIRInstruction,anotherIRInstruction]);
701
+ return $1;
702
+ }
703
+ }),
704
+ smalltalk.IRSendInliner);
705
+
706
+ smalltalk.addMethod(
707
+ "_inlineClosure_",
708
+ smalltalk.method({
709
+ selector: "inlineClosure:",
710
+ fn: function (anIRClosure){
711
+ var self=this;
712
+ var $1,$2;
713
+ var inlinedClosure;
714
+ var sequence;
715
+ var statements;
716
+ inlinedClosure=smalltalk.send(self,"_inlinedClosure",[]);
717
+ smalltalk.send(inlinedClosure,"_scope_",[smalltalk.send(anIRClosure,"_scope",[])]);
718
+ smalltalk.send(smalltalk.send(anIRClosure,"_instructions",[]),"_do_",[(function(each){
719
+ $1=smalltalk.send(each,"_isSequence",[]);
720
+ if(! smalltalk.assert($1)){
721
+ return smalltalk.send(inlinedClosure,"_add_",[each]);
722
+ };
723
+ })]);
724
+ sequence=smalltalk.send(self,"_inlinedSequence",[]);
725
+ smalltalk.send(inlinedClosure,"_add_",[sequence]);
726
+ statements=smalltalk.send(smalltalk.send(smalltalk.send(anIRClosure,"_instructions",[]),"_last",[]),"_instructions",[]);
727
+ smalltalk.send(statements,"_ifNotEmpty_",[(function(){
728
+ smalltalk.send(smalltalk.send(statements,"_allButLast",[]),"_do_",[(function(each){
729
+ return smalltalk.send(sequence,"_add_",[each]);
730
+ })]);
731
+ $2=smalltalk.send(smalltalk.send(smalltalk.send(statements,"_last",[]),"_isReturn",[]),"_and_",[(function(){
732
+ return smalltalk.send(smalltalk.send(statements,"_last",[]),"_isBlockReturn",[]);
733
+ })]);
734
+ if(smalltalk.assert($2)){
735
+ return smalltalk.send(sequence,"_add_",[smalltalk.send(smalltalk.send(smalltalk.send(statements,"_last",[]),"_instructions",[]),"_first",[])]);
736
+ } else {
737
+ return smalltalk.send(sequence,"_add_",[smalltalk.send(statements,"_last",[])]);
738
+ };
739
+ })]);
740
+ return inlinedClosure;
741
+ }
742
+ }),
743
+ smalltalk.IRSendInliner);
744
+
745
+ smalltalk.addMethod(
746
+ "_inlineSend_",
747
+ smalltalk.method({
748
+ selector: "inlineSend:",
749
+ fn: function (anIRSend){
750
+ var self=this;
751
+ var $1;
752
+ smalltalk.send(self,"_send_",[anIRSend]);
753
+ $1=smalltalk.send(self,"_perform_withArguments_",[smalltalk.send(smalltalk.send(self,"_send",[]),"_selector",[]),smalltalk.send(smalltalk.send(smalltalk.send(self,"_send",[]),"_instructions",[]),"_allButFirst",[])]);
754
+ return $1;
755
+ }
756
+ }),
757
+ smalltalk.IRSendInliner);
758
+
759
+ smalltalk.addMethod(
760
+ "_inlinedClosure",
761
+ smalltalk.method({
762
+ selector: "inlinedClosure",
763
+ fn: function (){
764
+ var self=this;
765
+ var $1;
766
+ $1=smalltalk.send((smalltalk.IRInlinedClosure || IRInlinedClosure),"_new",[]);
767
+ return $1;
768
+ }
769
+ }),
770
+ smalltalk.IRSendInliner);
771
+
772
+ smalltalk.addMethod(
773
+ "_inlinedSend_with_",
774
+ smalltalk.method({
775
+ selector: "inlinedSend:with:",
776
+ fn: function (inlinedSend,anIRInstruction){
777
+ var self=this;
778
+ var $1,$2,$3;
779
+ var inlinedClosure;
780
+ $1=smalltalk.send(anIRInstruction,"_isClosure",[]);
781
+ if(! smalltalk.assert($1)){
782
+ smalltalk.send(self,"_inliningError_",["Message argument should be a block"]);
783
+ };
784
+ $2=smalltalk.send(smalltalk.send(smalltalk.send(anIRInstruction,"_arguments",[]),"_size",[]),"__eq",[(0)]);
785
+ if(! smalltalk.assert($2)){
786
+ smalltalk.send(self,"_inliningError_",["Inlined block should have zero argument"]);
787
+ };
788
+ inlinedClosure=smalltalk.send(smalltalk.send(self,"_translator",[]),"_visit_",[smalltalk.send(self,"_inlineClosure_",[anIRInstruction])]);
789
+ smalltalk.send(inlinedSend,"_add_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_send",[]),"_instructions",[]),"_first",[])]);
790
+ $3=smalltalk.send(inlinedSend,"_add_",[inlinedClosure]);
791
+ smalltalk.send(smalltalk.send(self,"_send",[]),"_replaceWith_",[inlinedSend]);
792
+ return inlinedSend;
793
+ }
794
+ }),
795
+ smalltalk.IRSendInliner);
796
+
797
+ smalltalk.addMethod(
798
+ "_inlinedSend_with_with_",
799
+ smalltalk.method({
800
+ selector: "inlinedSend:with:with:",
801
+ fn: function (inlinedSend,anIRInstruction,anotherIRInstruction){
802
+ var self=this;
803
+ var $1,$2,$3,$4,$5;
804
+ var inlinedClosure1;
805
+ var inlinedClosure2;
806
+ $1=smalltalk.send(anIRInstruction,"_isClosure",[]);
807
+ if(! smalltalk.assert($1)){
808
+ smalltalk.send(self,"_inliningError_",["Message argument should be a block"]);
809
+ };
810
+ $2=smalltalk.send(smalltalk.send(smalltalk.send(anIRInstruction,"_arguments",[]),"_size",[]),"__eq",[(0)]);
811
+ if(! smalltalk.assert($2)){
812
+ smalltalk.send(self,"_inliningError_",["Inlined block should have zero argument"]);
813
+ };
814
+ $3=smalltalk.send(anotherIRInstruction,"_isClosure",[]);
815
+ if(! smalltalk.assert($3)){
816
+ smalltalk.send(self,"_inliningError_",["Message argument should be a block"]);
817
+ };
818
+ $4=smalltalk.send(smalltalk.send(smalltalk.send(anotherIRInstruction,"_arguments",[]),"_size",[]),"__eq",[(0)]);
819
+ if(! smalltalk.assert($4)){
820
+ smalltalk.send(self,"_inliningError_",["Inlined block should have zero argument"]);
821
+ };
822
+ inlinedClosure1=smalltalk.send(smalltalk.send(self,"_translator",[]),"_visit_",[smalltalk.send(self,"_inlineClosure_",[anIRInstruction])]);
823
+ inlinedClosure2=smalltalk.send(smalltalk.send(self,"_translator",[]),"_visit_",[smalltalk.send(self,"_inlineClosure_",[anotherIRInstruction])]);
824
+ smalltalk.send(inlinedSend,"_add_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_send",[]),"_instructions",[]),"_first",[])]);
825
+ smalltalk.send(inlinedSend,"_add_",[inlinedClosure1]);
826
+ $5=smalltalk.send(inlinedSend,"_add_",[inlinedClosure2]);
827
+ smalltalk.send(smalltalk.send(self,"_send",[]),"_replaceWith_",[inlinedSend]);
828
+ return inlinedSend;
829
+ }
830
+ }),
831
+ smalltalk.IRSendInliner);
832
+
833
+ smalltalk.addMethod(
834
+ "_inlinedSequence",
835
+ smalltalk.method({
836
+ selector: "inlinedSequence",
837
+ fn: function (){
838
+ var self=this;
839
+ var $1;
840
+ $1=smalltalk.send((smalltalk.IRInlinedSequence || IRInlinedSequence),"_new",[]);
841
+ return $1;
842
+ }
843
+ }),
844
+ smalltalk.IRSendInliner);
845
+
846
+ smalltalk.addMethod(
847
+ "_inliningError_",
848
+ smalltalk.method({
849
+ selector: "inliningError:",
850
+ fn: function (aString){
851
+ var self=this;
852
+ smalltalk.send((smalltalk.InliningError || InliningError),"_signal_",[aString]);
853
+ return self}
854
+ }),
855
+ smalltalk.IRSendInliner);
856
+
857
+ smalltalk.addMethod(
858
+ "_send",
859
+ smalltalk.method({
860
+ selector: "send",
861
+ fn: function (){
862
+ var self=this;
863
+ return self["@send"];
864
+ }
865
+ }),
866
+ smalltalk.IRSendInliner);
867
+
868
+ smalltalk.addMethod(
869
+ "_send_",
870
+ smalltalk.method({
871
+ selector: "send:",
872
+ fn: function (anIRSend){
873
+ var self=this;
874
+ self["@send"]=anIRSend;
875
+ return self}
876
+ }),
877
+ smalltalk.IRSendInliner);
878
+
879
+ smalltalk.addMethod(
880
+ "_translator",
881
+ smalltalk.method({
882
+ selector: "translator",
883
+ fn: function (){
884
+ var self=this;
885
+ return self["@translator"];
886
+ }
887
+ }),
888
+ smalltalk.IRSendInliner);
889
+
890
+ smalltalk.addMethod(
891
+ "_translator_",
892
+ smalltalk.method({
893
+ selector: "translator:",
894
+ fn: function (anASTTranslator){
895
+ var self=this;
896
+ self["@translator"]=anASTTranslator;
897
+ return self}
898
+ }),
899
+ smalltalk.IRSendInliner);
900
+
901
+
902
+ smalltalk.addMethod(
903
+ "_inlinedSelectors",
904
+ smalltalk.method({
905
+ selector: "inlinedSelectors",
906
+ fn: function (){
907
+ var self=this;
908
+ return ["ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:", "ifNil:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil"];
909
+ }
910
+ }),
911
+ smalltalk.IRSendInliner.klass);
912
+
913
+ smalltalk.addMethod(
914
+ "_shouldInline_",
915
+ smalltalk.method({
916
+ selector: "shouldInline:",
917
+ fn: function (anIRInstruction){
918
+ var self=this;
919
+ var $1,$2;
920
+ var $early={};
921
+ try {
922
+ $1=smalltalk.send(smalltalk.send(self,"_inlinedSelectors",[]),"_includes_",[smalltalk.send(anIRInstruction,"_selector",[])]);
923
+ if(! smalltalk.assert($1)){
924
+ return false;
925
+ };
926
+ smalltalk.send(smalltalk.send(smalltalk.send(anIRInstruction,"_instructions",[]),"_allButFirst",[]),"_do_",[(function(each){
927
+ $2=smalltalk.send(each,"_isClosure",[]);
928
+ if(! smalltalk.assert($2)){
929
+ throw $early=[false];
930
+ };
931
+ })]);
932
+ return true;
933
+ }
934
+ catch(e) {if(e===$early)return e[0]; throw e}
935
+ }
936
+ }),
937
+ smalltalk.IRSendInliner.klass);
938
+
939
+
940
+ smalltalk.addClass('IRAssignmentInliner', smalltalk.IRSendInliner, ['assignment'], 'Compiler-Inlining');
941
+ smalltalk.addMethod(
942
+ "_assignment",
943
+ smalltalk.method({
944
+ selector: "assignment",
945
+ fn: function (){
946
+ var self=this;
947
+ return self["@assignment"];
948
+ }
949
+ }),
950
+ smalltalk.IRAssignmentInliner);
951
+
952
+ smalltalk.addMethod(
953
+ "_assignment_",
954
+ smalltalk.method({
955
+ selector: "assignment:",
956
+ fn: function (aNode){
957
+ var self=this;
958
+ self["@assignment"]=aNode;
959
+ return self}
960
+ }),
961
+ smalltalk.IRAssignmentInliner);
962
+
963
+ smalltalk.addMethod(
964
+ "_inlineAssignment_",
965
+ smalltalk.method({
966
+ selector: "inlineAssignment:",
967
+ fn: function (anIRAssignment){
968
+ var self=this;
969
+ var inlinedAssignment;
970
+ smalltalk.send(self,"_assignment_",[anIRAssignment]);
971
+ inlinedAssignment=smalltalk.send((smalltalk.IRInlinedAssignment || IRInlinedAssignment),"_new",[]);
972
+ smalltalk.send(smalltalk.send(anIRAssignment,"_instructions",[]),"_do_",[(function(each){
973
+ return smalltalk.send(inlinedAssignment,"_add_",[each]);
974
+ })]);
975
+ smalltalk.send(anIRAssignment,"_replaceWith_",[inlinedAssignment]);
976
+ smalltalk.send(self,"_inlineSend_",[smalltalk.send(smalltalk.send(inlinedAssignment,"_instructions",[]),"_last",[])]);
977
+ return inlinedAssignment;
978
+ }
979
+ }),
980
+ smalltalk.IRAssignmentInliner);
981
+
982
+ smalltalk.addMethod(
983
+ "_inlineClosure_",
984
+ smalltalk.method({
985
+ selector: "inlineClosure:",
986
+ fn: function (anIRClosure){
987
+ var self=this;
988
+ var $1,$2,$3;
989
+ var inlinedClosure;
990
+ var statements;
991
+ inlinedClosure=smalltalk.send(self,"_inlineClosure_",[anIRClosure],smalltalk.IRSendInliner);
992
+ statements=smalltalk.send(smalltalk.send(smalltalk.send(inlinedClosure,"_instructions",[]),"_last",[]),"_instructions",[]);
993
+ smalltalk.send(statements,"_ifNotEmpty_",[(function(){
994
+ $1=smalltalk.send(smalltalk.send(statements,"_last",[]),"_canBeAssigned",[]);
995
+ if(smalltalk.assert($1)){
996
+ $2=smalltalk.send((smalltalk.IRAssignment || IRAssignment),"_new",[]);
997
+ smalltalk.send($2,"_add_",[smalltalk.send(smalltalk.send(smalltalk.send(self,"_assignment",[]),"_instructions",[]),"_first",[])]);
998
+ smalltalk.send($2,"_add_",[smalltalk.send(smalltalk.send(statements,"_last",[]),"_copy",[])]);
999
+ $3=smalltalk.send($2,"_yourself",[]);
1000
+ return smalltalk.send(smalltalk.send(statements,"_last",[]),"_replaceWith_",[$3]);
1001
+ };
1002
+ })]);
1003
+ return inlinedClosure;
1004
+ }
1005
+ }),
1006
+ smalltalk.IRAssignmentInliner);
1007
+
1008
+
1009
+
1010
+ smalltalk.addClass('IRNonLocalReturnInliner', smalltalk.IRSendInliner, [], 'Compiler-Inlining');
1011
+ smalltalk.addMethod(
1012
+ "_inlineClosure_",
1013
+ smalltalk.method({
1014
+ selector: "inlineClosure:",
1015
+ fn: function (anIRClosure){
1016
+ var self=this;
1017
+ var $1;
1018
+ $1=smalltalk.send(self,"_inlineCLosure_",[anIRClosure],smalltalk.IRSendInliner);
1019
+ return $1;
1020
+ }
1021
+ }),
1022
+ smalltalk.IRNonLocalReturnInliner);
1023
+
1024
+ smalltalk.addMethod(
1025
+ "_inlinedReturn",
1026
+ smalltalk.method({
1027
+ selector: "inlinedReturn",
1028
+ fn: function (){
1029
+ var self=this;
1030
+ var $1;
1031
+ $1=smalltalk.send((smalltalk.IRInlinedNonLocalReturn || IRInlinedNonLocalReturn),"_new",[]);
1032
+ return $1;
1033
+ }
1034
+ }),
1035
+ smalltalk.IRNonLocalReturnInliner);
1036
+
1037
+
1038
+
1039
+ smalltalk.addClass('IRReturnInliner', smalltalk.IRSendInliner, [], 'Compiler-Inlining');
1040
+ smalltalk.addMethod(
1041
+ "_inlineClosure_",
1042
+ smalltalk.method({
1043
+ selector: "inlineClosure:",
1044
+ fn: function (anIRClosure){
1045
+ var self=this;
1046
+ var $1,$2,$3;
1047
+ var closure;
1048
+ var statements;
1049
+ closure=smalltalk.send(self,"_inlineClosure_",[anIRClosure],smalltalk.IRSendInliner);
1050
+ statements=smalltalk.send(smalltalk.send(smalltalk.send(closure,"_instructions",[]),"_last",[]),"_instructions",[]);
1051
+ smalltalk.send(statements,"_ifNotEmpty_",[(function(){
1052
+ $1=smalltalk.send(smalltalk.send(statements,"_last",[]),"_isReturn",[]);
1053
+ if(! smalltalk.assert($1)){
1054
+ $2=smalltalk.send((smalltalk.IRReturn || IRReturn),"_new",[]);
1055
+ smalltalk.send($2,"_add_",[smalltalk.send(smalltalk.send(statements,"_last",[]),"_copy",[])]);
1056
+ $3=smalltalk.send($2,"_yourself",[]);
1057
+ return smalltalk.send(smalltalk.send(statements,"_last",[]),"_replaceWith_",[$3]);
1058
+ };
1059
+ })]);
1060
+ return closure;
1061
+ }
1062
+ }),
1063
+ smalltalk.IRReturnInliner);
1064
+
1065
+ smalltalk.addMethod(
1066
+ "_inlineReturn_",
1067
+ smalltalk.method({
1068
+ selector: "inlineReturn:",
1069
+ fn: function (anIRReturn){
1070
+ var self=this;
1071
+ var return_;
1072
+ return_=smalltalk.send(self,"_inlinedReturn",[]);
1073
+ smalltalk.send(smalltalk.send(anIRReturn,"_instructions",[]),"_do_",[(function(each){
1074
+ return smalltalk.send(return_,"_add_",[each]);
1075
+ })]);
1076
+ smalltalk.send(anIRReturn,"_replaceWith_",[return_]);
1077
+ smalltalk.send(self,"_inlineSend_",[smalltalk.send(smalltalk.send(return_,"_instructions",[]),"_last",[])]);
1078
+ return return_;
1079
+ }
1080
+ }),
1081
+ smalltalk.IRReturnInliner);
1082
+
1083
+ smalltalk.addMethod(
1084
+ "_inlinedReturn",
1085
+ smalltalk.method({
1086
+ selector: "inlinedReturn",
1087
+ fn: function (){
1088
+ var self=this;
1089
+ var $1;
1090
+ $1=smalltalk.send((smalltalk.IRInlinedReturn || IRInlinedReturn),"_new",[]);
1091
+ return $1;
1092
+ }
1093
+ }),
1094
+ smalltalk.IRReturnInliner);
1095
+
1096
+
1097
+
1098
+ smalltalk.addClass('InliningCodeGenerator', smalltalk.CodeGenerator, [], 'Compiler-Inlining');
1099
+ smalltalk.addMethod(
1100
+ "_compileNode_",
1101
+ smalltalk.method({
1102
+ selector: "compileNode:",
1103
+ fn: function (aNode){
1104
+ var self=this;
1105
+ var $2,$3,$1;
1106
+ var ir;
1107
+ var stream;
1108
+ smalltalk.send(smalltalk.send(self,"_semanticAnalyzer",[]),"_visit_",[aNode]);
1109
+ ir=smalltalk.send(smalltalk.send(self,"_translator",[]),"_visit_",[aNode]);
1110
+ smalltalk.send(smalltalk.send(self,"_inliner",[]),"_visit_",[ir]);
1111
+ $2=smalltalk.send(self,"_irTranslator",[]);
1112
+ smalltalk.send($2,"_visit_",[ir]);
1113
+ $3=smalltalk.send($2,"_contents",[]);
1114
+ $1=$3;
1115
+ return $1;
1116
+ }
1117
+ }),
1118
+ smalltalk.InliningCodeGenerator);
1119
+
1120
+ smalltalk.addMethod(
1121
+ "_inliner",
1122
+ smalltalk.method({
1123
+ selector: "inliner",
1124
+ fn: function (){
1125
+ var self=this;
1126
+ var $1;
1127
+ $1=smalltalk.send((smalltalk.IRInliner || IRInliner),"_new",[]);
1128
+ return $1;
1129
+ }
1130
+ }),
1131
+ smalltalk.InliningCodeGenerator);
1132
+
1133
+ smalltalk.addMethod(
1134
+ "_irTranslator",
1135
+ smalltalk.method({
1136
+ selector: "irTranslator",
1137
+ fn: function (){
1138
+ var self=this;
1139
+ var $1;
1140
+ $1=smalltalk.send((smalltalk.IRInliningJSTranslator || IRInliningJSTranslator),"_new",[]);
1141
+ return $1;
1142
+ }
1143
+ }),
1144
+ smalltalk.InliningCodeGenerator);
1145
+
1146
+
1147
+