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.
- data/amber/css/amber-normalize.css +73 -73
- data/amber/css/amber-normalize.less +1 -1
- data/amber/css/amber.css +106 -106
- data/amber/css/helios.css +242 -0
- data/amber/images/hsplitter.png +0 -0
- data/amber/images/vsplitter.png +0 -0
- data/amber/js/Benchfib.deploy.js +116 -38
- data/amber/js/Benchfib.js +120 -42
- data/amber/js/Canvas.deploy.js +674 -403
- data/amber/js/Canvas.js +682 -411
- data/amber/js/Compiler-AST.deploy.js +1150 -0
- data/amber/js/Compiler-AST.js +1591 -0
- data/amber/js/Compiler-Core.deploy.js +1562 -0
- data/amber/js/Compiler-Core.js +1972 -0
- data/amber/js/Compiler-Exceptions.deploy.js +114 -0
- data/amber/js/Compiler-Exceptions.js +161 -0
- data/amber/js/Compiler-IR.deploy.js +2326 -0
- data/amber/js/Compiler-IR.js +3146 -0
- data/amber/js/Compiler-Inlining.deploy.js +1147 -0
- data/amber/js/Compiler-Inlining.js +1514 -0
- data/amber/js/Compiler-Semantic.deploy.js +1207 -0
- data/amber/js/Compiler-Semantic.js +1628 -0
- data/amber/js/Compiler-Tests.deploy.js +646 -60
- data/amber/js/Compiler-Tests.js +843 -82
- data/amber/js/Compiler.deploy.js +1097 -159
- data/amber/js/Compiler.js +1414 -161
- data/amber/js/Examples.deploy.js +31 -15
- data/amber/js/Examples.js +33 -17
- data/amber/js/Helios-Announcements.deploy.js +127 -0
- data/amber/js/Helios-Announcements.js +157 -0
- data/amber/js/Helios-Browser.deploy.js +1473 -0
- data/amber/js/Helios-Browser.js +1953 -0
- data/amber/js/Helios-Commands.deploy.js +403 -0
- data/amber/js/Helios-Commands.js +563 -0
- data/amber/js/Helios-Core.deploy.js +1070 -0
- data/amber/js/Helios-Core.js +1445 -0
- data/amber/js/Helios-Environments.deploy.js +132 -0
- data/amber/js/Helios-Environments.js +179 -0
- data/amber/js/Helios-Inspector.deploy.js +855 -0
- data/amber/js/Helios-Inspector.js +1155 -0
- data/amber/js/Helios-KeyBindings.deploy.js +753 -0
- data/amber/js/Helios-KeyBindings.js +1023 -0
- data/amber/js/Helios-Layout.deploy.js +383 -0
- data/amber/js/Helios-Layout.js +523 -0
- data/amber/js/Helios-Workspace.deploy.js +799 -0
- data/amber/js/Helios-Workspace.js +1074 -0
- data/amber/js/IDE.deploy.js +2541 -1490
- data/amber/js/IDE.js +2721 -1660
- data/amber/js/Importer-Exporter.deploy.js +671 -0
- data/amber/js/Importer-Exporter.js +816 -0
- data/amber/js/Kernel-Announcements.deploy.js +137 -20
- data/amber/js/Kernel-Announcements.js +176 -22
- data/amber/js/Kernel-Classes.deploy.js +555 -168
- data/amber/js/Kernel-Classes.js +662 -205
- data/amber/js/Kernel-Collections.deploy.js +1403 -618
- data/amber/js/Kernel-Collections.js +1545 -690
- data/amber/js/Kernel-Exceptions.deploy.js +109 -45
- data/amber/js/Kernel-Exceptions.js +123 -49
- data/amber/js/Kernel-Methods.deploy.js +196 -81
- data/amber/js/Kernel-Methods.js +214 -89
- data/amber/js/Kernel-Objects.deploy.js +1542 -1117
- data/amber/js/Kernel-Objects.js +1593 -1148
- data/amber/js/Kernel-Tests.deploy.js +1725 -772
- data/amber/js/Kernel-Tests.js +2301 -1123
- data/amber/js/Kernel-Transcript.deploy.js +23 -25
- data/amber/js/Kernel-Transcript.js +24 -26
- data/amber/js/SUnit.deploy.js +204 -131
- data/amber/js/SUnit.js +222 -139
- data/amber/js/Spaces.deploy.js +240 -0
- data/amber/js/Spaces.js +326 -0
- data/amber/js/amber.js +26 -7
- data/amber/js/boot.js +65 -47
- data/amber/js/init.js +1 -1
- data/amber/js/lib/CodeMirror/amber.css +21 -21
- data/amber/js/lib/CodeMirror/codemirror.css +119 -13
- data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
- data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
- data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
- data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
- data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
- data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
- data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
- data/amber/st/Compiler-AST.st +505 -0
- data/amber/st/Compiler-Core.st +835 -0
- data/amber/st/Compiler-Exceptions.st +87 -0
- data/amber/st/Compiler-IR.st +1097 -0
- data/amber/st/Compiler-Inlining.st +650 -0
- data/amber/st/Compiler-Semantic.st +558 -0
- data/amber/st/Compiler-Tests.st +285 -381
- data/amber/st/Compiler.st +725 -2
- data/amber/st/Helios-Announcements.st +104 -0
- data/amber/st/Helios-Browser.st +708 -0
- data/amber/st/Helios-Commands.st +223 -0
- data/amber/st/Helios-Core.st +532 -0
- data/amber/st/Helios-Environments.st +98 -0
- data/amber/st/Helios-Inspector.st +367 -0
- data/amber/st/Helios-KeyBindings.st +337 -0
- data/amber/st/Helios-Layout.st +199 -0
- data/amber/st/Helios-Workspace.st +367 -0
- data/amber/st/IDE.st +75 -53
- data/amber/st/Importer-Exporter.st +386 -0
- data/amber/st/Kernel-Announcements.st +92 -0
- data/amber/st/Kernel-Classes.st +137 -15
- data/amber/st/Kernel-Collections.st +137 -47
- data/amber/st/Kernel-Exceptions.st +14 -0
- data/amber/st/Kernel-Methods.st +9 -1
- data/amber/st/Kernel-Objects.st +29 -5
- data/amber/st/Kernel-Tests.st +545 -199
- data/amber/st/SUnit.st +10 -0
- data/amber/st/Spaces.st +142 -0
- data/lib/resin/app.rb +1 -1
- metadata +86 -31
- data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
- data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
data/amber/js/Compiler.js
CHANGED
|
@@ -5,7 +5,7 @@ smalltalk.addMethod(
|
|
|
5
5
|
smalltalk.method({
|
|
6
6
|
selector: "nextChunk",
|
|
7
7
|
category: 'reading',
|
|
8
|
-
fn: function (){
|
|
8
|
+
fn: function () {
|
|
9
9
|
var self=this;
|
|
10
10
|
var $early={};
|
|
11
11
|
try{var char_=nil;
|
|
@@ -28,7 +28,7 @@ smalltalk.addMethod(
|
|
|
28
28
|
smalltalk.method({
|
|
29
29
|
selector: "stream:",
|
|
30
30
|
category: 'accessing',
|
|
31
|
-
fn: function (aStream){
|
|
31
|
+
fn: function (aStream) {
|
|
32
32
|
var self=this;
|
|
33
33
|
(self['@stream']=aStream);
|
|
34
34
|
return self;},
|
|
@@ -45,7 +45,7 @@ smalltalk.addMethod(
|
|
|
45
45
|
smalltalk.method({
|
|
46
46
|
selector: "on:",
|
|
47
47
|
category: 'not yet classified',
|
|
48
|
-
fn: function (aStream){
|
|
48
|
+
fn: function (aStream) {
|
|
49
49
|
var self=this;
|
|
50
50
|
return smalltalk.send(smalltalk.send(self, "_new", []), "_stream_", [aStream]);
|
|
51
51
|
return self;},
|
|
@@ -57,29 +57,45 @@ referencedClasses: []
|
|
|
57
57
|
smalltalk.ChunkParser.klass);
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables'], 'Compiler');
|
|
60
|
+
smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler');
|
|
61
61
|
smalltalk.addMethod(
|
|
62
62
|
"_codeGeneratorClass",
|
|
63
63
|
smalltalk.method({
|
|
64
64
|
selector: "codeGeneratorClass",
|
|
65
65
|
category: 'accessing',
|
|
66
|
-
fn: function (){
|
|
66
|
+
fn: function () {
|
|
67
67
|
var self=this;
|
|
68
|
-
return (smalltalk.FunCodeGenerator || FunCodeGenerator);
|
|
68
|
+
return (($receiver = self['@codeGeneratorClass']) == nil || $receiver == undefined) ? (function(){return (smalltalk.FunCodeGenerator || FunCodeGenerator);})() : $receiver;
|
|
69
69
|
return self;},
|
|
70
70
|
args: [],
|
|
71
|
-
source: "codeGeneratorClass\x0a\x09^FunCodeGenerator",
|
|
72
|
-
messageSends: [],
|
|
71
|
+
source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [FunCodeGenerator]",
|
|
72
|
+
messageSends: ["ifNil:"],
|
|
73
73
|
referencedClasses: ["FunCodeGenerator"]
|
|
74
74
|
}),
|
|
75
75
|
smalltalk.Compiler);
|
|
76
76
|
|
|
77
|
+
smalltalk.addMethod(
|
|
78
|
+
"_codeGeneratorClass_",
|
|
79
|
+
smalltalk.method({
|
|
80
|
+
selector: "codeGeneratorClass:",
|
|
81
|
+
category: 'accessing',
|
|
82
|
+
fn: function (aClass) {
|
|
83
|
+
var self=this;
|
|
84
|
+
(self['@codeGeneratorClass']=aClass);
|
|
85
|
+
return self;},
|
|
86
|
+
args: ["aClass"],
|
|
87
|
+
source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
|
|
88
|
+
messageSends: [],
|
|
89
|
+
referencedClasses: []
|
|
90
|
+
}),
|
|
91
|
+
smalltalk.Compiler);
|
|
92
|
+
|
|
77
93
|
smalltalk.addMethod(
|
|
78
94
|
"_compile_",
|
|
79
95
|
smalltalk.method({
|
|
80
96
|
selector: "compile:",
|
|
81
97
|
category: 'compiling',
|
|
82
|
-
fn: function (aString){
|
|
98
|
+
fn: function (aString) {
|
|
83
99
|
var self=this;
|
|
84
100
|
return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [aString])]);
|
|
85
101
|
return self;},
|
|
@@ -95,7 +111,7 @@ smalltalk.addMethod(
|
|
|
95
111
|
smalltalk.method({
|
|
96
112
|
selector: "compile:forClass:",
|
|
97
113
|
category: 'compiling',
|
|
98
|
-
fn: function (aString, aClass){
|
|
114
|
+
fn: function (aString, aClass) {
|
|
99
115
|
var self=this;
|
|
100
116
|
smalltalk.send(self, "_currentClass_", [aClass]);
|
|
101
117
|
smalltalk.send(self, "_source_", [aString]);
|
|
@@ -113,7 +129,7 @@ smalltalk.addMethod(
|
|
|
113
129
|
smalltalk.method({
|
|
114
130
|
selector: "compileExpression:",
|
|
115
131
|
category: 'compiling',
|
|
116
|
-
fn: function (aString){
|
|
132
|
+
fn: function (aString) {
|
|
117
133
|
var self=this;
|
|
118
134
|
smalltalk.send(self, "_currentClass_", [(smalltalk.DoIt || DoIt)]);
|
|
119
135
|
smalltalk.send(self, "_source_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
|
|
@@ -131,7 +147,7 @@ smalltalk.addMethod(
|
|
|
131
147
|
smalltalk.method({
|
|
132
148
|
selector: "compileNode:",
|
|
133
149
|
category: 'compiling',
|
|
134
|
-
fn: function (aNode){
|
|
150
|
+
fn: function (aNode) {
|
|
135
151
|
var self=this;
|
|
136
152
|
var generator=nil;
|
|
137
153
|
var result=nil;
|
|
@@ -153,7 +169,7 @@ smalltalk.addMethod(
|
|
|
153
169
|
smalltalk.method({
|
|
154
170
|
selector: "currentClass",
|
|
155
171
|
category: 'accessing',
|
|
156
|
-
fn: function (){
|
|
172
|
+
fn: function () {
|
|
157
173
|
var self=this;
|
|
158
174
|
return self['@currentClass'];
|
|
159
175
|
return self;},
|
|
@@ -169,7 +185,7 @@ smalltalk.addMethod(
|
|
|
169
185
|
smalltalk.method({
|
|
170
186
|
selector: "currentClass:",
|
|
171
187
|
category: 'accessing',
|
|
172
|
-
fn: function (aClass){
|
|
188
|
+
fn: function (aClass) {
|
|
173
189
|
var self=this;
|
|
174
190
|
(self['@currentClass']=aClass);
|
|
175
191
|
return self;},
|
|
@@ -185,7 +201,7 @@ smalltalk.addMethod(
|
|
|
185
201
|
smalltalk.method({
|
|
186
202
|
selector: "eval:",
|
|
187
203
|
category: 'compiling',
|
|
188
|
-
fn: function (aString){
|
|
204
|
+
fn: function (aString) {
|
|
189
205
|
var self=this;
|
|
190
206
|
return eval(aString);
|
|
191
207
|
return self;},
|
|
@@ -201,7 +217,7 @@ smalltalk.addMethod(
|
|
|
201
217
|
smalltalk.method({
|
|
202
218
|
selector: "evaluateExpression:",
|
|
203
219
|
category: 'compiling',
|
|
204
|
-
fn: function (aString){
|
|
220
|
+
fn: function (aString) {
|
|
205
221
|
var self=this;
|
|
206
222
|
var result=nil;
|
|
207
223
|
smalltalk.send((smalltalk.DoIt || DoIt), "_addCompiledMethod_", [smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compileExpression_", [aString])])]);
|
|
@@ -221,7 +237,7 @@ smalltalk.addMethod(
|
|
|
221
237
|
smalltalk.method({
|
|
222
238
|
selector: "install:forClass:category:",
|
|
223
239
|
category: 'compiling',
|
|
224
|
-
fn: function (aString, aBehavior, anotherString){
|
|
240
|
+
fn: function (aString, aBehavior, anotherString) {
|
|
225
241
|
var self=this;
|
|
226
242
|
var compiled=nil;
|
|
227
243
|
(compiled=smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compile_forClass_", [aString, aBehavior])]));
|
|
@@ -241,7 +257,7 @@ smalltalk.addMethod(
|
|
|
241
257
|
smalltalk.method({
|
|
242
258
|
selector: "parse:",
|
|
243
259
|
category: 'compiling',
|
|
244
|
-
fn: function (aString){
|
|
260
|
+
fn: function (aString) {
|
|
245
261
|
var self=this;
|
|
246
262
|
return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_parse_", [aString]);
|
|
247
263
|
return self;},
|
|
@@ -257,7 +273,7 @@ smalltalk.addMethod(
|
|
|
257
273
|
smalltalk.method({
|
|
258
274
|
selector: "parseExpression:",
|
|
259
275
|
category: 'compiling',
|
|
260
|
-
fn: function (aString){
|
|
276
|
+
fn: function (aString) {
|
|
261
277
|
var self=this;
|
|
262
278
|
return smalltalk.send(self, "_parse_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
|
|
263
279
|
return self;},
|
|
@@ -273,7 +289,7 @@ smalltalk.addMethod(
|
|
|
273
289
|
smalltalk.method({
|
|
274
290
|
selector: "recompile:",
|
|
275
291
|
category: 'compiling',
|
|
276
|
-
fn: function (aClass){
|
|
292
|
+
fn: function (aClass) {
|
|
277
293
|
var self=this;
|
|
278
294
|
smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(self, "_install_forClass_category_", [smalltalk.send(each, "_source", []), aClass, smalltalk.send(each, "_category", [])]);})]);
|
|
279
295
|
smalltalk.send(self, "_setupClass_", [aClass]);
|
|
@@ -291,7 +307,7 @@ smalltalk.addMethod(
|
|
|
291
307
|
smalltalk.method({
|
|
292
308
|
selector: "recompileAll",
|
|
293
309
|
category: 'compiling',
|
|
294
|
-
fn: function (){
|
|
310
|
+
fn: function () {
|
|
295
311
|
var self=this;
|
|
296
312
|
smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){(function($rec){smalltalk.send($rec, "_show_", [each]);return smalltalk.send($rec, "_cr", []);})((smalltalk.Transcript || Transcript));return smalltalk.send((function(){return smalltalk.send(self, "_recompile_", [each]);}), "_valueWithTimeout_", [(100)]);})]);
|
|
297
313
|
return self;},
|
|
@@ -307,7 +323,7 @@ smalltalk.addMethod(
|
|
|
307
323
|
smalltalk.method({
|
|
308
324
|
selector: "setupClass:",
|
|
309
325
|
category: 'compiling',
|
|
310
|
-
fn: function (aClass){
|
|
326
|
+
fn: function (aClass) {
|
|
311
327
|
var self=this;
|
|
312
328
|
smalltalk.init(aClass);
|
|
313
329
|
return self;},
|
|
@@ -323,7 +339,7 @@ smalltalk.addMethod(
|
|
|
323
339
|
smalltalk.method({
|
|
324
340
|
selector: "source",
|
|
325
341
|
category: 'accessing',
|
|
326
|
-
fn: function (){
|
|
342
|
+
fn: function () {
|
|
327
343
|
var self=this;
|
|
328
344
|
return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
|
|
329
345
|
return self;},
|
|
@@ -339,7 +355,7 @@ smalltalk.addMethod(
|
|
|
339
355
|
smalltalk.method({
|
|
340
356
|
selector: "source:",
|
|
341
357
|
category: 'accessing',
|
|
342
|
-
fn: function (aString){
|
|
358
|
+
fn: function (aString) {
|
|
343
359
|
var self=this;
|
|
344
360
|
(self['@source']=aString);
|
|
345
361
|
return self;},
|
|
@@ -355,7 +371,7 @@ smalltalk.addMethod(
|
|
|
355
371
|
smalltalk.method({
|
|
356
372
|
selector: "unknownVariables",
|
|
357
373
|
category: 'accessing',
|
|
358
|
-
fn: function (){
|
|
374
|
+
fn: function () {
|
|
359
375
|
var self=this;
|
|
360
376
|
return self['@unknownVariables'];
|
|
361
377
|
return self;},
|
|
@@ -371,7 +387,7 @@ smalltalk.addMethod(
|
|
|
371
387
|
smalltalk.method({
|
|
372
388
|
selector: "unknownVariables:",
|
|
373
389
|
category: 'accessing',
|
|
374
|
-
fn: function (aCollection){
|
|
390
|
+
fn: function (aCollection) {
|
|
375
391
|
var self=this;
|
|
376
392
|
(self['@unknownVariables']=aCollection);
|
|
377
393
|
return self;},
|
|
@@ -388,7 +404,7 @@ smalltalk.addMethod(
|
|
|
388
404
|
smalltalk.method({
|
|
389
405
|
selector: "recompile:",
|
|
390
406
|
category: 'compiling',
|
|
391
|
-
fn: function (aClass){
|
|
407
|
+
fn: function (aClass) {
|
|
392
408
|
var self=this;
|
|
393
409
|
smalltalk.send(smalltalk.send(self, "_new", []), "_recompile_", [aClass]);
|
|
394
410
|
return self;},
|
|
@@ -404,7 +420,7 @@ smalltalk.addMethod(
|
|
|
404
420
|
smalltalk.method({
|
|
405
421
|
selector: "recompileAll",
|
|
406
422
|
category: 'compiling',
|
|
407
|
-
fn: function (){
|
|
423
|
+
fn: function () {
|
|
408
424
|
var self=this;
|
|
409
425
|
smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_recompile_", [each]);})]);
|
|
410
426
|
return self;},
|
|
@@ -425,7 +441,7 @@ smalltalk.addMethod(
|
|
|
425
441
|
smalltalk.method({
|
|
426
442
|
selector: "classNameFor:",
|
|
427
443
|
category: 'private',
|
|
428
|
-
fn: function (aClass){
|
|
444
|
+
fn: function (aClass) {
|
|
429
445
|
var self=this;
|
|
430
446
|
return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
|
|
431
447
|
return self;},
|
|
@@ -441,7 +457,7 @@ smalltalk.addMethod(
|
|
|
441
457
|
smalltalk.method({
|
|
442
458
|
selector: "exportAll",
|
|
443
459
|
category: 'fileOut',
|
|
444
|
-
fn: function (){
|
|
460
|
+
fn: function () {
|
|
445
461
|
var self=this;
|
|
446
462
|
return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packages", []), "_do_", [(function(pkg){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportPackage_", [smalltalk.send(pkg, "_name", [])])]);})]);})]);
|
|
447
463
|
return self;},
|
|
@@ -457,7 +473,7 @@ smalltalk.addMethod(
|
|
|
457
473
|
smalltalk.method({
|
|
458
474
|
selector: "exportClass:",
|
|
459
475
|
category: 'fileOut',
|
|
460
|
-
fn: function (aClass){
|
|
476
|
+
fn: function (aClass) {
|
|
461
477
|
var self=this;
|
|
462
478
|
return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){smalltalk.send(self, "_exportDefinitionOf_on_", [aClass, stream]);smalltalk.send(self, "_exportMethodsOf_on_", [aClass, stream]);smalltalk.send(self, "_exportMetaDefinitionOf_on_", [aClass, stream]);return smalltalk.send(self, "_exportMethodsOf_on_", [smalltalk.send(aClass, "_class", []), stream]);})]);
|
|
463
479
|
return self;},
|
|
@@ -473,7 +489,7 @@ smalltalk.addMethod(
|
|
|
473
489
|
smalltalk.method({
|
|
474
490
|
selector: "exportDefinitionOf:on:",
|
|
475
491
|
category: 'private',
|
|
476
|
-
fn: function (aClass, aStream){
|
|
492
|
+
fn: function (aClass, aStream) {
|
|
477
493
|
var self=this;
|
|
478
494
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addClass("]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", ["', "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [", ["]);})(aStream);
|
|
479
495
|
smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [", "]);})]);
|
|
@@ -493,7 +509,7 @@ smalltalk.addMethod(
|
|
|
493
509
|
smalltalk.method({
|
|
494
510
|
selector: "exportMetaDefinitionOf:on:",
|
|
495
511
|
category: 'private',
|
|
496
|
-
fn: function (aClass, aStream){
|
|
512
|
+
fn: function (aClass, aStream) {
|
|
497
513
|
var self=this;
|
|
498
514
|
((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [".iVarNames = ["]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [","]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send("];", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [".iVarNames = ["]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [","]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send("];", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])])]);})]));
|
|
499
515
|
return self;},
|
|
@@ -509,7 +525,7 @@ smalltalk.addMethod(
|
|
|
509
525
|
smalltalk.method({
|
|
510
526
|
selector: "exportMethod:of:on:",
|
|
511
527
|
category: 'private',
|
|
512
|
-
fn: function (aMethod, aClass, aStream){
|
|
528
|
+
fn: function (aMethod, aClass, aStream) {
|
|
513
529
|
var self=this;
|
|
514
530
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addMethod("]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("category: '", "__comma", [smalltalk.send(aMethod, "_category", [])]), "__comma", ["',"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_arguments", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("messageSends: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("referencedClasses: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_referencedClasses", []), "_asJavascript", [])])]);})(aStream);
|
|
515
531
|
(function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["}),"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [");"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
|
|
@@ -526,7 +542,7 @@ smalltalk.addMethod(
|
|
|
526
542
|
smalltalk.method({
|
|
527
543
|
selector: "exportMethodsOf:on:",
|
|
528
544
|
category: 'private',
|
|
529
|
-
fn: function (aClass, aStream){
|
|
545
|
+
fn: function (aClass, aStream) {
|
|
530
546
|
var self=this;
|
|
531
547
|
smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(each){return ((($receiver = smalltalk.send(smalltalk.send(each, "_category", []), "_match_", ["^\x5c*"])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]));})]);
|
|
532
548
|
smalltalk.send(aStream, "_lf", []);
|
|
@@ -543,7 +559,7 @@ smalltalk.addMethod(
|
|
|
543
559
|
smalltalk.method({
|
|
544
560
|
selector: "exportPackage:",
|
|
545
561
|
category: 'fileOut',
|
|
546
|
-
fn: function (packageName){
|
|
562
|
+
fn: function (packageName) {
|
|
547
563
|
var self=this;
|
|
548
564
|
var package=nil;
|
|
549
565
|
return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){(package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_packageAt_", [packageName]));smalltalk.send(self, "_exportPackageDefinitionOf_on_", [package, stream]);smalltalk.send(smalltalk.send(smalltalk.send(package, "_sortedClasses", []), "_asSet", []), "_do_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_exportClass_", [each])]);})]);return smalltalk.send(self, "_exportPackageExtensionsOf_on_", [package, stream]);})]);
|
|
@@ -560,7 +576,7 @@ smalltalk.addMethod(
|
|
|
560
576
|
smalltalk.method({
|
|
561
577
|
selector: "exportPackageDefinitionOf:on:",
|
|
562
578
|
category: 'private',
|
|
563
|
-
fn: function (package, aStream){
|
|
579
|
+
fn: function (package, aStream) {
|
|
564
580
|
var self=this;
|
|
565
581
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addPackage("]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("'", "__comma", [smalltalk.send(package, "_name", [])]), "__comma", ["', "]), "__comma", [smalltalk.send(package, "_propertiesAsJSON", [])]), "__comma", [");"])]);})(aStream);
|
|
566
582
|
smalltalk.send(aStream, "_lf", []);
|
|
@@ -577,7 +593,7 @@ smalltalk.addMethod(
|
|
|
577
593
|
smalltalk.method({
|
|
578
594
|
selector: "exportPackageExtensionsOf:on:",
|
|
579
595
|
category: 'private',
|
|
580
|
-
fn: function (package, aStream){
|
|
596
|
+
fn: function (package, aStream) {
|
|
581
597
|
var self=this;
|
|
582
598
|
var name=nil;
|
|
583
599
|
(name=smalltalk.send(package, "_name", []));
|
|
@@ -598,7 +614,7 @@ smalltalk.addMethod(
|
|
|
598
614
|
smalltalk.method({
|
|
599
615
|
selector: "chunkEscape:",
|
|
600
616
|
category: 'not yet classified',
|
|
601
|
-
fn: function (aString){
|
|
617
|
+
fn: function (aString) {
|
|
602
618
|
var self=this;
|
|
603
619
|
return smalltalk.send(smalltalk.send(aString, "_replace_with_", ["!", "!!"]), "_trimBoth", []);
|
|
604
620
|
return self;},
|
|
@@ -614,7 +630,7 @@ smalltalk.addMethod(
|
|
|
614
630
|
smalltalk.method({
|
|
615
631
|
selector: "classNameFor:",
|
|
616
632
|
category: 'not yet classified',
|
|
617
|
-
fn: function (aClass){
|
|
633
|
+
fn: function (aClass) {
|
|
618
634
|
var self=this;
|
|
619
635
|
return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [" class"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [" class"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
|
|
620
636
|
return self;},
|
|
@@ -630,7 +646,7 @@ smalltalk.addMethod(
|
|
|
630
646
|
smalltalk.method({
|
|
631
647
|
selector: "exportDefinitionOf:on:",
|
|
632
648
|
category: 'not yet classified',
|
|
633
|
-
fn: function (aClass, aStream){
|
|
649
|
+
fn: function (aClass, aStream) {
|
|
634
650
|
var self=this;
|
|
635
651
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(" subclass: #", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["\x09instanceVariableNames: '"]);})(aStream);
|
|
636
652
|
smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);
|
|
@@ -650,7 +666,7 @@ smalltalk.addMethod(
|
|
|
650
666
|
smalltalk.method({
|
|
651
667
|
selector: "exportMetaDefinitionOf:on:",
|
|
652
668
|
category: 'not yet classified',
|
|
653
|
-
fn: function (aClass, aStream){
|
|
669
|
+
fn: function (aClass, aStream) {
|
|
654
670
|
var self=this;
|
|
655
671
|
((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])]);return smalltalk.send($rec, "_nextPutAll_", [" instanceVariableNames: '"]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["'!"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])]);return smalltalk.send($rec, "_nextPutAll_", [" instanceVariableNames: '"]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["'!"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);})]));
|
|
656
672
|
return self;},
|
|
@@ -666,7 +682,7 @@ smalltalk.addMethod(
|
|
|
666
682
|
smalltalk.method({
|
|
667
683
|
selector: "exportMethod:of:on:",
|
|
668
684
|
category: 'not yet classified',
|
|
669
|
-
fn: function (aMethod, aClass, aStream){
|
|
685
|
+
fn: function (aMethod, aClass, aStream) {
|
|
670
686
|
var self=this;
|
|
671
687
|
(function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aMethod, "_source", [])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["!"]);})(aStream);
|
|
672
688
|
return self;},
|
|
@@ -682,7 +698,7 @@ smalltalk.addMethod(
|
|
|
682
698
|
smalltalk.method({
|
|
683
699
|
selector: "exportMethods:category:of:on:",
|
|
684
700
|
category: 'not yet classified',
|
|
685
|
-
fn: function (methods, category, aClass, aStream){
|
|
701
|
+
fn: function (methods, category, aClass, aStream) {
|
|
686
702
|
var self=this;
|
|
687
703
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("!", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(" methodsFor: '", "__comma", [category]), "__comma", ["'!"])]);})(aStream);
|
|
688
704
|
smalltalk.send(smalltalk.send(methods, "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(b, "_selector", [])]));})]), "_do_", [(function(each){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]);
|
|
@@ -700,7 +716,7 @@ smalltalk.addMethod(
|
|
|
700
716
|
smalltalk.method({
|
|
701
717
|
selector: "exportMethodsOf:on:",
|
|
702
718
|
category: 'not yet classified',
|
|
703
|
-
fn: function (aClass, aStream){
|
|
719
|
+
fn: function (aClass, aStream) {
|
|
704
720
|
var self=this;
|
|
705
721
|
var map=nil;
|
|
706
722
|
(map=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
|
|
@@ -720,7 +736,7 @@ smalltalk.addMethod(
|
|
|
720
736
|
smalltalk.method({
|
|
721
737
|
selector: "exportPackageDefinitionOf:on:",
|
|
722
738
|
category: 'not yet classified',
|
|
723
|
-
fn: function (package, aStream){
|
|
739
|
+
fn: function (package, aStream) {
|
|
724
740
|
var self=this;
|
|
725
741
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Smalltalk current createPackage: '", "__comma", [smalltalk.send(package, "_name", [])]), "__comma", ["' properties: "]), "__comma", [smalltalk.send(smalltalk.send(package, "_properties", []), "_storeString", [])]), "__comma", ["!"])]);return smalltalk.send($rec, "_lf", []);})(aStream);
|
|
726
742
|
return self;},
|
|
@@ -736,7 +752,7 @@ smalltalk.addMethod(
|
|
|
736
752
|
smalltalk.method({
|
|
737
753
|
selector: "exportPackageExtensionsOf:on:",
|
|
738
754
|
category: 'not yet classified',
|
|
739
|
-
fn: function (package, aStream){
|
|
755
|
+
fn: function (package, aStream) {
|
|
740
756
|
var self=this;
|
|
741
757
|
var name=nil;
|
|
742
758
|
var map=nil;
|
|
@@ -759,7 +775,7 @@ smalltalk.addMethod(
|
|
|
759
775
|
smalltalk.method({
|
|
760
776
|
selector: "exportDefinitionOf:on:",
|
|
761
777
|
category: 'private',
|
|
762
|
-
fn: function (aClass, aStream){
|
|
778
|
+
fn: function (aClass, aStream) {
|
|
763
779
|
var self=this;
|
|
764
780
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addClass("]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", ["', "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [", ["]);})(aStream);
|
|
765
781
|
smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send("'", "__comma", [each]), "__comma", ["'"])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [", "]);})]);
|
|
@@ -778,7 +794,7 @@ smalltalk.addMethod(
|
|
|
778
794
|
smalltalk.method({
|
|
779
795
|
selector: "exportMethod:of:on:",
|
|
780
796
|
category: 'private',
|
|
781
|
-
fn: function (aMethod, aClass, aStream){
|
|
797
|
+
fn: function (aMethod, aClass, aStream) {
|
|
782
798
|
var self=this;
|
|
783
799
|
(function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.addMethod("]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["}),"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [");"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
|
|
784
800
|
return self;},
|
|
@@ -797,7 +813,7 @@ smalltalk.addMethod(
|
|
|
797
813
|
smalltalk.method({
|
|
798
814
|
selector: "import:",
|
|
799
815
|
category: 'fileIn',
|
|
800
|
-
fn: function (aStream){
|
|
816
|
+
fn: function (aStream) {
|
|
801
817
|
var self=this;
|
|
802
818
|
var chunk=nil;
|
|
803
819
|
var result=nil;
|
|
@@ -822,7 +838,7 @@ smalltalk.addMethod(
|
|
|
822
838
|
smalltalk.method({
|
|
823
839
|
selector: "accept:",
|
|
824
840
|
category: 'visiting',
|
|
825
|
-
fn: function (aVisitor){
|
|
841
|
+
fn: function (aVisitor) {
|
|
826
842
|
var self=this;
|
|
827
843
|
smalltalk.send(aVisitor, "_visitNode_", [self]);
|
|
828
844
|
return self;},
|
|
@@ -838,7 +854,7 @@ smalltalk.addMethod(
|
|
|
838
854
|
smalltalk.method({
|
|
839
855
|
selector: "addNode:",
|
|
840
856
|
category: 'accessing',
|
|
841
|
-
fn: function (aNode){
|
|
857
|
+
fn: function (aNode) {
|
|
842
858
|
var self=this;
|
|
843
859
|
smalltalk.send(smalltalk.send(self, "_nodes", []), "_add_", [aNode]);
|
|
844
860
|
return self;},
|
|
@@ -854,7 +870,7 @@ smalltalk.addMethod(
|
|
|
854
870
|
smalltalk.method({
|
|
855
871
|
selector: "isBlockNode",
|
|
856
872
|
category: 'testing',
|
|
857
|
-
fn: function (){
|
|
873
|
+
fn: function () {
|
|
858
874
|
var self=this;
|
|
859
875
|
return false;
|
|
860
876
|
return self;},
|
|
@@ -870,7 +886,7 @@ smalltalk.addMethod(
|
|
|
870
886
|
smalltalk.method({
|
|
871
887
|
selector: "isBlockSequenceNode",
|
|
872
888
|
category: 'testing',
|
|
873
|
-
fn: function (){
|
|
889
|
+
fn: function () {
|
|
874
890
|
var self=this;
|
|
875
891
|
return false;
|
|
876
892
|
return self;},
|
|
@@ -886,7 +902,7 @@ smalltalk.addMethod(
|
|
|
886
902
|
smalltalk.method({
|
|
887
903
|
selector: "isValueNode",
|
|
888
904
|
category: 'testing',
|
|
889
|
-
fn: function (){
|
|
905
|
+
fn: function () {
|
|
890
906
|
var self=this;
|
|
891
907
|
return false;
|
|
892
908
|
return self;},
|
|
@@ -902,7 +918,7 @@ smalltalk.addMethod(
|
|
|
902
918
|
smalltalk.method({
|
|
903
919
|
selector: "nodes",
|
|
904
920
|
category: 'accessing',
|
|
905
|
-
fn: function (){
|
|
921
|
+
fn: function () {
|
|
906
922
|
var self=this;
|
|
907
923
|
return (($receiver = self['@nodes']) == nil || $receiver == undefined) ? (function(){return (self['@nodes']=smalltalk.send((smalltalk.Array || Array), "_new", []));})() : $receiver;
|
|
908
924
|
return self;},
|
|
@@ -918,7 +934,7 @@ smalltalk.addMethod(
|
|
|
918
934
|
smalltalk.method({
|
|
919
935
|
selector: "nodes:",
|
|
920
936
|
category: 'building',
|
|
921
|
-
fn: function (aCollection){
|
|
937
|
+
fn: function (aCollection) {
|
|
922
938
|
var self=this;
|
|
923
939
|
(self['@nodes']=aCollection);
|
|
924
940
|
return self;},
|
|
@@ -937,7 +953,7 @@ smalltalk.addMethod(
|
|
|
937
953
|
smalltalk.method({
|
|
938
954
|
selector: "accept:",
|
|
939
955
|
category: 'visiting',
|
|
940
|
-
fn: function (aVisitor){
|
|
956
|
+
fn: function (aVisitor) {
|
|
941
957
|
var self=this;
|
|
942
958
|
smalltalk.send(aVisitor, "_visitAssignmentNode_", [self]);
|
|
943
959
|
return self;},
|
|
@@ -953,7 +969,7 @@ smalltalk.addMethod(
|
|
|
953
969
|
smalltalk.method({
|
|
954
970
|
selector: "left",
|
|
955
971
|
category: 'accessing',
|
|
956
|
-
fn: function (){
|
|
972
|
+
fn: function () {
|
|
957
973
|
var self=this;
|
|
958
974
|
return self['@left'];
|
|
959
975
|
return self;},
|
|
@@ -969,7 +985,7 @@ smalltalk.addMethod(
|
|
|
969
985
|
smalltalk.method({
|
|
970
986
|
selector: "left:",
|
|
971
987
|
category: 'accessing',
|
|
972
|
-
fn: function (aNode){
|
|
988
|
+
fn: function (aNode) {
|
|
973
989
|
var self=this;
|
|
974
990
|
(self['@left']=aNode);
|
|
975
991
|
smalltalk.send(self['@left'], "_assigned_", [true]);
|
|
@@ -986,7 +1002,7 @@ smalltalk.addMethod(
|
|
|
986
1002
|
smalltalk.method({
|
|
987
1003
|
selector: "right",
|
|
988
1004
|
category: 'accessing',
|
|
989
|
-
fn: function (){
|
|
1005
|
+
fn: function () {
|
|
990
1006
|
var self=this;
|
|
991
1007
|
return self['@right'];
|
|
992
1008
|
return self;},
|
|
@@ -1002,7 +1018,7 @@ smalltalk.addMethod(
|
|
|
1002
1018
|
smalltalk.method({
|
|
1003
1019
|
selector: "right:",
|
|
1004
1020
|
category: 'accessing',
|
|
1005
|
-
fn: function (aNode){
|
|
1021
|
+
fn: function (aNode) {
|
|
1006
1022
|
var self=this;
|
|
1007
1023
|
(self['@right']=aNode);
|
|
1008
1024
|
return self;},
|
|
@@ -1021,7 +1037,7 @@ smalltalk.addMethod(
|
|
|
1021
1037
|
smalltalk.method({
|
|
1022
1038
|
selector: "accept:",
|
|
1023
1039
|
category: 'visiting',
|
|
1024
|
-
fn: function (aVisitor){
|
|
1040
|
+
fn: function (aVisitor) {
|
|
1025
1041
|
var self=this;
|
|
1026
1042
|
smalltalk.send(aVisitor, "_visitBlockNode_", [self]);
|
|
1027
1043
|
return self;},
|
|
@@ -1037,7 +1053,7 @@ smalltalk.addMethod(
|
|
|
1037
1053
|
smalltalk.method({
|
|
1038
1054
|
selector: "inlined",
|
|
1039
1055
|
category: 'accessing',
|
|
1040
|
-
fn: function (){
|
|
1056
|
+
fn: function () {
|
|
1041
1057
|
var self=this;
|
|
1042
1058
|
return (($receiver = self['@inlined']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
|
|
1043
1059
|
return self;},
|
|
@@ -1053,7 +1069,7 @@ smalltalk.addMethod(
|
|
|
1053
1069
|
smalltalk.method({
|
|
1054
1070
|
selector: "inlined:",
|
|
1055
1071
|
category: 'accessing',
|
|
1056
|
-
fn: function (aBoolean){
|
|
1072
|
+
fn: function (aBoolean) {
|
|
1057
1073
|
var self=this;
|
|
1058
1074
|
(self['@inlined']=aBoolean);
|
|
1059
1075
|
return self;},
|
|
@@ -1069,7 +1085,7 @@ smalltalk.addMethod(
|
|
|
1069
1085
|
smalltalk.method({
|
|
1070
1086
|
selector: "isBlockNode",
|
|
1071
1087
|
category: 'testing',
|
|
1072
|
-
fn: function (){
|
|
1088
|
+
fn: function () {
|
|
1073
1089
|
var self=this;
|
|
1074
1090
|
return true;
|
|
1075
1091
|
return self;},
|
|
@@ -1085,7 +1101,7 @@ smalltalk.addMethod(
|
|
|
1085
1101
|
smalltalk.method({
|
|
1086
1102
|
selector: "parameters",
|
|
1087
1103
|
category: 'accessing',
|
|
1088
|
-
fn: function (){
|
|
1104
|
+
fn: function () {
|
|
1089
1105
|
var self=this;
|
|
1090
1106
|
return (($receiver = self['@parameters']) == nil || $receiver == undefined) ? (function(){return (self['@parameters']=smalltalk.send((smalltalk.Array || Array), "_new", []));})() : $receiver;
|
|
1091
1107
|
return self;},
|
|
@@ -1101,7 +1117,7 @@ smalltalk.addMethod(
|
|
|
1101
1117
|
smalltalk.method({
|
|
1102
1118
|
selector: "parameters:",
|
|
1103
1119
|
category: 'accessing',
|
|
1104
|
-
fn: function (aCollection){
|
|
1120
|
+
fn: function (aCollection) {
|
|
1105
1121
|
var self=this;
|
|
1106
1122
|
(self['@parameters']=aCollection);
|
|
1107
1123
|
return self;},
|
|
@@ -1120,7 +1136,7 @@ smalltalk.addMethod(
|
|
|
1120
1136
|
smalltalk.method({
|
|
1121
1137
|
selector: "accept:",
|
|
1122
1138
|
category: 'visiting',
|
|
1123
|
-
fn: function (aVisitor){
|
|
1139
|
+
fn: function (aVisitor) {
|
|
1124
1140
|
var self=this;
|
|
1125
1141
|
smalltalk.send(aVisitor, "_visitCascadeNode_", [self]);
|
|
1126
1142
|
return self;},
|
|
@@ -1136,7 +1152,7 @@ smalltalk.addMethod(
|
|
|
1136
1152
|
smalltalk.method({
|
|
1137
1153
|
selector: "receiver",
|
|
1138
1154
|
category: 'accessing',
|
|
1139
|
-
fn: function (){
|
|
1155
|
+
fn: function () {
|
|
1140
1156
|
var self=this;
|
|
1141
1157
|
return self['@receiver'];
|
|
1142
1158
|
return self;},
|
|
@@ -1152,7 +1168,7 @@ smalltalk.addMethod(
|
|
|
1152
1168
|
smalltalk.method({
|
|
1153
1169
|
selector: "receiver:",
|
|
1154
1170
|
category: 'accessing',
|
|
1155
|
-
fn: function (aNode){
|
|
1171
|
+
fn: function (aNode) {
|
|
1156
1172
|
var self=this;
|
|
1157
1173
|
(self['@receiver']=aNode);
|
|
1158
1174
|
return self;},
|
|
@@ -1171,7 +1187,7 @@ smalltalk.addMethod(
|
|
|
1171
1187
|
smalltalk.method({
|
|
1172
1188
|
selector: "accept:",
|
|
1173
1189
|
category: 'visiting',
|
|
1174
|
-
fn: function (aVisitor){
|
|
1190
|
+
fn: function (aVisitor) {
|
|
1175
1191
|
var self=this;
|
|
1176
1192
|
smalltalk.send(aVisitor, "_visitDynamicArrayNode_", [self]);
|
|
1177
1193
|
return self;},
|
|
@@ -1190,7 +1206,7 @@ smalltalk.addMethod(
|
|
|
1190
1206
|
smalltalk.method({
|
|
1191
1207
|
selector: "accept:",
|
|
1192
1208
|
category: 'visiting',
|
|
1193
|
-
fn: function (aVisitor){
|
|
1209
|
+
fn: function (aVisitor) {
|
|
1194
1210
|
var self=this;
|
|
1195
1211
|
smalltalk.send(aVisitor, "_visitDynamicDictionaryNode_", [self]);
|
|
1196
1212
|
return self;},
|
|
@@ -1209,7 +1225,7 @@ smalltalk.addMethod(
|
|
|
1209
1225
|
smalltalk.method({
|
|
1210
1226
|
selector: "accept:",
|
|
1211
1227
|
category: 'visiting',
|
|
1212
|
-
fn: function (aVisitor){
|
|
1228
|
+
fn: function (aVisitor) {
|
|
1213
1229
|
var self=this;
|
|
1214
1230
|
smalltalk.send(aVisitor, "_visitJSStatementNode_", [self]);
|
|
1215
1231
|
return self;},
|
|
@@ -1225,7 +1241,7 @@ smalltalk.addMethod(
|
|
|
1225
1241
|
smalltalk.method({
|
|
1226
1242
|
selector: "source",
|
|
1227
1243
|
category: 'accessing',
|
|
1228
|
-
fn: function (){
|
|
1244
|
+
fn: function () {
|
|
1229
1245
|
var self=this;
|
|
1230
1246
|
return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
|
|
1231
1247
|
return self;},
|
|
@@ -1241,7 +1257,7 @@ smalltalk.addMethod(
|
|
|
1241
1257
|
smalltalk.method({
|
|
1242
1258
|
selector: "source:",
|
|
1243
1259
|
category: 'accessing',
|
|
1244
|
-
fn: function (aString){
|
|
1260
|
+
fn: function (aString) {
|
|
1245
1261
|
var self=this;
|
|
1246
1262
|
(self['@source']=aString);
|
|
1247
1263
|
return self;},
|
|
@@ -1260,7 +1276,7 @@ smalltalk.addMethod(
|
|
|
1260
1276
|
smalltalk.method({
|
|
1261
1277
|
selector: "accept:",
|
|
1262
1278
|
category: 'visiting',
|
|
1263
|
-
fn: function (aVisitor){
|
|
1279
|
+
fn: function (aVisitor) {
|
|
1264
1280
|
var self=this;
|
|
1265
1281
|
smalltalk.send(aVisitor, "_visitMethodNode_", [self]);
|
|
1266
1282
|
return self;},
|
|
@@ -1276,7 +1292,7 @@ smalltalk.addMethod(
|
|
|
1276
1292
|
smalltalk.method({
|
|
1277
1293
|
selector: "arguments",
|
|
1278
1294
|
category: 'accessing',
|
|
1279
|
-
fn: function (){
|
|
1295
|
+
fn: function () {
|
|
1280
1296
|
var self=this;
|
|
1281
1297
|
return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
|
|
1282
1298
|
return self;},
|
|
@@ -1292,7 +1308,7 @@ smalltalk.addMethod(
|
|
|
1292
1308
|
smalltalk.method({
|
|
1293
1309
|
selector: "arguments:",
|
|
1294
1310
|
category: 'accessing',
|
|
1295
|
-
fn: function (aCollection){
|
|
1311
|
+
fn: function (aCollection) {
|
|
1296
1312
|
var self=this;
|
|
1297
1313
|
(self['@arguments']=aCollection);
|
|
1298
1314
|
return self;},
|
|
@@ -1308,7 +1324,7 @@ smalltalk.addMethod(
|
|
|
1308
1324
|
smalltalk.method({
|
|
1309
1325
|
selector: "selector",
|
|
1310
1326
|
category: 'accessing',
|
|
1311
|
-
fn: function (){
|
|
1327
|
+
fn: function () {
|
|
1312
1328
|
var self=this;
|
|
1313
1329
|
return self['@selector'];
|
|
1314
1330
|
return self;},
|
|
@@ -1324,7 +1340,7 @@ smalltalk.addMethod(
|
|
|
1324
1340
|
smalltalk.method({
|
|
1325
1341
|
selector: "selector:",
|
|
1326
1342
|
category: 'accessing',
|
|
1327
|
-
fn: function (aString){
|
|
1343
|
+
fn: function (aString) {
|
|
1328
1344
|
var self=this;
|
|
1329
1345
|
(self['@selector']=aString);
|
|
1330
1346
|
return self;},
|
|
@@ -1340,7 +1356,7 @@ smalltalk.addMethod(
|
|
|
1340
1356
|
smalltalk.method({
|
|
1341
1357
|
selector: "source",
|
|
1342
1358
|
category: 'accessing',
|
|
1343
|
-
fn: function (){
|
|
1359
|
+
fn: function () {
|
|
1344
1360
|
var self=this;
|
|
1345
1361
|
return self['@source'];
|
|
1346
1362
|
return self;},
|
|
@@ -1356,7 +1372,7 @@ smalltalk.addMethod(
|
|
|
1356
1372
|
smalltalk.method({
|
|
1357
1373
|
selector: "source:",
|
|
1358
1374
|
category: 'accessing',
|
|
1359
|
-
fn: function (aString){
|
|
1375
|
+
fn: function (aString) {
|
|
1360
1376
|
var self=this;
|
|
1361
1377
|
(self['@source']=aString);
|
|
1362
1378
|
return self;},
|
|
@@ -1375,7 +1391,7 @@ smalltalk.addMethod(
|
|
|
1375
1391
|
smalltalk.method({
|
|
1376
1392
|
selector: "accept:",
|
|
1377
1393
|
category: 'visiting',
|
|
1378
|
-
fn: function (aVisitor){
|
|
1394
|
+
fn: function (aVisitor) {
|
|
1379
1395
|
var self=this;
|
|
1380
1396
|
smalltalk.send(aVisitor, "_visitReturnNode_", [self]);
|
|
1381
1397
|
return self;},
|
|
@@ -1394,7 +1410,7 @@ smalltalk.addMethod(
|
|
|
1394
1410
|
smalltalk.method({
|
|
1395
1411
|
selector: "accept:",
|
|
1396
1412
|
category: 'visiting',
|
|
1397
|
-
fn: function (aVisitor){
|
|
1413
|
+
fn: function (aVisitor) {
|
|
1398
1414
|
var self=this;
|
|
1399
1415
|
smalltalk.send(aVisitor, "_visitSendNode_", [self]);
|
|
1400
1416
|
return self;},
|
|
@@ -1410,7 +1426,7 @@ smalltalk.addMethod(
|
|
|
1410
1426
|
smalltalk.method({
|
|
1411
1427
|
selector: "arguments",
|
|
1412
1428
|
category: 'accessing',
|
|
1413
|
-
fn: function (){
|
|
1429
|
+
fn: function () {
|
|
1414
1430
|
var self=this;
|
|
1415
1431
|
return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return (self['@arguments']=[]);})() : $receiver;
|
|
1416
1432
|
return self;},
|
|
@@ -1426,7 +1442,7 @@ smalltalk.addMethod(
|
|
|
1426
1442
|
smalltalk.method({
|
|
1427
1443
|
selector: "arguments:",
|
|
1428
1444
|
category: 'accessing',
|
|
1429
|
-
fn: function (aCollection){
|
|
1445
|
+
fn: function (aCollection) {
|
|
1430
1446
|
var self=this;
|
|
1431
1447
|
(self['@arguments']=aCollection);
|
|
1432
1448
|
return self;},
|
|
@@ -1442,7 +1458,7 @@ smalltalk.addMethod(
|
|
|
1442
1458
|
smalltalk.method({
|
|
1443
1459
|
selector: "cascadeNodeWithMessages:",
|
|
1444
1460
|
category: 'accessing',
|
|
1445
|
-
fn: function (aCollection){
|
|
1461
|
+
fn: function (aCollection) {
|
|
1446
1462
|
var self=this;
|
|
1447
1463
|
var first=nil;
|
|
1448
1464
|
(first=(function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.SendNode || SendNode), "_new", [])));
|
|
@@ -1460,7 +1476,7 @@ smalltalk.addMethod(
|
|
|
1460
1476
|
smalltalk.method({
|
|
1461
1477
|
selector: "receiver",
|
|
1462
1478
|
category: 'accessing',
|
|
1463
|
-
fn: function (){
|
|
1479
|
+
fn: function () {
|
|
1464
1480
|
var self=this;
|
|
1465
1481
|
return self['@receiver'];
|
|
1466
1482
|
return self;},
|
|
@@ -1476,7 +1492,7 @@ smalltalk.addMethod(
|
|
|
1476
1492
|
smalltalk.method({
|
|
1477
1493
|
selector: "receiver:",
|
|
1478
1494
|
category: 'accessing',
|
|
1479
|
-
fn: function (aNode){
|
|
1495
|
+
fn: function (aNode) {
|
|
1480
1496
|
var self=this;
|
|
1481
1497
|
(self['@receiver']=aNode);
|
|
1482
1498
|
return self;},
|
|
@@ -1492,7 +1508,7 @@ smalltalk.addMethod(
|
|
|
1492
1508
|
smalltalk.method({
|
|
1493
1509
|
selector: "selector",
|
|
1494
1510
|
category: 'accessing',
|
|
1495
|
-
fn: function (){
|
|
1511
|
+
fn: function () {
|
|
1496
1512
|
var self=this;
|
|
1497
1513
|
return self['@selector'];
|
|
1498
1514
|
return self;},
|
|
@@ -1508,7 +1524,7 @@ smalltalk.addMethod(
|
|
|
1508
1524
|
smalltalk.method({
|
|
1509
1525
|
selector: "selector:",
|
|
1510
1526
|
category: 'accessing',
|
|
1511
|
-
fn: function (aString){
|
|
1527
|
+
fn: function (aString) {
|
|
1512
1528
|
var self=this;
|
|
1513
1529
|
(self['@selector']=aString);
|
|
1514
1530
|
return self;},
|
|
@@ -1524,7 +1540,7 @@ smalltalk.addMethod(
|
|
|
1524
1540
|
smalltalk.method({
|
|
1525
1541
|
selector: "valueForReceiver:",
|
|
1526
1542
|
category: 'accessing',
|
|
1527
|
-
fn: function (anObject){
|
|
1543
|
+
fn: function (anObject) {
|
|
1528
1544
|
var self=this;
|
|
1529
1545
|
return (function($rec){smalltalk.send($rec, "_receiver_", [(($receiver = smalltalk.send(self, "_receiver", [])) == nil || $receiver == undefined) ? (function(){return anObject;})() : (function(){return smalltalk.send(smalltalk.send(self, "_receiver", []), "_valueForReceiver_", [anObject]);})()]);smalltalk.send($rec, "_selector_", [smalltalk.send(self, "_selector", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(self, "_arguments", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.SendNode || SendNode), "_new", []));
|
|
1530
1546
|
return self;},
|
|
@@ -1543,7 +1559,7 @@ smalltalk.addMethod(
|
|
|
1543
1559
|
smalltalk.method({
|
|
1544
1560
|
selector: "accept:",
|
|
1545
1561
|
category: 'visiting',
|
|
1546
|
-
fn: function (aVisitor){
|
|
1562
|
+
fn: function (aVisitor) {
|
|
1547
1563
|
var self=this;
|
|
1548
1564
|
smalltalk.send(aVisitor, "_visitSequenceNode_", [self]);
|
|
1549
1565
|
return self;},
|
|
@@ -1559,7 +1575,7 @@ smalltalk.addMethod(
|
|
|
1559
1575
|
smalltalk.method({
|
|
1560
1576
|
selector: "asBlockSequenceNode",
|
|
1561
1577
|
category: 'testing',
|
|
1562
|
-
fn: function (){
|
|
1578
|
+
fn: function () {
|
|
1563
1579
|
var self=this;
|
|
1564
1580
|
return (function($rec){smalltalk.send($rec, "_nodes_", [smalltalk.send(self, "_nodes", [])]);smalltalk.send($rec, "_temps_", [smalltalk.send(self, "_temps", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.BlockSequenceNode || BlockSequenceNode), "_new", []));
|
|
1565
1581
|
return self;},
|
|
@@ -1575,7 +1591,7 @@ smalltalk.addMethod(
|
|
|
1575
1591
|
smalltalk.method({
|
|
1576
1592
|
selector: "temps",
|
|
1577
1593
|
category: 'accessing',
|
|
1578
|
-
fn: function (){
|
|
1594
|
+
fn: function () {
|
|
1579
1595
|
var self=this;
|
|
1580
1596
|
return (($receiver = self['@temps']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
|
|
1581
1597
|
return self;},
|
|
@@ -1591,7 +1607,7 @@ smalltalk.addMethod(
|
|
|
1591
1607
|
smalltalk.method({
|
|
1592
1608
|
selector: "temps:",
|
|
1593
1609
|
category: 'accessing',
|
|
1594
|
-
fn: function (aCollection){
|
|
1610
|
+
fn: function (aCollection) {
|
|
1595
1611
|
var self=this;
|
|
1596
1612
|
(self['@temps']=aCollection);
|
|
1597
1613
|
return self;},
|
|
@@ -1610,7 +1626,7 @@ smalltalk.addMethod(
|
|
|
1610
1626
|
smalltalk.method({
|
|
1611
1627
|
selector: "accept:",
|
|
1612
1628
|
category: 'visiting',
|
|
1613
|
-
fn: function (aVisitor){
|
|
1629
|
+
fn: function (aVisitor) {
|
|
1614
1630
|
var self=this;
|
|
1615
1631
|
smalltalk.send(aVisitor, "_visitBlockSequenceNode_", [self]);
|
|
1616
1632
|
return self;},
|
|
@@ -1626,7 +1642,7 @@ smalltalk.addMethod(
|
|
|
1626
1642
|
smalltalk.method({
|
|
1627
1643
|
selector: "isBlockSequenceNode",
|
|
1628
1644
|
category: 'testing',
|
|
1629
|
-
fn: function (){
|
|
1645
|
+
fn: function () {
|
|
1630
1646
|
var self=this;
|
|
1631
1647
|
return true;
|
|
1632
1648
|
return self;},
|
|
@@ -1645,7 +1661,7 @@ smalltalk.addMethod(
|
|
|
1645
1661
|
smalltalk.method({
|
|
1646
1662
|
selector: "accept:",
|
|
1647
1663
|
category: 'visiting',
|
|
1648
|
-
fn: function (aVisitor){
|
|
1664
|
+
fn: function (aVisitor) {
|
|
1649
1665
|
var self=this;
|
|
1650
1666
|
smalltalk.send(aVisitor, "_visitValueNode_", [self]);
|
|
1651
1667
|
return self;},
|
|
@@ -1661,7 +1677,7 @@ smalltalk.addMethod(
|
|
|
1661
1677
|
smalltalk.method({
|
|
1662
1678
|
selector: "isValueNode",
|
|
1663
1679
|
category: 'testing',
|
|
1664
|
-
fn: function (){
|
|
1680
|
+
fn: function () {
|
|
1665
1681
|
var self=this;
|
|
1666
1682
|
return true;
|
|
1667
1683
|
return self;},
|
|
@@ -1677,7 +1693,7 @@ smalltalk.addMethod(
|
|
|
1677
1693
|
smalltalk.method({
|
|
1678
1694
|
selector: "value",
|
|
1679
1695
|
category: 'accessing',
|
|
1680
|
-
fn: function (){
|
|
1696
|
+
fn: function () {
|
|
1681
1697
|
var self=this;
|
|
1682
1698
|
return self['@value'];
|
|
1683
1699
|
return self;},
|
|
@@ -1693,7 +1709,7 @@ smalltalk.addMethod(
|
|
|
1693
1709
|
smalltalk.method({
|
|
1694
1710
|
selector: "value:",
|
|
1695
1711
|
category: 'accessing',
|
|
1696
|
-
fn: function (anObject){
|
|
1712
|
+
fn: function (anObject) {
|
|
1697
1713
|
var self=this;
|
|
1698
1714
|
(self['@value']=anObject);
|
|
1699
1715
|
return self;},
|
|
@@ -1712,7 +1728,7 @@ smalltalk.addMethod(
|
|
|
1712
1728
|
smalltalk.method({
|
|
1713
1729
|
selector: "accept:",
|
|
1714
1730
|
category: 'visiting',
|
|
1715
|
-
fn: function (aVisitor){
|
|
1731
|
+
fn: function (aVisitor) {
|
|
1716
1732
|
var self=this;
|
|
1717
1733
|
smalltalk.send(aVisitor, "_visitVariableNode_", [self]);
|
|
1718
1734
|
return self;},
|
|
@@ -1728,7 +1744,7 @@ smalltalk.addMethod(
|
|
|
1728
1744
|
smalltalk.method({
|
|
1729
1745
|
selector: "assigned",
|
|
1730
1746
|
category: 'accessing',
|
|
1731
|
-
fn: function (){
|
|
1747
|
+
fn: function () {
|
|
1732
1748
|
var self=this;
|
|
1733
1749
|
return (($receiver = self['@assigned']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
|
|
1734
1750
|
return self;},
|
|
@@ -1744,7 +1760,7 @@ smalltalk.addMethod(
|
|
|
1744
1760
|
smalltalk.method({
|
|
1745
1761
|
selector: "assigned:",
|
|
1746
1762
|
category: 'accessing',
|
|
1747
|
-
fn: function (aBoolean){
|
|
1763
|
+
fn: function (aBoolean) {
|
|
1748
1764
|
var self=this;
|
|
1749
1765
|
(self['@assigned']=aBoolean);
|
|
1750
1766
|
return self;},
|
|
@@ -1763,7 +1779,7 @@ smalltalk.addMethod(
|
|
|
1763
1779
|
smalltalk.method({
|
|
1764
1780
|
selector: "accept:",
|
|
1765
1781
|
category: 'visiting',
|
|
1766
|
-
fn: function (aVisitor){
|
|
1782
|
+
fn: function (aVisitor) {
|
|
1767
1783
|
var self=this;
|
|
1768
1784
|
smalltalk.send(aVisitor, "_visitClassReferenceNode_", [self]);
|
|
1769
1785
|
return self;},
|
|
@@ -1776,13 +1792,64 @@ smalltalk.ClassReferenceNode);
|
|
|
1776
1792
|
|
|
1777
1793
|
|
|
1778
1794
|
|
|
1795
|
+
smalltalk.addClass('VerbatimNode', smalltalk.Node, ['value'], 'Compiler');
|
|
1796
|
+
smalltalk.addMethod(
|
|
1797
|
+
"_accept_",
|
|
1798
|
+
smalltalk.method({
|
|
1799
|
+
selector: "accept:",
|
|
1800
|
+
category: 'visiting',
|
|
1801
|
+
fn: function (aVisitor) {
|
|
1802
|
+
var self=this;
|
|
1803
|
+
smalltalk.send(aVisitor, "_visitVerbatimNode_", [self]);
|
|
1804
|
+
return self;},
|
|
1805
|
+
args: ["aVisitor"],
|
|
1806
|
+
source: "accept: aVisitor\x0a\x09aVisitor visitVerbatimNode: self",
|
|
1807
|
+
messageSends: ["visitVerbatimNode:"],
|
|
1808
|
+
referencedClasses: []
|
|
1809
|
+
}),
|
|
1810
|
+
smalltalk.VerbatimNode);
|
|
1811
|
+
|
|
1812
|
+
smalltalk.addMethod(
|
|
1813
|
+
"_value",
|
|
1814
|
+
smalltalk.method({
|
|
1815
|
+
selector: "value",
|
|
1816
|
+
category: 'accessing',
|
|
1817
|
+
fn: function () {
|
|
1818
|
+
var self=this;
|
|
1819
|
+
return self['@value'];
|
|
1820
|
+
return self;},
|
|
1821
|
+
args: [],
|
|
1822
|
+
source: "value\x0a\x09^value",
|
|
1823
|
+
messageSends: [],
|
|
1824
|
+
referencedClasses: []
|
|
1825
|
+
}),
|
|
1826
|
+
smalltalk.VerbatimNode);
|
|
1827
|
+
|
|
1828
|
+
smalltalk.addMethod(
|
|
1829
|
+
"_value_",
|
|
1830
|
+
smalltalk.method({
|
|
1831
|
+
selector: "value:",
|
|
1832
|
+
category: 'accessing',
|
|
1833
|
+
fn: function (anObject) {
|
|
1834
|
+
var self=this;
|
|
1835
|
+
(self['@value']=anObject);
|
|
1836
|
+
return self;},
|
|
1837
|
+
args: ["anObject"],
|
|
1838
|
+
source: "value: anObject\x0a\x09value := anObject",
|
|
1839
|
+
messageSends: [],
|
|
1840
|
+
referencedClasses: []
|
|
1841
|
+
}),
|
|
1842
|
+
smalltalk.VerbatimNode);
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
|
|
1779
1846
|
smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
|
|
1780
1847
|
smalltalk.addMethod(
|
|
1781
1848
|
"_visit_",
|
|
1782
1849
|
smalltalk.method({
|
|
1783
1850
|
selector: "visit:",
|
|
1784
1851
|
category: 'visiting',
|
|
1785
|
-
fn: function (aNode){
|
|
1852
|
+
fn: function (aNode) {
|
|
1786
1853
|
var self=this;
|
|
1787
1854
|
smalltalk.send(aNode, "_accept_", [self]);
|
|
1788
1855
|
return self;},
|
|
@@ -1798,7 +1865,7 @@ smalltalk.addMethod(
|
|
|
1798
1865
|
smalltalk.method({
|
|
1799
1866
|
selector: "visitAssignmentNode:",
|
|
1800
1867
|
category: 'visiting',
|
|
1801
|
-
fn: function (aNode){
|
|
1868
|
+
fn: function (aNode) {
|
|
1802
1869
|
var self=this;
|
|
1803
1870
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1804
1871
|
return self;},
|
|
@@ -1814,7 +1881,7 @@ smalltalk.addMethod(
|
|
|
1814
1881
|
smalltalk.method({
|
|
1815
1882
|
selector: "visitBlockNode:",
|
|
1816
1883
|
category: 'visiting',
|
|
1817
|
-
fn: function (aNode){
|
|
1884
|
+
fn: function (aNode) {
|
|
1818
1885
|
var self=this;
|
|
1819
1886
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1820
1887
|
return self;},
|
|
@@ -1830,7 +1897,7 @@ smalltalk.addMethod(
|
|
|
1830
1897
|
smalltalk.method({
|
|
1831
1898
|
selector: "visitBlockSequenceNode:",
|
|
1832
1899
|
category: 'visiting',
|
|
1833
|
-
fn: function (aNode){
|
|
1900
|
+
fn: function (aNode) {
|
|
1834
1901
|
var self=this;
|
|
1835
1902
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1836
1903
|
return self;},
|
|
@@ -1846,7 +1913,7 @@ smalltalk.addMethod(
|
|
|
1846
1913
|
smalltalk.method({
|
|
1847
1914
|
selector: "visitCascadeNode:",
|
|
1848
1915
|
category: 'visiting',
|
|
1849
|
-
fn: function (aNode){
|
|
1916
|
+
fn: function (aNode) {
|
|
1850
1917
|
var self=this;
|
|
1851
1918
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1852
1919
|
return self;},
|
|
@@ -1862,7 +1929,7 @@ smalltalk.addMethod(
|
|
|
1862
1929
|
smalltalk.method({
|
|
1863
1930
|
selector: "visitClassReferenceNode:",
|
|
1864
1931
|
category: 'visiting',
|
|
1865
|
-
fn: function (aNode){
|
|
1932
|
+
fn: function (aNode) {
|
|
1866
1933
|
var self=this;
|
|
1867
1934
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1868
1935
|
return self;},
|
|
@@ -1878,7 +1945,7 @@ smalltalk.addMethod(
|
|
|
1878
1945
|
smalltalk.method({
|
|
1879
1946
|
selector: "visitDynamicArrayNode:",
|
|
1880
1947
|
category: 'visiting',
|
|
1881
|
-
fn: function (aNode){
|
|
1948
|
+
fn: function (aNode) {
|
|
1882
1949
|
var self=this;
|
|
1883
1950
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1884
1951
|
return self;},
|
|
@@ -1894,7 +1961,7 @@ smalltalk.addMethod(
|
|
|
1894
1961
|
smalltalk.method({
|
|
1895
1962
|
selector: "visitDynamicDictionaryNode:",
|
|
1896
1963
|
category: 'visiting',
|
|
1897
|
-
fn: function (aNode){
|
|
1964
|
+
fn: function (aNode) {
|
|
1898
1965
|
var self=this;
|
|
1899
1966
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1900
1967
|
return self;},
|
|
@@ -1910,7 +1977,7 @@ smalltalk.addMethod(
|
|
|
1910
1977
|
smalltalk.method({
|
|
1911
1978
|
selector: "visitJSStatementNode:",
|
|
1912
1979
|
category: 'visiting',
|
|
1913
|
-
fn: function (aNode){
|
|
1980
|
+
fn: function (aNode) {
|
|
1914
1981
|
var self=this;
|
|
1915
1982
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1916
1983
|
return self;},
|
|
@@ -1926,7 +1993,7 @@ smalltalk.addMethod(
|
|
|
1926
1993
|
smalltalk.method({
|
|
1927
1994
|
selector: "visitMethodNode:",
|
|
1928
1995
|
category: 'visiting',
|
|
1929
|
-
fn: function (aNode){
|
|
1996
|
+
fn: function (aNode) {
|
|
1930
1997
|
var self=this;
|
|
1931
1998
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1932
1999
|
return self;},
|
|
@@ -1942,7 +2009,7 @@ smalltalk.addMethod(
|
|
|
1942
2009
|
smalltalk.method({
|
|
1943
2010
|
selector: "visitNode:",
|
|
1944
2011
|
category: 'visiting',
|
|
1945
|
-
fn: function (aNode){
|
|
2012
|
+
fn: function (aNode) {
|
|
1946
2013
|
var self=this;
|
|
1947
2014
|
|
|
1948
2015
|
return self;},
|
|
@@ -1958,7 +2025,7 @@ smalltalk.addMethod(
|
|
|
1958
2025
|
smalltalk.method({
|
|
1959
2026
|
selector: "visitReturnNode:",
|
|
1960
2027
|
category: 'visiting',
|
|
1961
|
-
fn: function (aNode){
|
|
2028
|
+
fn: function (aNode) {
|
|
1962
2029
|
var self=this;
|
|
1963
2030
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1964
2031
|
return self;},
|
|
@@ -1974,7 +2041,7 @@ smalltalk.addMethod(
|
|
|
1974
2041
|
smalltalk.method({
|
|
1975
2042
|
selector: "visitSendNode:",
|
|
1976
2043
|
category: 'visiting',
|
|
1977
|
-
fn: function (aNode){
|
|
2044
|
+
fn: function (aNode) {
|
|
1978
2045
|
var self=this;
|
|
1979
2046
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1980
2047
|
return self;},
|
|
@@ -1990,7 +2057,7 @@ smalltalk.addMethod(
|
|
|
1990
2057
|
smalltalk.method({
|
|
1991
2058
|
selector: "visitSequenceNode:",
|
|
1992
2059
|
category: 'visiting',
|
|
1993
|
-
fn: function (aNode){
|
|
2060
|
+
fn: function (aNode) {
|
|
1994
2061
|
var self=this;
|
|
1995
2062
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
1996
2063
|
return self;},
|
|
@@ -2006,7 +2073,7 @@ smalltalk.addMethod(
|
|
|
2006
2073
|
smalltalk.method({
|
|
2007
2074
|
selector: "visitValueNode:",
|
|
2008
2075
|
category: 'visiting',
|
|
2009
|
-
fn: function (aNode){
|
|
2076
|
+
fn: function (aNode) {
|
|
2010
2077
|
var self=this;
|
|
2011
2078
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
2012
2079
|
return self;},
|
|
@@ -2022,7 +2089,7 @@ smalltalk.addMethod(
|
|
|
2022
2089
|
smalltalk.method({
|
|
2023
2090
|
selector: "visitVariableNode:",
|
|
2024
2091
|
category: 'visiting',
|
|
2025
|
-
fn: function (aNode){
|
|
2092
|
+
fn: function (aNode) {
|
|
2026
2093
|
var self=this;
|
|
2027
2094
|
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
2028
2095
|
return self;},
|
|
@@ -2033,6 +2100,22 @@ referencedClasses: []
|
|
|
2033
2100
|
}),
|
|
2034
2101
|
smalltalk.NodeVisitor);
|
|
2035
2102
|
|
|
2103
|
+
smalltalk.addMethod(
|
|
2104
|
+
"_visitVerbatimNode_",
|
|
2105
|
+
smalltalk.method({
|
|
2106
|
+
selector: "visitVerbatimNode:",
|
|
2107
|
+
category: 'visiting',
|
|
2108
|
+
fn: function (aNode) {
|
|
2109
|
+
var self=this;
|
|
2110
|
+
smalltalk.send(self, "_visitNode_", [aNode]);
|
|
2111
|
+
return self;},
|
|
2112
|
+
args: ["aNode"],
|
|
2113
|
+
source: "visitVerbatimNode: aNode\x0a\x09self visitNode: aNode",
|
|
2114
|
+
messageSends: ["visitNode:"],
|
|
2115
|
+
referencedClasses: []
|
|
2116
|
+
}),
|
|
2117
|
+
smalltalk.NodeVisitor);
|
|
2118
|
+
|
|
2036
2119
|
|
|
2037
2120
|
|
|
2038
2121
|
smalltalk.addClass('AbstractCodeGenerator', smalltalk.NodeVisitor, ['currentClass', 'source'], 'Compiler');
|
|
@@ -2041,7 +2124,7 @@ smalltalk.addMethod(
|
|
|
2041
2124
|
smalltalk.method({
|
|
2042
2125
|
selector: "classNameFor:",
|
|
2043
2126
|
category: 'accessing',
|
|
2044
|
-
fn: function (aClass){
|
|
2127
|
+
fn: function (aClass) {
|
|
2045
2128
|
var self=this;
|
|
2046
2129
|
return ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);})() : (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return ((($receiver = smalltalk.send(aClass, "_isNil", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "nil";})() : (function(){return smalltalk.send(aClass, "_name", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]));})]));
|
|
2047
2130
|
return self;},
|
|
@@ -2057,7 +2140,7 @@ smalltalk.addMethod(
|
|
|
2057
2140
|
smalltalk.method({
|
|
2058
2141
|
selector: "compileNode:",
|
|
2059
2142
|
category: 'compiling',
|
|
2060
|
-
fn: function (aNode){
|
|
2143
|
+
fn: function (aNode) {
|
|
2061
2144
|
var self=this;
|
|
2062
2145
|
smalltalk.send(self, "_subclassResponsibility", []);
|
|
2063
2146
|
return self;},
|
|
@@ -2073,7 +2156,7 @@ smalltalk.addMethod(
|
|
|
2073
2156
|
smalltalk.method({
|
|
2074
2157
|
selector: "currentClass",
|
|
2075
2158
|
category: 'accessing',
|
|
2076
|
-
fn: function (){
|
|
2159
|
+
fn: function () {
|
|
2077
2160
|
var self=this;
|
|
2078
2161
|
return self['@currentClass'];
|
|
2079
2162
|
return self;},
|
|
@@ -2089,7 +2172,7 @@ smalltalk.addMethod(
|
|
|
2089
2172
|
smalltalk.method({
|
|
2090
2173
|
selector: "currentClass:",
|
|
2091
2174
|
category: 'accessing',
|
|
2092
|
-
fn: function (aClass){
|
|
2175
|
+
fn: function (aClass) {
|
|
2093
2176
|
var self=this;
|
|
2094
2177
|
(self['@currentClass']=aClass);
|
|
2095
2178
|
return self;},
|
|
@@ -2105,7 +2188,7 @@ smalltalk.addMethod(
|
|
|
2105
2188
|
smalltalk.method({
|
|
2106
2189
|
selector: "pseudoVariables",
|
|
2107
2190
|
category: 'accessing',
|
|
2108
|
-
fn: function (){
|
|
2191
|
+
fn: function () {
|
|
2109
2192
|
var self=this;
|
|
2110
2193
|
return ["self", "super", "true", "false", "nil", "thisContext"];
|
|
2111
2194
|
return self;},
|
|
@@ -2121,7 +2204,7 @@ smalltalk.addMethod(
|
|
|
2121
2204
|
smalltalk.method({
|
|
2122
2205
|
selector: "safeVariableNameFor:",
|
|
2123
2206
|
category: 'accessing',
|
|
2124
|
-
fn: function (aString){
|
|
2207
|
+
fn: function (aString) {
|
|
2125
2208
|
var self=this;
|
|
2126
2209
|
return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_reservedWords", []), "_includes_", [aString])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aString, "__comma", ["_"]);})() : (function(){return aString;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aString, "__comma", ["_"]);}), (function(){return aString;})]));
|
|
2127
2210
|
return self;},
|
|
@@ -2137,7 +2220,7 @@ smalltalk.addMethod(
|
|
|
2137
2220
|
smalltalk.method({
|
|
2138
2221
|
selector: "source",
|
|
2139
2222
|
category: 'accessing',
|
|
2140
|
-
fn: function (){
|
|
2223
|
+
fn: function () {
|
|
2141
2224
|
var self=this;
|
|
2142
2225
|
return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
|
|
2143
2226
|
return self;},
|
|
@@ -2153,7 +2236,7 @@ smalltalk.addMethod(
|
|
|
2153
2236
|
smalltalk.method({
|
|
2154
2237
|
selector: "source:",
|
|
2155
2238
|
category: 'accessing',
|
|
2156
|
-
fn: function (aString){
|
|
2239
|
+
fn: function (aString) {
|
|
2157
2240
|
var self=this;
|
|
2158
2241
|
(self['@source']=aString);
|
|
2159
2242
|
return self;},
|
|
@@ -2172,7 +2255,7 @@ smalltalk.addMethod(
|
|
|
2172
2255
|
smalltalk.method({
|
|
2173
2256
|
selector: "argVariables",
|
|
2174
2257
|
category: 'accessing',
|
|
2175
|
-
fn: function (){
|
|
2258
|
+
fn: function () {
|
|
2176
2259
|
var self=this;
|
|
2177
2260
|
return smalltalk.send(self['@argVariables'], "_copy", []);
|
|
2178
2261
|
return self;},
|
|
@@ -2188,7 +2271,7 @@ smalltalk.addMethod(
|
|
|
2188
2271
|
smalltalk.method({
|
|
2189
2272
|
selector: "checkClass:for:",
|
|
2190
2273
|
category: 'optimizations',
|
|
2191
|
-
fn: function (aClassName, receiver){
|
|
2274
|
+
fn: function (aClassName, receiver) {
|
|
2192
2275
|
var self=this;
|
|
2193
2276
|
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((($receiver = ", "__comma", [receiver]), "__comma", [").klass === smalltalk."]), "__comma", [aClassName]), "__comma", [") ? "])]);
|
|
2194
2277
|
return self;},
|
|
@@ -2204,7 +2287,7 @@ smalltalk.addMethod(
|
|
|
2204
2287
|
smalltalk.method({
|
|
2205
2288
|
selector: "compileNode:",
|
|
2206
2289
|
category: 'compiling',
|
|
2207
|
-
fn: function (aNode){
|
|
2290
|
+
fn: function (aNode) {
|
|
2208
2291
|
var self=this;
|
|
2209
2292
|
(self['@stream']=smalltalk.send("", "_writeStream", []));
|
|
2210
2293
|
smalltalk.send(self, "_visit_", [aNode]);
|
|
@@ -2222,7 +2305,7 @@ smalltalk.addMethod(
|
|
|
2222
2305
|
smalltalk.method({
|
|
2223
2306
|
selector: "initialize",
|
|
2224
2307
|
category: 'initialization',
|
|
2225
|
-
fn: function (){
|
|
2308
|
+
fn: function () {
|
|
2226
2309
|
var self=this;
|
|
2227
2310
|
smalltalk.send(self, "_initialize", [], smalltalk.FunCodeGenerator.superclass || nil);
|
|
2228
2311
|
(self['@stream']=smalltalk.send("", "_writeStream", []));
|
|
@@ -2244,7 +2327,7 @@ smalltalk.addMethod(
|
|
|
2244
2327
|
smalltalk.method({
|
|
2245
2328
|
selector: "inline:receiver:argumentNodes:",
|
|
2246
2329
|
category: 'optimizations',
|
|
2247
|
-
fn: function (aSelector, receiver, aCollection){
|
|
2330
|
+
fn: function (aSelector, receiver, aCollection) {
|
|
2248
2331
|
var self=this;
|
|
2249
2332
|
var inlined=nil;
|
|
2250
2333
|
(inlined=false);
|
|
@@ -2274,7 +2357,7 @@ smalltalk.addMethod(
|
|
|
2274
2357
|
smalltalk.method({
|
|
2275
2358
|
selector: "inlineLiteral:receiverNode:argumentNodes:",
|
|
2276
2359
|
category: 'optimizations',
|
|
2277
|
-
fn: function (aSelector, anObject, aCollection){
|
|
2360
|
+
fn: function (aSelector, anObject, aCollection) {
|
|
2278
2361
|
var self=this;
|
|
2279
2362
|
var inlined=nil;
|
|
2280
2363
|
(inlined=false);
|
|
@@ -2308,7 +2391,7 @@ smalltalk.addMethod(
|
|
|
2308
2391
|
smalltalk.method({
|
|
2309
2392
|
selector: "isNode:ofClass:",
|
|
2310
2393
|
category: 'optimizations',
|
|
2311
|
-
fn: function (aNode, aClass){
|
|
2394
|
+
fn: function (aNode, aClass) {
|
|
2312
2395
|
var self=this;
|
|
2313
2396
|
return smalltalk.send(smalltalk.send(aNode, "_isValueNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "_class", []), "__eq", [aClass]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["self"]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_currentClass", []), "__eq", [aClass]);})]);})]);})]);
|
|
2314
2397
|
return self;},
|
|
@@ -2324,7 +2407,7 @@ smalltalk.addMethod(
|
|
|
2324
2407
|
smalltalk.method({
|
|
2325
2408
|
selector: "knownVariables",
|
|
2326
2409
|
category: 'accessing',
|
|
2327
|
-
fn: function (){
|
|
2410
|
+
fn: function () {
|
|
2328
2411
|
var self=this;
|
|
2329
2412
|
return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_tempVariables", [])]);smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_argVariables", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_pseudoVariables", []));
|
|
2330
2413
|
return self;},
|
|
@@ -2340,7 +2423,7 @@ smalltalk.addMethod(
|
|
|
2340
2423
|
smalltalk.method({
|
|
2341
2424
|
selector: "performOptimizations",
|
|
2342
2425
|
category: 'testing',
|
|
2343
|
-
fn: function (){
|
|
2426
|
+
fn: function () {
|
|
2344
2427
|
var self=this;
|
|
2345
2428
|
return smalltalk.send(smalltalk.send(self, "_class", []), "_performOptimizations", []);
|
|
2346
2429
|
return self;},
|
|
@@ -2356,7 +2439,7 @@ smalltalk.addMethod(
|
|
|
2356
2439
|
smalltalk.method({
|
|
2357
2440
|
selector: "send:to:arguments:superSend:",
|
|
2358
2441
|
category: 'visiting',
|
|
2359
|
-
fn: function (aSelector, aReceiver, aCollection, aBoolean){
|
|
2442
|
+
fn: function (aSelector, aReceiver, aCollection, aBoolean) {
|
|
2360
2443
|
var self=this;
|
|
2361
2444
|
return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){var tmp=nil;
|
|
2362
2445
|
(tmp=self['@stream']);smalltalk.send(str, "_nextPutAll_", ["smalltalk.send("]);smalltalk.send(str, "_nextPutAll_", [aReceiver]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", \x22", "__comma", [smalltalk.send(aSelector, "_asSelector", [])]), "__comma", ["\x22, ["])]);(self['@stream']=str);smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);(self['@stream']=tmp);smalltalk.send(str, "_nextPutAll_", ["]"]);((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(self, "_currentClass", [])])]), "__comma", [".superclass || nil"])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(self, "_currentClass", [])])]), "__comma", [".superclass || nil"])]);})]));return smalltalk.send(str, "_nextPutAll_", [")"]);})]);
|
|
@@ -2373,7 +2456,7 @@ smalltalk.addMethod(
|
|
|
2373
2456
|
smalltalk.method({
|
|
2374
2457
|
selector: "tempVariables",
|
|
2375
2458
|
category: 'accessing',
|
|
2376
|
-
fn: function (){
|
|
2459
|
+
fn: function () {
|
|
2377
2460
|
var self=this;
|
|
2378
2461
|
return smalltalk.send(self['@tempVariables'], "_copy", []);
|
|
2379
2462
|
return self;},
|
|
@@ -2389,7 +2472,7 @@ smalltalk.addMethod(
|
|
|
2389
2472
|
smalltalk.method({
|
|
2390
2473
|
selector: "unknownVariables",
|
|
2391
2474
|
category: 'accessing',
|
|
2392
|
-
fn: function (){
|
|
2475
|
+
fn: function () {
|
|
2393
2476
|
var self=this;
|
|
2394
2477
|
return smalltalk.send(self['@unknownVariables'], "_copy", []);
|
|
2395
2478
|
return self;},
|
|
@@ -2405,7 +2488,7 @@ smalltalk.addMethod(
|
|
|
2405
2488
|
smalltalk.method({
|
|
2406
2489
|
selector: "visit:",
|
|
2407
2490
|
category: 'visiting',
|
|
2408
|
-
fn: function (aNode){
|
|
2491
|
+
fn: function (aNode) {
|
|
2409
2492
|
var self=this;
|
|
2410
2493
|
smalltalk.send(aNode, "_accept_", [self]);
|
|
2411
2494
|
return self;},
|
|
@@ -2421,7 +2504,7 @@ smalltalk.addMethod(
|
|
|
2421
2504
|
smalltalk.method({
|
|
2422
2505
|
selector: "visitAssignmentNode:",
|
|
2423
2506
|
category: 'visiting',
|
|
2424
|
-
fn: function (aNode){
|
|
2507
|
+
fn: function (aNode) {
|
|
2425
2508
|
var self=this;
|
|
2426
2509
|
smalltalk.send(self['@stream'], "_nextPutAll_", ["("]);
|
|
2427
2510
|
smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
|
|
@@ -2441,7 +2524,7 @@ smalltalk.addMethod(
|
|
|
2441
2524
|
smalltalk.method({
|
|
2442
2525
|
selector: "visitBlockNode:",
|
|
2443
2526
|
category: 'visiting',
|
|
2444
|
-
fn: function (aNode){
|
|
2527
|
+
fn: function (aNode) {
|
|
2445
2528
|
var self=this;
|
|
2446
2529
|
smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
|
|
2447
2530
|
smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
|
|
@@ -2461,7 +2544,7 @@ smalltalk.addMethod(
|
|
|
2461
2544
|
smalltalk.method({
|
|
2462
2545
|
selector: "visitBlockSequenceNode:",
|
|
2463
2546
|
category: 'visiting',
|
|
2464
|
-
fn: function (aNode){
|
|
2547
|
+
fn: function (aNode) {
|
|
2465
2548
|
var self=this;
|
|
2466
2549
|
var index=nil;
|
|
2467
2550
|
(self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
|
|
@@ -2482,7 +2565,7 @@ smalltalk.addMethod(
|
|
|
2482
2565
|
smalltalk.method({
|
|
2483
2566
|
selector: "visitCascadeNode:",
|
|
2484
2567
|
category: 'visiting',
|
|
2485
|
-
fn: function (aNode){
|
|
2568
|
+
fn: function (aNode) {
|
|
2486
2569
|
var self=this;
|
|
2487
2570
|
var index=nil;
|
|
2488
2571
|
(index=(0));
|
|
@@ -2505,7 +2588,7 @@ smalltalk.addMethod(
|
|
|
2505
2588
|
smalltalk.method({
|
|
2506
2589
|
selector: "visitClassReferenceNode:",
|
|
2507
2590
|
category: 'visiting',
|
|
2508
|
-
fn: function (aNode){
|
|
2591
|
+
fn: function (aNode) {
|
|
2509
2592
|
var self=this;
|
|
2510
2593
|
((($receiver = smalltalk.send(self['@referencedClasses'], "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})]));
|
|
2511
2594
|
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", [")"])]);
|
|
@@ -2522,7 +2605,7 @@ smalltalk.addMethod(
|
|
|
2522
2605
|
smalltalk.method({
|
|
2523
2606
|
selector: "visitDynamicArrayNode:",
|
|
2524
2607
|
category: 'visiting',
|
|
2525
|
-
fn: function (aNode){
|
|
2608
|
+
fn: function (aNode) {
|
|
2526
2609
|
var self=this;
|
|
2527
2610
|
smalltalk.send(self['@stream'], "_nextPutAll_", ["["]);
|
|
2528
2611
|
smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
|
|
@@ -2540,7 +2623,7 @@ smalltalk.addMethod(
|
|
|
2540
2623
|
smalltalk.method({
|
|
2541
2624
|
selector: "visitDynamicDictionaryNode:",
|
|
2542
2625
|
category: 'visiting',
|
|
2543
|
-
fn: function (aNode){
|
|
2626
|
+
fn: function (aNode) {
|
|
2544
2627
|
var self=this;
|
|
2545
2628
|
smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.HashedCollection._fromPairs_(["]);
|
|
2546
2629
|
smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
|
|
@@ -2558,7 +2641,7 @@ smalltalk.addMethod(
|
|
|
2558
2641
|
smalltalk.method({
|
|
2559
2642
|
selector: "visitFailure:",
|
|
2560
2643
|
category: 'visiting',
|
|
2561
|
-
fn: function (aFailure){
|
|
2644
|
+
fn: function (aFailure) {
|
|
2562
2645
|
var self=this;
|
|
2563
2646
|
smalltalk.send(self, "_error_", [smalltalk.send(aFailure, "_asString", [])]);
|
|
2564
2647
|
return self;},
|
|
@@ -2574,7 +2657,7 @@ smalltalk.addMethod(
|
|
|
2574
2657
|
smalltalk.method({
|
|
2575
2658
|
selector: "visitJSStatementNode:",
|
|
2576
2659
|
category: 'visiting',
|
|
2577
|
-
fn: function (aNode){
|
|
2660
|
+
fn: function (aNode) {
|
|
2578
2661
|
var self=this;
|
|
2579
2662
|
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(aNode, "_source", [])]);
|
|
2580
2663
|
return self;},
|
|
@@ -2590,7 +2673,7 @@ smalltalk.addMethod(
|
|
|
2590
2673
|
smalltalk.method({
|
|
2591
2674
|
selector: "visitMethodNode:",
|
|
2592
2675
|
category: 'visiting',
|
|
2593
|
-
fn: function (aNode){
|
|
2676
|
+
fn: function (aNode) {
|
|
2594
2677
|
var self=this;
|
|
2595
2678
|
var str=nil;
|
|
2596
2679
|
var currentSelector=nil;
|
|
@@ -2633,7 +2716,7 @@ smalltalk.addMethod(
|
|
|
2633
2716
|
smalltalk.method({
|
|
2634
2717
|
selector: "visitReturnNode:",
|
|
2635
2718
|
category: 'visiting',
|
|
2636
|
-
fn: function (aNode){
|
|
2719
|
+
fn: function (aNode) {
|
|
2637
2720
|
var self=this;
|
|
2638
2721
|
((($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);})]));
|
|
2639
2722
|
((($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 "]);})]));
|
|
@@ -2652,7 +2735,7 @@ smalltalk.addMethod(
|
|
|
2652
2735
|
smalltalk.method({
|
|
2653
2736
|
selector: "visitSendNode:",
|
|
2654
2737
|
category: 'visiting',
|
|
2655
|
-
fn: function (aNode){
|
|
2738
|
+
fn: function (aNode) {
|
|
2656
2739
|
var self=this;
|
|
2657
2740
|
var str=nil;
|
|
2658
2741
|
var receiver=nil;
|
|
@@ -2679,7 +2762,7 @@ smalltalk.addMethod(
|
|
|
2679
2762
|
smalltalk.method({
|
|
2680
2763
|
selector: "visitSequenceNode:",
|
|
2681
2764
|
category: 'visiting',
|
|
2682
|
-
fn: function (aNode){
|
|
2765
|
+
fn: function (aNode) {
|
|
2683
2766
|
var self=this;
|
|
2684
2767
|
smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
|
|
2685
2768
|
(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']);})]);
|
|
@@ -2697,7 +2780,7 @@ smalltalk.addMethod(
|
|
|
2697
2780
|
smalltalk.method({
|
|
2698
2781
|
selector: "visitValueNode:",
|
|
2699
2782
|
category: 'visiting',
|
|
2700
|
-
fn: function (aNode){
|
|
2783
|
+
fn: function (aNode) {
|
|
2701
2784
|
var self=this;
|
|
2702
2785
|
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
|
|
2703
2786
|
return self;},
|
|
@@ -2713,7 +2796,7 @@ smalltalk.addMethod(
|
|
|
2713
2796
|
smalltalk.method({
|
|
2714
2797
|
selector: "visitVariableNode:",
|
|
2715
2798
|
category: 'visiting',
|
|
2716
|
-
fn: function (aNode){
|
|
2799
|
+
fn: function (aNode) {
|
|
2717
2800
|
var self=this;
|
|
2718
2801
|
var varName=nil;
|
|
2719
2802
|
((($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]);})]));})]));})]));
|
|
@@ -2732,7 +2815,7 @@ smalltalk.addMethod(
|
|
|
2732
2815
|
smalltalk.method({
|
|
2733
2816
|
selector: "performOptimizations",
|
|
2734
2817
|
category: 'accessing',
|
|
2735
|
-
fn: function (){
|
|
2818
|
+
fn: function () {
|
|
2736
2819
|
var self=this;
|
|
2737
2820
|
return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
|
|
2738
2821
|
return self;},
|
|
@@ -2748,7 +2831,7 @@ smalltalk.addMethod(
|
|
|
2748
2831
|
smalltalk.method({
|
|
2749
2832
|
selector: "performOptimizations:",
|
|
2750
2833
|
category: 'accessing',
|
|
2751
|
-
fn: function (aBoolean){
|
|
2834
|
+
fn: function (aBoolean) {
|
|
2752
2835
|
var self=this;
|
|
2753
2836
|
(self['@performOptimizations']=aBoolean);
|
|
2754
2837
|
return self;},
|
|
@@ -2760,3 +2843,1173 @@ referencedClasses: []
|
|
|
2760
2843
|
smalltalk.FunCodeGenerator.klass);
|
|
2761
2844
|
|
|
2762
2845
|
|
|
2846
|
+
smalltalk.addClass('ImpCodeGenerator', smalltalk.AbstractCodeGenerator, ['stream', 'nestedBlocks', 'earlyReturn', 'currentSelector', 'unknownVariables', 'tempVariables', 'messageSends', 'referencedClasses', 'classReferenced', 'argVariables', 'mutables', 'target', 'lazyVars', 'realVarNames'], 'Compiler');
|
|
2847
|
+
smalltalk.addMethod(
|
|
2848
|
+
"_aboutToModifyState",
|
|
2849
|
+
smalltalk.method({
|
|
2850
|
+
selector: "aboutToModifyState",
|
|
2851
|
+
category: 'compilation DSL',
|
|
2852
|
+
fn: function (){
|
|
2853
|
+
var self=this;
|
|
2854
|
+
var list=nil;
|
|
2855
|
+
var old=nil;
|
|
2856
|
+
(list=self['@mutables']);
|
|
2857
|
+
(self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
|
2858
|
+
(old=smalltalk.send(self, "_switchTarget_", [nil]));
|
|
2859
|
+
smalltalk.send(list, "_do_", [(function(each){var value=nil;
|
|
2860
|
+
smalltalk.send(self, "_switchTarget_", [each]);return smalltalk.send(self, "_realAssign_", [smalltalk.send(self['@lazyVars'], "_at_", [each])]);})]);
|
|
2861
|
+
smalltalk.send(self, "_switchTarget_", [old]);
|
|
2862
|
+
return self;},
|
|
2863
|
+
args: [],
|
|
2864
|
+
source: "aboutToModifyState\x0a| list old |\x0a\x09list := mutables.\x0a\x09mutables := Set new.\x0a\x09old := self switchTarget: nil.\x0a\x09list do: [ :each | | value |\x0a\x09\x09self switchTarget: each.\x0a\x09\x09self realAssign: (lazyVars at: each)\x0a\x09].\x0a\x09self switchTarget: old",
|
|
2865
|
+
messageSends: ["new", "switchTarget:", "do:", "realAssign:", "at:"],
|
|
2866
|
+
referencedClasses: ["Set"]
|
|
2867
|
+
}),
|
|
2868
|
+
smalltalk.ImpCodeGenerator);
|
|
2869
|
+
|
|
2870
|
+
smalltalk.addMethod(
|
|
2871
|
+
"_argVariables",
|
|
2872
|
+
smalltalk.method({
|
|
2873
|
+
selector: "argVariables",
|
|
2874
|
+
category: 'accessing',
|
|
2875
|
+
fn: function () {
|
|
2876
|
+
var self=this;
|
|
2877
|
+
return smalltalk.send(self['@argVariables'], "_copy", []);
|
|
2878
|
+
return self;},
|
|
2879
|
+
args: [],
|
|
2880
|
+
source: "argVariables\x0a\x09^argVariables copy",
|
|
2881
|
+
messageSends: ["copy"],
|
|
2882
|
+
referencedClasses: []
|
|
2883
|
+
}),
|
|
2884
|
+
smalltalk.ImpCodeGenerator);
|
|
2885
|
+
|
|
2886
|
+
smalltalk.addMethod(
|
|
2887
|
+
"_assert_",
|
|
2888
|
+
smalltalk.method({
|
|
2889
|
+
selector: "assert:",
|
|
2890
|
+
category: 'testing',
|
|
2891
|
+
fn: function (aBoolean) {
|
|
2892
|
+
var self=this;
|
|
2893
|
+
((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", ["assertion failed"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", ["assertion failed"]);})]));
|
|
2894
|
+
return self;},
|
|
2895
|
+
args: ["aBoolean"],
|
|
2896
|
+
source: "assert: aBoolean\x0a\x09aBoolean ifFalse: [ self error: 'assertion failed' ]",
|
|
2897
|
+
messageSends: ["ifFalse:", "error:"],
|
|
2898
|
+
referencedClasses: []
|
|
2899
|
+
}),
|
|
2900
|
+
smalltalk.ImpCodeGenerator);
|
|
2901
|
+
|
|
2902
|
+
smalltalk.addMethod(
|
|
2903
|
+
"_checkClass_for_",
|
|
2904
|
+
smalltalk.method({
|
|
2905
|
+
selector: "checkClass:for:",
|
|
2906
|
+
category: 'optimizations',
|
|
2907
|
+
fn: function (aClassName, receiver) {
|
|
2908
|
+
var self=this;
|
|
2909
|
+
smalltalk.send(self, "_prvCheckClass_for_", [aClassName, receiver]);
|
|
2910
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["{"]);
|
|
2911
|
+
return self;},
|
|
2912
|
+
args: ["aClassName", "receiver"],
|
|
2913
|
+
source: "checkClass: aClassName for: receiver\x0a\x09self prvCheckClass: aClassName for: receiver.\x0a\x09stream nextPutAll: '{'",
|
|
2914
|
+
messageSends: ["prvCheckClass:for:", "nextPutAll:"],
|
|
2915
|
+
referencedClasses: []
|
|
2916
|
+
}),
|
|
2917
|
+
smalltalk.ImpCodeGenerator);
|
|
2918
|
+
|
|
2919
|
+
smalltalk.addMethod(
|
|
2920
|
+
"_checkClass_for_includeIf_",
|
|
2921
|
+
smalltalk.method({
|
|
2922
|
+
selector: "checkClass:for:includeIf:",
|
|
2923
|
+
category: 'optimizations',
|
|
2924
|
+
fn: function (aClassName, receiver, aBoolean){
|
|
2925
|
+
var self=this;
|
|
2926
|
+
smalltalk.send(self, "_prvCheckClass_for_", [aClassName, receiver]);
|
|
2927
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "if((";})() : (function(){return "if(!(";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "if((";}), (function(){return "if(!(";})])), "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [")) {"])]);
|
|
2928
|
+
return self;},
|
|
2929
|
+
args: ["aClassName", "receiver", "aBoolean"],
|
|
2930
|
+
source: "checkClass: aClassName for: receiver includeIf: aBoolean\x0a\x09self prvCheckClass: aClassName for: receiver.\x0a\x09stream nextPutAll: (aBoolean ifTrue: ['if(('] ifFalse: ['if(!(']), (self useValueNamed: receiver), ')) {'",
|
|
2931
|
+
messageSends: ["prvCheckClass:for:", "nextPutAll:", ",", "ifTrue:ifFalse:", "useValueNamed:"],
|
|
2932
|
+
referencedClasses: []
|
|
2933
|
+
}),
|
|
2934
|
+
smalltalk.ImpCodeGenerator);
|
|
2935
|
+
|
|
2936
|
+
smalltalk.addMethod(
|
|
2937
|
+
"_compileNode_",
|
|
2938
|
+
smalltalk.method({
|
|
2939
|
+
selector: "compileNode:",
|
|
2940
|
+
category: 'compiling',
|
|
2941
|
+
fn: function (aNode) {
|
|
2942
|
+
var self=this;
|
|
2943
|
+
(self['@stream']=smalltalk.send("", "_writeStream", []));
|
|
2944
|
+
smalltalk.send(self, "_visit_", [aNode]);
|
|
2945
|
+
return smalltalk.send(self['@stream'], "_contents", []);
|
|
2946
|
+
return self;},
|
|
2947
|
+
args: ["aNode"],
|
|
2948
|
+
source: "compileNode: aNode\x0a\x09stream := '' writeStream.\x0a\x09self visit: aNode.\x0a\x09^stream contents",
|
|
2949
|
+
messageSends: ["writeStream", "visit:", "contents"],
|
|
2950
|
+
referencedClasses: []
|
|
2951
|
+
}),
|
|
2952
|
+
smalltalk.ImpCodeGenerator);
|
|
2953
|
+
|
|
2954
|
+
smalltalk.addMethod(
|
|
2955
|
+
"_ifValueWanted_",
|
|
2956
|
+
smalltalk.method({
|
|
2957
|
+
selector: "ifValueWanted:",
|
|
2958
|
+
category: 'compilation DSL',
|
|
2959
|
+
fn: function (aBlock){
|
|
2960
|
+
var self=this;
|
|
2961
|
+
smalltalk.send(self['@target'], "_ifNotNil_", [aBlock]);
|
|
2962
|
+
return self;},
|
|
2963
|
+
args: ["aBlock"],
|
|
2964
|
+
source: "ifValueWanted: aBlock\x0a\x09target ifNotNil: aBlock",
|
|
2965
|
+
messageSends: ["ifNotNil:"],
|
|
2966
|
+
referencedClasses: []
|
|
2967
|
+
}),
|
|
2968
|
+
smalltalk.ImpCodeGenerator);
|
|
2969
|
+
|
|
2970
|
+
smalltalk.addMethod(
|
|
2971
|
+
"_initialize",
|
|
2972
|
+
smalltalk.method({
|
|
2973
|
+
selector: "initialize",
|
|
2974
|
+
category: 'initialization',
|
|
2975
|
+
fn: function (){
|
|
2976
|
+
var self=this;
|
|
2977
|
+
smalltalk.send(self, "_initialize", [], smalltalk.ImpCodeGenerator.superclass || nil);
|
|
2978
|
+
(self['@stream']=smalltalk.send("", "_writeStream", []));
|
|
2979
|
+
(self['@unknownVariables']=[]);
|
|
2980
|
+
(self['@tempVariables']=[]);
|
|
2981
|
+
(self['@argVariables']=[]);
|
|
2982
|
+
(self['@messageSends']=[]);
|
|
2983
|
+
(self['@classReferenced']=[]);
|
|
2984
|
+
(self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
|
2985
|
+
(self['@realVarNames']=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
|
2986
|
+
(self['@lazyVars']=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
|
|
2987
|
+
(self['@target']=nil);
|
|
2988
|
+
return self;},
|
|
2989
|
+
args: [],
|
|
2990
|
+
source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream. \x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09messageSends := #().\x0a\x09classReferenced := #().\x0a\x09mutables := Set new.\x0a\x09realVarNames := Set new.\x0a\x09lazyVars := HashedCollection new.\x0a\x09target := nil\x0a",
|
|
2991
|
+
messageSends: ["initialize", "writeStream", "new"],
|
|
2992
|
+
referencedClasses: ["Set", "HashedCollection"]
|
|
2993
|
+
}),
|
|
2994
|
+
smalltalk.ImpCodeGenerator);
|
|
2995
|
+
|
|
2996
|
+
smalltalk.addMethod(
|
|
2997
|
+
"_inline_receiver_argumentNodes_",
|
|
2998
|
+
smalltalk.method({
|
|
2999
|
+
selector: "inline:receiver:argumentNodes:",
|
|
3000
|
+
category: 'optimizations',
|
|
3001
|
+
fn: function (aSelector, receiver, aCollection){
|
|
3002
|
+
var self=this;
|
|
3003
|
+
var $early={};
|
|
3004
|
+
try{((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})]));
|
|
3005
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})]));
|
|
3006
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})]));
|
|
3007
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})]));
|
|
3008
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3009
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3010
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3011
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3012
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3013
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3014
|
+
((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3015
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3016
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3017
|
+
((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3018
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3019
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3020
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3021
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["+"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3022
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["+"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3023
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3024
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["-"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3025
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["-"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3026
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3027
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["*"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3028
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["*"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3029
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
|
|
3030
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["/"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
|
|
3031
|
+
(operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["/"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
|
|
3032
|
+
return nil;
|
|
3033
|
+
return self;
|
|
3034
|
+
} catch(e) {if(e===$early)return e[0]; throw e}},
|
|
3035
|
+
args: ["aSelector", "receiver", "aCollection"],
|
|
3036
|
+
source: "inline: aSelector receiver: receiver argumentNodes: aCollection\x0a\x0a\x09\x22-- Booleans --\x22\x0a\x0a\x09(aSelector = 'ifFalse:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: false.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self nilIfValueWanted ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09(aSelector = 'ifTrue:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: true.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self nilIfValueWanted ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09(aSelector = 'ifTrue:ifFalse:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: true.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09(aSelector = 'ifFalse:ifTrue:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: false.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '<') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '<', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a\x09(aSelector = '<=') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '<=', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a\x09(aSelector = '>') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '>', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a\x09(aSelector = '>=') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '>=', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '+') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '+', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '-') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '-', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '*') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '*', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '/') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '/', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a ^nil",
|
|
3037
|
+
messageSends: ["ifTrue:", "=", "isBlockNode", "first", "checkClass:for:includeIf:", "prvPutAndElse:", "visit:", "nodes", "nilIfValueWanted", "and:", "second", "isolatedUse:", "checkClass:for:", "lazyAssignExpression:", ",", "useValueNamed:", "value:", "new"],
|
|
3038
|
+
referencedClasses: ["VerbatimNode"]
|
|
3039
|
+
}),
|
|
3040
|
+
smalltalk.ImpCodeGenerator);
|
|
3041
|
+
|
|
3042
|
+
smalltalk.addMethod(
|
|
3043
|
+
"_inlineLiteral_receiverNode_argumentNodes_",
|
|
3044
|
+
smalltalk.method({
|
|
3045
|
+
selector: "inlineLiteral:receiverNode:argumentNodes:",
|
|
3046
|
+
category: 'optimizations',
|
|
3047
|
+
fn: function (aSelector, anObject, aCollection){
|
|
3048
|
+
var self=this;
|
|
3049
|
+
var inlined=nil;
|
|
3050
|
+
(inlined=false);
|
|
3051
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
|
|
3052
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
|
|
3053
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
|
|
3054
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
|
|
3055
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})]));
|
|
3056
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
|
|
3057
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
|
|
3058
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
|
|
3059
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
|
|
3060
|
+
smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})]));
|
|
3061
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})]));
|
|
3062
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})]));
|
|
3063
|
+
((($receiver = smalltalk.send(["+", "-", "*", "/", "<", "<=", ">=", ">"], "_includes_", [aSelector])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_prvInlineNumberOperator_on_and_", [aSelector, anObject, smalltalk.send(aCollection, "_first", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_prvInlineNumberOperator_on_and_", [aSelector, anObject, smalltalk.send(aCollection, "_first", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (inlined=true);})]));})]));
|
|
3064
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3065
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3066
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3067
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3068
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})]));
|
|
3069
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3070
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3071
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3072
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3073
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})]));
|
|
3074
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3075
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3076
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3077
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3078
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})]));
|
|
3079
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3080
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3081
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3082
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3083
|
+
smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})]));
|
|
3084
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["isNil"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3085
|
+
(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null)"])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3086
|
+
(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null)"])]);return (inlined=true);})]));
|
|
3087
|
+
((($receiver = smalltalk.send(aSelector, "__eq", ["notNil"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3088
|
+
(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null)"])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3089
|
+
(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null)"])]);return (inlined=true);})]));
|
|
3090
|
+
return inlined;
|
|
3091
|
+
return self;},
|
|
3092
|
+
args: ["aSelector", "anObject", "aCollection"],
|
|
3093
|
+
source: "inlineLiteral: aSelector receiverNode: anObject argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a \x0a\x09\x22-- BlockClosures --\x22\x0a\x0a\x09(aSelector = 'whileTrue:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [ | old |\x0a\x09\x09\x09self prvWhileConditionStatement: 'for(;;){' pre: 'if (!(' condition: anObject post: ')) {'.\x0a\x09\x09\x09stream nextPutAll: 'break}', self mylf.\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection first nodes first targetBeing: nil ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [ | old |\x0a\x09\x09\x09self prvWhileConditionStatement: 'for(;;){' pre: 'if ((' condition: anObject post: ')) {'.\x0a\x09\x09\x09stream nextPutAll: 'break}', self mylf.\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection first nodes first targetBeing: nil ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileTrue') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a\x09\x09\x09self prvWhileConditionStatement: 'do{' pre: '}while((' condition: anObject post: '));', self mylf.\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a\x09\x09\x09self prvWhileConditionStatement: 'do{' pre: '}while(!(' condition: anObject post: '));', self mylf.\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(#('+' '-' '*' '/' '<' '<=' '>=' '>') includes: aSelector) ifTrue: [\x0a\x09\x09(self prvInlineNumberOperator: aSelector on: anObject and: aCollection first) ifTrue: [\x0a\x09\x09\x09inlined := true]].\x0a \x09 \x0a\x09\x22-- UndefinedObject --\x22\x0a\x0a\x09(aSelector = 'ifNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') === nil || (', rcv, ') == null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self lazyAssignValue: rcv ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') !== nil && (', rcv, ') != null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self lazyAssignValue: rcv ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNil:ifNotNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') === nil || (', rcv, ') == null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:ifNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') !== nil && (', rcv, ') != null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'isNil') ifTrue: [ | rcv |\x0a\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09self lazyAssignValue: '((', rcv, ') === nil || (', rcv, ') == null)'.\x0a\x09\x09inlined := true].\x0a\x0a\x09(aSelector = 'notNil') ifTrue: [ | rcv |\x0a\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09self lazyAssignValue: '((', rcv, ') !== nil && (', rcv, ') != null)'.\x0a\x09\x09inlined := true].\x0a\x0a ^inlined",
|
|
3094
|
+
messageSends: ["ifTrue:", "=", "and:", "isBlockNode", "first", "prvWhileConditionStatement:pre:condition:post:", "nextPutAll:", ",", "mylf", "prvPutAndClose:", "visit:targetBeing:", "nodes", "includes:", "prvInlineNumberOperator:on:and:", "aboutToModifyState", "isolatedUse:", "makeTargetRealVariable", "prvPutAndElse:", "visit:", "lazyAssignValue:", "second"],
|
|
3095
|
+
referencedClasses: []
|
|
3096
|
+
}),
|
|
3097
|
+
smalltalk.ImpCodeGenerator);
|
|
3098
|
+
|
|
3099
|
+
smalltalk.addMethod(
|
|
3100
|
+
"_isNode_ofClass_",
|
|
3101
|
+
smalltalk.method({
|
|
3102
|
+
selector: "isNode:ofClass:",
|
|
3103
|
+
category: 'optimizations',
|
|
3104
|
+
fn: function (aNode, aClass) {
|
|
3105
|
+
var self=this;
|
|
3106
|
+
return smalltalk.send(smalltalk.send(aNode, "_isValueNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "_class", []), "__eq", [aClass]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["self"]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_currentClass", []), "__eq", [aClass]);})]);})]);})]);
|
|
3107
|
+
return self;},
|
|
3108
|
+
args: ["aNode", "aClass"],
|
|
3109
|
+
source: "isNode: aNode ofClass: aClass\x0a\x09^aNode isValueNode and: [\x0a \x09aNode value class = aClass or: [\x0a \x09\x09aNode value = 'self' and: [self currentClass = aClass]]]",
|
|
3110
|
+
messageSends: ["and:", "isValueNode", "or:", "=", "class", "value", "currentClass"],
|
|
3111
|
+
referencedClasses: []
|
|
3112
|
+
}),
|
|
3113
|
+
smalltalk.ImpCodeGenerator);
|
|
3114
|
+
|
|
3115
|
+
smalltalk.addMethod(
|
|
3116
|
+
"_isolated_",
|
|
3117
|
+
smalltalk.method({
|
|
3118
|
+
selector: "isolated:",
|
|
3119
|
+
category: 'compilation DSL',
|
|
3120
|
+
fn: function (node){
|
|
3121
|
+
var self=this;
|
|
3122
|
+
return smalltalk.send(self, "_visit_targetBeing_", [node, smalltalk.send(self, "_nextLazyvarName", [])]);
|
|
3123
|
+
return self;},
|
|
3124
|
+
args: ["node"],
|
|
3125
|
+
source: "isolated: node\x0a \x09^ self visit: node targetBeing: self nextLazyvarName",
|
|
3126
|
+
messageSends: ["visit:targetBeing:", "nextLazyvarName"],
|
|
3127
|
+
referencedClasses: []
|
|
3128
|
+
}),
|
|
3129
|
+
smalltalk.ImpCodeGenerator);
|
|
3130
|
+
|
|
3131
|
+
smalltalk.addMethod(
|
|
3132
|
+
"_isolatedUse_",
|
|
3133
|
+
smalltalk.method({
|
|
3134
|
+
selector: "isolatedUse:",
|
|
3135
|
+
category: 'compilation DSL',
|
|
3136
|
+
fn: function (node){
|
|
3137
|
+
var self=this;
|
|
3138
|
+
var old=nil;
|
|
3139
|
+
(old=smalltalk.send(self, "_switchTarget_", [smalltalk.send(self, "_nextLazyvarName", [])]));
|
|
3140
|
+
smalltalk.send(self, "_visit_", [node]);
|
|
3141
|
+
return smalltalk.send(self, "_useValueNamed_", [smalltalk.send(self, "_switchTarget_", [old])]);
|
|
3142
|
+
return self;},
|
|
3143
|
+
args: ["node"],
|
|
3144
|
+
source: "isolatedUse: node\x0a| old |\x0a\x09old := self switchTarget: self nextLazyvarName.\x0a\x09self visit: node.\x0a\x09^self useValueNamed: (self switchTarget: old)",
|
|
3145
|
+
messageSends: ["switchTarget:", "nextLazyvarName", "visit:", "useValueNamed:"],
|
|
3146
|
+
referencedClasses: []
|
|
3147
|
+
}),
|
|
3148
|
+
smalltalk.ImpCodeGenerator);
|
|
3149
|
+
|
|
3150
|
+
smalltalk.addMethod(
|
|
3151
|
+
"_knownVariables",
|
|
3152
|
+
smalltalk.method({
|
|
3153
|
+
selector: "knownVariables",
|
|
3154
|
+
category: 'accessing',
|
|
3155
|
+
fn: function () {
|
|
3156
|
+
var self=this;
|
|
3157
|
+
return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_tempVariables", [])]);smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_argVariables", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_pseudoVariables", []));
|
|
3158
|
+
return self;},
|
|
3159
|
+
args: [],
|
|
3160
|
+
source: "knownVariables\x0a\x09^self pseudoVariables \x0a\x09\x09addAll: self tempVariables;\x0a\x09\x09addAll: self argVariables;\x0a\x09\x09yourself",
|
|
3161
|
+
messageSends: ["addAll:", "tempVariables", "argVariables", "yourself", "pseudoVariables"],
|
|
3162
|
+
referencedClasses: []
|
|
3163
|
+
}),
|
|
3164
|
+
smalltalk.ImpCodeGenerator);
|
|
3165
|
+
|
|
3166
|
+
smalltalk.addMethod(
|
|
3167
|
+
"_lazyAssign_dependsOnState_",
|
|
3168
|
+
smalltalk.method({
|
|
3169
|
+
selector: "lazyAssign:dependsOnState:",
|
|
3170
|
+
category: 'compilation DSL',
|
|
3171
|
+
fn: function (aString, aBoolean){
|
|
3172
|
+
var self=this;
|
|
3173
|
+
((($receiver = smalltalk.send(self['@lazyVars'], "_includesKey_", [self['@target']])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@lazyVars'], "_at_put_", [self['@target'], aString]);return ((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})]));})() : (function(){return smalltalk.send(self, "_realAssign_", [aString]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(self['@lazyVars'], "_at_put_", [self['@target'], aString]);return ((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})]));}), (function(){return smalltalk.send(self, "_realAssign_", [aString]);})]));
|
|
3174
|
+
return self;},
|
|
3175
|
+
args: ["aString", "aBoolean"],
|
|
3176
|
+
source: "lazyAssign: aString dependsOnState: aBoolean\x0a\x09(lazyVars includesKey: target)\x0a\x09\x09ifTrue: [ lazyVars at: target put: aString. aBoolean ifTrue: [ mutables add: target ] ]\x0a\x09\x09ifFalse: [ self realAssign: aString ]",
|
|
3177
|
+
messageSends: ["ifTrue:ifFalse:", "includesKey:", "at:put:", "ifTrue:", "add:", "realAssign:"],
|
|
3178
|
+
referencedClasses: []
|
|
3179
|
+
}),
|
|
3180
|
+
smalltalk.ImpCodeGenerator);
|
|
3181
|
+
|
|
3182
|
+
smalltalk.addMethod(
|
|
3183
|
+
"_lazyAssignExpression_",
|
|
3184
|
+
smalltalk.method({
|
|
3185
|
+
selector: "lazyAssignExpression:",
|
|
3186
|
+
category: 'compilation DSL',
|
|
3187
|
+
fn: function (aString){
|
|
3188
|
+
var self=this;
|
|
3189
|
+
smalltalk.send(self, "_lazyAssign_dependsOnState_", [aString, true]);
|
|
3190
|
+
return self;},
|
|
3191
|
+
args: ["aString"],
|
|
3192
|
+
source: "lazyAssignExpression: aString\x0a\x09self lazyAssign: aString dependsOnState: true",
|
|
3193
|
+
messageSends: ["lazyAssign:dependsOnState:"],
|
|
3194
|
+
referencedClasses: []
|
|
3195
|
+
}),
|
|
3196
|
+
smalltalk.ImpCodeGenerator);
|
|
3197
|
+
|
|
3198
|
+
smalltalk.addMethod(
|
|
3199
|
+
"_lazyAssignValue_",
|
|
3200
|
+
smalltalk.method({
|
|
3201
|
+
selector: "lazyAssignValue:",
|
|
3202
|
+
category: 'compilation DSL',
|
|
3203
|
+
fn: function (aString){
|
|
3204
|
+
var self=this;
|
|
3205
|
+
smalltalk.send(self, "_lazyAssign_dependsOnState_", [aString, false]);
|
|
3206
|
+
return self;},
|
|
3207
|
+
args: ["aString"],
|
|
3208
|
+
source: "lazyAssignValue: aString\x0a\x09self lazyAssign: aString dependsOnState: false",
|
|
3209
|
+
messageSends: ["lazyAssign:dependsOnState:"],
|
|
3210
|
+
referencedClasses: []
|
|
3211
|
+
}),
|
|
3212
|
+
smalltalk.ImpCodeGenerator);
|
|
3213
|
+
|
|
3214
|
+
smalltalk.addMethod(
|
|
3215
|
+
"_makeTargetRealVariable",
|
|
3216
|
+
smalltalk.method({
|
|
3217
|
+
selector: "makeTargetRealVariable",
|
|
3218
|
+
category: 'compilation DSL',
|
|
3219
|
+
fn: function (){
|
|
3220
|
+
var self=this;
|
|
3221
|
+
((($receiver = smalltalk.send(self['@lazyVars'], "_includesKey_", [self['@target']])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@lazyVars'], "_removeKey_", [self['@target']]);smalltalk.send(self['@lazyVars'], "_at_put_", [smalltalk.send("assigned ", "__comma", [self['@target']]), nil]);return smalltalk.send(self['@realVarNames'], "_add_", [self['@target']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@lazyVars'], "_removeKey_", [self['@target']]);smalltalk.send(self['@lazyVars'], "_at_put_", [smalltalk.send("assigned ", "__comma", [self['@target']]), nil]);return smalltalk.send(self['@realVarNames'], "_add_", [self['@target']]);})]));
|
|
3222
|
+
return self;},
|
|
3223
|
+
args: [],
|
|
3224
|
+
source: "makeTargetRealVariable\x0a\x09(lazyVars includesKey: target) ifTrue: [\x0a\x09\x09lazyVars removeKey: target.\x0a\x09\x09lazyVars at: 'assigned ',target put: nil. \x22<-- only to retain size, it is used in nextLazyvarName\x22\x0a\x09\x09realVarNames add: target ].",
|
|
3225
|
+
messageSends: ["ifTrue:", "includesKey:", "removeKey:", "at:put:", ",", "add:"],
|
|
3226
|
+
referencedClasses: []
|
|
3227
|
+
}),
|
|
3228
|
+
smalltalk.ImpCodeGenerator);
|
|
3229
|
+
|
|
3230
|
+
smalltalk.addMethod(
|
|
3231
|
+
"_mylf",
|
|
3232
|
+
smalltalk.method({
|
|
3233
|
+
selector: "mylf",
|
|
3234
|
+
category: 'output',
|
|
3235
|
+
fn: function () {
|
|
3236
|
+
var self=this;
|
|
3237
|
+
return smalltalk.send(smalltalk.send((smalltalk.String || String), "_lf", []), "__comma", [smalltalk.send(smalltalk.send((smalltalk.Array || Array), "_new_", [((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(2) : smalltalk.send($receiver, "__plus", [(2)]))]), "_join_", [smalltalk.send((smalltalk.String || String), "_tab", [])])]);
|
|
3238
|
+
return self;},
|
|
3239
|
+
args: [],
|
|
3240
|
+
source: "mylf\x0a\x09^String lf, ((Array new: nestedBlocks+2) join: String tab)",
|
|
3241
|
+
messageSends: [",", "lf", "join:", "new:", "+", "tab"],
|
|
3242
|
+
referencedClasses: ["String", "Array"]
|
|
3243
|
+
}),
|
|
3244
|
+
smalltalk.ImpCodeGenerator);
|
|
3245
|
+
|
|
3246
|
+
smalltalk.addMethod(
|
|
3247
|
+
"_nextLazyvarName",
|
|
3248
|
+
smalltalk.method({
|
|
3249
|
+
selector: "nextLazyvarName",
|
|
3250
|
+
category: 'compilation DSL',
|
|
3251
|
+
fn: function (){
|
|
3252
|
+
var self=this;
|
|
3253
|
+
var name=nil;
|
|
3254
|
+
(name=smalltalk.send("$", "__comma", [smalltalk.send(smalltalk.send(self['@lazyVars'], "_size", []), "_asString", [])]));
|
|
3255
|
+
smalltalk.send(self['@lazyVars'], "_at_put_", [name, name]);
|
|
3256
|
+
return name;
|
|
3257
|
+
return self;},
|
|
3258
|
+
args: [],
|
|
3259
|
+
source: "nextLazyvarName\x0a\x09| name |\x0a\x09name := '$', lazyVars size asString.\x0a\x09lazyVars at: name put: name.\x0a\x09^name",
|
|
3260
|
+
messageSends: [",", "asString", "size", "at:put:"],
|
|
3261
|
+
referencedClasses: []
|
|
3262
|
+
}),
|
|
3263
|
+
smalltalk.ImpCodeGenerator);
|
|
3264
|
+
|
|
3265
|
+
smalltalk.addMethod(
|
|
3266
|
+
"_nilIfValueWanted",
|
|
3267
|
+
smalltalk.method({
|
|
3268
|
+
selector: "nilIfValueWanted",
|
|
3269
|
+
category: 'compilation DSL',
|
|
3270
|
+
fn: function (){
|
|
3271
|
+
var self=this;
|
|
3272
|
+
(($receiver = self['@target']) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_lazyAssignValue_", ["nil"]);})() : nil;
|
|
3273
|
+
return self;},
|
|
3274
|
+
args: [],
|
|
3275
|
+
source: "nilIfValueWanted\x0a\x09target ifNotNil: [ self lazyAssignValue: 'nil' ]",
|
|
3276
|
+
messageSends: ["ifNotNil:", "lazyAssignValue:"],
|
|
3277
|
+
referencedClasses: []
|
|
3278
|
+
}),
|
|
3279
|
+
smalltalk.ImpCodeGenerator);
|
|
3280
|
+
|
|
3281
|
+
smalltalk.addMethod(
|
|
3282
|
+
"_performOptimizations",
|
|
3283
|
+
smalltalk.method({
|
|
3284
|
+
selector: "performOptimizations",
|
|
3285
|
+
category: 'testing',
|
|
3286
|
+
fn: function () {
|
|
3287
|
+
var self=this;
|
|
3288
|
+
return smalltalk.send(smalltalk.send(self, "_class", []), "_performOptimizations", []);
|
|
3289
|
+
return self;},
|
|
3290
|
+
args: [],
|
|
3291
|
+
source: "performOptimizations\x0a\x09^self class performOptimizations",
|
|
3292
|
+
messageSends: ["performOptimizations", "class"],
|
|
3293
|
+
referencedClasses: []
|
|
3294
|
+
}),
|
|
3295
|
+
smalltalk.ImpCodeGenerator);
|
|
3296
|
+
|
|
3297
|
+
smalltalk.addMethod(
|
|
3298
|
+
"_prvCheckClass_for_",
|
|
3299
|
+
smalltalk.method({
|
|
3300
|
+
selector: "prvCheckClass:for:",
|
|
3301
|
+
category: 'optimizations',
|
|
3302
|
+
fn: function (aClassName, receiver){
|
|
3303
|
+
var self=this;
|
|
3304
|
+
smalltalk.send(self, "_makeTargetRealVariable", []);
|
|
3305
|
+
smalltalk.send(self, "_aboutToModifyState", []);
|
|
3306
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [").klass === smalltalk."]), "__comma", [aClassName]), "__comma", [") "])]);
|
|
3307
|
+
return self;},
|
|
3308
|
+
args: ["aClassName", "receiver"],
|
|
3309
|
+
source: "prvCheckClass: aClassName for: receiver\x0a\x09self makeTargetRealVariable.\x0a\x09self aboutToModifyState.\x0a stream nextPutAll: 'if((', (self useValueNamed: receiver), ').klass === smalltalk.', aClassName, ') '",
|
|
3310
|
+
messageSends: ["makeTargetRealVariable", "aboutToModifyState", "nextPutAll:", ",", "useValueNamed:"],
|
|
3311
|
+
referencedClasses: []
|
|
3312
|
+
}),
|
|
3313
|
+
smalltalk.ImpCodeGenerator);
|
|
3314
|
+
|
|
3315
|
+
smalltalk.addMethod(
|
|
3316
|
+
"_prvInlineNumberOperator_on_and_",
|
|
3317
|
+
smalltalk.method({
|
|
3318
|
+
selector: "prvInlineNumberOperator:on:and:",
|
|
3319
|
+
category: 'optimizations',
|
|
3320
|
+
fn: function (aSelector, receiverNode, operandNode){
|
|
3321
|
+
var self=this;
|
|
3322
|
+
var $early={};
|
|
3323
|
+
try{((($receiver = smalltalk.send(aSelector, "__eq", [aSelector])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [receiverNode, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3324
|
+
var operand=nil;
|
|
3325
|
+
(rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3326
|
+
var operand=nil;
|
|
3327
|
+
(rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [receiverNode, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
|
|
3328
|
+
var operand=nil;
|
|
3329
|
+
(rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
|
|
3330
|
+
var operand=nil;
|
|
3331
|
+
(rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})]));})]));
|
|
3332
|
+
return false;
|
|
3333
|
+
return self;
|
|
3334
|
+
} catch(e) {if(e===$early)return e[0]; throw e}},
|
|
3335
|
+
args: ["aSelector", "receiverNode", "operandNode"],
|
|
3336
|
+
source: "prvInlineNumberOperator: aSelector on: receiverNode and: operandNode\x0a\x09(aSelector = aSelector) ifTrue: [\x0a\x09\x09(self isNode: receiverNode ofClass: Number) ifTrue: [\x0a\x09\x09\x09| rcv operand |\x0a\x09\x09\x09rcv := self isolated: receiverNode.\x0a\x09\x09\x09operand := self isolated: operandNode.\x0a\x09\x09\x09self lazyAssignValue: ((self useValueNamed: rcv), aSelector, (self useValueNamed: operand)).\x0a\x09\x09\x09^true]].\x0a\x09^false\x0a",
|
|
3337
|
+
messageSends: ["ifTrue:", "=", "isNode:ofClass:", "isolated:", "lazyAssignValue:", ",", "useValueNamed:"],
|
|
3338
|
+
referencedClasses: ["Number"]
|
|
3339
|
+
}),
|
|
3340
|
+
smalltalk.ImpCodeGenerator);
|
|
3341
|
+
|
|
3342
|
+
smalltalk.addMethod(
|
|
3343
|
+
"_prvPutAndClose_",
|
|
3344
|
+
smalltalk.method({
|
|
3345
|
+
selector: "prvPutAndClose:",
|
|
3346
|
+
category: 'output',
|
|
3347
|
+
fn: function (aBlock) {
|
|
3348
|
+
var self=this;
|
|
3349
|
+
smalltalk.send(aBlock, "_value", []);
|
|
3350
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("}", "__comma", [smalltalk.send(self, "_mylf", [])])]);
|
|
3351
|
+
return self;},
|
|
3352
|
+
args: ["aBlock"],
|
|
3353
|
+
source: "prvPutAndClose: aBlock\x0a\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '}', self mylf\x0a",
|
|
3354
|
+
messageSends: ["value", "nextPutAll:", ",", "mylf"],
|
|
3355
|
+
referencedClasses: []
|
|
3356
|
+
}),
|
|
3357
|
+
smalltalk.ImpCodeGenerator);
|
|
3358
|
+
|
|
3359
|
+
smalltalk.addMethod(
|
|
3360
|
+
"_prvPutAndElse_",
|
|
3361
|
+
smalltalk.method({
|
|
3362
|
+
selector: "prvPutAndElse:",
|
|
3363
|
+
category: 'output',
|
|
3364
|
+
fn: function (aBlock) {
|
|
3365
|
+
var self=this;
|
|
3366
|
+
smalltalk.send(aBlock, "_value", []);
|
|
3367
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["} else {"]);
|
|
3368
|
+
return self;},
|
|
3369
|
+
args: ["aBlock"],
|
|
3370
|
+
source: "prvPutAndElse: aBlock\x0a\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '} else {'\x0a",
|
|
3371
|
+
messageSends: ["value", "nextPutAll:"],
|
|
3372
|
+
referencedClasses: []
|
|
3373
|
+
}),
|
|
3374
|
+
smalltalk.ImpCodeGenerator);
|
|
3375
|
+
|
|
3376
|
+
smalltalk.addMethod(
|
|
3377
|
+
"_prvWhileConditionStatement_pre_condition_post_",
|
|
3378
|
+
smalltalk.method({
|
|
3379
|
+
selector: "prvWhileConditionStatement:pre:condition:post:",
|
|
3380
|
+
category: 'optimizations',
|
|
3381
|
+
fn: function (stmtString, preString, anObject, postString){
|
|
3382
|
+
var self=this;
|
|
3383
|
+
var x=nil;
|
|
3384
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", [stmtString]);
|
|
3385
|
+
(x=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(smalltalk.send(anObject, "_nodes", []), "_first", [])]));
|
|
3386
|
+
smalltalk.send(x, "_ifEmpty_", [(function(){return (x="\x22should not reach - receiver includes ^\x22");})]);
|
|
3387
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(preString, "__comma", [x]), "__comma", [postString])]);
|
|
3388
|
+
smalltalk.send(self, "_nilIfValueWanted", []);
|
|
3389
|
+
return self;},
|
|
3390
|
+
args: ["stmtString", "preString", "anObject", "postString"],
|
|
3391
|
+
source: "prvWhileConditionStatement: stmtString pre: preString condition: anObject post: postString\x0a\x09| x |\x0a\x09stream nextPutAll: stmtString.\x0a\x09x := self isolatedUse: anObject nodes first.\x0a\x09x ifEmpty: [ x := '\x22should not reach - receiver includes ^\x22' ].\x0a\x09stream nextPutAll: preString, x, postString.\x0a\x09self nilIfValueWanted",
|
|
3392
|
+
messageSends: ["nextPutAll:", "isolatedUse:", "first", "nodes", "ifEmpty:", ",", "nilIfValueWanted"],
|
|
3393
|
+
referencedClasses: []
|
|
3394
|
+
}),
|
|
3395
|
+
smalltalk.ImpCodeGenerator);
|
|
3396
|
+
|
|
3397
|
+
smalltalk.addMethod(
|
|
3398
|
+
"_putTemps_",
|
|
3399
|
+
smalltalk.method({
|
|
3400
|
+
selector: "putTemps:",
|
|
3401
|
+
category: 'output',
|
|
3402
|
+
fn: function (temps) {
|
|
3403
|
+
var self=this;
|
|
3404
|
+
smalltalk.send(temps, "_ifNotEmpty_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["var "]);smalltalk.send(temps, "_do_separatedBy_", [(function(each){var temp=nil;
|
|
3405
|
+
(temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(temp, "__comma", ["=nil"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(";", "__comma", [smalltalk.send(self, "_mylf", [])])]);})]);
|
|
3406
|
+
return self;},
|
|
3407
|
+
args: ["temps"],
|
|
3408
|
+
source: "putTemps: temps\x0a temps ifNotEmpty: [\x0a\x09stream nextPutAll: 'var '.\x0a\x09temps do: [:each | | temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09 tempVariables add: temp.\x0a\x09 stream nextPutAll: temp, '=nil'] separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ';', self mylf\x0a ]",
|
|
3409
|
+
messageSends: ["ifNotEmpty:", "nextPutAll:", "do:separatedBy:", "safeVariableNameFor:", "add:", ",", "mylf"],
|
|
3410
|
+
referencedClasses: []
|
|
3411
|
+
}),
|
|
3412
|
+
smalltalk.ImpCodeGenerator);
|
|
3413
|
+
|
|
3414
|
+
smalltalk.addMethod(
|
|
3415
|
+
"_realAssign_",
|
|
3416
|
+
smalltalk.method({
|
|
3417
|
+
selector: "realAssign:",
|
|
3418
|
+
category: 'compilation DSL',
|
|
3419
|
+
fn: function (aString){
|
|
3420
|
+
var self=this;
|
|
3421
|
+
var closer=nil;
|
|
3422
|
+
smalltalk.send(aString, "_ifNotEmpty_", [(function(){smalltalk.send(self, "_aboutToModifyState", []);(closer="");smalltalk.send(self, "_ifValueWanted_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [((($receiver = smalltalk.send(self['@target'], "__eq", ["^"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "return ";})() : (function(){return ((($receiver = smalltalk.send(self['@target'], "__eq", ["!"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){(closer="]");return "throw $early=[";})() : (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){(closer="]");return "throw $early=[";}), (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "return ";}), (function(){return ((($receiver = smalltalk.send(self['@target'], "__eq", ["!"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){(closer="]");return "throw $early=[";})() : (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){(closer="]");return "throw $early=[";}), (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})]));})]))]);})]);smalltalk.send(self, "_makeTargetRealVariable", []);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(aString, "__comma", [closer]), "__comma", [";"]), "__comma", [smalltalk.send(self, "_mylf", [])])]);})]);
|
|
3423
|
+
return self;},
|
|
3424
|
+
args: ["aString"],
|
|
3425
|
+
source: "realAssign: aString\x0a\x09| closer |\x0a\x09aString ifNotEmpty: [\x0a\x09\x09self aboutToModifyState.\x0a\x09\x09closer := ''.\x0a\x09\x09self ifValueWanted: [ stream nextPutAll:\x0a\x09\x09\x09(target = '^' ifTrue: ['return '] ifFalse: [\x0a\x09\x09\x09\x09target = '!' ifTrue: [ closer := ']'. 'throw $early=['] ifFalse: [\x0a\x09\x09\x09\x09\x09target, '=']]) ].\x0a\x09\x09self makeTargetRealVariable.\x0a\x09\x09stream nextPutAll: aString, closer, ';', self mylf ]",
|
|
3426
|
+
messageSends: ["ifNotEmpty:", "aboutToModifyState", "ifValueWanted:", "nextPutAll:", "ifTrue:ifFalse:", "=", ",", "makeTargetRealVariable", "mylf"],
|
|
3427
|
+
referencedClasses: []
|
|
3428
|
+
}),
|
|
3429
|
+
smalltalk.ImpCodeGenerator);
|
|
3430
|
+
|
|
3431
|
+
smalltalk.addMethod(
|
|
3432
|
+
"_send_to_arguments_superSend_",
|
|
3433
|
+
smalltalk.method({
|
|
3434
|
+
selector: "send:to:arguments:superSend:",
|
|
3435
|
+
category: 'visiting',
|
|
3436
|
+
fn: function (aSelector, aReceiver, aCollection, aBoolean){
|
|
3437
|
+
var self=this;
|
|
3438
|
+
var args=nil;
|
|
3439
|
+
(args=smalltalk.send(self, "_isolated_", [(function($rec){smalltalk.send($rec, "_nodes_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.DynamicArrayNode || DynamicArrayNode), "_new", []))]));
|
|
3440
|
+
smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){smalltalk.send(str, "_nextPutAll_", ["smalltalk.send("]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self, "_useValueNamed_", [aReceiver])]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", \x22", "__comma", [smalltalk.send(aSelector, "_asSelector", [])]), "__comma", ["\x22, "])]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self, "_useValueNamed_", [args])]);((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(smalltalk.send(self, "_currentClass", []), "_superclass", [])])])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(smalltalk.send(self, "_currentClass", []), "_superclass", [])])])]);})]));return smalltalk.send(str, "_nextPutAll_", [")"]);})])]);
|
|
3441
|
+
return self;},
|
|
3442
|
+
args: ["aSelector", "aReceiver", "aCollection", "aBoolean"],
|
|
3443
|
+
source: "send: aSelector to: aReceiver arguments: aCollection superSend: aBoolean\x0a\x09| args |\x0a\x09args := self isolated: (DynamicArrayNode new nodes: aCollection; yourself).\x0a\x09self lazyAssignExpression: (String streamContents: [ :str |\x0a\x09\x09str nextPutAll: 'smalltalk.send('.\x0a\x09\x09str nextPutAll: (self useValueNamed: aReceiver).\x0a\x09\x09str nextPutAll: ', \x22', aSelector asSelector, '\x22, '.\x0a\x09\x09str nextPutAll: (self useValueNamed: args).\x0a\x09\x09aBoolean ifTrue: [\x0a\x09\x09\x09str nextPutAll: ', smalltalk.', (self classNameFor: self currentClass superclass)].\x0a\x09\x09str nextPutAll: ')'\x0a\x09])",
|
|
3444
|
+
messageSends: ["isolated:", "nodes:", "yourself", "new", "lazyAssignExpression:", "streamContents:", "nextPutAll:", "useValueNamed:", ",", "asSelector", "ifTrue:", "classNameFor:", "superclass", "currentClass"],
|
|
3445
|
+
referencedClasses: ["DynamicArrayNode", "String"]
|
|
3446
|
+
}),
|
|
3447
|
+
smalltalk.ImpCodeGenerator);
|
|
3448
|
+
|
|
3449
|
+
smalltalk.addMethod(
|
|
3450
|
+
"_sequenceOfNodes_temps_",
|
|
3451
|
+
smalltalk.method({
|
|
3452
|
+
selector: "sequenceOfNodes:temps:",
|
|
3453
|
+
category: 'visiting',
|
|
3454
|
+
fn: function (nodes, temps){
|
|
3455
|
+
var self=this;
|
|
3456
|
+
((($receiver = smalltalk.send(nodes, "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){var old=nil;
|
|
3457
|
+
var index=nil;
|
|
3458
|
+
smalltalk.send(self, "_putTemps_", [temps]);(old=smalltalk.send(self, "_switchTarget_", [nil]));(index=(0));return smalltalk.send(nodes, "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(nodes, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_switchTarget_", [old]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_switchTarget_", [old]);})]));return smalltalk.send(self, "_visit_", [each]);})]);})() : (function(){return smalltalk.send(self, "_nilIfValueWanted", []);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){var old=nil;
|
|
3459
|
+
var index=nil;
|
|
3460
|
+
smalltalk.send(self, "_putTemps_", [temps]);(old=smalltalk.send(self, "_switchTarget_", [nil]));(index=(0));return smalltalk.send(nodes, "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(nodes, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_switchTarget_", [old]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_switchTarget_", [old]);})]));return smalltalk.send(self, "_visit_", [each]);})]);}), (function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]));
|
|
3461
|
+
return self;},
|
|
3462
|
+
args: ["nodes", "temps"],
|
|
3463
|
+
source: "sequenceOfNodes: nodes temps: temps\x0a\x09nodes isEmpty\x0a\x09\x09ifFalse: [ | old index |\x0a\x09\x09\x09self putTemps: temps.\x0a\x09\x09\x09old :=self switchTarget: nil.\x0a\x09\x09\x09index := 0.\x0a\x09\x09\x09nodes do: [:each |\x0a\x09\x09\x09\x09index := index + 1.\x0a\x09\x09\x09\x09index = nodes size ifTrue: [ self switchTarget: old ].\x0a\x09\x09\x09self visit: each ]]\x0a\x09\x09ifTrue: [ self nilIfValueWanted ]",
|
|
3464
|
+
messageSends: ["ifFalse:ifTrue:", "isEmpty", "putTemps:", "switchTarget:", "do:", "+", "ifTrue:", "=", "size", "visit:", "nilIfValueWanted"],
|
|
3465
|
+
referencedClasses: []
|
|
3466
|
+
}),
|
|
3467
|
+
smalltalk.ImpCodeGenerator);
|
|
3468
|
+
|
|
3469
|
+
smalltalk.addMethod(
|
|
3470
|
+
"_switchTarget_",
|
|
3471
|
+
smalltalk.method({
|
|
3472
|
+
selector: "switchTarget:",
|
|
3473
|
+
category: 'compilation DSL',
|
|
3474
|
+
fn: function (aString){
|
|
3475
|
+
var self=this;
|
|
3476
|
+
var old=nil;
|
|
3477
|
+
(old=self['@target']);
|
|
3478
|
+
(self['@target']=aString);
|
|
3479
|
+
return old;
|
|
3480
|
+
return self;},
|
|
3481
|
+
args: ["aString"],
|
|
3482
|
+
source: "switchTarget: aString\x0a\x09| old |\x0a\x09old := target.\x0a\x09target := aString.\x0a\x09^old",
|
|
3483
|
+
messageSends: [],
|
|
3484
|
+
referencedClasses: []
|
|
3485
|
+
}),
|
|
3486
|
+
smalltalk.ImpCodeGenerator);
|
|
3487
|
+
|
|
3488
|
+
smalltalk.addMethod(
|
|
3489
|
+
"_tempVariables",
|
|
3490
|
+
smalltalk.method({
|
|
3491
|
+
selector: "tempVariables",
|
|
3492
|
+
category: 'accessing',
|
|
3493
|
+
fn: function () {
|
|
3494
|
+
var self=this;
|
|
3495
|
+
return smalltalk.send(self['@tempVariables'], "_copy", []);
|
|
3496
|
+
return self;},
|
|
3497
|
+
args: [],
|
|
3498
|
+
source: "tempVariables\x0a\x09^tempVariables copy",
|
|
3499
|
+
messageSends: ["copy"],
|
|
3500
|
+
referencedClasses: []
|
|
3501
|
+
}),
|
|
3502
|
+
smalltalk.ImpCodeGenerator);
|
|
3503
|
+
|
|
3504
|
+
smalltalk.addMethod(
|
|
3505
|
+
"_unknownVariables",
|
|
3506
|
+
smalltalk.method({
|
|
3507
|
+
selector: "unknownVariables",
|
|
3508
|
+
category: 'accessing',
|
|
3509
|
+
fn: function () {
|
|
3510
|
+
var self=this;
|
|
3511
|
+
return smalltalk.send(self['@unknownVariables'], "_copy", []);
|
|
3512
|
+
return self;},
|
|
3513
|
+
args: [],
|
|
3514
|
+
source: "unknownVariables\x0a\x09^unknownVariables copy",
|
|
3515
|
+
messageSends: ["copy"],
|
|
3516
|
+
referencedClasses: []
|
|
3517
|
+
}),
|
|
3518
|
+
smalltalk.ImpCodeGenerator);
|
|
3519
|
+
|
|
3520
|
+
smalltalk.addMethod(
|
|
3521
|
+
"_useValueNamed_",
|
|
3522
|
+
smalltalk.method({
|
|
3523
|
+
selector: "useValueNamed:",
|
|
3524
|
+
category: 'compilation DSL',
|
|
3525
|
+
fn: function (key){
|
|
3526
|
+
var self=this;
|
|
3527
|
+
var $early={};
|
|
3528
|
+
try{var val=nil;
|
|
3529
|
+
((($receiver = smalltalk.send(self['@realVarNames'], "_includes_", [key])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw $early=[key]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=[key]})();})]));
|
|
3530
|
+
smalltalk.send(self['@mutables'], "_remove_", [key]);
|
|
3531
|
+
return smalltalk.send(self['@lazyVars'], "_at_", [key]);
|
|
3532
|
+
return self;
|
|
3533
|
+
} catch(e) {if(e===$early)return e[0]; throw e}},
|
|
3534
|
+
args: ["key"],
|
|
3535
|
+
source: "useValueNamed: key\x0a\x09| val |\x0a\x09(realVarNames includes: key) ifTrue: [ ^key ].\x0a\x09mutables remove: key.\x0a\x09^lazyVars at: key",
|
|
3536
|
+
messageSends: ["ifTrue:", "includes:", "remove:", "at:"],
|
|
3537
|
+
referencedClasses: []
|
|
3538
|
+
}),
|
|
3539
|
+
smalltalk.ImpCodeGenerator);
|
|
3540
|
+
|
|
3541
|
+
smalltalk.addMethod(
|
|
3542
|
+
"_visit_",
|
|
3543
|
+
smalltalk.method({
|
|
3544
|
+
selector: "visit:",
|
|
3545
|
+
category: 'visiting',
|
|
3546
|
+
fn: function (aNode) {
|
|
3547
|
+
var self=this;
|
|
3548
|
+
smalltalk.send(aNode, "_accept_", [self]);
|
|
3549
|
+
return self;},
|
|
3550
|
+
args: ["aNode"],
|
|
3551
|
+
source: "visit: aNode\x0a\x09aNode accept: self",
|
|
3552
|
+
messageSends: ["accept:"],
|
|
3553
|
+
referencedClasses: []
|
|
3554
|
+
}),
|
|
3555
|
+
smalltalk.ImpCodeGenerator);
|
|
3556
|
+
|
|
3557
|
+
smalltalk.addMethod(
|
|
3558
|
+
"_visit_targetBeing_",
|
|
3559
|
+
smalltalk.method({
|
|
3560
|
+
selector: "visit:targetBeing:",
|
|
3561
|
+
category: 'compilation DSL',
|
|
3562
|
+
fn: function (aNode, aString){
|
|
3563
|
+
var self=this;
|
|
3564
|
+
var old=nil;
|
|
3565
|
+
(old=smalltalk.send(self, "_switchTarget_", [aString]));
|
|
3566
|
+
smalltalk.send(self, "_visit_", [aNode]);
|
|
3567
|
+
return smalltalk.send(self, "_switchTarget_", [old]);
|
|
3568
|
+
return self;},
|
|
3569
|
+
args: ["aNode", "aString"],
|
|
3570
|
+
source: "visit: aNode targetBeing: aString\x0a| old |\x0a\x09old := self switchTarget: aString.\x0a\x09self visit: aNode.\x0a\x09^ self switchTarget: old.\x0a",
|
|
3571
|
+
messageSends: ["switchTarget:", "visit:"],
|
|
3572
|
+
referencedClasses: []
|
|
3573
|
+
}),
|
|
3574
|
+
smalltalk.ImpCodeGenerator);
|
|
3575
|
+
|
|
3576
|
+
smalltalk.addMethod(
|
|
3577
|
+
"_visitAssignmentNode_",
|
|
3578
|
+
smalltalk.method({
|
|
3579
|
+
selector: "visitAssignmentNode:",
|
|
3580
|
+
category: 'visiting',
|
|
3581
|
+
fn: function (aNode){
|
|
3582
|
+
var self=this;
|
|
3583
|
+
var olds=nil;
|
|
3584
|
+
var oldt=nil;
|
|
3585
|
+
(olds=self['@stream']);
|
|
3586
|
+
(self['@stream']=smalltalk.send("", "_writeStream", []));
|
|
3587
|
+
(oldt=smalltalk.send(self, "_switchTarget_", [smalltalk.send(self, "_nextLazyvarName", [])]));
|
|
3588
|
+
smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
|
|
3589
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@lazyVars'], "_at_", [self['@target']]), "_~_eq", [self['@target']])]);
|
|
3590
|
+
smalltalk.send(self, "_switchTarget_", [smalltalk.send(self, "_useValueNamed_", [smalltalk.send(self, "_switchTarget_", [nil])])]);
|
|
3591
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@lazyVars'], "_includesKey_", [self['@target']]), "_not", [])]);
|
|
3592
|
+
(self['@stream']=olds);
|
|
3593
|
+
smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);
|
|
3594
|
+
(olds=smalltalk.send(self, "_switchTarget_", [oldt]));
|
|
3595
|
+
smalltalk.send(self, "_ifValueWanted_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [olds]);})]);
|
|
3596
|
+
return self;},
|
|
3597
|
+
args: ["aNode"],
|
|
3598
|
+
source: "visitAssignmentNode: aNode\x0a| olds oldt |\x0a\x09olds := stream.\x0a\x09stream := '' writeStream.\x0a\x09oldt := self switchTarget: self nextLazyvarName.\x0a\x09self visit: aNode left.\x0a\x09self assert: (lazyVars at: target) ~= target.\x0a\x09self switchTarget: (self useValueNamed: (self switchTarget: nil)).\x0a\x09self assert: (lazyVars includesKey: target) not.\x0a\x09stream := olds.\x0a\x09self visit: aNode right.\x0a\x09olds := self switchTarget: oldt.\x0a\x09self ifValueWanted: [ self lazyAssignExpression: olds ]",
|
|
3599
|
+
messageSends: ["writeStream", "switchTarget:", "nextLazyvarName", "visit:", "left", "assert:", "~=", "at:", "useValueNamed:", "not", "includesKey:", "right", "ifValueWanted:", "lazyAssignExpression:"],
|
|
3600
|
+
referencedClasses: []
|
|
3601
|
+
}),
|
|
3602
|
+
smalltalk.ImpCodeGenerator);
|
|
3603
|
+
|
|
3604
|
+
smalltalk.addMethod(
|
|
3605
|
+
"_visitBlockNode_",
|
|
3606
|
+
smalltalk.method({
|
|
3607
|
+
selector: "visitBlockNode:",
|
|
3608
|
+
category: 'visiting',
|
|
3609
|
+
fn: function (aNode){
|
|
3610
|
+
var self=this;
|
|
3611
|
+
var oldt=nil;
|
|
3612
|
+
var olds=nil;
|
|
3613
|
+
var oldm=nil;
|
|
3614
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", []), "__eq", [(1)])]);
|
|
3615
|
+
(oldt=smalltalk.send(self, "_switchTarget_", ["^"]));
|
|
3616
|
+
(olds=self['@stream']);
|
|
3617
|
+
(self['@stream']=smalltalk.send("", "_writeStream", []));
|
|
3618
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
|
|
3619
|
+
smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
|
|
3620
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["){"]);
|
|
3621
|
+
(self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
|
|
3622
|
+
(oldm=self['@mutables']);
|
|
3623
|
+
(self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
|
3624
|
+
smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", [])]);
|
|
3625
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(self['@mutables'], "_isEmpty", [])]);
|
|
3626
|
+
(self['@mutables']=oldm);
|
|
3627
|
+
(self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])));
|
|
3628
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
|
|
3629
|
+
smalltalk.send(self, "_switchTarget_", [oldt]);
|
|
3630
|
+
(oldt=smalltalk.send(self['@stream'], "_contents", []));
|
|
3631
|
+
(self['@stream']=olds);
|
|
3632
|
+
smalltalk.send(self, "_lazyAssignExpression_", [oldt]);
|
|
3633
|
+
return self;},
|
|
3634
|
+
args: ["aNode"],
|
|
3635
|
+
source: "visitBlockNode: aNode\x0a| oldt olds oldm |\x0a\x09self assert: aNode nodes size = 1.\x0a\x09oldt := self switchTarget: '^'.\x0a\x09olds := stream.\x0a\x09stream := '' writeStream.\x0a\x09stream nextPutAll: '(function('.\x0a\x09aNode parameters \x0a\x09 do: [:each |\x0a\x09\x09tempVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream nextPutAll: '){'.\x0a\x09nestedBlocks := nestedBlocks + 1.\x0a\x09oldm := mutables.\x0a\x09mutables := Set new.\x0a\x09self visit: aNode nodes first.\x0a\x09self assert: mutables isEmpty.\x0a\x09mutables := oldm.\x0a\x09nestedBlocks := nestedBlocks - 1.\x0a\x09stream nextPutAll: '})'.\x0a\x09self switchTarget: oldt.\x0a\x09oldt := stream contents.\x0a\x09stream := olds.\x0a\x09self lazyAssignExpression: oldt",
|
|
3636
|
+
messageSends: ["assert:", "=", "size", "nodes", "switchTarget:", "writeStream", "nextPutAll:", "do:separatedBy:", "parameters", "add:", "+", "new", "visit:", "first", "isEmpty", "-", "contents", "lazyAssignExpression:"],
|
|
3637
|
+
referencedClasses: ["Set"]
|
|
3638
|
+
}),
|
|
3639
|
+
smalltalk.ImpCodeGenerator);
|
|
3640
|
+
|
|
3641
|
+
smalltalk.addMethod(
|
|
3642
|
+
"_visitBlockSequenceNode_",
|
|
3643
|
+
smalltalk.method({
|
|
3644
|
+
selector: "visitBlockSequenceNode:",
|
|
3645
|
+
category: 'visiting',
|
|
3646
|
+
fn: function (aNode) {
|
|
3647
|
+
var self=this;
|
|
3648
|
+
smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), smalltalk.send(aNode, "_temps", [])]);
|
|
3649
|
+
return self;},
|
|
3650
|
+
args: ["aNode"],
|
|
3651
|
+
source: "visitBlockSequenceNode: aNode\x0a\x09self sequenceOfNodes: aNode nodes temps: aNode temps",
|
|
3652
|
+
messageSends: ["sequenceOfNodes:temps:", "nodes", "temps"],
|
|
3653
|
+
referencedClasses: []
|
|
3654
|
+
}),
|
|
3655
|
+
smalltalk.ImpCodeGenerator);
|
|
3656
|
+
|
|
3657
|
+
smalltalk.addMethod(
|
|
3658
|
+
"_visitCascadeNode_",
|
|
3659
|
+
smalltalk.method({
|
|
3660
|
+
selector: "visitCascadeNode:",
|
|
3661
|
+
category: 'visiting',
|
|
3662
|
+
fn: function (aNode){
|
|
3663
|
+
var self=this;
|
|
3664
|
+
var rcv=nil;
|
|
3665
|
+
(rcv=smalltalk.send(self, "_isolated_", [smalltalk.send(aNode, "_receiver", [])]));
|
|
3666
|
+
smalltalk.send(self, "_aboutToModifyState", []);
|
|
3667
|
+
(rcv=smalltalk.send(self, "_useValueNamed_", [rcv]));
|
|
3668
|
+
smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [rcv])]);})]);
|
|
3669
|
+
smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), []]);
|
|
3670
|
+
return self;},
|
|
3671
|
+
args: ["aNode"],
|
|
3672
|
+
source: "visitCascadeNode: aNode\x0a\x09| rcv |\x0a\x09rcv := self isolated: aNode receiver.\x0a\x09self aboutToModifyState.\x0a\x09rcv := self useValueNamed: rcv.\x0a\x09aNode nodes do: [:each |\x0a\x09\x09each receiver: (VerbatimNode new value: rcv) ].\x0a\x09self sequenceOfNodes: aNode nodes temps: #()",
|
|
3673
|
+
messageSends: ["isolated:", "receiver", "aboutToModifyState", "useValueNamed:", "do:", "nodes", "receiver:", "value:", "new", "sequenceOfNodes:temps:"],
|
|
3674
|
+
referencedClasses: ["VerbatimNode"]
|
|
3675
|
+
}),
|
|
3676
|
+
smalltalk.ImpCodeGenerator);
|
|
3677
|
+
|
|
3678
|
+
smalltalk.addMethod(
|
|
3679
|
+
"_visitClassReferenceNode_",
|
|
3680
|
+
smalltalk.method({
|
|
3681
|
+
selector: "visitClassReferenceNode:",
|
|
3682
|
+
category: 'visiting',
|
|
3683
|
+
fn: function (aNode){
|
|
3684
|
+
var self=this;
|
|
3685
|
+
((($receiver = smalltalk.send(self['@referencedClasses'], "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})]));
|
|
3686
|
+
smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(smalltalk.", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [" || "]), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [")"])]);
|
|
3687
|
+
return self;},
|
|
3688
|
+
args: ["aNode"],
|
|
3689
|
+
source: "visitClassReferenceNode: aNode\x0a\x09(referencedClasses includes: aNode value) ifFalse: [\x0a\x09\x09referencedClasses add: aNode value].\x0a\x09self lazyAssignExpression: '(smalltalk.', aNode value, ' || ', aNode value, ')'",
|
|
3690
|
+
messageSends: ["ifFalse:", "includes:", "value", "add:", "lazyAssignExpression:", ","],
|
|
3691
|
+
referencedClasses: []
|
|
3692
|
+
}),
|
|
3693
|
+
smalltalk.ImpCodeGenerator);
|
|
3694
|
+
|
|
3695
|
+
smalltalk.addMethod(
|
|
3696
|
+
"_visitDynamicArrayNode_",
|
|
3697
|
+
smalltalk.method({
|
|
3698
|
+
selector: "visitDynamicArrayNode:",
|
|
3699
|
+
category: 'visiting',
|
|
3700
|
+
fn: function (aNode){
|
|
3701
|
+
var self=this;
|
|
3702
|
+
var args=nil;
|
|
3703
|
+
(args=smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_collect_", [(function(node){return smalltalk.send(self, "_isolated_", [node]);})]));
|
|
3704
|
+
smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){smalltalk.send(str, "_nextPutAll_", ["["]);smalltalk.send(args, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self, "_useValueNamed_", [each])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [", "]);})]);return smalltalk.send(str, "_nextPutAll_", ["]"]);})])]);
|
|
3705
|
+
return self;},
|
|
3706
|
+
args: ["aNode"],
|
|
3707
|
+
source: "visitDynamicArrayNode: aNode\x0a\x09| args |\x0a\x09args :=aNode nodes collect: [ :node | self isolated: node ].\x0a\x09self lazyAssignValue: (String streamContents: [ :str |\x0a\x09\x09str nextPutAll: '['.\x0a\x09\x09args\x0a\x09 \x09\x09do: [:each | str nextPutAll: (self useValueNamed: each) ]\x0a\x09 \x09\x09separatedBy: [str nextPutAll: ', '].\x0a str nextPutAll: ']'\x0a\x09])",
|
|
3708
|
+
messageSends: ["collect:", "nodes", "isolated:", "lazyAssignValue:", "streamContents:", "nextPutAll:", "do:separatedBy:", "useValueNamed:"],
|
|
3709
|
+
referencedClasses: ["String"]
|
|
3710
|
+
}),
|
|
3711
|
+
smalltalk.ImpCodeGenerator);
|
|
3712
|
+
|
|
3713
|
+
smalltalk.addMethod(
|
|
3714
|
+
"_visitDynamicDictionaryNode_",
|
|
3715
|
+
smalltalk.method({
|
|
3716
|
+
selector: "visitDynamicDictionaryNode:",
|
|
3717
|
+
category: 'visiting',
|
|
3718
|
+
fn: function (aNode){
|
|
3719
|
+
var self=this;
|
|
3720
|
+
var elements=nil;
|
|
3721
|
+
(elements=smalltalk.send(self, "_isolated_", [(function($rec){smalltalk.send($rec, "_nodes_", [smalltalk.send(aNode, "_nodes", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.DynamicArrayNode || DynamicArrayNode), "_new", []))]));
|
|
3722
|
+
smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send("smalltalk.HashedCollection._fromPairs_(", "__comma", [smalltalk.send(self, "_useValueNamed_", [elements])]), "__comma", [")"])]);
|
|
3723
|
+
return self;},
|
|
3724
|
+
args: ["aNode"],
|
|
3725
|
+
source: "visitDynamicDictionaryNode: aNode\x0a\x09| elements |\x0a\x09elements := self isolated: (DynamicArrayNode new nodes: aNode nodes; yourself).\x0a\x09self lazyAssignValue: 'smalltalk.HashedCollection._fromPairs_(', (self useValueNamed: elements), ')'",
|
|
3726
|
+
messageSends: ["isolated:", "nodes:", "nodes", "yourself", "new", "lazyAssignValue:", ",", "useValueNamed:"],
|
|
3727
|
+
referencedClasses: ["DynamicArrayNode"]
|
|
3728
|
+
}),
|
|
3729
|
+
smalltalk.ImpCodeGenerator);
|
|
3730
|
+
|
|
3731
|
+
smalltalk.addMethod(
|
|
3732
|
+
"_visitFailure_",
|
|
3733
|
+
smalltalk.method({
|
|
3734
|
+
selector: "visitFailure:",
|
|
3735
|
+
category: 'visiting',
|
|
3736
|
+
fn: function (aFailure) {
|
|
3737
|
+
var self=this;
|
|
3738
|
+
smalltalk.send(self, "_error_", [smalltalk.send(aFailure, "_asString", [])]);
|
|
3739
|
+
return self;},
|
|
3740
|
+
args: ["aFailure"],
|
|
3741
|
+
source: "visitFailure: aFailure\x0a\x09self error: aFailure asString",
|
|
3742
|
+
messageSends: ["error:", "asString"],
|
|
3743
|
+
referencedClasses: []
|
|
3744
|
+
}),
|
|
3745
|
+
smalltalk.ImpCodeGenerator);
|
|
3746
|
+
|
|
3747
|
+
smalltalk.addMethod(
|
|
3748
|
+
"_visitJSStatementNode_",
|
|
3749
|
+
smalltalk.method({
|
|
3750
|
+
selector: "visitJSStatementNode:",
|
|
3751
|
+
category: 'visiting',
|
|
3752
|
+
fn: function (aNode){
|
|
3753
|
+
var self=this;
|
|
3754
|
+
smalltalk.send(self, "_aboutToModifyState", []);
|
|
3755
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(";", "__comma", [smalltalk.send(smalltalk.send(aNode, "_source", []), "_replace_with_", [">>", ">"])]), "__comma", [";"]), "__comma", [smalltalk.send(self, "_mylf", [])])]);
|
|
3756
|
+
return self;},
|
|
3757
|
+
args: ["aNode"],
|
|
3758
|
+
source: "visitJSStatementNode: aNode\x0a\x09self aboutToModifyState.\x0a\x09stream nextPutAll: ';', (aNode source replace: '>>' with: '>'), ';', self mylf",
|
|
3759
|
+
messageSends: ["aboutToModifyState", "nextPutAll:", ",", "replace:with:", "source", "mylf"],
|
|
3760
|
+
referencedClasses: []
|
|
3761
|
+
}),
|
|
3762
|
+
smalltalk.ImpCodeGenerator);
|
|
3763
|
+
|
|
3764
|
+
smalltalk.addMethod(
|
|
3765
|
+
"_visitMethodNode_",
|
|
3766
|
+
smalltalk.method({
|
|
3767
|
+
selector: "visitMethodNode:",
|
|
3768
|
+
category: 'visiting',
|
|
3769
|
+
fn: function (aNode){
|
|
3770
|
+
var self=this;
|
|
3771
|
+
var str=nil;
|
|
3772
|
+
var currentSelector=nil;
|
|
3773
|
+
(self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []));
|
|
3774
|
+
(self['@nestedBlocks']=(0));
|
|
3775
|
+
(self['@earlyReturn']=false);
|
|
3776
|
+
(self['@messageSends']=[]);
|
|
3777
|
+
(self['@referencedClasses']=[]);
|
|
3778
|
+
(self['@unknownVariables']=[]);
|
|
3779
|
+
(self['@tempVariables']=[]);
|
|
3780
|
+
(self['@argVariables']=[]);
|
|
3781
|
+
(self['@lazyVars']=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
|
|
3782
|
+
(self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
|
3783
|
+
(self['@realVarNames']=smalltalk.send((smalltalk.Set || Set), "_new", []));
|
|
3784
|
+
(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']);
|
|
3785
|
+
(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']);
|
|
3786
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
|
|
3787
|
+
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_", [", "]);})]);
|
|
3788
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("){var self=this;", "__comma", [smalltalk.send(self, "_mylf", [])])]);
|
|
3789
|
+
(str=self['@stream']);
|
|
3790
|
+
(self['@stream']=smalltalk.send("", "_writeStream", []));
|
|
3791
|
+
smalltalk.send(self, "_switchTarget_", [nil]);
|
|
3792
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", []), "__eq", [(1)])]);
|
|
3793
|
+
smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", [])]);
|
|
3794
|
+
smalltalk.send(self['@realVarNames'], "_ifNotEmpty_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send("var ", "__comma", [smalltalk.send(smalltalk.send(self['@realVarNames'], "_asArray", []), "_join_", [","])]), "__comma", [";"]), "__comma", [smalltalk.send(self, "_mylf", [])])]);})]);
|
|
3795
|
+
((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send("var $early={}; try{", "__comma", [smalltalk.send(self, "_mylf", [])])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send("var $early={}; try{", "__comma", [smalltalk.send(self, "_mylf", [])])]);})]));
|
|
3796
|
+
smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
|
|
3797
|
+
(self['@stream']=str);
|
|
3798
|
+
((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", []), "_nodes", []), "_notEmpty", []), "_and_", [(function(){var checker=nil;
|
|
3799
|
+
(checker=smalltalk.send((smalltalk.ReturnNodeChecker || ReturnNodeChecker), "_new", []));smalltalk.send(checker, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", []), "_nodes", []), "_last", [])]);return smalltalk.send(checker, "_wasReturnNode", []);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self, "_switchTarget_", ["^"]);smalltalk.send(self, "_lazyAssignValue_", ["self"]);return smalltalk.send(self, "_switchTarget_", [nil]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){smalltalk.send(self, "_switchTarget_", ["^"]);smalltalk.send(self, "_lazyAssignValue_", ["self"]);return smalltalk.send(self, "_switchTarget_", [nil]);})]));
|
|
3800
|
+
((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["} catch(e) {if(e===$early) return e[0]; throw e}"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["} catch(e) {if(e===$early) return e[0]; throw e}"]);})]));
|
|
3801
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
|
|
3802
|
+
(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']);
|
|
3803
|
+
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_", [","]);})]);
|
|
3804
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
|
|
3805
|
+
smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
|
|
3806
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(self['@mutables'], "_isEmpty", [])]);
|
|
3807
|
+
return self;},
|
|
3808
|
+
args: ["aNode"],
|
|
3809
|
+
source: "visitMethodNode: aNode\x0a\x09| str currentSelector | \x0a\x09currentSelector := aNode selector asSelector.\x0a\x09nestedBlocks := 0.\x0a\x09earlyReturn := false.\x0a\x09messageSends := #().\x0a\x09referencedClasses := #().\x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09lazyVars := HashedCollection new.\x0a\x09mutables := Set new.\x0a\x09realVarNames := Set new.\x0a\x09stream \x0a\x09 nextPutAll: 'smalltalk.method({'; lf;\x0a\x09 nextPutAll: 'selector: \x22', aNode selector, '\x22,'; lf.\x0a\x09stream nextPutAll: 'source: ', self source asJavascript, ',';lf.\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09aNode arguments \x0a\x09 do: [:each | \x0a\x09\x09argVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream \x0a\x09 nextPutAll: '){var self=this;', self mylf.\x0a\x09str := stream.\x0a\x09stream := '' writeStream.\x0a\x09self switchTarget: nil.\x0a\x09self assert: aNode nodes size = 1.\x0a\x09self visit: aNode nodes first.\x0a\x09realVarNames ifNotEmpty: [ str nextPutAll: 'var ', (realVarNames asArray join: ','), ';', self mylf ].\x0a\x09earlyReturn ifTrue: [\x0a\x09 str nextPutAll: 'var $early={}; try{', self mylf].\x0a\x09str nextPutAll: stream contents.\x0a\x09stream := str.\x0a\x09(aNode nodes first nodes notEmpty and: [ |checker|\x0a\x09 checker := ReturnNodeChecker new.\x0a\x09 checker visit: aNode nodes first nodes last.\x0a\x09 checker wasReturnNode]) ifFalse: [ self switchTarget: '^'. self lazyAssignValue: 'self'. self switchTarget: nil ].\x0a\x09earlyReturn ifTrue: [\x0a\x09 stream nextPutAll: '} catch(e) {if(e===$early) return e[0]; throw e}'].\x0a\x09stream nextPutAll: '}'.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: messageSends asJavascript, ','; lf;\x0a \x09nextPutAll: 'args: ', argVariables asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09referencedClasses \x0a\x09\x09do: [:each | stream nextPutAll: each printString]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'.\x0a\x09stream nextPutAll: '})'.\x0a\x09self assert: mutables isEmpty",
|
|
3810
|
+
messageSends: ["asSelector", "selector", "new", "nextPutAll:", "lf", ",", "asJavascript", "source", "do:separatedBy:", "arguments", "add:", "mylf", "writeStream", "switchTarget:", "assert:", "=", "size", "nodes", "visit:", "first", "ifNotEmpty:", "join:", "asArray", "ifTrue:", "contents", "ifFalse:", "and:", "notEmpty", "last", "wasReturnNode", "lazyAssignValue:", "printString", "isEmpty"],
|
|
3811
|
+
referencedClasses: ["HashedCollection", "Set", "ReturnNodeChecker", "String"]
|
|
3812
|
+
}),
|
|
3813
|
+
smalltalk.ImpCodeGenerator);
|
|
3814
|
+
|
|
3815
|
+
smalltalk.addMethod(
|
|
3816
|
+
"_visitReturnNode_",
|
|
3817
|
+
smalltalk.method({
|
|
3818
|
+
selector: "visitReturnNode:",
|
|
3819
|
+
category: 'visiting',
|
|
3820
|
+
fn: function (aNode){
|
|
3821
|
+
var self=this;
|
|
3822
|
+
smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", []), "__eq", [(1)])]);
|
|
3823
|
+
((($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);})]));
|
|
3824
|
+
smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", []), ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "!";})() : (function(){return "^";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "!";}), (function(){return "^";})]))]);
|
|
3825
|
+
smalltalk.send(self, "_lazyAssignValue_", [""]);
|
|
3826
|
+
return self;},
|
|
3827
|
+
args: ["aNode"],
|
|
3828
|
+
source: "visitReturnNode: aNode\x0a\x09self assert: aNode nodes size = 1.\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 earlyReturn := true].\x0a\x09self\x0a\x09\x09visit: aNode nodes first\x0a\x09\x09targetBeing: (nestedBlocks > 0 ifTrue: ['!'] ifFalse: ['^']).\x0a\x09self lazyAssignValue: ''",
|
|
3829
|
+
messageSends: ["assert:", "=", "size", "nodes", "ifTrue:", ">", "visit:targetBeing:", "first", "ifTrue:ifFalse:", "lazyAssignValue:"],
|
|
3830
|
+
referencedClasses: []
|
|
3831
|
+
}),
|
|
3832
|
+
smalltalk.ImpCodeGenerator);
|
|
3833
|
+
|
|
3834
|
+
smalltalk.addMethod(
|
|
3835
|
+
"_visitSendNode_",
|
|
3836
|
+
smalltalk.method({
|
|
3837
|
+
selector: "visitSendNode:",
|
|
3838
|
+
category: 'visiting',
|
|
3839
|
+
fn: function (aNode){
|
|
3840
|
+
var self=this;
|
|
3841
|
+
var $early={};
|
|
3842
|
+
try{var receiver=nil;
|
|
3843
|
+
var superSend=nil;
|
|
3844
|
+
var rcv=nil;
|
|
3845
|
+
((($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", [])]);})]));
|
|
3846
|
+
((($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 (function(){throw $early=[self]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=[self]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(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 (function(){throw $early=[self]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=[self]})();})]));})]));
|
|
3847
|
+
(rcv=smalltalk.send(self, "_isolated_", [smalltalk.send(aNode, "_receiver", [])]));
|
|
3848
|
+
(superSend=smalltalk.send(smalltalk.send(self['@lazyVars'], "_at_ifAbsent_", [rcv, (function(){return nil;})]), "__eq", ["super"]));
|
|
3849
|
+
((($receiver = superSend).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@mutables'], "_remove_", [rcv]);return smalltalk.send(self['@lazyVars'], "_at_put_", [rcv, "self"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@mutables'], "_remove_", [rcv]);return smalltalk.send(self['@lazyVars'], "_at_put_", [rcv, "self"]);})]));
|
|
3850
|
+
((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var inline=nil;
|
|
3851
|
+
(inline=smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), rcv, smalltalk.send(aNode, "_arguments", [])]));return (($receiver = inline) != nil && $receiver != undefined) ? (function(){var args=nil;
|
|
3852
|
+
(args=((($receiver = smalltalk.send(inline, "__eq", [true])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aNode, "_arguments", []);})() : (function(){return inline;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aNode, "_arguments", []);}), (function(){return inline;})])));smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), rcv, args, superSend]);})]);return (function(){throw $early=[self]})();})() : nil;})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var inline=nil;
|
|
3853
|
+
(inline=smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), rcv, smalltalk.send(aNode, "_arguments", [])]));return (($receiver = inline) != nil && $receiver != undefined) ? (function(){var args=nil;
|
|
3854
|
+
(args=((($receiver = smalltalk.send(inline, "__eq", [true])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aNode, "_arguments", []);})() : (function(){return inline;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aNode, "_arguments", []);}), (function(){return inline;})])));smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), rcv, args, superSend]);})]);return (function(){throw $early=[self]})();})() : nil;})]));
|
|
3855
|
+
smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), rcv, smalltalk.send(aNode, "_arguments", []), superSend]);
|
|
3856
|
+
return self;
|
|
3857
|
+
} catch(e) {if(e===$early)return e[0]; throw e}},
|
|
3858
|
+
args: ["aNode"],
|
|
3859
|
+
source: "visitSendNode: aNode\x0a | receiver superSend rcv |\x0a (messageSends includes: aNode selector) ifFalse: [\x0a messageSends add: aNode selector].\x0a\x09\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09(self inlineLiteral: aNode selector receiverNode: aNode receiver argumentNodes: aNode arguments) ifTrue: [ ^self ].\x0a\x09\x09].\x0a\x0a\x09rcv := self isolated: aNode receiver.\x0a superSend := (lazyVars at: rcv ifAbsent: []) = 'super'.\x0a superSend ifTrue: [ mutables remove: rcv. lazyVars at: rcv put: 'self' ].\x0a\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [ | inline |\x0a\x09\x09\x09inline := self inline: aNode selector receiver: rcv argumentNodes: aNode arguments.\x0a\x09\x09\x09inline ifNotNil: [ | args |\x0a\x09\x09\x09\x09args := inline = true ifTrue: [ aNode arguments ] ifFalse: [ inline ].\x0a\x09\x09\x09\x09self prvPutAndClose: [ self send: aNode selector to: rcv arguments: args superSend: superSend ].\x0a\x09\x09\x09\x09^self ]].\x0a\x09self send: aNode selector to: rcv arguments: aNode arguments superSend: superSend",
|
|
3860
|
+
messageSends: ["ifFalse:", "includes:", "selector", "add:", "ifTrue:", "performOptimizations", "inlineLiteral:receiverNode:argumentNodes:", "receiver", "arguments", "isolated:", "=", "at:ifAbsent:", "remove:", "at:put:", "inline:receiver:argumentNodes:", "ifNotNil:", "ifTrue:ifFalse:", "prvPutAndClose:", "send:to:arguments:superSend:"],
|
|
3861
|
+
referencedClasses: []
|
|
3862
|
+
}),
|
|
3863
|
+
smalltalk.ImpCodeGenerator);
|
|
3864
|
+
|
|
3865
|
+
smalltalk.addMethod(
|
|
3866
|
+
"_visitSequenceNode_",
|
|
3867
|
+
smalltalk.method({
|
|
3868
|
+
selector: "visitSequenceNode:",
|
|
3869
|
+
category: 'visiting',
|
|
3870
|
+
fn: function (aNode) {
|
|
3871
|
+
var self=this;
|
|
3872
|
+
((($receiver = smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), smalltalk.send(aNode, "_temps", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), smalltalk.send(aNode, "_temps", [])]);})]));
|
|
3873
|
+
return self;},
|
|
3874
|
+
args: ["aNode"],
|
|
3875
|
+
source: "visitSequenceNode: aNode\x0a\x09aNode nodes isEmpty ifFalse: [\x0a\x09\x09self sequenceOfNodes: aNode nodes temps: aNode temps ]\x0a",
|
|
3876
|
+
messageSends: ["ifFalse:", "isEmpty", "nodes", "sequenceOfNodes:temps:", "temps"],
|
|
3877
|
+
referencedClasses: []
|
|
3878
|
+
}),
|
|
3879
|
+
smalltalk.ImpCodeGenerator);
|
|
3880
|
+
|
|
3881
|
+
smalltalk.addMethod(
|
|
3882
|
+
"_visitValueNode_",
|
|
3883
|
+
smalltalk.method({
|
|
3884
|
+
selector: "visitValueNode:",
|
|
3885
|
+
category: 'visiting',
|
|
3886
|
+
fn: function (aNode){
|
|
3887
|
+
var self=this;
|
|
3888
|
+
smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
|
|
3889
|
+
return self;},
|
|
3890
|
+
args: ["aNode"],
|
|
3891
|
+
source: "visitValueNode: aNode\x0a\x09self lazyAssignValue: aNode value asJavascript",
|
|
3892
|
+
messageSends: ["lazyAssignValue:", "asJavascript", "value"],
|
|
3893
|
+
referencedClasses: []
|
|
3894
|
+
}),
|
|
3895
|
+
smalltalk.ImpCodeGenerator);
|
|
3896
|
+
|
|
3897
|
+
smalltalk.addMethod(
|
|
3898
|
+
"_visitVariableNode_",
|
|
3899
|
+
smalltalk.method({
|
|
3900
|
+
selector: "visitVariableNode:",
|
|
3901
|
+
category: 'visiting',
|
|
3902
|
+
fn: function (aNode){
|
|
3903
|
+
var self=this;
|
|
3904
|
+
var varName=nil;
|
|
3905
|
+
((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_currentClass", []), "_allInstanceVariableNames", []), "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [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, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})]));})]));})]));
|
|
3906
|
+
return self;},
|
|
3907
|
+
args: ["aNode"],
|
|
3908
|
+
source: "visitVariableNode: aNode\x0a\x09| varName |\x0a\x09(self currentClass allInstanceVariableNames includes: aNode value) \x0a\x09\x09ifTrue: [self lazyAssignExpression: 'self[''@', aNode value, ''']']\x0a\x09\x09ifFalse: [\x0a \x09varName := self safeVariableNameFor: aNode value.\x0a\x09\x09\x09(self knownVariables includes: varName) \x0a \x09\x09ifFalse: [\x0a \x09unknownVariables add: aNode value.\x0a \x09aNode assigned \x0a \x09\x09ifTrue: [self lazyAssignExpression: varName]\x0a \x09\x09ifFalse: [self lazyAssignExpression: '(typeof ', varName, ' == ''undefined'' ? nil : ', varName, ')']]\x0a \x09\x09ifTrue: [\x0a \x09aNode value = 'thisContext'\x0a \x09\x09ifTrue: [self lazyAssignExpression: '(smalltalk.getThisContext())']\x0a \x09\x09\x09\x09ifFalse: [(self pseudoVariables includes: varName)\x0a\x09\x09\x09\x09\x09\x09\x09ifTrue: [ self lazyAssignValue: varName ]\x0a\x09\x09\x09\x09\x09\x09\x09ifFalse: [ self lazyAssignExpression: varName]]]]",
|
|
3909
|
+
messageSends: ["ifTrue:ifFalse:", "includes:", "allInstanceVariableNames", "currentClass", "value", "lazyAssignExpression:", ",", "safeVariableNameFor:", "ifFalse:ifTrue:", "knownVariables", "add:", "assigned", "=", "pseudoVariables", "lazyAssignValue:"],
|
|
3910
|
+
referencedClasses: []
|
|
3911
|
+
}),
|
|
3912
|
+
smalltalk.ImpCodeGenerator);
|
|
3913
|
+
|
|
3914
|
+
smalltalk.addMethod(
|
|
3915
|
+
"_visitVerbatimNode_",
|
|
3916
|
+
smalltalk.method({
|
|
3917
|
+
selector: "visitVerbatimNode:",
|
|
3918
|
+
category: 'visiting',
|
|
3919
|
+
fn: function (aNode){
|
|
3920
|
+
var self=this;
|
|
3921
|
+
smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(aNode, "_value", [])]);
|
|
3922
|
+
return self;},
|
|
3923
|
+
args: ["aNode"],
|
|
3924
|
+
source: "visitVerbatimNode: aNode\x0a\x09self lazyAssignValue: aNode value",
|
|
3925
|
+
messageSends: ["lazyAssignValue:", "value"],
|
|
3926
|
+
referencedClasses: []
|
|
3927
|
+
}),
|
|
3928
|
+
smalltalk.ImpCodeGenerator);
|
|
3929
|
+
|
|
3930
|
+
|
|
3931
|
+
smalltalk.ImpCodeGenerator.klass.iVarNames = ['performOptimizations'];
|
|
3932
|
+
smalltalk.addMethod(
|
|
3933
|
+
"_performOptimizations",
|
|
3934
|
+
smalltalk.method({
|
|
3935
|
+
selector: "performOptimizations",
|
|
3936
|
+
category: 'accessing',
|
|
3937
|
+
fn: function () {
|
|
3938
|
+
var self=this;
|
|
3939
|
+
return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
|
|
3940
|
+
return self;},
|
|
3941
|
+
args: [],
|
|
3942
|
+
source: "performOptimizations\x0a\x09^performOptimizations ifNil: [true]",
|
|
3943
|
+
messageSends: ["ifNil:"],
|
|
3944
|
+
referencedClasses: []
|
|
3945
|
+
}),
|
|
3946
|
+
smalltalk.ImpCodeGenerator.klass);
|
|
3947
|
+
|
|
3948
|
+
smalltalk.addMethod(
|
|
3949
|
+
"_performOptimizations_",
|
|
3950
|
+
smalltalk.method({
|
|
3951
|
+
selector: "performOptimizations:",
|
|
3952
|
+
category: 'accessing',
|
|
3953
|
+
fn: function (aBoolean) {
|
|
3954
|
+
var self=this;
|
|
3955
|
+
(self['@performOptimizations']=aBoolean);
|
|
3956
|
+
return self;},
|
|
3957
|
+
args: ["aBoolean"],
|
|
3958
|
+
source: "performOptimizations: aBoolean\x0a\x09performOptimizations := aBoolean",
|
|
3959
|
+
messageSends: [],
|
|
3960
|
+
referencedClasses: []
|
|
3961
|
+
}),
|
|
3962
|
+
smalltalk.ImpCodeGenerator.klass);
|
|
3963
|
+
|
|
3964
|
+
|
|
3965
|
+
smalltalk.addClass('ReturnNodeChecker', smalltalk.NodeVisitor, ['wasReturnNode'], 'Compiler');
|
|
3966
|
+
smalltalk.addMethod(
|
|
3967
|
+
"_initialize",
|
|
3968
|
+
smalltalk.method({
|
|
3969
|
+
selector: "initialize",
|
|
3970
|
+
category: 'initializing',
|
|
3971
|
+
fn: function () {
|
|
3972
|
+
var self=this;
|
|
3973
|
+
(self['@wasReturnNode']=false);
|
|
3974
|
+
return self;},
|
|
3975
|
+
args: [],
|
|
3976
|
+
source: "initialize\x0a\x09wasReturnNode := false",
|
|
3977
|
+
messageSends: [],
|
|
3978
|
+
referencedClasses: []
|
|
3979
|
+
}),
|
|
3980
|
+
smalltalk.ReturnNodeChecker);
|
|
3981
|
+
|
|
3982
|
+
smalltalk.addMethod(
|
|
3983
|
+
"_visitReturnNode_",
|
|
3984
|
+
smalltalk.method({
|
|
3985
|
+
selector: "visitReturnNode:",
|
|
3986
|
+
category: 'visiting',
|
|
3987
|
+
fn: function (aNode) {
|
|
3988
|
+
var self=this;
|
|
3989
|
+
(self['@wasReturnNode']=true);
|
|
3990
|
+
return self;},
|
|
3991
|
+
args: ["aNode"],
|
|
3992
|
+
source: "visitReturnNode: aNode\x0a\x09wasReturnNode := true",
|
|
3993
|
+
messageSends: [],
|
|
3994
|
+
referencedClasses: []
|
|
3995
|
+
}),
|
|
3996
|
+
smalltalk.ReturnNodeChecker);
|
|
3997
|
+
|
|
3998
|
+
smalltalk.addMethod(
|
|
3999
|
+
"_wasReturnNode",
|
|
4000
|
+
smalltalk.method({
|
|
4001
|
+
selector: "wasReturnNode",
|
|
4002
|
+
category: 'accessing',
|
|
4003
|
+
fn: function () {
|
|
4004
|
+
var self=this;
|
|
4005
|
+
return self['@wasReturnNode'];
|
|
4006
|
+
return self;},
|
|
4007
|
+
args: [],
|
|
4008
|
+
source: "wasReturnNode\x0a\x09^wasReturnNode",
|
|
4009
|
+
messageSends: [],
|
|
4010
|
+
referencedClasses: []
|
|
4011
|
+
}),
|
|
4012
|
+
smalltalk.ReturnNodeChecker);
|
|
4013
|
+
|
|
4014
|
+
|
|
4015
|
+
|