Compiler-IR.deploy.js 59 KB

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