Compiler-IR.deploy.js 59 KB

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