Compiler-Core.js 130 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455
  1. smalltalk.addPackage('Compiler-Core', {});
  2. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  3. smalltalk.Compiler.comment="I provide the public interface for compiling Amber source code into JavaScript.\x0a\x0aThe code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`. \x0aThe default code generator is an instance of `InlinedCodeGenerator`"
  4. smalltalk.addMethod(
  5. "_codeGeneratorClass",
  6. smalltalk.method({
  7. selector: "codeGeneratorClass",
  8. category: 'accessing',
  9. fn: function () {
  10. var self=this;
  11. return (($receiver = self['@codeGeneratorClass']) == nil || $receiver == undefined) ? (function(){return (smalltalk.FunCodeGenerator || FunCodeGenerator);})() : $receiver;
  12. return self;},
  13. args: [],
  14. source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [FunCodeGenerator]",
  15. messageSends: ["ifNil:"],
  16. referencedClasses: ["FunCodeGenerator"]
  17. }),
  18. smalltalk.Compiler);
  19. smalltalk.addMethod(
  20. "_codeGeneratorClass_",
  21. smalltalk.method({
  22. selector: "codeGeneratorClass:",
  23. category: 'accessing',
  24. fn: function (aClass) {
  25. var self=this;
  26. (self['@codeGeneratorClass']=aClass);
  27. return self;},
  28. args: ["aClass"],
  29. source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
  30. messageSends: [],
  31. referencedClasses: []
  32. }),
  33. smalltalk.Compiler);
  34. smalltalk.addMethod(
  35. "_compile_",
  36. smalltalk.method({
  37. selector: "compile:",
  38. category: 'compiling',
  39. fn: function (aString) {
  40. var self=this;
  41. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [aString])]);
  42. return self;},
  43. args: ["aString"],
  44. source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
  45. messageSends: ["compileNode:", "parse:"],
  46. referencedClasses: []
  47. }),
  48. smalltalk.Compiler);
  49. smalltalk.addMethod(
  50. "_compile_forClass_",
  51. smalltalk.method({
  52. selector: "compile:forClass:",
  53. category: 'compiling',
  54. fn: function (aString, aClass) {
  55. var self=this;
  56. smalltalk.send(self, "_currentClass_", [aClass]);
  57. smalltalk.send(self, "_source_", [aString]);
  58. return smalltalk.send(self, "_compile_", [aString]);
  59. return self;},
  60. args: ["aString", "aClass"],
  61. source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
  62. messageSends: ["currentClass:", "source:", "compile:"],
  63. referencedClasses: []
  64. }),
  65. smalltalk.Compiler);
  66. smalltalk.addMethod(
  67. "_compileExpression_",
  68. smalltalk.method({
  69. selector: "compileExpression:",
  70. category: 'compiling',
  71. fn: function (aString) {
  72. var self=this;
  73. smalltalk.send(self, "_currentClass_", [(smalltalk.DoIt || DoIt)]);
  74. smalltalk.send(self, "_source_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  75. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [smalltalk.send(self, "_source", [])])]);
  76. return self;},
  77. args: ["aString"],
  78. source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  79. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
  80. referencedClasses: ["DoIt"]
  81. }),
  82. smalltalk.Compiler);
  83. smalltalk.addMethod(
  84. "_compileNode_",
  85. smalltalk.method({
  86. selector: "compileNode:",
  87. category: 'compiling',
  88. fn: function (aNode) {
  89. var self=this;
  90. var generator=nil;
  91. var result=nil;
  92. (generator=smalltalk.send(smalltalk.send(self, "_codeGeneratorClass", []), "_new", []));
  93. (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(self, "_source", [])]);return smalltalk.send($rec, "_currentClass_", [smalltalk.send(self, "_currentClass", [])]);})(generator);
  94. (result=smalltalk.send(generator, "_compileNode_", [aNode]));
  95. smalltalk.send(self, "_unknownVariables_", [[]]);
  96. return result;
  97. return self;},
  98. args: ["aNode"],
  99. source: "compileNode: aNode\x0a\x09| generator result |\x0a\x09generator := self codeGeneratorClass new.\x0a\x09generator\x0a\x09\x09source: self source;\x0a\x09\x09currentClass: self currentClass.\x0a\x09result := generator compileNode: aNode.\x0a\x09self unknownVariables: #().\x0a\x09^result",
  100. messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"],
  101. referencedClasses: []
  102. }),
  103. smalltalk.Compiler);
  104. smalltalk.addMethod(
  105. "_currentClass",
  106. smalltalk.method({
  107. selector: "currentClass",
  108. category: 'accessing',
  109. fn: function () {
  110. var self=this;
  111. return self['@currentClass'];
  112. return self;},
  113. args: [],
  114. source: "currentClass\x0a\x09^currentClass",
  115. messageSends: [],
  116. referencedClasses: []
  117. }),
  118. smalltalk.Compiler);
  119. smalltalk.addMethod(
  120. "_currentClass_",
  121. smalltalk.method({
  122. selector: "currentClass:",
  123. category: 'accessing',
  124. fn: function (aClass) {
  125. var self=this;
  126. (self['@currentClass']=aClass);
  127. return self;},
  128. args: ["aClass"],
  129. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  130. messageSends: [],
  131. referencedClasses: []
  132. }),
  133. smalltalk.Compiler);
  134. smalltalk.addMethod(
  135. "_eval_",
  136. smalltalk.method({
  137. selector: "eval:",
  138. category: 'compiling',
  139. fn: function (aString) {
  140. var self=this;
  141. return eval(aString);
  142. return self;},
  143. args: ["aString"],
  144. source: "eval: aString\x0a\x09<return eval(aString)>",
  145. messageSends: [],
  146. referencedClasses: []
  147. }),
  148. smalltalk.Compiler);
  149. smalltalk.addMethod(
  150. "_evaluateExpression_",
  151. smalltalk.method({
  152. selector: "evaluateExpression:",
  153. category: 'compiling',
  154. fn: function (aString) {
  155. var self=this;
  156. var result=nil;
  157. smalltalk.send((smalltalk.DoIt || DoIt), "_addCompiledMethod_", [smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compileExpression_", [aString])])]);
  158. (result=smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_new", []), "_doIt", []));
  159. smalltalk.send((smalltalk.DoIt || DoIt), "_removeCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_methodDictionary", []), "_at_", ["doIt"])]);
  160. return result;
  161. return self;},
  162. args: ["aString"],
  163. source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09| result |\x0a\x09DoIt addCompiledMethod: (self eval: (self compileExpression: aString)).\x0a\x09result := DoIt new doIt.\x0a\x09DoIt removeCompiledMethod: (DoIt methodDictionary at: 'doIt').\x0a\x09^result",
  164. messageSends: ["addCompiledMethod:", "eval:", "compileExpression:", "doIt", "new", "removeCompiledMethod:", "at:", "methodDictionary"],
  165. referencedClasses: ["DoIt"]
  166. }),
  167. smalltalk.Compiler);
  168. smalltalk.addMethod(
  169. "_install_forClass_category_",
  170. smalltalk.method({
  171. selector: "install:forClass:category:",
  172. category: 'compiling',
  173. fn: function (aString, aBehavior, anotherString) {
  174. var self=this;
  175. var compiled=nil;
  176. (compiled=smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compile_forClass_", [aString, aBehavior])]));
  177. smalltalk.send(compiled, "_category_", [anotherString]);
  178. smalltalk.send(aBehavior, "_addCompiledMethod_", [compiled]);
  179. return compiled;
  180. return self;},
  181. args: ["aString", "aBehavior", "anotherString"],
  182. source: "install: aString forClass: aBehavior category: anotherString\x0a\x09| compiled |\x0a\x09compiled := self eval: (self compile: aString forClass: aBehavior).\x0a\x09compiled category: anotherString.\x0a\x09aBehavior addCompiledMethod: compiled.\x0a\x09^compiled",
  183. messageSends: ["eval:", "compile:forClass:", "category:", "addCompiledMethod:"],
  184. referencedClasses: []
  185. }),
  186. smalltalk.Compiler);
  187. smalltalk.addMethod(
  188. "_parse_",
  189. smalltalk.method({
  190. selector: "parse:",
  191. category: 'compiling',
  192. fn: function (aString) {
  193. var self=this;
  194. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_parse_", [aString]);
  195. return self;},
  196. args: ["aString"],
  197. source: "parse: aString\x0a ^Smalltalk current parse: aString",
  198. messageSends: ["parse:", "current"],
  199. referencedClasses: ["Smalltalk"]
  200. }),
  201. smalltalk.Compiler);
  202. smalltalk.addMethod(
  203. "_parseExpression_",
  204. smalltalk.method({
  205. selector: "parseExpression:",
  206. category: 'compiling',
  207. fn: function (aString) {
  208. var self=this;
  209. return smalltalk.send(self, "_parse_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  210. return self;},
  211. args: ["aString"],
  212. source: "parseExpression: aString\x0a ^self parse: 'doIt ^[', aString, '] value'",
  213. messageSends: ["parse:", ","],
  214. referencedClasses: []
  215. }),
  216. smalltalk.Compiler);
  217. smalltalk.addMethod(
  218. "_recompile_",
  219. smalltalk.method({
  220. selector: "recompile:",
  221. category: 'compiling',
  222. fn: function (aClass) {
  223. var self=this;
  224. smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){smalltalk.send((typeof console == 'undefined' ? nil : console), "_log_", [smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" >> "]), "__comma", [smalltalk.send(each, "_selector", [])])]);return smalltalk.send(self, "_install_forClass_category_", [smalltalk.send(each, "_source", []), aClass, smalltalk.send(each, "_category", [])]);})]);
  225. smalltalk.send(self, "_setupClass_", [aClass]);
  226. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})]));
  227. return self;},
  228. args: ["aClass"],
  229. source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each |\x0a\x09\x09console log: aClass name, ' >> ', each selector.\x0a\x09\x09self install: each source forClass: aClass category: each category].\x0a\x09self setupClass: aClass.\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
  230. messageSends: ["do:", "methodDictionary", "log:", ",", "name", "selector", "install:forClass:category:", "source", "category", "setupClass:", "ifFalse:", "isMetaclass", "recompile:", "class"],
  231. referencedClasses: []
  232. }),
  233. smalltalk.Compiler);
  234. smalltalk.addMethod(
  235. "_recompileAll",
  236. smalltalk.method({
  237. selector: "recompileAll",
  238. category: 'compiling',
  239. fn: function () {
  240. var self=this;
  241. 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)]);})]);
  242. return self;},
  243. args: [],
  244. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
  245. messageSends: ["do:", "classes", "current", "show:", "cr", "valueWithTimeout:", "recompile:"],
  246. referencedClasses: ["Smalltalk", "Transcript"]
  247. }),
  248. smalltalk.Compiler);
  249. smalltalk.addMethod(
  250. "_setupClass_",
  251. smalltalk.method({
  252. selector: "setupClass:",
  253. category: 'compiling',
  254. fn: function (aClass) {
  255. var self=this;
  256. smalltalk.init(aClass);
  257. return self;},
  258. args: ["aClass"],
  259. source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass)>",
  260. messageSends: [],
  261. referencedClasses: []
  262. }),
  263. smalltalk.Compiler);
  264. smalltalk.addMethod(
  265. "_source",
  266. smalltalk.method({
  267. selector: "source",
  268. category: 'accessing',
  269. fn: function () {
  270. var self=this;
  271. return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  272. return self;},
  273. args: [],
  274. source: "source\x0a\x09^source ifNil: ['']",
  275. messageSends: ["ifNil:"],
  276. referencedClasses: []
  277. }),
  278. smalltalk.Compiler);
  279. smalltalk.addMethod(
  280. "_source_",
  281. smalltalk.method({
  282. selector: "source:",
  283. category: 'accessing',
  284. fn: function (aString) {
  285. var self=this;
  286. (self['@source']=aString);
  287. return self;},
  288. args: ["aString"],
  289. source: "source: aString\x0a\x09source := aString",
  290. messageSends: [],
  291. referencedClasses: []
  292. }),
  293. smalltalk.Compiler);
  294. smalltalk.addMethod(
  295. "_unknownVariables",
  296. smalltalk.method({
  297. selector: "unknownVariables",
  298. category: 'accessing',
  299. fn: function () {
  300. var self=this;
  301. return self['@unknownVariables'];
  302. return self;},
  303. args: [],
  304. source: "unknownVariables\x0a\x09^unknownVariables",
  305. messageSends: [],
  306. referencedClasses: []
  307. }),
  308. smalltalk.Compiler);
  309. smalltalk.addMethod(
  310. "_unknownVariables_",
  311. smalltalk.method({
  312. selector: "unknownVariables:",
  313. category: 'accessing',
  314. fn: function (aCollection) {
  315. var self=this;
  316. (self['@unknownVariables']=aCollection);
  317. return self;},
  318. args: ["aCollection"],
  319. source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection",
  320. messageSends: [],
  321. referencedClasses: []
  322. }),
  323. smalltalk.Compiler);
  324. smalltalk.addMethod(
  325. "_recompile_",
  326. smalltalk.method({
  327. selector: "recompile:",
  328. category: 'compiling',
  329. fn: function (aClass) {
  330. var self=this;
  331. smalltalk.send(smalltalk.send(self, "_new", []), "_recompile_", [aClass]);
  332. return self;},
  333. args: ["aClass"],
  334. source: "recompile: aClass\x0a\x09self new recompile: aClass",
  335. messageSends: ["recompile:", "new"],
  336. referencedClasses: []
  337. }),
  338. smalltalk.Compiler.klass);
  339. smalltalk.addMethod(
  340. "_recompileAll",
  341. smalltalk.method({
  342. selector: "recompileAll",
  343. category: 'compiling',
  344. fn: function () {
  345. var self=this;
  346. smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_recompile_", [each]);})]);
  347. return self;},
  348. args: [],
  349. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
  350. messageSends: ["do:", "classes", "current", "recompile:"],
  351. referencedClasses: ["Smalltalk"]
  352. }),
  353. smalltalk.Compiler.klass);
  354. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  355. smalltalk.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`."
  356. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  357. smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors."
  358. smalltalk.addMethod(
  359. "_visit_",
  360. smalltalk.method({
  361. selector: "visit:",
  362. category: 'visiting',
  363. fn: function (aNode) {
  364. var self=this;
  365. return smalltalk.send(aNode, "_accept_", [self]);
  366. return self;},
  367. args: ["aNode"],
  368. source: "visit: aNode\x0a\x09^ aNode accept: self",
  369. messageSends: ["accept:"],
  370. referencedClasses: []
  371. }),
  372. smalltalk.NodeVisitor);
  373. smalltalk.addMethod(
  374. "_visitAll_",
  375. smalltalk.method({
  376. selector: "visitAll:",
  377. category: 'visiting',
  378. fn: function (aCollection) {
  379. var self=this;
  380. return smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  381. return self;},
  382. args: ["aCollection"],
  383. source: "visitAll: aCollection\x0a\x09^ aCollection do: [ :each | self visit: each ]",
  384. messageSends: ["do:", "visit:"],
  385. referencedClasses: []
  386. }),
  387. smalltalk.NodeVisitor);
  388. smalltalk.addMethod(
  389. "_visitAssignmentNode_",
  390. smalltalk.method({
  391. selector: "visitAssignmentNode:",
  392. category: 'visiting',
  393. fn: function (aNode) {
  394. var self=this;
  395. return smalltalk.send(self, "_visitNode_", [aNode]);
  396. return self;},
  397. args: ["aNode"],
  398. source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
  399. messageSends: ["visitNode:"],
  400. referencedClasses: []
  401. }),
  402. smalltalk.NodeVisitor);
  403. smalltalk.addMethod(
  404. "_visitBlockNode_",
  405. smalltalk.method({
  406. selector: "visitBlockNode:",
  407. category: 'visiting',
  408. fn: function (aNode) {
  409. var self=this;
  410. return smalltalk.send(self, "_visitNode_", [aNode]);
  411. return self;},
  412. args: ["aNode"],
  413. source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
  414. messageSends: ["visitNode:"],
  415. referencedClasses: []
  416. }),
  417. smalltalk.NodeVisitor);
  418. smalltalk.addMethod(
  419. "_visitBlockSequenceNode_",
  420. smalltalk.method({
  421. selector: "visitBlockSequenceNode:",
  422. category: 'visiting',
  423. fn: function (aNode) {
  424. var self=this;
  425. return smalltalk.send(self, "_visitSequenceNode_", [aNode]);
  426. return self;},
  427. args: ["aNode"],
  428. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  429. messageSends: ["visitSequenceNode:"],
  430. referencedClasses: []
  431. }),
  432. smalltalk.NodeVisitor);
  433. smalltalk.addMethod(
  434. "_visitCascadeNode_",
  435. smalltalk.method({
  436. selector: "visitCascadeNode:",
  437. category: 'visiting',
  438. fn: function (aNode) {
  439. var self=this;
  440. return smalltalk.send(self, "_visitNode_", [aNode]);
  441. return self;},
  442. args: ["aNode"],
  443. source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
  444. messageSends: ["visitNode:"],
  445. referencedClasses: []
  446. }),
  447. smalltalk.NodeVisitor);
  448. smalltalk.addMethod(
  449. "_visitClassReferenceNode_",
  450. smalltalk.method({
  451. selector: "visitClassReferenceNode:",
  452. category: 'visiting',
  453. fn: function (aNode) {
  454. var self=this;
  455. return smalltalk.send(self, "_visitVariableNode_", [aNode]);
  456. return self;},
  457. args: ["aNode"],
  458. source: "visitClassReferenceNode: aNode\x0a\x09^ self visitVariableNode: aNode",
  459. messageSends: ["visitVariableNode:"],
  460. referencedClasses: []
  461. }),
  462. smalltalk.NodeVisitor);
  463. smalltalk.addMethod(
  464. "_visitDynamicArrayNode_",
  465. smalltalk.method({
  466. selector: "visitDynamicArrayNode:",
  467. category: 'visiting',
  468. fn: function (aNode) {
  469. var self=this;
  470. return smalltalk.send(self, "_visitNode_", [aNode]);
  471. return self;},
  472. args: ["aNode"],
  473. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
  474. messageSends: ["visitNode:"],
  475. referencedClasses: []
  476. }),
  477. smalltalk.NodeVisitor);
  478. smalltalk.addMethod(
  479. "_visitDynamicDictionaryNode_",
  480. smalltalk.method({
  481. selector: "visitDynamicDictionaryNode:",
  482. category: 'visiting',
  483. fn: function (aNode) {
  484. var self=this;
  485. return smalltalk.send(self, "_visitNode_", [aNode]);
  486. return self;},
  487. args: ["aNode"],
  488. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
  489. messageSends: ["visitNode:"],
  490. referencedClasses: []
  491. }),
  492. smalltalk.NodeVisitor);
  493. smalltalk.addMethod(
  494. "_visitJSStatementNode_",
  495. smalltalk.method({
  496. selector: "visitJSStatementNode:",
  497. category: 'visiting',
  498. fn: function (aNode) {
  499. var self=this;
  500. return smalltalk.send(self, "_visitNode_", [aNode]);
  501. return self;},
  502. args: ["aNode"],
  503. source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
  504. messageSends: ["visitNode:"],
  505. referencedClasses: []
  506. }),
  507. smalltalk.NodeVisitor);
  508. smalltalk.addMethod(
  509. "_visitMethodNode_",
  510. smalltalk.method({
  511. selector: "visitMethodNode:",
  512. category: 'visiting',
  513. fn: function (aNode) {
  514. var self=this;
  515. return smalltalk.send(self, "_visitNode_", [aNode]);
  516. return self;},
  517. args: ["aNode"],
  518. source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
  519. messageSends: ["visitNode:"],
  520. referencedClasses: []
  521. }),
  522. smalltalk.NodeVisitor);
  523. smalltalk.addMethod(
  524. "_visitNode_",
  525. smalltalk.method({
  526. selector: "visitNode:",
  527. category: 'visiting',
  528. fn: function (aNode) {
  529. var self=this;
  530. return smalltalk.send(self, "_visitAll_", [smalltalk.send(aNode, "_nodes", [])]);
  531. return self;},
  532. args: ["aNode"],
  533. source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
  534. messageSends: ["visitAll:", "nodes"],
  535. referencedClasses: []
  536. }),
  537. smalltalk.NodeVisitor);
  538. smalltalk.addMethod(
  539. "_visitReturnNode_",
  540. smalltalk.method({
  541. selector: "visitReturnNode:",
  542. category: 'visiting',
  543. fn: function (aNode) {
  544. var self=this;
  545. return smalltalk.send(self, "_visitNode_", [aNode]);
  546. return self;},
  547. args: ["aNode"],
  548. source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
  549. messageSends: ["visitNode:"],
  550. referencedClasses: []
  551. }),
  552. smalltalk.NodeVisitor);
  553. smalltalk.addMethod(
  554. "_visitSendNode_",
  555. smalltalk.method({
  556. selector: "visitSendNode:",
  557. category: 'visiting',
  558. fn: function (aNode) {
  559. var self=this;
  560. return smalltalk.send(self, "_visitNode_", [aNode]);
  561. return self;},
  562. args: ["aNode"],
  563. source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
  564. messageSends: ["visitNode:"],
  565. referencedClasses: []
  566. }),
  567. smalltalk.NodeVisitor);
  568. smalltalk.addMethod(
  569. "_visitSequenceNode_",
  570. smalltalk.method({
  571. selector: "visitSequenceNode:",
  572. category: 'visiting',
  573. fn: function (aNode) {
  574. var self=this;
  575. return smalltalk.send(self, "_visitNode_", [aNode]);
  576. return self;},
  577. args: ["aNode"],
  578. source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
  579. messageSends: ["visitNode:"],
  580. referencedClasses: []
  581. }),
  582. smalltalk.NodeVisitor);
  583. smalltalk.addMethod(
  584. "_visitValueNode_",
  585. smalltalk.method({
  586. selector: "visitValueNode:",
  587. category: 'visiting',
  588. fn: function (aNode) {
  589. var self=this;
  590. return smalltalk.send(self, "_visitNode_", [aNode]);
  591. return self;},
  592. args: ["aNode"],
  593. source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
  594. messageSends: ["visitNode:"],
  595. referencedClasses: []
  596. }),
  597. smalltalk.NodeVisitor);
  598. smalltalk.addMethod(
  599. "_visitVariableNode_",
  600. smalltalk.method({
  601. selector: "visitVariableNode:",
  602. category: 'visiting',
  603. fn: function (aNode) {
  604. var self=this;
  605. return smalltalk.send(self, "_visitNode_", [aNode]);
  606. return self;},
  607. args: ["aNode"],
  608. source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
  609. messageSends: ["visitNode:"],
  610. referencedClasses: []
  611. }),
  612. smalltalk.NodeVisitor);
  613. smalltalk.addClass('AbstractCodeGenerator', smalltalk.NodeVisitor, ['currentClass', 'source'], 'Compiler-Core');
  614. smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API."
  615. smalltalk.addMethod(
  616. "_classNameFor_",
  617. smalltalk.method({
  618. selector: "classNameFor:",
  619. category: 'accessing',
  620. fn: function (aClass) {
  621. var self=this;
  622. 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", []);})]));})]));
  623. return self;},
  624. args: ["aClass"],
  625. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  626. messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
  627. referencedClasses: []
  628. }),
  629. smalltalk.AbstractCodeGenerator);
  630. smalltalk.addMethod(
  631. "_compileNode_",
  632. smalltalk.method({
  633. selector: "compileNode:",
  634. category: 'compiling',
  635. fn: function (aNode) {
  636. var self=this;
  637. smalltalk.send(self, "_subclassResponsibility", []);
  638. return self;},
  639. args: ["aNode"],
  640. source: "compileNode: aNode\x0a\x09self subclassResponsibility",
  641. messageSends: ["subclassResponsibility"],
  642. referencedClasses: []
  643. }),
  644. smalltalk.AbstractCodeGenerator);
  645. smalltalk.addMethod(
  646. "_currentClass",
  647. smalltalk.method({
  648. selector: "currentClass",
  649. category: 'accessing',
  650. fn: function () {
  651. var self=this;
  652. return self['@currentClass'];
  653. return self;},
  654. args: [],
  655. source: "currentClass\x0a\x09^currentClass",
  656. messageSends: [],
  657. referencedClasses: []
  658. }),
  659. smalltalk.AbstractCodeGenerator);
  660. smalltalk.addMethod(
  661. "_currentClass_",
  662. smalltalk.method({
  663. selector: "currentClass:",
  664. category: 'accessing',
  665. fn: function (aClass) {
  666. var self=this;
  667. (self['@currentClass']=aClass);
  668. return self;},
  669. args: ["aClass"],
  670. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  671. messageSends: [],
  672. referencedClasses: []
  673. }),
  674. smalltalk.AbstractCodeGenerator);
  675. smalltalk.addMethod(
  676. "_pseudoVariables",
  677. smalltalk.method({
  678. selector: "pseudoVariables",
  679. category: 'accessing',
  680. fn: function () {
  681. var self=this;
  682. return ["self", "super", "true", "false", "nil", "thisContext"];
  683. return self;},
  684. args: [],
  685. source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
  686. messageSends: [],
  687. referencedClasses: []
  688. }),
  689. smalltalk.AbstractCodeGenerator);
  690. smalltalk.addMethod(
  691. "_safeVariableNameFor_",
  692. smalltalk.method({
  693. selector: "safeVariableNameFor:",
  694. category: 'accessing',
  695. fn: function (aString) {
  696. var self=this;
  697. 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;})]));
  698. return self;},
  699. args: ["aString"],
  700. source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
  701. messageSends: ["ifTrue:ifFalse:", "includes:", "reservedWords", "current", ","],
  702. referencedClasses: ["Smalltalk"]
  703. }),
  704. smalltalk.AbstractCodeGenerator);
  705. smalltalk.addMethod(
  706. "_source",
  707. smalltalk.method({
  708. selector: "source",
  709. category: 'accessing',
  710. fn: function () {
  711. var self=this;
  712. return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  713. return self;},
  714. args: [],
  715. source: "source\x0a\x09^source ifNil: ['']",
  716. messageSends: ["ifNil:"],
  717. referencedClasses: []
  718. }),
  719. smalltalk.AbstractCodeGenerator);
  720. smalltalk.addMethod(
  721. "_source_",
  722. smalltalk.method({
  723. selector: "source:",
  724. category: 'accessing',
  725. fn: function (aString) {
  726. var self=this;
  727. (self['@source']=aString);
  728. return self;},
  729. args: ["aString"],
  730. source: "source: aString\x0a\x09source := aString",
  731. messageSends: [],
  732. referencedClasses: []
  733. }),
  734. smalltalk.AbstractCodeGenerator);
  735. smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
  736. smalltalk.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation."
  737. smalltalk.addMethod(
  738. "_compileNode_",
  739. smalltalk.method({
  740. selector: "compileNode:",
  741. category: 'compiling',
  742. fn: function (aNode) {
  743. var self=this;
  744. var ir=nil;
  745. var stream=nil;
  746. smalltalk.send(smalltalk.send(self, "_semanticAnalyzer", []), "_visit_", [aNode]);
  747. (ir=smalltalk.send(smalltalk.send(self, "_translator", []), "_visit_", [aNode]));
  748. return (function($rec){smalltalk.send($rec, "_visit_", [ir]);return smalltalk.send($rec, "_contents", []);})(smalltalk.send(self, "_irTranslator", []));
  749. return self;},
  750. args: ["aNode"],
  751. source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09^ self irTranslator\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
  752. messageSends: ["visit:", "semanticAnalyzer", "translator", "contents", "irTranslator"],
  753. referencedClasses: []
  754. }),
  755. smalltalk.CodeGenerator);
  756. smalltalk.addMethod(
  757. "_irTranslator",
  758. smalltalk.method({
  759. selector: "irTranslator",
  760. category: 'compiling',
  761. fn: function () {
  762. var self=this;
  763. return smalltalk.send((smalltalk.IRJSTranslator || IRJSTranslator), "_new", []);
  764. return self;},
  765. args: [],
  766. source: "irTranslator\x0a\x09^ IRJSTranslator new",
  767. messageSends: ["new"],
  768. referencedClasses: ["IRJSTranslator"]
  769. }),
  770. smalltalk.CodeGenerator);
  771. smalltalk.addMethod(
  772. "_semanticAnalyzer",
  773. smalltalk.method({
  774. selector: "semanticAnalyzer",
  775. category: 'compiling',
  776. fn: function () {
  777. var self=this;
  778. return smalltalk.send((smalltalk.SemanticAnalyzer || SemanticAnalyzer), "_on_", [smalltalk.send(self, "_currentClass", [])]);
  779. return self;},
  780. args: [],
  781. source: "semanticAnalyzer\x0a\x09^ SemanticAnalyzer on: self currentClass",
  782. messageSends: ["on:", "currentClass"],
  783. referencedClasses: ["SemanticAnalyzer"]
  784. }),
  785. smalltalk.CodeGenerator);
  786. smalltalk.addMethod(
  787. "_translator",
  788. smalltalk.method({
  789. selector: "translator",
  790. category: 'compiling',
  791. fn: function () {
  792. var self=this;
  793. return (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(self, "_source", [])]);smalltalk.send($rec, "_theClass_", [smalltalk.send(self, "_currentClass", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRASTTranslator || IRASTTranslator), "_new", []));
  794. return self;},
  795. args: [],
  796. source: "translator\x0a\x09^ IRASTTranslator new\x0a\x09\x09source: self source;\x0a\x09\x09theClass: self currentClass;\x0a\x09\x09yourself",
  797. messageSends: ["source:", "source", "theClass:", "currentClass", "yourself", "new"],
  798. referencedClasses: ["IRASTTranslator"]
  799. }),
  800. smalltalk.CodeGenerator);
  801. smalltalk.addClass('FunCodeGenerator', smalltalk.AbstractCodeGenerator, ['stream', 'nestedBlocks', 'earlyReturn', 'currentSelector', 'unknownVariables', 'tempVariables', 'messageSends', 'referencedClasses', 'classReferenced', 'argVariables'], 'Compiler-Core');
  802. smalltalk.addMethod(
  803. "_argVariables",
  804. smalltalk.method({
  805. selector: "argVariables",
  806. category: 'accessing',
  807. fn: function () {
  808. var self=this;
  809. return smalltalk.send(self['@argVariables'], "_copy", []);
  810. return self;},
  811. args: [],
  812. source: "argVariables\x0a\x09^argVariables copy",
  813. messageSends: ["copy"],
  814. referencedClasses: []
  815. }),
  816. smalltalk.FunCodeGenerator);
  817. smalltalk.addMethod(
  818. "_checkClass_for_",
  819. smalltalk.method({
  820. selector: "checkClass:for:",
  821. category: 'optimizations',
  822. fn: function (aClassName, receiver) {
  823. var self=this;
  824. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((($receiver = ", "__comma", [receiver]), "__comma", [").klass === smalltalk."]), "__comma", [aClassName]), "__comma", [") ? "])]);
  825. return self;},
  826. args: ["aClassName", "receiver"],
  827. source: "checkClass: aClassName for: receiver\x0a stream nextPutAll: '((($receiver = ', receiver, ').klass === smalltalk.', aClassName, ') ? '",
  828. messageSends: ["nextPutAll:", ","],
  829. referencedClasses: []
  830. }),
  831. smalltalk.FunCodeGenerator);
  832. smalltalk.addMethod(
  833. "_compileNode_",
  834. smalltalk.method({
  835. selector: "compileNode:",
  836. category: 'compiling',
  837. fn: function (aNode) {
  838. var self=this;
  839. (self['@stream']=smalltalk.send("", "_writeStream", []));
  840. smalltalk.send(self, "_visit_", [aNode]);
  841. return smalltalk.send(self['@stream'], "_contents", []);
  842. return self;},
  843. args: ["aNode"],
  844. source: "compileNode: aNode\x0a\x09stream := '' writeStream.\x0a\x09self visit: aNode.\x0a\x09^stream contents",
  845. messageSends: ["writeStream", "visit:", "contents"],
  846. referencedClasses: []
  847. }),
  848. smalltalk.FunCodeGenerator);
  849. smalltalk.addMethod(
  850. "_initialize",
  851. smalltalk.method({
  852. selector: "initialize",
  853. category: 'initialization',
  854. fn: function () {
  855. var self=this;
  856. smalltalk.send(self, "_initialize", [], smalltalk.FunCodeGenerator.superclass || nil);
  857. (self['@stream']=smalltalk.send("", "_writeStream", []));
  858. (self['@unknownVariables']=[]);
  859. (self['@tempVariables']=[]);
  860. (self['@argVariables']=[]);
  861. (self['@messageSends']=[]);
  862. (self['@classReferenced']=[]);
  863. return self;},
  864. args: [],
  865. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream. \x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09messageSends := #().\x0a\x09classReferenced := #()",
  866. messageSends: ["initialize", "writeStream"],
  867. referencedClasses: []
  868. }),
  869. smalltalk.FunCodeGenerator);
  870. smalltalk.addMethod(
  871. "_inline_receiver_argumentNodes_",
  872. smalltalk.method({
  873. selector: "inline:receiver:argumentNodes:",
  874. category: 'optimizations',
  875. fn: function (aSelector, receiver, aCollection) {
  876. var self=this;
  877. var inlined=nil;
  878. (inlined=false);
  879. ((($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_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=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_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})]));
  880. ((($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_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=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_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})]));
  881. ((($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_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);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(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})]));
  882. ((($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_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);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(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})]));
  883. ((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  884. ((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  885. ((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  886. ((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  887. ((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver +"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver +"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  888. ((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver -"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver -"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  889. ((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver *"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver *"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  890. ((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver /"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver /"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
  891. return inlined;
  892. return self;},
  893. args: ["aSelector", "receiver", "aCollection"],
  894. source: "inline: aSelector receiver: receiver argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a\x0a\x09\x22-- Booleans --\x22\x0a\x0a\x09(aSelector = 'ifFalse:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:ifFalse:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifFalse:ifTrue:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>') ifTrue: [ \x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '+') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver +'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '-') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver -'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '*') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver *'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '/') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver /'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a ^inlined",
  895. messageSends: ["ifTrue:", "=", "isBlockNode", "first", "checkClass:for:", "nextPutAll:", "visit:", "and:", "second"],
  896. referencedClasses: []
  897. }),
  898. smalltalk.FunCodeGenerator);
  899. smalltalk.addMethod(
  900. "_inlineLiteral_receiverNode_argumentNodes_",
  901. smalltalk.method({
  902. selector: "inlineLiteral:receiverNode:argumentNodes:",
  903. category: 'optimizations',
  904. fn: function (aSelector, anObject, aCollection) {
  905. var self=this;
  906. var inlined=nil;
  907. (inlined=false);
  908. ((($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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})]));
  909. ((($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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})]));
  910. ((($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['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})]));
  911. ((($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['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})]));
  912. ((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  913. ((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  914. ((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  915. ((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  916. ((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  917. ((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  918. ((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  919. ((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
  920. ((($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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})]));})]));
  921. ((($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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})]));})]));
  922. ((($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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})]));
  923. ((($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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);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(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})]));
  924. return inlined;
  925. return self;},
  926. args: ["aSelector", "anObject", "aCollection"],
  927. 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: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileTrue') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '+') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' + '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '-') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' - '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '*') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' * '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '/') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' / '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' < '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' <= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' > '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' >= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a \x09 \x0a\x09\x22-- UndefinedObject --\x22\x0a\x0a\x09(aSelector = 'ifNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : $receiver'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') != nil && $receiver != undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : nil'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNil:ifNotNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:ifNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a \x0a ^inlined",
  928. messageSends: ["ifTrue:", "=", "and:", "isBlockNode", "first", "nextPutAll:", "visit:", "isNode:ofClass:", "second"],
  929. referencedClasses: ["Number"]
  930. }),
  931. smalltalk.FunCodeGenerator);
  932. smalltalk.addMethod(
  933. "_isNode_ofClass_",
  934. smalltalk.method({
  935. selector: "isNode:ofClass:",
  936. category: 'optimizations',
  937. fn: function (aNode, aClass) {
  938. var self=this;
  939. 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]);})]);})]);})]);
  940. return self;},
  941. args: ["aNode", "aClass"],
  942. 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]]]",
  943. messageSends: ["and:", "isValueNode", "or:", "=", "class", "value", "currentClass"],
  944. referencedClasses: []
  945. }),
  946. smalltalk.FunCodeGenerator);
  947. smalltalk.addMethod(
  948. "_knownVariables",
  949. smalltalk.method({
  950. selector: "knownVariables",
  951. category: 'accessing',
  952. fn: function () {
  953. var self=this;
  954. 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", []));
  955. return self;},
  956. args: [],
  957. source: "knownVariables\x0a\x09^self pseudoVariables \x0a\x09\x09addAll: self tempVariables;\x0a\x09\x09addAll: self argVariables;\x0a\x09\x09yourself",
  958. messageSends: ["addAll:", "tempVariables", "argVariables", "yourself", "pseudoVariables"],
  959. referencedClasses: []
  960. }),
  961. smalltalk.FunCodeGenerator);
  962. smalltalk.addMethod(
  963. "_performOptimizations",
  964. smalltalk.method({
  965. selector: "performOptimizations",
  966. category: 'testing',
  967. fn: function () {
  968. var self=this;
  969. return smalltalk.send(smalltalk.send(self, "_class", []), "_performOptimizations", []);
  970. return self;},
  971. args: [],
  972. source: "performOptimizations\x0a\x09^self class performOptimizations",
  973. messageSends: ["performOptimizations", "class"],
  974. referencedClasses: []
  975. }),
  976. smalltalk.FunCodeGenerator);
  977. smalltalk.addMethod(
  978. "_send_to_arguments_superSend_",
  979. smalltalk.method({
  980. selector: "send:to:arguments:superSend:",
  981. category: 'visiting',
  982. fn: function (aSelector, aReceiver, aCollection, aBoolean) {
  983. var self=this;
  984. return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){var tmp=nil;
  985. (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_", [")"]);})]);
  986. return self;},
  987. args: ["aSelector", "aReceiver", "aCollection", "aBoolean"],
  988. source: "send: aSelector to: aReceiver arguments: aCollection superSend: aBoolean\x0a\x09^String streamContents: [:str || tmp |\x0a \x09tmp := stream.\x0a\x09\x09str nextPutAll: 'smalltalk.send('.\x0a\x09\x09str nextPutAll: aReceiver.\x0a\x09\x09str nextPutAll: ', \x22', aSelector asSelector, '\x22, ['.\x0a stream := str.\x0a\x09\x09aCollection\x0a\x09 \x09\x09do: [:each | self visit: each]\x0a\x09 \x09\x09separatedBy: [stream nextPutAll: ', '].\x0a stream := tmp.\x0a str nextPutAll: ']'.\x0a\x09\x09aBoolean ifTrue: [\x0a\x09\x09\x09str nextPutAll: ', smalltalk.', (self classNameFor: self currentClass), '.superclass || nil'].\x0a\x09\x09str nextPutAll: ')']",
  989. messageSends: ["streamContents:", "nextPutAll:", ",", "asSelector", "do:separatedBy:", "visit:", "ifTrue:", "classNameFor:", "currentClass"],
  990. referencedClasses: ["String"]
  991. }),
  992. smalltalk.FunCodeGenerator);
  993. smalltalk.addMethod(
  994. "_tempVariables",
  995. smalltalk.method({
  996. selector: "tempVariables",
  997. category: 'accessing',
  998. fn: function () {
  999. var self=this;
  1000. return smalltalk.send(self['@tempVariables'], "_copy", []);
  1001. return self;},
  1002. args: [],
  1003. source: "tempVariables\x0a\x09^tempVariables copy",
  1004. messageSends: ["copy"],
  1005. referencedClasses: []
  1006. }),
  1007. smalltalk.FunCodeGenerator);
  1008. smalltalk.addMethod(
  1009. "_unknownVariables",
  1010. smalltalk.method({
  1011. selector: "unknownVariables",
  1012. category: 'accessing',
  1013. fn: function () {
  1014. var self=this;
  1015. return smalltalk.send(self['@unknownVariables'], "_copy", []);
  1016. return self;},
  1017. args: [],
  1018. source: "unknownVariables\x0a\x09^unknownVariables copy",
  1019. messageSends: ["copy"],
  1020. referencedClasses: []
  1021. }),
  1022. smalltalk.FunCodeGenerator);
  1023. smalltalk.addMethod(
  1024. "_visit_",
  1025. smalltalk.method({
  1026. selector: "visit:",
  1027. category: 'visiting',
  1028. fn: function (aNode) {
  1029. var self=this;
  1030. smalltalk.send(aNode, "_accept_", [self]);
  1031. return self;},
  1032. args: ["aNode"],
  1033. source: "visit: aNode\x0a\x09aNode accept: self",
  1034. messageSends: ["accept:"],
  1035. referencedClasses: []
  1036. }),
  1037. smalltalk.FunCodeGenerator);
  1038. smalltalk.addMethod(
  1039. "_visitAssignmentNode_",
  1040. smalltalk.method({
  1041. selector: "visitAssignmentNode:",
  1042. category: 'visiting',
  1043. fn: function (aNode) {
  1044. var self=this;
  1045. smalltalk.send(self['@stream'], "_nextPutAll_", ["("]);
  1046. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
  1047. smalltalk.send(self['@stream'], "_nextPutAll_", ["="]);
  1048. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);
  1049. smalltalk.send(self['@stream'], "_nextPutAll_", [")"]);
  1050. return self;},
  1051. args: ["aNode"],
  1052. source: "visitAssignmentNode: aNode\x0a\x09stream nextPutAll: '('.\x0a\x09self visit: aNode left.\x0a\x09stream nextPutAll: '='.\x0a\x09self visit: aNode right.\x0a\x09stream nextPutAll: ')'",
  1053. messageSends: ["nextPutAll:", "visit:", "left", "right"],
  1054. referencedClasses: []
  1055. }),
  1056. smalltalk.FunCodeGenerator);
  1057. smalltalk.addMethod(
  1058. "_visitBlockNode_",
  1059. smalltalk.method({
  1060. selector: "visitBlockNode:",
  1061. category: 'visiting',
  1062. fn: function (aNode) {
  1063. var self=this;
  1064. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
  1065. 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_", [", "]);})]);
  1066. smalltalk.send(self['@stream'], "_nextPutAll_", ["){"]);
  1067. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  1068. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  1069. return self;},
  1070. args: ["aNode"],
  1071. source: "visitBlockNode: aNode\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\x09aNode nodes do: [:each | self visit: each].\x0a\x09stream nextPutAll: '})'",
  1072. messageSends: ["nextPutAll:", "do:separatedBy:", "parameters", "add:", "do:", "nodes", "visit:"],
  1073. referencedClasses: []
  1074. }),
  1075. smalltalk.FunCodeGenerator);
  1076. smalltalk.addMethod(
  1077. "_visitBlockSequenceNode_",
  1078. smalltalk.method({
  1079. selector: "visitBlockSequenceNode:",
  1080. category: 'visiting',
  1081. fn: function (aNode) {
  1082. var self=this;
  1083. var index=nil;
  1084. (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
  1085. ((($receiver = smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return nil;"]);})() : (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  1086. (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']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return nil;"]);}), (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  1087. (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']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);})]));
  1088. (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])));
  1089. return self;},
  1090. args: ["aNode"],
  1091. source: "visitBlockSequenceNode: aNode\x0a\x09| index |\x0a\x09nestedBlocks := nestedBlocks + 1.\x0a\x09aNode nodes isEmpty\x0a\x09 ifTrue: [\x0a\x09\x09stream nextPutAll: 'return nil;']\x0a\x09 ifFalse: [\x0a\x09\x09aNode temps do: [:each | | temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09\x09 tempVariables add: temp.\x0a\x09\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09\x09index := 0.\x0a\x09\x09aNode nodes do: [:each |\x0a\x09\x09 index := index + 1.\x0a\x09\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09\x09stream nextPutAll: 'return '].\x0a\x09\x09 self visit: each.\x0a\x09\x09 stream nextPutAll: ';']].\x0a\x09nestedBlocks := nestedBlocks - 1",
  1092. messageSends: ["+", "ifTrue:ifFalse:", "isEmpty", "nodes", "nextPutAll:", "do:", "temps", "safeVariableNameFor:", "add:", ",", "lf", "ifTrue:", "=", "size", "visit:", "-"],
  1093. referencedClasses: []
  1094. }),
  1095. smalltalk.FunCodeGenerator);
  1096. smalltalk.addMethod(
  1097. "_visitCascadeNode_",
  1098. smalltalk.method({
  1099. selector: "visitCascadeNode:",
  1100. category: 'visiting',
  1101. fn: function (aNode) {
  1102. var self=this;
  1103. var index=nil;
  1104. (index=(0));
  1105. ((($receiver = smalltalk.send(self['@tempVariables'], "_includes_", ["$rec"])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})]));
  1106. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function($rec){"]);
  1107. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VariableNode || VariableNode), "_new", []), "_value_", ["$rec"])]);smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);
  1108. smalltalk.send(self['@stream'], "_nextPutAll_", ["})("]);
  1109. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  1110. smalltalk.send(self['@stream'], "_nextPutAll_", [")"]);
  1111. return self;},
  1112. args: ["aNode"],
  1113. source: "visitCascadeNode: aNode\x0a\x09| index |\x0a\x09index := 0.\x0a\x09(tempVariables includes: '$rec') ifFalse: [\x0a\x09\x09tempVariables add: '$rec'].\x0a\x09stream nextPutAll: '(function($rec){'.\x0a\x09aNode nodes do: [:each |\x0a\x09 index := index + 1.\x0a\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09stream nextPutAll: 'return '].\x0a\x09 each receiver: (VariableNode new value: '$rec').\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';'].\x0a\x09stream nextPutAll: '})('.\x0a\x09self visit: aNode receiver.\x0a\x09stream nextPutAll: ')'",
  1114. messageSends: ["ifFalse:", "includes:", "add:", "nextPutAll:", "do:", "nodes", "+", "ifTrue:", "=", "size", "receiver:", "value:", "new", "visit:", "receiver"],
  1115. referencedClasses: ["VariableNode"]
  1116. }),
  1117. smalltalk.FunCodeGenerator);
  1118. smalltalk.addMethod(
  1119. "_visitClassReferenceNode_",
  1120. smalltalk.method({
  1121. selector: "visitClassReferenceNode:",
  1122. category: 'visiting',
  1123. fn: function (aNode) {
  1124. var self=this;
  1125. ((($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", [])]);})]));
  1126. 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", [")"])]);
  1127. return self;},
  1128. args: ["aNode"],
  1129. source: "visitClassReferenceNode: aNode\x0a\x09(referencedClasses includes: aNode value) ifFalse: [\x0a\x09\x09referencedClasses add: aNode value].\x0a\x09stream nextPutAll: '(smalltalk.', aNode value, ' || ', aNode value, ')'",
  1130. messageSends: ["ifFalse:", "includes:", "value", "add:", "nextPutAll:", ","],
  1131. referencedClasses: []
  1132. }),
  1133. smalltalk.FunCodeGenerator);
  1134. smalltalk.addMethod(
  1135. "_visitDynamicArrayNode_",
  1136. smalltalk.method({
  1137. selector: "visitDynamicArrayNode:",
  1138. category: 'visiting',
  1139. fn: function (aNode) {
  1140. var self=this;
  1141. smalltalk.send(self['@stream'], "_nextPutAll_", ["["]);
  1142. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1143. smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
  1144. return self;},
  1145. args: ["aNode"],
  1146. source: "visitDynamicArrayNode: aNode\x0a\x09stream nextPutAll: '['.\x0a\x09aNode nodes \x0a\x09\x09do: [:each | self visit: each]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'",
  1147. messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
  1148. referencedClasses: []
  1149. }),
  1150. smalltalk.FunCodeGenerator);
  1151. smalltalk.addMethod(
  1152. "_visitDynamicDictionaryNode_",
  1153. smalltalk.method({
  1154. selector: "visitDynamicDictionaryNode:",
  1155. category: 'visiting',
  1156. fn: function (aNode) {
  1157. var self=this;
  1158. smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.HashedCollection._fromPairs_(["]);
  1159. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1160. smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]);
  1161. return self;},
  1162. args: ["aNode"],
  1163. source: "visitDynamicDictionaryNode: aNode\x0a\x09stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09aNode nodes \x0a\x09\x09\x09do: [:each | self visit: each]\x0a\x09\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09\x09stream nextPutAll: '])'",
  1164. messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
  1165. referencedClasses: []
  1166. }),
  1167. smalltalk.FunCodeGenerator);
  1168. smalltalk.addMethod(
  1169. "_visitFailure_",
  1170. smalltalk.method({
  1171. selector: "visitFailure:",
  1172. category: 'visiting',
  1173. fn: function (aFailure) {
  1174. var self=this;
  1175. smalltalk.send(self, "_error_", [smalltalk.send(aFailure, "_asString", [])]);
  1176. return self;},
  1177. args: ["aFailure"],
  1178. source: "visitFailure: aFailure\x0a\x09self error: aFailure asString",
  1179. messageSends: ["error:", "asString"],
  1180. referencedClasses: []
  1181. }),
  1182. smalltalk.FunCodeGenerator);
  1183. smalltalk.addMethod(
  1184. "_visitJSStatementNode_",
  1185. smalltalk.method({
  1186. selector: "visitJSStatementNode:",
  1187. category: 'visiting',
  1188. fn: function (aNode) {
  1189. var self=this;
  1190. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(aNode, "_source", [])]);
  1191. return self;},
  1192. args: ["aNode"],
  1193. source: "visitJSStatementNode: aNode\x0a\x09stream nextPutAll: aNode source",
  1194. messageSends: ["nextPutAll:", "source"],
  1195. referencedClasses: []
  1196. }),
  1197. smalltalk.FunCodeGenerator);
  1198. smalltalk.addMethod(
  1199. "_visitMethodNode_",
  1200. smalltalk.method({
  1201. selector: "visitMethodNode:",
  1202. category: 'visiting',
  1203. fn: function (aNode) {
  1204. var self=this;
  1205. var str=nil;
  1206. var currentSelector=nil;
  1207. (self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []));
  1208. (self['@nestedBlocks']=(0));
  1209. (self['@earlyReturn']=false);
  1210. (self['@messageSends']=[]);
  1211. (self['@referencedClasses']=[]);
  1212. (self['@unknownVariables']=[]);
  1213. (self['@tempVariables']=[]);
  1214. (self['@argVariables']=[]);
  1215. (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']);
  1216. (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']);
  1217. smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
  1218. 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_", [", "]);})]);
  1219. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1220. (str=self['@stream']);
  1221. (self['@stream']=smalltalk.send("", "_writeStream", []));
  1222. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  1223. ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})]));
  1224. smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
  1225. (self['@stream']=str);
  1226. (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["return self;"]);})(self['@stream']);
  1227. ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})]));
  1228. smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
  1229. (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']);
  1230. 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_", [","]);})]);
  1231. smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
  1232. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  1233. return self;},
  1234. args: ["aNode"],
  1235. 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\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: '){'; lf;\x0a\x09 nextPutAll: 'var self=this;'; lf.\x0a\x09str := stream.\x0a\x09stream := '' writeStream.\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09earlyReturn ifTrue: [\x0a\x09 str nextPutAll: 'var $early={};'; lf; nextPutAll: 'try{'].\x0a\x09str nextPutAll: stream contents.\x0a\x09stream := str.\x0a\x09stream \x0a\x09 lf; \x0a\x09 nextPutAll: 'return self;'.\x0a\x09earlyReturn ifTrue: [\x0a\x09 stream lf; 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: '})'",
  1236. messageSends: ["asSelector", "selector", "nextPutAll:", "lf", ",", "asJavascript", "source", "do:separatedBy:", "arguments", "add:", "writeStream", "do:", "nodes", "visit:", "ifTrue:", "contents", "printString"],
  1237. referencedClasses: ["String"]
  1238. }),
  1239. smalltalk.FunCodeGenerator);
  1240. smalltalk.addMethod(
  1241. "_visitReturnNode_",
  1242. smalltalk.method({
  1243. selector: "visitReturnNode:",
  1244. category: 'visiting',
  1245. fn: function (aNode) {
  1246. var self=this;
  1247. ((($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);})]));
  1248. ((($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 "]);})]));
  1249. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  1250. ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})]));
  1251. return self;},
  1252. args: ["aNode"],
  1253. source: "visitReturnNode: aNode\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 earlyReturn := true].\x0a\x09nestedBlocks > 0\x0a\x09 ifTrue: [\x0a\x09\x09stream\x0a\x09\x09 nextPutAll: '(function(){throw $early=[']\x0a\x09 ifFalse: [stream nextPutAll: 'return '].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 stream nextPutAll: ']})()']",
  1254. messageSends: ["ifTrue:", ">", "ifTrue:ifFalse:", "nextPutAll:", "do:", "nodes", "visit:"],
  1255. referencedClasses: []
  1256. }),
  1257. smalltalk.FunCodeGenerator);
  1258. smalltalk.addMethod(
  1259. "_visitSendNode_",
  1260. smalltalk.method({
  1261. selector: "visitSendNode:",
  1262. category: 'visiting',
  1263. fn: function (aNode) {
  1264. var self=this;
  1265. var str=nil;
  1266. var receiver=nil;
  1267. var superSend=nil;
  1268. var inlined=nil;
  1269. (str=self['@stream']);
  1270. ((($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", [])]);})]));
  1271. (self['@stream']=smalltalk.send("", "_writeStream", []));
  1272. smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
  1273. (superSend=smalltalk.send(smalltalk.send(self['@stream'], "_contents", []), "__eq", ["super"]));
  1274. (receiver=((($receiver = superSend).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "self";})() : (function(){return smalltalk.send(self['@stream'], "_contents", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "self";}), (function(){return smalltalk.send(self['@stream'], "_contents", []);})])));
  1275. (self['@stream']=str);
  1276. ((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));
  1277. return self;},
  1278. args: ["aNode"],
  1279. source: "visitSendNode: aNode\x0a | str receiver superSend inlined |\x0a str := stream.\x0a (messageSends includes: aNode selector) ifFalse: [\x0a messageSends add: aNode selector].\x0a stream := '' writeStream.\x0a self visit: aNode receiver.\x0a superSend := stream contents = 'super'.\x0a receiver := superSend ifTrue: ['self'] ifFalse: [stream contents].\x0a stream := str.\x0a\x09\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09(self inlineLiteral: aNode selector receiverNode: aNode receiver argumentNodes: aNode arguments) ifFalse: [\x0a\x09\x09\x09\x09(self inline: aNode selector receiver: receiver argumentNodes: aNode arguments)\x0a \x09\x09\x09ifTrue: [stream nextPutAll: ' : ', (self send: aNode selector to: '$receiver' arguments: aNode arguments superSend: superSend), ')']\x0a \x09\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]]]\x0a\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]",
  1280. messageSends: ["ifFalse:", "includes:", "selector", "add:", "writeStream", "visit:", "receiver", "=", "contents", "ifTrue:ifFalse:", "performOptimizations", "inlineLiteral:receiverNode:argumentNodes:", "arguments", "inline:receiver:argumentNodes:", "nextPutAll:", ",", "send:to:arguments:superSend:"],
  1281. referencedClasses: []
  1282. }),
  1283. smalltalk.FunCodeGenerator);
  1284. smalltalk.addMethod(
  1285. "_visitSequenceNode_",
  1286. smalltalk.method({
  1287. selector: "visitSequenceNode:",
  1288. category: 'visiting',
  1289. fn: function (aNode) {
  1290. var self=this;
  1291. smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
  1292. (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']);})]);
  1293. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);}), (function(){return smalltalk.send(self['@stream'], "_lf", []);})]);
  1294. return self;},
  1295. args: ["aNode"],
  1296. source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [:each || temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09 tempVariables add: temp.\x0a\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';']\x0a\x09 separatedBy: [stream lf]",
  1297. messageSends: ["do:", "temps", "safeVariableNameFor:", "add:", "nextPutAll:", ",", "lf", "do:separatedBy:", "nodes", "visit:"],
  1298. referencedClasses: []
  1299. }),
  1300. smalltalk.FunCodeGenerator);
  1301. smalltalk.addMethod(
  1302. "_visitValueNode_",
  1303. smalltalk.method({
  1304. selector: "visitValueNode:",
  1305. category: 'visiting',
  1306. fn: function (aNode) {
  1307. var self=this;
  1308. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
  1309. return self;},
  1310. args: ["aNode"],
  1311. source: "visitValueNode: aNode\x0a\x09stream nextPutAll: aNode value asJavascript",
  1312. messageSends: ["nextPutAll:", "asJavascript", "value"],
  1313. referencedClasses: []
  1314. }),
  1315. smalltalk.FunCodeGenerator);
  1316. smalltalk.addMethod(
  1317. "_visitVariableNode_",
  1318. smalltalk.method({
  1319. selector: "visitVariableNode:",
  1320. category: 'visiting',
  1321. fn: function (aNode) {
  1322. var self=this;
  1323. var varName=nil;
  1324. ((($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]);})]));})]));})]));
  1325. return self;},
  1326. args: ["aNode"],
  1327. source: "visitVariableNode: aNode\x0a\x09| varName |\x0a\x09(self currentClass allInstanceVariableNames includes: aNode value) \x0a\x09\x09ifTrue: [stream nextPutAll: '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: [stream nextPutAll: varName]\x0a \x09\x09ifFalse: [stream nextPutAll: '(typeof ', varName, ' == ''undefined'' ? nil : ', varName, ')']]\x0a \x09\x09ifTrue: [\x0a \x09aNode value = 'thisContext'\x0a \x09\x09ifTrue: [stream nextPutAll: '(smalltalk.getThisContext())']\x0a \x09\x09\x09\x09ifFalse: [stream nextPutAll: varName]]]",
  1328. messageSends: ["ifTrue:ifFalse:", "includes:", "allInstanceVariableNames", "currentClass", "value", "nextPutAll:", ",", "safeVariableNameFor:", "ifFalse:ifTrue:", "knownVariables", "add:", "assigned", "="],
  1329. referencedClasses: []
  1330. }),
  1331. smalltalk.FunCodeGenerator);
  1332. smalltalk.FunCodeGenerator.klass.iVarNames = ['performOptimizations'];
  1333. smalltalk.addMethod(
  1334. "_performOptimizations",
  1335. smalltalk.method({
  1336. selector: "performOptimizations",
  1337. category: 'accessing',
  1338. fn: function () {
  1339. var self=this;
  1340. return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
  1341. return self;},
  1342. args: [],
  1343. source: "performOptimizations\x0a\x09^performOptimizations ifNil: [true]",
  1344. messageSends: ["ifNil:"],
  1345. referencedClasses: []
  1346. }),
  1347. smalltalk.FunCodeGenerator.klass);
  1348. smalltalk.addMethod(
  1349. "_performOptimizations_",
  1350. smalltalk.method({
  1351. selector: "performOptimizations:",
  1352. category: 'accessing',
  1353. fn: function (aBoolean) {
  1354. var self=this;
  1355. (self['@performOptimizations']=aBoolean);
  1356. return self;},
  1357. args: ["aBoolean"],
  1358. source: "performOptimizations: aBoolean\x0a\x09performOptimizations := aBoolean",
  1359. messageSends: [],
  1360. referencedClasses: []
  1361. }),
  1362. smalltalk.FunCodeGenerator.klass);