Compiler-IR.deploy.js 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738
  1. smalltalk.addPackage('Compiler-IR', {});
  2. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
  3. smalltalk.addMethod(
  4. "_alias_",
  5. smalltalk.method({
  6. selector: "alias:",
  7. fn: function (aNode) {
  8. var self=this;
  9. var variable=nil;
  10. (variable=(function($rec){smalltalk.send($rec, "_variable_", [smalltalk.send(smalltalk.send((smalltalk.AliasVar || AliasVar), "_new", []), "_name_", [smalltalk.send("$", "__comma", [smalltalk.send(self, "_nextAlias", [])])])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRVariable || IRVariable), "_new", [])));
  11. smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [(function($rec){smalltalk.send($rec, "_add_", [variable]);smalltalk.send($rec, "_add_", [smalltalk.send(self, "_visit_", [aNode])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRAlias || IRAlias), "_new", []))]);
  12. smalltalk.send(smalltalk.send(smalltalk.send(self, "_method", []), "_internalVariables", []), "_add_", [variable]);
  13. return variable;
  14. return self;}
  15. }),
  16. smalltalk.IRASTTranslator);
  17. smalltalk.addMethod(
  18. "_method",
  19. smalltalk.method({
  20. selector: "method",
  21. fn: function () {
  22. var self=this;
  23. return self['@method'];
  24. return self;}
  25. }),
  26. smalltalk.IRASTTranslator);
  27. smalltalk.addMethod(
  28. "_method_",
  29. smalltalk.method({
  30. selector: "method:",
  31. fn: function (anIRMethod) {
  32. var self=this;
  33. (self['@method']=anIRMethod);
  34. return self;}
  35. }),
  36. smalltalk.IRASTTranslator);
  37. smalltalk.addMethod(
  38. "_nextAlias",
  39. smalltalk.method({
  40. selector: "nextAlias",
  41. fn: function () {
  42. var self=this;
  43. (($receiver = self['@nextAlias']) == nil || $receiver == undefined) ? (function(){return (self['@nextAlias']=(0));})() : $receiver;
  44. (self['@nextAlias']=((($receiver = self['@nextAlias']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
  45. return smalltalk.send(self['@nextAlias'], "_asString", []);
  46. return self;}
  47. }),
  48. smalltalk.IRASTTranslator);
  49. smalltalk.addMethod(
  50. "_sequence",
  51. smalltalk.method({
  52. selector: "sequence",
  53. fn: function () {
  54. var self=this;
  55. return self['@sequence'];
  56. return self;}
  57. }),
  58. smalltalk.IRASTTranslator);
  59. smalltalk.addMethod(
  60. "_sequence_",
  61. smalltalk.method({
  62. selector: "sequence:",
  63. fn: function (anIRSequence) {
  64. var self=this;
  65. (self['@sequence']=anIRSequence);
  66. return self;}
  67. }),
  68. smalltalk.IRASTTranslator);
  69. smalltalk.addMethod(
  70. "_source",
  71. smalltalk.method({
  72. selector: "source",
  73. fn: function () {
  74. var self=this;
  75. return self['@source'];
  76. return self;}
  77. }),
  78. smalltalk.IRASTTranslator);
  79. smalltalk.addMethod(
  80. "_source_",
  81. smalltalk.method({
  82. selector: "source:",
  83. fn: function (aString) {
  84. var self=this;
  85. (self['@source']=aString);
  86. return self;}
  87. }),
  88. smalltalk.IRASTTranslator);
  89. smalltalk.addMethod(
  90. "_theClass",
  91. smalltalk.method({
  92. selector: "theClass",
  93. fn: function () {
  94. var self=this;
  95. return self['@theClass'];
  96. return self;}
  97. }),
  98. smalltalk.IRASTTranslator);
  99. smalltalk.addMethod(
  100. "_theClass_",
  101. smalltalk.method({
  102. selector: "theClass:",
  103. fn: function (aClass) {
  104. var self=this;
  105. (self['@theClass']=aClass);
  106. return self;}
  107. }),
  108. smalltalk.IRASTTranslator);
  109. smalltalk.addMethod(
  110. "_visitAssignmentNode_",
  111. smalltalk.method({
  112. selector: "visitAssignmentNode:",
  113. fn: function (aNode) {
  114. var self=this;
  115. var left=nil;
  116. var right=nil;
  117. ((($receiver = smalltalk.send(smalltalk.send(aNode, "_right", []), "_isAssignmentNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var assignment=nil;
  118. (assignment=smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]));smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [assignment]);return (right=smalltalk.send(smalltalk.send(assignment, "_instructions", []), "_first", []));})() : (function(){return (right=smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){var assignment=nil;
  119. (assignment=smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]));smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [assignment]);return (right=smalltalk.send(smalltalk.send(assignment, "_instructions", []), "_first", []));}), (function(){return (right=smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]));})]));
  120. (left=smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]));
  121. return (function($rec){smalltalk.send($rec, "_add_", [left]);smalltalk.send($rec, "_add_", [right]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRAssignment || IRAssignment), "_new", []));
  122. return self;}
  123. }),
  124. smalltalk.IRASTTranslator);
  125. smalltalk.addMethod(
  126. "_visitBlockNode_",
  127. smalltalk.method({
  128. selector: "visitBlockNode:",
  129. fn: function (aNode) {
  130. var self=this;
  131. var closure=nil;
  132. (closure=(function($rec){smalltalk.send($rec, "_arguments_", [smalltalk.send(aNode, "_parameters", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRClosure || IRClosure), "_new", [])));
  133. smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_scope", []), "_temps", []), "_do_", [(function(each){return smalltalk.send(closure, "_add_", [(function($rec){smalltalk.send($rec, "_name_", [smalltalk.send(each, "_name", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRTempDeclaration || IRTempDeclaration), "_new", []))]);})]);
  134. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(closure, "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);
  135. return closure;
  136. return self;}
  137. }),
  138. smalltalk.IRASTTranslator);
  139. smalltalk.addMethod(
  140. "_visitBlockSequenceNode_",
  141. smalltalk.method({
  142. selector: "visitBlockSequenceNode:",
  143. fn: function (aNode) {
  144. var self=this;
  145. var seq=nil;
  146. (seq=smalltalk.send((smalltalk.IRBlockSequence || IRBlockSequence), "_new", []));
  147. smalltalk.send(self, "_sequence_", [seq]);
  148. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);
  149. return seq;
  150. return self;}
  151. }),
  152. smalltalk.IRASTTranslator);
  153. smalltalk.addMethod(
  154. "_visitCascadeNode_",
  155. smalltalk.method({
  156. selector: "visitCascadeNode:",
  157. fn: function (aNode) {
  158. var self=this;
  159. var alias=nil;
  160. ((($receiver = smalltalk.send(smalltalk.send(aNode, "_receiver", []), "_isValueNode", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){(alias=smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [smalltalk.send(self, "_alias_", [smalltalk.send(aNode, "_receiver", [])])]));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VariableNode || VariableNode), "_new", []), "_binding_", [smalltalk.send(alias, "_variable", [])])]);})]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){(alias=smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [smalltalk.send(self, "_alias_", [smalltalk.send(aNode, "_receiver", [])])]));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VariableNode || VariableNode), "_new", []), "_binding_", [smalltalk.send(alias, "_variable", [])])]);})]);})]));
  161. smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_allButLast", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);
  162. return smalltalk.send(self, "_alias_", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_last", [])]);
  163. return self;}
  164. }),
  165. smalltalk.IRASTTranslator);
  166. smalltalk.addMethod(
  167. "_visitJSStatementNode_",
  168. smalltalk.method({
  169. selector: "visitJSStatementNode:",
  170. fn: function (aNode) {
  171. var self=this;
  172. return (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(aNode, "_source", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRVerbatim || IRVerbatim), "_new", []));
  173. return self;}
  174. }),
  175. smalltalk.IRASTTranslator);
  176. smalltalk.addMethod(
  177. "_visitMethodNode_",
  178. smalltalk.method({
  179. selector: "visitMethodNode:",
  180. fn: function (aNode){
  181. var self=this;
  182. smalltalk.send(self, "_method_", [(function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(self, "_source", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(aNode, "_arguments", [])]);smalltalk.send($rec, "_selector_", [smalltalk.send(aNode, "_selector", [])]);smalltalk.send($rec, "_messageSends_", [smalltalk.send(aNode, "_messageSends", [])]);smalltalk.send($rec, "_classReferences_", [smalltalk.send(aNode, "_classReferences", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRMethod || IRMethod), "_new", []))]);
  183. smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_scope", []), "_temps", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_method", []), "_add_", [(function($rec){smalltalk.send($rec, "_name_", [smalltalk.send(each, "_name", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRTempDeclaration || IRTempDeclaration), "_new", []))]);})]);
  184. ((($receiver = smalltalk.send(aNode, "_hasNonLocalReturn", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var handling=nil;
  185. (handling=smalltalk.send((smalltalk.IRNonLocalReturnHandling || IRNonLocalReturnHandling), "_new", []));smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(handling, "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);return smalltalk.send(smalltalk.send(self, "_method", []), "_add_", [handling]);})() : (function(){return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_method", []), "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){var handling=nil;
  186. (handling=smalltalk.send((smalltalk.IRNonLocalReturnHandling || IRNonLocalReturnHandling), "_new", []));smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(handling, "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);return smalltalk.send(smalltalk.send(self, "_method", []), "_add_", [handling]);}), (function(){return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_method", []), "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);})]));
  187. ((($receiver = smalltalk.send(aNode, "_hasLocalReturn", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_method", []), "_add_", [smalltalk.send((smalltalk.IRReturn || IRReturn), "_new", [])]), "_add_", [(function($rec){smalltalk.send($rec, "_variable_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_scope", []), "_pseudoVars", []), "_at_", ["self"])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRVariable || IRVariable), "_new", []))]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_method", []), "_add_", [smalltalk.send((smalltalk.IRReturn || IRReturn), "_new", [])]), "_add_", [(function($rec){smalltalk.send($rec, "_variable_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_scope", []), "_pseudoVars", []), "_at_", ["self"])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRVariable || IRVariable), "_new", []))]);})]));
  188. return smalltalk.send(self, "_method", []);
  189. return self;}
  190. }),
  191. smalltalk.IRASTTranslator);
  192. smalltalk.addMethod(
  193. "_visitReturnNode_",
  194. smalltalk.method({
  195. selector: "visitReturnNode:",
  196. fn: function (aNode) {
  197. var self=this;
  198. var return_=nil;
  199. (return_=((($receiver = smalltalk.send(aNode, "_nonLocalReturn", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send((smalltalk.IRNonLocalReturn || IRNonLocalReturn), "_new", []);})() : (function(){return smalltalk.send((smalltalk.IRReturn || IRReturn), "_new", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send((smalltalk.IRNonLocalReturn || IRNonLocalReturn), "_new", []);}), (function(){return smalltalk.send((smalltalk.IRReturn || IRReturn), "_new", []);})])));
  200. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(return_, "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);
  201. return return_;
  202. return self;}
  203. }),
  204. smalltalk.IRASTTranslator);
  205. smalltalk.addMethod(
  206. "_visitSendNode_",
  207. smalltalk.method({
  208. selector: "visitSendNode:",
  209. fn: function (aNode) {
  210. var self=this;
  211. var send=nil;
  212. var receiver=nil;
  213. var arguments=nil;
  214. (send=smalltalk.send((smalltalk.IRSend || IRSend), "_new", []));
  215. smalltalk.send(send, "_selector_", [smalltalk.send(aNode, "_selector", [])]);
  216. ((($receiver = smalltalk.send(aNode, "_superSend", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(send, "_classSend_", [smalltalk.send(smalltalk.send(self, "_theClass", []), "_superclass", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(send, "_classSend_", [smalltalk.send(smalltalk.send(self, "_theClass", []), "_superclass", [])]);})]));
  217. (receiver=smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]));
  218. (arguments=smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_collect_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]));
  219. smalltalk.send(send, "_add_", [receiver]);
  220. smalltalk.send(arguments, "_do_", [(function(each){return smalltalk.send(send, "_add_", [each]);})]);
  221. return send;
  222. return self;}
  223. }),
  224. smalltalk.IRASTTranslator);
  225. smalltalk.addMethod(
  226. "_visitSequenceNode_",
  227. smalltalk.method({
  228. selector: "visitSequenceNode:",
  229. fn: function (aNode) {
  230. var self=this;
  231. var seq=nil;
  232. (seq=smalltalk.send((smalltalk.IRSequence || IRSequence), "_new", []));
  233. smalltalk.send(self, "_sequence_", [seq]);
  234. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(self, "_sequence", []), "_add_", [smalltalk.send(self, "_visit_", [each])]);})]);
  235. return seq;
  236. return self;}
  237. }),
  238. smalltalk.IRASTTranslator);
  239. smalltalk.addMethod(
  240. "_visitValueNode_",
  241. smalltalk.method({
  242. selector: "visitValueNode:",
  243. fn: function (aNode) {
  244. var self=this;
  245. return (function($rec){smalltalk.send($rec, "_value_", [smalltalk.send(aNode, "_value", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRValue || IRValue), "_new", []));
  246. return self;}
  247. }),
  248. smalltalk.IRASTTranslator);
  249. smalltalk.addMethod(
  250. "_visitVariableNode_",
  251. smalltalk.method({
  252. selector: "visitVariableNode:",
  253. fn: function (aNode) {
  254. var self=this;
  255. return (function($rec){smalltalk.send($rec, "_variable_", [smalltalk.send(aNode, "_binding", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.IRVariable || IRVariable), "_new", []));
  256. return self;}
  257. }),
  258. smalltalk.IRASTTranslator);
  259. smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler-IR');
  260. smalltalk.addMethod(
  261. "_accept_",
  262. smalltalk.method({
  263. selector: "accept:",
  264. fn: function (aVisitor) {
  265. var self=this;
  266. return smalltalk.send(aVisitor, "_visitIRInstruction_", [self]);
  267. return self;}
  268. }),
  269. smalltalk.IRInstruction);
  270. smalltalk.addMethod(
  271. "_add_",
  272. smalltalk.method({
  273. selector: "add:",
  274. fn: function (anObject){
  275. var self=this;
  276. smalltalk.send(anObject, "_parent_", [self]);
  277. return smalltalk.send(smalltalk.send(self, "_instructions", []), "_add_", [anObject]);
  278. return self;}
  279. }),
  280. smalltalk.IRInstruction);
  281. smalltalk.addMethod(
  282. "_instructions",
  283. smalltalk.method({
  284. selector: "instructions",
  285. fn: function () {
  286. var self=this;
  287. return (($receiver = self['@instructions']) == nil || $receiver == undefined) ? (function(){return (self['@instructions']=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection), "_new", []));})() : $receiver;
  288. return self;}
  289. }),
  290. smalltalk.IRInstruction);
  291. smalltalk.addMethod(
  292. "_isClosure",
  293. smalltalk.method({
  294. selector: "isClosure",
  295. fn: function () {
  296. var self=this;
  297. return false;
  298. return self;}
  299. }),
  300. smalltalk.IRInstruction);
  301. smalltalk.addMethod(
  302. "_isInlined",
  303. smalltalk.method({
  304. selector: "isInlined",
  305. fn: function (){
  306. var self=this;
  307. return false;
  308. return self;}
  309. }),
  310. smalltalk.IRInstruction);
  311. smalltalk.addMethod(
  312. "_isReturn",
  313. smalltalk.method({
  314. selector: "isReturn",
  315. fn: function () {
  316. var self=this;
  317. return false;
  318. return self;}
  319. }),
  320. smalltalk.IRInstruction);
  321. smalltalk.addMethod(
  322. "_isSend",
  323. smalltalk.method({
  324. selector: "isSend",
  325. fn: function (){
  326. var self=this;
  327. return false;
  328. return self;}
  329. }),
  330. smalltalk.IRInstruction);
  331. smalltalk.addMethod(
  332. "_isVariable",
  333. smalltalk.method({
  334. selector: "isVariable",
  335. fn: function (){
  336. var self=this;
  337. return false;
  338. return self;}
  339. }),
  340. smalltalk.IRInstruction);
  341. smalltalk.addMethod(
  342. "_parent",
  343. smalltalk.method({
  344. selector: "parent",
  345. fn: function (){
  346. var self=this;
  347. return self['@parent'];
  348. return self;}
  349. }),
  350. smalltalk.IRInstruction);
  351. smalltalk.addMethod(
  352. "_parent_",
  353. smalltalk.method({
  354. selector: "parent:",
  355. fn: function (anIRInstruction){
  356. var self=this;
  357. (self['@parent']=anIRInstruction);
  358. return self;}
  359. }),
  360. smalltalk.IRInstruction);
  361. smalltalk.addMethod(
  362. "_remove",
  363. smalltalk.method({
  364. selector: "remove",
  365. fn: function (){
  366. var self=this;
  367. smalltalk.send(smalltalk.send(self, "_parent", []), "_remove_", [self]);
  368. return self;}
  369. }),
  370. smalltalk.IRInstruction);
  371. smalltalk.addMethod(
  372. "_remove_",
  373. smalltalk.method({
  374. selector: "remove:",
  375. fn: function (anIRInstruction){
  376. var self=this;
  377. smalltalk.send(smalltalk.send(self, "_instructions", []), "_remove_", [anIRInstruction]);
  378. return self;}
  379. }),
  380. smalltalk.IRInstruction);
  381. smalltalk.addMethod(
  382. "_replace_with_",
  383. smalltalk.method({
  384. selector: "replace:with:",
  385. fn: function (anIRInstruction, anotherIRInstruction){
  386. var self=this;
  387. smalltalk.send(anotherIRInstruction, "_parent_", [self]);
  388. smalltalk.send(smalltalk.send(self, "_instructions", []), "_at_put_", [smalltalk.send(smalltalk.send(self, "_instructions", []), "_indexOf_", [anIRInstruction]), anotherIRInstruction]);
  389. return self;}
  390. }),
  391. smalltalk.IRInstruction);
  392. smalltalk.addMethod(
  393. "_replaceWith_",
  394. smalltalk.method({
  395. selector: "replaceWith:",
  396. fn: function (anIRInstruction){
  397. var self=this;
  398. smalltalk.send(smalltalk.send(self, "_parent", []), "_replace_with_", [self, anIRInstruction]);
  399. return self;}
  400. }),
  401. smalltalk.IRInstruction);
  402. smalltalk.addMethod(
  403. "_on_",
  404. smalltalk.method({
  405. selector: "on:",
  406. fn: function (aBuilder) {
  407. var self=this;
  408. return (function($rec){smalltalk.send($rec, "_builder_", [aBuilder]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  409. return self;}
  410. }),
  411. smalltalk.IRInstruction.klass);
  412. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  413. smalltalk.addMethod(
  414. "_accept_",
  415. smalltalk.method({
  416. selector: "accept:",
  417. fn: function (aVisitor) {
  418. var self=this;
  419. return smalltalk.send(aVisitor, "_visitIRAssignment_", [self]);
  420. return self;}
  421. }),
  422. smalltalk.IRAssignment);
  423. smalltalk.addClass('IRAlias', smalltalk.IRAssignment, [], 'Compiler-IR');
  424. smalltalk.addMethod(
  425. "_accept_",
  426. smalltalk.method({
  427. selector: "accept:",
  428. fn: function (aVisitor) {
  429. var self=this;
  430. return smalltalk.send(aVisitor, "_visitIRAlias_", [self]);
  431. return self;}
  432. }),
  433. smalltalk.IRAlias);
  434. smalltalk.addClass('IRClosure', smalltalk.IRInstruction, ['arguments'], 'Compiler-IR');
  435. smalltalk.addMethod(
  436. "_accept_",
  437. smalltalk.method({
  438. selector: "accept:",
  439. fn: function (aVisitor) {
  440. var self=this;
  441. return smalltalk.send(aVisitor, "_visitIRClosure_", [self]);
  442. return self;}
  443. }),
  444. smalltalk.IRClosure);
  445. smalltalk.addMethod(
  446. "_arguments",
  447. smalltalk.method({
  448. selector: "arguments",
  449. fn: function () {
  450. var self=this;
  451. return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
  452. return self;}
  453. }),
  454. smalltalk.IRClosure);
  455. smalltalk.addMethod(
  456. "_arguments_",
  457. smalltalk.method({
  458. selector: "arguments:",
  459. fn: function (aCollection) {
  460. var self=this;
  461. (self['@arguments']=aCollection);
  462. return self;}
  463. }),
  464. smalltalk.IRClosure);
  465. smalltalk.addMethod(
  466. "_isClosure",
  467. smalltalk.method({
  468. selector: "isClosure",
  469. fn: function () {
  470. var self=this;
  471. return true;
  472. return self;}
  473. }),
  474. smalltalk.IRClosure);
  475. smalltalk.addClass('IRMethod', smalltalk.IRInstruction, ['source', 'selector', 'classReferences', 'messageSends', 'arguments', 'internalVariables'], 'Compiler-IR');
  476. smalltalk.addMethod(
  477. "_accept_",
  478. smalltalk.method({
  479. selector: "accept:",
  480. fn: function (aVisitor) {
  481. var self=this;
  482. return smalltalk.send(aVisitor, "_visitIRMethod_", [self]);
  483. return self;}
  484. }),
  485. smalltalk.IRMethod);
  486. smalltalk.addMethod(
  487. "_arguments",
  488. smalltalk.method({
  489. selector: "arguments",
  490. fn: function () {
  491. var self=this;
  492. return self['@arguments'];
  493. return self;}
  494. }),
  495. smalltalk.IRMethod);
  496. smalltalk.addMethod(
  497. "_arguments_",
  498. smalltalk.method({
  499. selector: "arguments:",
  500. fn: function (aCollection) {
  501. var self=this;
  502. (self['@arguments']=aCollection);
  503. return self;}
  504. }),
  505. smalltalk.IRMethod);
  506. smalltalk.addMethod(
  507. "_classReferences",
  508. smalltalk.method({
  509. selector: "classReferences",
  510. fn: function () {
  511. var self=this;
  512. return self['@classReferences'];
  513. return self;}
  514. }),
  515. smalltalk.IRMethod);
  516. smalltalk.addMethod(
  517. "_classReferences_",
  518. smalltalk.method({
  519. selector: "classReferences:",
  520. fn: function (aCollection) {
  521. var self=this;
  522. (self['@classReferences']=aCollection);
  523. return self;}
  524. }),
  525. smalltalk.IRMethod);
  526. smalltalk.addMethod(
  527. "_internalVariables",
  528. smalltalk.method({
  529. selector: "internalVariables",
  530. fn: function () {
  531. var self=this;
  532. return (($receiver = self['@internalVariables']) == nil || $receiver == undefined) ? (function(){return (self['@internalVariables']=smalltalk.send((smalltalk.Set || Set), "_new", []));})() : $receiver;
  533. return self;}
  534. }),
  535. smalltalk.IRMethod);
  536. smalltalk.addMethod(
  537. "_messageSends",
  538. smalltalk.method({
  539. selector: "messageSends",
  540. fn: function () {
  541. var self=this;
  542. return self['@messageSends'];
  543. return self;}
  544. }),
  545. smalltalk.IRMethod);
  546. smalltalk.addMethod(
  547. "_messageSends_",
  548. smalltalk.method({
  549. selector: "messageSends:",
  550. fn: function (aCollection) {
  551. var self=this;
  552. (self['@messageSends']=aCollection);
  553. return self;}
  554. }),
  555. smalltalk.IRMethod);
  556. smalltalk.addMethod(
  557. "_selector",
  558. smalltalk.method({
  559. selector: "selector",
  560. fn: function () {
  561. var self=this;
  562. return self['@selector'];
  563. return self;}
  564. }),
  565. smalltalk.IRMethod);
  566. smalltalk.addMethod(
  567. "_selector_",
  568. smalltalk.method({
  569. selector: "selector:",
  570. fn: function (aString) {
  571. var self=this;
  572. (self['@selector']=aString);
  573. return self;}
  574. }),
  575. smalltalk.IRMethod);
  576. smalltalk.addMethod(
  577. "_source",
  578. smalltalk.method({
  579. selector: "source",
  580. fn: function () {
  581. var self=this;
  582. return self['@source'];
  583. return self;}
  584. }),
  585. smalltalk.IRMethod);
  586. smalltalk.addMethod(
  587. "_source_",
  588. smalltalk.method({
  589. selector: "source:",
  590. fn: function (aString) {
  591. var self=this;
  592. (self['@source']=aString);
  593. return self;}
  594. }),
  595. smalltalk.IRMethod);
  596. smalltalk.addClass('IRNonLocalReturnHandling', smalltalk.IRInstruction, [], 'Compiler-IR');
  597. smalltalk.addMethod(
  598. "_accept_",
  599. smalltalk.method({
  600. selector: "accept:",
  601. fn: function (aVisitor) {
  602. var self=this;
  603. return smalltalk.send(aVisitor, "_visitIRNonLocalReturnHandling_", [self]);
  604. return self;}
  605. }),
  606. smalltalk.IRNonLocalReturnHandling);
  607. smalltalk.addClass('IRReturn', smalltalk.IRInstruction, [], 'Compiler-IR');
  608. smalltalk.addMethod(
  609. "_accept_",
  610. smalltalk.method({
  611. selector: "accept:",
  612. fn: function (aVisitor) {
  613. var self=this;
  614. return smalltalk.send(aVisitor, "_visitIRReturn_", [self]);
  615. return self;}
  616. }),
  617. smalltalk.IRReturn);
  618. smalltalk.addMethod(
  619. "_isReturn",
  620. smalltalk.method({
  621. selector: "isReturn",
  622. fn: function () {
  623. var self=this;
  624. return true;
  625. return self;}
  626. }),
  627. smalltalk.IRReturn);
  628. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  629. smalltalk.addMethod(
  630. "_accept_",
  631. smalltalk.method({
  632. selector: "accept:",
  633. fn: function (aVisitor) {
  634. var self=this;
  635. return smalltalk.send(aVisitor, "_visitIRNonLocalReturn_", [self]);
  636. return self;}
  637. }),
  638. smalltalk.IRNonLocalReturn);
  639. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend'], 'Compiler-IR');
  640. smalltalk.addMethod(
  641. "_accept_",
  642. smalltalk.method({
  643. selector: "accept:",
  644. fn: function (aVisitor) {
  645. var self=this;
  646. return smalltalk.send(aVisitor, "_visitIRSend_", [self]);
  647. return self;}
  648. }),
  649. smalltalk.IRSend);
  650. smalltalk.addMethod(
  651. "_classSend",
  652. smalltalk.method({
  653. selector: "classSend",
  654. fn: function () {
  655. var self=this;
  656. return self['@classSend'];
  657. return self;}
  658. }),
  659. smalltalk.IRSend);
  660. smalltalk.addMethod(
  661. "_classSend_",
  662. smalltalk.method({
  663. selector: "classSend:",
  664. fn: function (aClass) {
  665. var self=this;
  666. (self['@classSend']=aClass);
  667. return self;}
  668. }),
  669. smalltalk.IRSend);
  670. smalltalk.addMethod(
  671. "_isSend",
  672. smalltalk.method({
  673. selector: "isSend",
  674. fn: function (){
  675. var self=this;
  676. return true;
  677. return self;}
  678. }),
  679. smalltalk.IRSend);
  680. smalltalk.addMethod(
  681. "_selector",
  682. smalltalk.method({
  683. selector: "selector",
  684. fn: function () {
  685. var self=this;
  686. return self['@selector'];
  687. return self;}
  688. }),
  689. smalltalk.IRSend);
  690. smalltalk.addMethod(
  691. "_selector_",
  692. smalltalk.method({
  693. selector: "selector:",
  694. fn: function (aString) {
  695. var self=this;
  696. (self['@selector']=aString);
  697. return self;}
  698. }),
  699. smalltalk.IRSend);
  700. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  701. smalltalk.addMethod(
  702. "_accept_",
  703. smalltalk.method({
  704. selector: "accept:",
  705. fn: function (aVisitor) {
  706. var self=this;
  707. return smalltalk.send(aVisitor, "_visitIRSequence_", [self]);
  708. return self;}
  709. }),
  710. smalltalk.IRSequence);
  711. smalltalk.addMethod(
  712. "_add_",
  713. smalltalk.method({
  714. selector: "add:",
  715. fn: function (anIRInstruction) {
  716. var self=this;
  717. var statement=nil;
  718. (statement=smalltalk.send((smalltalk.IRStatement || IRStatement), "_new", []));
  719. smalltalk.send(statement, "_add_", [anIRInstruction]);
  720. smalltalk.send(smalltalk.send(self, "_instructions", []), "_add_", [statement]);
  721. return anIRInstruction;
  722. return self;}
  723. }),
  724. smalltalk.IRSequence);
  725. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  726. smalltalk.addMethod(
  727. "_accept_",
  728. smalltalk.method({
  729. selector: "accept:",
  730. fn: function (aVisitor) {
  731. var self=this;
  732. return smalltalk.send(aVisitor, "_visitIRBlockSequence_", [self]);
  733. return self;}
  734. }),
  735. smalltalk.IRBlockSequence);
  736. smalltalk.addClass('IRStatement', smalltalk.IRInstruction, [], 'Compiler-IR');
  737. smalltalk.addMethod(
  738. "_accept_",
  739. smalltalk.method({
  740. selector: "accept:",
  741. fn: function (aVisitor) {
  742. var self=this;
  743. return smalltalk.send(aVisitor, "_visitIRStatement_", [self]);
  744. return self;}
  745. }),
  746. smalltalk.IRStatement);
  747. smalltalk.addMethod(
  748. "_isReturn",
  749. smalltalk.method({
  750. selector: "isReturn",
  751. fn: function () {
  752. var self=this;
  753. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instructions", []), "_first", []), "_isReturn", []);
  754. return self;}
  755. }),
  756. smalltalk.IRStatement);
  757. smalltalk.addClass('IRTempDeclaration', smalltalk.IRInstruction, ['name'], 'Compiler-IR');
  758. smalltalk.addMethod(
  759. "_accept_",
  760. smalltalk.method({
  761. selector: "accept:",
  762. fn: function (aVisitor) {
  763. var self=this;
  764. return smalltalk.send(aVisitor, "_visitIRTempDeclaration_", [self]);
  765. return self;}
  766. }),
  767. smalltalk.IRTempDeclaration);
  768. smalltalk.addMethod(
  769. "_name",
  770. smalltalk.method({
  771. selector: "name",
  772. fn: function () {
  773. var self=this;
  774. return self['@name'];
  775. return self;}
  776. }),
  777. smalltalk.IRTempDeclaration);
  778. smalltalk.addMethod(
  779. "_name_",
  780. smalltalk.method({
  781. selector: "name:",
  782. fn: function (aString) {
  783. var self=this;
  784. (self['@name']=aString);
  785. return self;}
  786. }),
  787. smalltalk.IRTempDeclaration);
  788. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  789. smalltalk.addMethod(
  790. "_accept_",
  791. smalltalk.method({
  792. selector: "accept:",
  793. fn: function (aVisitor) {
  794. var self=this;
  795. return smalltalk.send(aVisitor, "_visitIRValue_", [self]);
  796. return self;}
  797. }),
  798. smalltalk.IRValue);
  799. smalltalk.addMethod(
  800. "_value",
  801. smalltalk.method({
  802. selector: "value",
  803. fn: function () {
  804. var self=this;
  805. return self['@value'];
  806. return self;}
  807. }),
  808. smalltalk.IRValue);
  809. smalltalk.addMethod(
  810. "_value_",
  811. smalltalk.method({
  812. selector: "value:",
  813. fn: function (aString) {
  814. var self=this;
  815. (self['@value']=aString);
  816. return self;}
  817. }),
  818. smalltalk.IRValue);
  819. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  820. smalltalk.addMethod(
  821. "_accept_",
  822. smalltalk.method({
  823. selector: "accept:",
  824. fn: function (aVisitor) {
  825. var self=this;
  826. return smalltalk.send(aVisitor, "_visitIRVariable_", [self]);
  827. return self;}
  828. }),
  829. smalltalk.IRVariable);
  830. smalltalk.addMethod(
  831. "_isVariable",
  832. smalltalk.method({
  833. selector: "isVariable",
  834. fn: function (){
  835. var self=this;
  836. return true;
  837. return self;}
  838. }),
  839. smalltalk.IRVariable);
  840. smalltalk.addMethod(
  841. "_variable",
  842. smalltalk.method({
  843. selector: "variable",
  844. fn: function () {
  845. var self=this;
  846. return self['@variable'];
  847. return self;}
  848. }),
  849. smalltalk.IRVariable);
  850. smalltalk.addMethod(
  851. "_variable_",
  852. smalltalk.method({
  853. selector: "variable:",
  854. fn: function (aScopeVariable) {
  855. var self=this;
  856. (self['@variable']=aScopeVariable);
  857. return self;}
  858. }),
  859. smalltalk.IRVariable);
  860. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  861. smalltalk.addMethod(
  862. "_accept_",
  863. smalltalk.method({
  864. selector: "accept:",
  865. fn: function (aVisitor) {
  866. var self=this;
  867. return smalltalk.send(aVisitor, "_visitIRVerbatim_", [self]);
  868. return self;}
  869. }),
  870. smalltalk.IRVerbatim);
  871. smalltalk.addMethod(
  872. "_source",
  873. smalltalk.method({
  874. selector: "source",
  875. fn: function () {
  876. var self=this;
  877. return self['@source'];
  878. return self;}
  879. }),
  880. smalltalk.IRVerbatim);
  881. smalltalk.addMethod(
  882. "_source_",
  883. smalltalk.method({
  884. selector: "source:",
  885. fn: function (aString) {
  886. var self=this;
  887. (self['@source']=aString);
  888. return self;}
  889. }),
  890. smalltalk.IRVerbatim);
  891. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  892. smalltalk.addMethod(
  893. "_visit_",
  894. smalltalk.method({
  895. selector: "visit:",
  896. fn: function (anIRInstruction) {
  897. var self=this;
  898. return smalltalk.send(anIRInstruction, "_accept_", [self]);
  899. return self;}
  900. }),
  901. smalltalk.IRVisitor);
  902. smalltalk.addMethod(
  903. "_visitIRAlias_",
  904. smalltalk.method({
  905. selector: "visitIRAlias:",
  906. fn: function (anIRAlias) {
  907. var self=this;
  908. return smalltalk.send(self, "_visitIRAssignment_", [anIRAlias]);
  909. return self;}
  910. }),
  911. smalltalk.IRVisitor);
  912. smalltalk.addMethod(
  913. "_visitIRAssignment_",
  914. smalltalk.method({
  915. selector: "visitIRAssignment:",
  916. fn: function (anIRAssignment) {
  917. var self=this;
  918. return smalltalk.send(self, "_visitIRInstruction_", [anIRAssignment]);
  919. return self;}
  920. }),
  921. smalltalk.IRVisitor);
  922. smalltalk.addMethod(
  923. "_visitIRBlockSequence_",
  924. smalltalk.method({
  925. selector: "visitIRBlockSequence:",
  926. fn: function (anIRBlockSequence) {
  927. var self=this;
  928. return smalltalk.send(self, "_visitIRSequence_", [anIRBlockSequence]);
  929. return self;}
  930. }),
  931. smalltalk.IRVisitor);
  932. smalltalk.addMethod(
  933. "_visitIRClosure_",
  934. smalltalk.method({
  935. selector: "visitIRClosure:",
  936. fn: function (anIRClosure) {
  937. var self=this;
  938. return smalltalk.send(self, "_visitIRInstruction_", [anIRClosure]);
  939. return self;}
  940. }),
  941. smalltalk.IRVisitor);
  942. smalltalk.addMethod(
  943. "_visitIRInlinedAssignment_",
  944. smalltalk.method({
  945. selector: "visitIRInlinedAssignment:",
  946. fn: function (anIRInlinedAssignment){
  947. var self=this;
  948. return smalltalk.send(self, "_visitIRAssignment_", [anIRInlinedAssignment]);
  949. return self;}
  950. }),
  951. smalltalk.IRVisitor);
  952. smalltalk.addMethod(
  953. "_visitIRInlinedClosure_",
  954. smalltalk.method({
  955. selector: "visitIRInlinedClosure:",
  956. fn: function (anIRClosure) {
  957. var self=this;
  958. return smalltalk.send(self, "_visitIRClosure_", [anIRClosure]);
  959. return self;}
  960. }),
  961. smalltalk.IRVisitor);
  962. smalltalk.addMethod(
  963. "_visitIRInlinedIfTrue_",
  964. smalltalk.method({
  965. selector: "visitIRInlinedIfTrue:",
  966. fn: function (anIRInlinedIfTrue) {
  967. var self=this;
  968. return smalltalk.send(self, "_visitIRInlinedSend_", [anIRInlinedIfTrue]);
  969. return self;}
  970. }),
  971. smalltalk.IRVisitor);
  972. smalltalk.addMethod(
  973. "_visitIRInlinedNonLocalReturn_",
  974. smalltalk.method({
  975. selector: "visitIRInlinedNonLocalReturn:",
  976. fn: function (anIRNonLocalReturn){
  977. var self=this;
  978. return smalltalk.send(self, "_visitIRNonLocalReturn_", [smalltalk.send(anIRNonLocalReturn, "_anIRNonLocalReturn", [])]);
  979. return self;}
  980. }),
  981. smalltalk.IRVisitor);
  982. smalltalk.addMethod(
  983. "_visitIRInlinedSend_",
  984. smalltalk.method({
  985. selector: "visitIRInlinedSend:",
  986. fn: function (anIRInlinedSend) {
  987. var self=this;
  988. return smalltalk.send(self, "_visitIRSend_", [anIRInlinedSend]);
  989. return self;}
  990. }),
  991. smalltalk.IRVisitor);
  992. smalltalk.addMethod(
  993. "_visitIRInstruction_",
  994. smalltalk.method({
  995. selector: "visitIRInstruction:",
  996. fn: function (anIRInstruction) {
  997. var self=this;
  998. return smalltalk.send(smalltalk.send(anIRInstruction, "_instructions", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  999. return self;}
  1000. }),
  1001. smalltalk.IRVisitor);
  1002. smalltalk.addMethod(
  1003. "_visitIRMethod_",
  1004. smalltalk.method({
  1005. selector: "visitIRMethod:",
  1006. fn: function (anIRMethod) {
  1007. var self=this;
  1008. return smalltalk.send(self, "_visitIRInstruction_", [anIRMethod]);
  1009. return self;}
  1010. }),
  1011. smalltalk.IRVisitor);
  1012. smalltalk.addMethod(
  1013. "_visitIRNonLocalReturn_",
  1014. smalltalk.method({
  1015. selector: "visitIRNonLocalReturn:",
  1016. fn: function (anIRNonLocalReturn) {
  1017. var self=this;
  1018. return smalltalk.send(self, "_visitIRInstruction_", [anIRNonLocalReturn]);
  1019. return self;}
  1020. }),
  1021. smalltalk.IRVisitor);
  1022. smalltalk.addMethod(
  1023. "_visitIRNonLocalReturnHandling_",
  1024. smalltalk.method({
  1025. selector: "visitIRNonLocalReturnHandling:",
  1026. fn: function (anIRNonLocalReturnHandling) {
  1027. var self=this;
  1028. return smalltalk.send(self, "_visitIRInstruction_", [anIRNonLocalReturnHandling]);
  1029. return self;}
  1030. }),
  1031. smalltalk.IRVisitor);
  1032. smalltalk.addMethod(
  1033. "_visitIRReturn_",
  1034. smalltalk.method({
  1035. selector: "visitIRReturn:",
  1036. fn: function (anIRReturn) {
  1037. var self=this;
  1038. return smalltalk.send(self, "_visitIRInstruction_", [anIRReturn]);
  1039. return self;}
  1040. }),
  1041. smalltalk.IRVisitor);
  1042. smalltalk.addMethod(
  1043. "_visitIRSend_",
  1044. smalltalk.method({
  1045. selector: "visitIRSend:",
  1046. fn: function (anIRSend) {
  1047. var self=this;
  1048. return smalltalk.send(self, "_visitIRInstruction_", [anIRSend]);
  1049. return self;}
  1050. }),
  1051. smalltalk.IRVisitor);
  1052. smalltalk.addMethod(
  1053. "_visitIRSequence_",
  1054. smalltalk.method({
  1055. selector: "visitIRSequence:",
  1056. fn: function (anIRSequence) {
  1057. var self=this;
  1058. return smalltalk.send(self, "_visitIRInstruction_", [anIRSequence]);
  1059. return self;}
  1060. }),
  1061. smalltalk.IRVisitor);
  1062. smalltalk.addMethod(
  1063. "_visitIRStatement_",
  1064. smalltalk.method({
  1065. selector: "visitIRStatement:",
  1066. fn: function (anIRStatement) {
  1067. var self=this;
  1068. return smalltalk.send(self, "_visitIRInstruction_", [anIRStatement]);
  1069. return self;}
  1070. }),
  1071. smalltalk.IRVisitor);
  1072. smalltalk.addMethod(
  1073. "_visitIRTempDeclaration_",
  1074. smalltalk.method({
  1075. selector: "visitIRTempDeclaration:",
  1076. fn: function (anIRTempDeclaration) {
  1077. var self=this;
  1078. return smalltalk.send(self, "_visitIRInstruction_", [anIRTempDeclaration]);
  1079. return self;}
  1080. }),
  1081. smalltalk.IRVisitor);
  1082. smalltalk.addMethod(
  1083. "_visitIRValue_",
  1084. smalltalk.method({
  1085. selector: "visitIRValue:",
  1086. fn: function (anIRValue) {
  1087. var self=this;
  1088. return smalltalk.send(self, "_visitIRInstruction_", [anIRValue]);
  1089. return self;}
  1090. }),
  1091. smalltalk.IRVisitor);
  1092. smalltalk.addMethod(
  1093. "_visitIRVariable_",
  1094. smalltalk.method({
  1095. selector: "visitIRVariable:",
  1096. fn: function (anIRVariable) {
  1097. var self=this;
  1098. return smalltalk.send(self, "_visitIRInstruction_", [anIRVariable]);
  1099. return self;}
  1100. }),
  1101. smalltalk.IRVisitor);
  1102. smalltalk.addMethod(
  1103. "_visitIRVerbatim_",
  1104. smalltalk.method({
  1105. selector: "visitIRVerbatim:",
  1106. fn: function (anIRVerbatim) {
  1107. var self=this;
  1108. return smalltalk.send(self, "_visitIRInstruction_", [anIRVerbatim]);
  1109. return self;}
  1110. }),
  1111. smalltalk.IRVisitor);
  1112. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  1113. smalltalk.addMethod(
  1114. "_contents",
  1115. smalltalk.method({
  1116. selector: "contents",
  1117. fn: function () {
  1118. var self=this;
  1119. return smalltalk.send(smalltalk.send(self, "_stream", []), "_contents", []);
  1120. return self;}
  1121. }),
  1122. smalltalk.IRJSTranslator);
  1123. smalltalk.addMethod(
  1124. "_initialize",
  1125. smalltalk.method({
  1126. selector: "initialize",
  1127. fn: function () {
  1128. var self=this;
  1129. smalltalk.send(self, "_initialize", [], smalltalk.IRJSTranslator.superclass || nil);
  1130. (self['@stream']=smalltalk.send((smalltalk.JSStream || JSStream), "_new", []));
  1131. return self;}
  1132. }),
  1133. smalltalk.IRJSTranslator);
  1134. smalltalk.addMethod(
  1135. "_stream",
  1136. smalltalk.method({
  1137. selector: "stream",
  1138. fn: function () {
  1139. var self=this;
  1140. return self['@stream'];
  1141. return self;}
  1142. }),
  1143. smalltalk.IRJSTranslator);
  1144. smalltalk.addMethod(
  1145. "_stream_",
  1146. smalltalk.method({
  1147. selector: "stream:",
  1148. fn: function (aStream) {
  1149. var self=this;
  1150. (self['@stream']=aStream);
  1151. return self;}
  1152. }),
  1153. smalltalk.IRJSTranslator);
  1154. smalltalk.addMethod(
  1155. "_visitIRAssignment_",
  1156. smalltalk.method({
  1157. selector: "visitIRAssignment:",
  1158. fn: function (anIRAssignment) {
  1159. var self=this;
  1160. smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRAssignment, "_instructions", []), "_first", [])]);
  1161. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAssignment", []);
  1162. smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRAssignment, "_instructions", []), "_last", [])]);
  1163. return self;}
  1164. }),
  1165. smalltalk.IRJSTranslator);
  1166. smalltalk.addMethod(
  1167. "_visitIRBlockSequence_",
  1168. smalltalk.method({
  1169. selector: "visitIRBlockSequence:",
  1170. fn: function (anIRBlockSequence) {
  1171. var self=this;
  1172. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutSequenceWith_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anIRBlockSequence, "_instructions", []), "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(smalltalk.send(smalltalk.send(anIRBlockSequence, "_instructions", []), "_allButLast", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(anIRBlockSequence, "_instructions", []), "_last", []), "_isReturn", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutReturn", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutReturn", []);})]));return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRBlockSequence, "_instructions", []), "_last", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(smalltalk.send(smalltalk.send(anIRBlockSequence, "_instructions", []), "_allButLast", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(anIRBlockSequence, "_instructions", []), "_last", []), "_isReturn", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutReturn", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutReturn", []);})]));return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRBlockSequence, "_instructions", []), "_last", [])]);})]));})]);
  1173. return self;}
  1174. }),
  1175. smalltalk.IRJSTranslator);
  1176. smalltalk.addMethod(
  1177. "_visitIRClosure_",
  1178. smalltalk.method({
  1179. selector: "visitIRClosure:",
  1180. fn: function (anIRClosure) {
  1181. var self=this;
  1182. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutClosureWith_arguments_", [(function(){return smalltalk.send(self, "_visitIRClosure_", [anIRClosure], smalltalk.IRJSTranslator.superclass || nil);}), smalltalk.send(anIRClosure, "_arguments", [])]);
  1183. return self;}
  1184. }),
  1185. smalltalk.IRJSTranslator);
  1186. smalltalk.addMethod(
  1187. "_visitIRMethod_",
  1188. smalltalk.method({
  1189. selector: "visitIRMethod:",
  1190. fn: function (anIRMethod) {
  1191. var self=this;
  1192. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutMethodDeclaration_with_", [anIRMethod, (function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutFunctionWith_arguments_", [(function(){((($receiver = smalltalk.send(smalltalk.send(anIRMethod, "_internalVariables", []), "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutVars_", [smalltalk.send(smalltalk.send(smalltalk.send(anIRMethod, "_internalVariables", []), "_asArray", []), "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_variable", []), "_alias", []);})])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutVars_", [smalltalk.send(smalltalk.send(smalltalk.send(anIRMethod, "_internalVariables", []), "_asArray", []), "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_variable", []), "_alias", []);})])]);})]));return smalltalk.send(self, "_visitIRMethod_", [anIRMethod], smalltalk.IRJSTranslator.superclass || nil);}), smalltalk.send(anIRMethod, "_arguments", [])]);})]);
  1193. return self;}
  1194. }),
  1195. smalltalk.IRJSTranslator);
  1196. smalltalk.addMethod(
  1197. "_visitIRNonLocalReturn_",
  1198. smalltalk.method({
  1199. selector: "visitIRNonLocalReturn:",
  1200. fn: function (anIRNonLocalReturn) {
  1201. var self=this;
  1202. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutNonLocalReturnWith_", [(function(){return smalltalk.send(self, "_visitIRNonLocalReturn_", [anIRNonLocalReturn], smalltalk.IRJSTranslator.superclass || nil);})]);
  1203. return self;}
  1204. }),
  1205. smalltalk.IRJSTranslator);
  1206. smalltalk.addMethod(
  1207. "_visitIRNonLocalReturnHandling_",
  1208. smalltalk.method({
  1209. selector: "visitIRNonLocalReturnHandling:",
  1210. fn: function (anIRNonLocalReturnHandling) {
  1211. var self=this;
  1212. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutNonLocalReturnHandlingWith_", [(function(){return smalltalk.send(self, "_visitIRNonLocalReturnHandling_", [anIRNonLocalReturnHandling], smalltalk.IRJSTranslator.superclass || nil);})]);
  1213. return self;}
  1214. }),
  1215. smalltalk.IRJSTranslator);
  1216. smalltalk.addMethod(
  1217. "_visitIRReturn_",
  1218. smalltalk.method({
  1219. selector: "visitIRReturn:",
  1220. fn: function (anIRReturn) {
  1221. var self=this;
  1222. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutReturnWith_", [(function(){return smalltalk.send(self, "_visitIRReturn_", [anIRReturn], smalltalk.IRJSTranslator.superclass || nil);})]);
  1223. return self;}
  1224. }),
  1225. smalltalk.IRJSTranslator);
  1226. smalltalk.addMethod(
  1227. "_visitIRSend_",
  1228. smalltalk.method({
  1229. selector: "visitIRSend:",
  1230. fn: function (anIRSend) {
  1231. var self=this;
  1232. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", ["smalltalk.send("]);
  1233. smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRSend, "_instructions", []), "_first", [])]);
  1234. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(smalltalk.send(anIRSend, "_selector", []), "_asSelector", [])]), "__comma", ["\x22,["])]);
  1235. smalltalk.send(smalltalk.send(smalltalk.send(anIRSend, "_instructions", []), "_allButFirst", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [","]);})]);
  1236. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", ["]"]);
  1237. (($receiver = smalltalk.send(anIRSend, "_classSend", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(",", "__comma", [smalltalk.send(smalltalk.send(anIRSend, "_classSend", []), "_asJavascript", [])])]);})() : nil;
  1238. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [")"]);
  1239. return self;}
  1240. }),
  1241. smalltalk.IRJSTranslator);
  1242. smalltalk.addMethod(
  1243. "_visitIRSequence_",
  1244. smalltalk.method({
  1245. selector: "visitIRSequence:",
  1246. fn: function (anIRSequence) {
  1247. var self=this;
  1248. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutSequenceWith_", [(function(){return smalltalk.send(self, "_visitIRSequence_", [anIRSequence], smalltalk.IRJSTranslator.superclass || nil);})]);
  1249. return self;}
  1250. }),
  1251. smalltalk.IRJSTranslator);
  1252. smalltalk.addMethod(
  1253. "_visitIRStatement_",
  1254. smalltalk.method({
  1255. selector: "visitIRStatement:",
  1256. fn: function (anIRStatement){
  1257. var self=this;
  1258. ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(anIRStatement, "_instructions", []), "_size", []), "__eq", [(1)]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(anIRStatement, "_instructions", []), "_first", []), "_isVariable", []);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutStatementWith_", [(function(){return smalltalk.send(self, "_visitIRStatement_", [anIRStatement], smalltalk.IRJSTranslator.superclass || nil);})]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutStatementWith_", [(function(){return smalltalk.send(self, "_visitIRStatement_", [anIRStatement], smalltalk.IRJSTranslator.superclass || nil);})]);})]));
  1259. return self;}
  1260. }),
  1261. smalltalk.IRJSTranslator);
  1262. smalltalk.addMethod(
  1263. "_visitIRTempDeclaration_",
  1264. smalltalk.method({
  1265. selector: "visitIRTempDeclaration:",
  1266. fn: function (anIRTempDeclaration) {
  1267. var self=this;
  1268. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutVar_", [smalltalk.send(smalltalk.send(anIRTempDeclaration, "_name", []), "_asVariableName", [])]);
  1269. return self;}
  1270. }),
  1271. smalltalk.IRJSTranslator);
  1272. smalltalk.addMethod(
  1273. "_visitIRValue_",
  1274. smalltalk.method({
  1275. selector: "visitIRValue:",
  1276. fn: function (anIRValue) {
  1277. var self=this;
  1278. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(smalltalk.send(anIRValue, "_value", []), "_asJavascript", [])]);
  1279. return self;}
  1280. }),
  1281. smalltalk.IRJSTranslator);
  1282. smalltalk.addMethod(
  1283. "_visitIRVariable_",
  1284. smalltalk.method({
  1285. selector: "visitIRVariable:",
  1286. fn: function (anIRVariable) {
  1287. var self=this;
  1288. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(smalltalk.send(anIRVariable, "_variable", []), "_alias", [])]);
  1289. return self;}
  1290. }),
  1291. smalltalk.IRJSTranslator);
  1292. smalltalk.addMethod(
  1293. "_visitIRVerbatim_",
  1294. smalltalk.method({
  1295. selector: "visitIRVerbatim:",
  1296. fn: function (anIRVerbatim) {
  1297. var self=this;
  1298. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutStatementWith_", [(function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(anIRVerbatim, "_source", [])]);})]);
  1299. return self;}
  1300. }),
  1301. smalltalk.IRJSTranslator);
  1302. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  1303. smalltalk.addMethod(
  1304. "_contents",
  1305. smalltalk.method({
  1306. selector: "contents",
  1307. fn: function () {
  1308. var self=this;
  1309. return smalltalk.send(self['@stream'], "_contents", []);
  1310. return self;}
  1311. }),
  1312. smalltalk.JSStream);
  1313. smalltalk.addMethod(
  1314. "_initialize",
  1315. smalltalk.method({
  1316. selector: "initialize",
  1317. fn: function () {
  1318. var self=this;
  1319. smalltalk.send(self, "_initialize", [], smalltalk.JSStream.superclass || nil);
  1320. (self['@stream']=smalltalk.send("", "_writeStream", []));
  1321. return self;}
  1322. }),
  1323. smalltalk.JSStream);
  1324. smalltalk.addMethod(
  1325. "_lf",
  1326. smalltalk.method({
  1327. selector: "lf",
  1328. fn: function () {
  1329. var self=this;
  1330. smalltalk.send(self['@stream'], "_lf", []);
  1331. return self;}
  1332. }),
  1333. smalltalk.JSStream);
  1334. smalltalk.addMethod(
  1335. "_nextPut_",
  1336. smalltalk.method({
  1337. selector: "nextPut:",
  1338. fn: function (aString) {
  1339. var self=this;
  1340. smalltalk.send(self['@stream'], "_nextPut_", [aString]);
  1341. return self;}
  1342. }),
  1343. smalltalk.JSStream);
  1344. smalltalk.addMethod(
  1345. "_nextPutAll_",
  1346. smalltalk.method({
  1347. selector: "nextPutAll:",
  1348. fn: function (aString) {
  1349. var self=this;
  1350. smalltalk.send(self['@stream'], "_nextPutAll_", [aString]);
  1351. return self;}
  1352. }),
  1353. smalltalk.JSStream);
  1354. smalltalk.addMethod(
  1355. "_nextPutAssignment",
  1356. smalltalk.method({
  1357. selector: "nextPutAssignment",
  1358. fn: function () {
  1359. var self=this;
  1360. smalltalk.send(self['@stream'], "_nextPutAll_", ["="]);
  1361. return self;}
  1362. }),
  1363. smalltalk.JSStream);
  1364. smalltalk.addMethod(
  1365. "_nextPutClosureWith_arguments_",
  1366. smalltalk.method({
  1367. selector: "nextPutClosureWith:arguments:",
  1368. fn: function (aBlock, anArray) {
  1369. var self=this;
  1370. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
  1371. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asVariableName", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  1372. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1373. smalltalk.send(aBlock, "_value", []);
  1374. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  1375. return self;}
  1376. }),
  1377. smalltalk.JSStream);
  1378. smalltalk.addMethod(
  1379. "_nextPutFunctionWith_arguments_",
  1380. smalltalk.method({
  1381. selector: "nextPutFunctionWith:arguments:",
  1382. fn: function (aBlock, anArray) {
  1383. var self=this;
  1384. smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
  1385. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asVariableName", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  1386. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1387. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1388. smalltalk.send(aBlock, "_value", []);
  1389. smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
  1390. return self;}
  1391. }),
  1392. smalltalk.JSStream);
  1393. smalltalk.addMethod(
  1394. "_nextPutIf_with_",
  1395. smalltalk.method({
  1396. selector: "nextPutIf:with:",
  1397. fn: function (aBlock, anotherBlock) {
  1398. var self=this;
  1399. smalltalk.send(self['@stream'], "_nextPutAll_", ["if("]);
  1400. smalltalk.send(aBlock, "_value", []);
  1401. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1402. smalltalk.send(anotherBlock, "_value", []);
  1403. smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
  1404. return self;}
  1405. }),
  1406. smalltalk.JSStream);
  1407. smalltalk.addMethod(
  1408. "_nextPutMethodDeclaration_with_",
  1409. smalltalk.method({
  1410. selector: "nextPutMethodDeclaration:with:",
  1411. fn: function (aMethod, aBlock) {
  1412. var self=this;
  1413. (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(aMethod, "_selector", [])]), "__comma", ["\x22,"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1414. smalltalk.send(aBlock, "_value", []);
  1415. (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(smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asArray", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_arguments", []), "_collect_", [(function(each){return smalltalk.send(each, "_value", []);})]), "_asArray", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
  1416. smalltalk.send(smalltalk.send(aMethod, "_classReferences", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asJavascript", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1417. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["]"]);return smalltalk.send($rec, "_nextPutAll_", ["})"]);})(self['@stream']);
  1418. return self;}
  1419. }),
  1420. smalltalk.JSStream);
  1421. smalltalk.addMethod(
  1422. "_nextPutNonLocalReturnHandlingWith_",
  1423. smalltalk.method({
  1424. selector: "nextPutNonLocalReturnHandlingWith:",
  1425. fn: function (aBlock) {
  1426. var self=this;
  1427. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["try {"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1428. smalltalk.send(aBlock, "_value", []);
  1429. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["}"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["catch(e) {if(e===$early)return e[0]; throw e}"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1430. return self;}
  1431. }),
  1432. smalltalk.JSStream);
  1433. smalltalk.addMethod(
  1434. "_nextPutNonLocalReturnWith_",
  1435. smalltalk.method({
  1436. selector: "nextPutNonLocalReturnWith:",
  1437. fn: function (aBlock) {
  1438. var self=this;
  1439. smalltalk.send(self['@stream'], "_nextPutAll_", ["throw $early=["]);
  1440. smalltalk.send(aBlock, "_value", []);
  1441. smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
  1442. return self;}
  1443. }),
  1444. smalltalk.JSStream);
  1445. smalltalk.addMethod(
  1446. "_nextPutReturn",
  1447. smalltalk.method({
  1448. selector: "nextPutReturn",
  1449. fn: function () {
  1450. var self=this;
  1451. smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);
  1452. return self;}
  1453. }),
  1454. smalltalk.JSStream);
  1455. smalltalk.addMethod(
  1456. "_nextPutReturnWith_",
  1457. smalltalk.method({
  1458. selector: "nextPutReturnWith:",
  1459. fn: function (aBlock) {
  1460. var self=this;
  1461. smalltalk.send(self, "_nextPutReturn", []);
  1462. smalltalk.send(aBlock, "_value", []);
  1463. return self;}
  1464. }),
  1465. smalltalk.JSStream);
  1466. smalltalk.addMethod(
  1467. "_nextPutSendTo_selector_arguments_",
  1468. smalltalk.method({
  1469. selector: "nextPutSendTo:selector:arguments:",
  1470. fn: function (receiver, selector, arguments) {
  1471. var self=this;
  1472. smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.send("]);
  1473. smalltalk.send(receiver, "_emitOn_", [self]);
  1474. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(selector, "_asSelector", [])]), "__comma", ["\x22,["])]);
  1475. smalltalk.send(arguments, "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_emitOn_", [self]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1476. smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]);
  1477. return self;}
  1478. }),
  1479. smalltalk.JSStream);
  1480. smalltalk.addMethod(
  1481. "_nextPutSequenceWith_",
  1482. smalltalk.method({
  1483. selector: "nextPutSequenceWith:",
  1484. fn: function (aBlock) {
  1485. var self=this;
  1486. smalltalk.send(aBlock, "_value", []);
  1487. return self;}
  1488. }),
  1489. smalltalk.JSStream);
  1490. smalltalk.addMethod(
  1491. "_nextPutStatement_with_",
  1492. smalltalk.method({
  1493. selector: "nextPutStatement:with:",
  1494. fn: function (anInteger, aBlock) {
  1495. var self=this;
  1496. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("case ", "__comma", [smalltalk.send(anInteger, "_asString", [])]), "__comma", [":"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1497. smalltalk.send(self, "_nextPutStatementWith_", [aBlock]);
  1498. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("smalltalk.thisContext.pc=", "__comma", [smalltalk.send(((($receiver = anInteger).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])), "_asString", [])]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1499. return self;}
  1500. }),
  1501. smalltalk.JSStream);
  1502. smalltalk.addMethod(
  1503. "_nextPutStatementWith_",
  1504. smalltalk.method({
  1505. selector: "nextPutStatementWith:",
  1506. fn: function (aBlock) {
  1507. var self=this;
  1508. smalltalk.send(aBlock, "_value", []);
  1509. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1510. return self;}
  1511. }),
  1512. smalltalk.JSStream);
  1513. smalltalk.addMethod(
  1514. "_nextPutVar_",
  1515. smalltalk.method({
  1516. selector: "nextPutVar:",
  1517. fn: function (aString) {
  1518. var self=this;
  1519. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [aString]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1520. return self;}
  1521. }),
  1522. smalltalk.JSStream);
  1523. smalltalk.addMethod(
  1524. "_nextPutVars_",
  1525. smalltalk.method({
  1526. selector: "nextPutVars:",
  1527. fn: function (aCollection) {
  1528. var self=this;
  1529. smalltalk.send(self['@stream'], "_nextPutAll_", ["var "]);
  1530. smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1531. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1532. return self;}
  1533. }),
  1534. smalltalk.JSStream);
  1535. smalltalk.addMethod(
  1536. "_appendToInstruction_",
  1537. smalltalk.method({
  1538. selector: "appendToInstruction:",
  1539. fn: function (anIRInstruction) {
  1540. var self=this;
  1541. smalltalk.send(anIRInstruction, "_appendBlock_", [self]);
  1542. return self;}
  1543. }),
  1544. smalltalk.BlockClosure);
  1545. smalltalk.addMethod(
  1546. "_asVariableName",
  1547. smalltalk.method({
  1548. selector: "asVariableName",
  1549. fn: function () {
  1550. var self=this;
  1551. return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_reservedWords", []), "_includes_", [self])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "__comma", ["_"]);})() : (function(){return self;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "__comma", ["_"]);}), (function(){return self;})]));
  1552. return self;}
  1553. }),
  1554. smalltalk.String);