Compiler-IR.deploy.js 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977
  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, "_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. "_isReturn",
  610. smalltalk.method({
  611. selector: "isReturn",
  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('IRClosure', smalltalk.IRInstruction, ['arguments'], '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, "_visitIRClosure_", [self]);
  668. return self;}
  669. }),
  670. smalltalk.IRClosure);
  671. smalltalk.addMethod(
  672. "_arguments",
  673. smalltalk.method({
  674. selector: "arguments",
  675. fn: function (){
  676. var self=this;
  677. return (($receiver = self['@arguments']) == nil || $receiver == undefined) ? (function(){return [];})() : $receiver;
  678. return self;}
  679. }),
  680. smalltalk.IRClosure);
  681. smalltalk.addMethod(
  682. "_arguments_",
  683. smalltalk.method({
  684. selector: "arguments:",
  685. fn: function (aCollection) {
  686. var self=this;
  687. (self['@arguments']=aCollection);
  688. return self;}
  689. }),
  690. smalltalk.IRClosure);
  691. smalltalk.addMethod(
  692. "_isClosure",
  693. smalltalk.method({
  694. selector: "isClosure",
  695. fn: function () {
  696. var self=this;
  697. return true;
  698. return self;}
  699. }),
  700. smalltalk.IRClosure);
  701. smalltalk.addClass('IRMethod', smalltalk.IRInstruction, ['source', 'selector', 'classReferences', 'messageSends', 'arguments', 'internalVariables'], 'Compiler-IR');
  702. smalltalk.addMethod(
  703. "_accept_",
  704. smalltalk.method({
  705. selector: "accept:",
  706. fn: function (aVisitor) {
  707. var self=this;
  708. smalltalk.send(aVisitor, "_visitIRMethod_", [self]);
  709. return self;}
  710. }),
  711. smalltalk.IRMethod);
  712. smalltalk.addMethod(
  713. "_arguments",
  714. smalltalk.method({
  715. selector: "arguments",
  716. fn: function () {
  717. var self=this;
  718. return self['@arguments'];
  719. return self;}
  720. }),
  721. smalltalk.IRMethod);
  722. smalltalk.addMethod(
  723. "_arguments_",
  724. smalltalk.method({
  725. selector: "arguments:",
  726. fn: function (aCollection) {
  727. var self=this;
  728. (self['@arguments']=aCollection);
  729. return self;}
  730. }),
  731. smalltalk.IRMethod);
  732. smalltalk.addMethod(
  733. "_classReferences",
  734. smalltalk.method({
  735. selector: "classReferences",
  736. fn: function () {
  737. var self=this;
  738. return self['@classReferences'];
  739. return self;}
  740. }),
  741. smalltalk.IRMethod);
  742. smalltalk.addMethod(
  743. "_classReferences_",
  744. smalltalk.method({
  745. selector: "classReferences:",
  746. fn: function (aCollection) {
  747. var self=this;
  748. (self['@classReferences']=aCollection);
  749. return self;}
  750. }),
  751. smalltalk.IRMethod);
  752. smalltalk.addMethod(
  753. "_internalVariables",
  754. smalltalk.method({
  755. selector: "internalVariables",
  756. fn: function () {
  757. var self=this;
  758. return (($receiver = self['@internalVariables']) == nil || $receiver == undefined) ? (function(){return (self['@internalVariables']=smalltalk.send((smalltalk.Set || Set), "_new", []));})() : $receiver;
  759. return self;}
  760. }),
  761. smalltalk.IRMethod);
  762. smalltalk.addMethod(
  763. "_messageSends",
  764. smalltalk.method({
  765. selector: "messageSends",
  766. fn: function () {
  767. var self=this;
  768. return self['@messageSends'];
  769. return self;}
  770. }),
  771. smalltalk.IRMethod);
  772. smalltalk.addMethod(
  773. "_messageSends_",
  774. smalltalk.method({
  775. selector: "messageSends:",
  776. fn: function (aCollection) {
  777. var self=this;
  778. (self['@messageSends']=aCollection);
  779. return self;}
  780. }),
  781. smalltalk.IRMethod);
  782. smalltalk.addMethod(
  783. "_selector",
  784. smalltalk.method({
  785. selector: "selector",
  786. fn: function () {
  787. var self=this;
  788. return self['@selector'];
  789. return self;}
  790. }),
  791. smalltalk.IRMethod);
  792. smalltalk.addMethod(
  793. "_selector_",
  794. smalltalk.method({
  795. selector: "selector:",
  796. fn: function (aString) {
  797. var self=this;
  798. (self['@selector']=aString);
  799. return self;}
  800. }),
  801. smalltalk.IRMethod);
  802. smalltalk.addMethod(
  803. "_source",
  804. smalltalk.method({
  805. selector: "source",
  806. fn: function () {
  807. var self=this;
  808. return self['@source'];
  809. return self;}
  810. }),
  811. smalltalk.IRMethod);
  812. smalltalk.addMethod(
  813. "_source_",
  814. smalltalk.method({
  815. selector: "source:",
  816. fn: function (aString) {
  817. var self=this;
  818. (self['@source']=aString);
  819. return self;}
  820. }),
  821. smalltalk.IRMethod);
  822. smalltalk.addClass('IRNonLocalReturnHandling', smalltalk.IRInstruction, [], 'Compiler-IR');
  823. smalltalk.addMethod(
  824. "_accept_",
  825. smalltalk.method({
  826. selector: "accept:",
  827. fn: function (aVisitor) {
  828. var self=this;
  829. smalltalk.send(aVisitor, "_visitIRNonLocalReturnHandling_", [self]);
  830. return self;}
  831. }),
  832. smalltalk.IRNonLocalReturnHandling);
  833. smalltalk.addClass('IRReturn', smalltalk.IRInstruction, [], 'Compiler-IR');
  834. smalltalk.addMethod(
  835. "_accept_",
  836. smalltalk.method({
  837. selector: "accept:",
  838. fn: function (aVisitor) {
  839. var self=this;
  840. smalltalk.send(aVisitor, "_visitIRReturn_", [self]);
  841. return self;}
  842. }),
  843. smalltalk.IRReturn);
  844. smalltalk.addMethod(
  845. "_isReturn",
  846. smalltalk.method({
  847. selector: "isReturn",
  848. fn: function (){
  849. var self=this;
  850. return true;
  851. return self;}
  852. }),
  853. smalltalk.IRReturn);
  854. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  855. smalltalk.addMethod(
  856. "_accept_",
  857. smalltalk.method({
  858. selector: "accept:",
  859. fn: function (aVisitor) {
  860. var self=this;
  861. smalltalk.send(aVisitor, "_visitIRNonLocalReturn_", [self]);
  862. return self;}
  863. }),
  864. smalltalk.IRNonLocalReturn);
  865. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend'], 'Compiler-IR');
  866. smalltalk.addMethod(
  867. "_accept_",
  868. smalltalk.method({
  869. selector: "accept:",
  870. fn: function (aVisitor) {
  871. var self=this;
  872. smalltalk.send(aVisitor, "_visitIRSend_", [self]);
  873. return self;}
  874. }),
  875. smalltalk.IRSend);
  876. smalltalk.addMethod(
  877. "_classSend",
  878. smalltalk.method({
  879. selector: "classSend",
  880. fn: function () {
  881. var self=this;
  882. return self['@classSend'];
  883. return self;}
  884. }),
  885. smalltalk.IRSend);
  886. smalltalk.addMethod(
  887. "_classSend_",
  888. smalltalk.method({
  889. selector: "classSend:",
  890. fn: function (aClass) {
  891. var self=this;
  892. (self['@classSend']=aClass);
  893. return self;}
  894. }),
  895. smalltalk.IRSend);
  896. smalltalk.addMethod(
  897. "_selector",
  898. smalltalk.method({
  899. selector: "selector",
  900. fn: function () {
  901. var self=this;
  902. return self['@selector'];
  903. return self;}
  904. }),
  905. smalltalk.IRSend);
  906. smalltalk.addMethod(
  907. "_selector_",
  908. smalltalk.method({
  909. selector: "selector:",
  910. fn: function (aString) {
  911. var self=this;
  912. (self['@selector']=aString);
  913. return self;}
  914. }),
  915. smalltalk.IRSend);
  916. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  917. smalltalk.addMethod(
  918. "_accept_",
  919. smalltalk.method({
  920. selector: "accept:",
  921. fn: function (aVisitor) {
  922. var self=this;
  923. smalltalk.send(aVisitor, "_visitIRSequence_", [self]);
  924. return self;}
  925. }),
  926. smalltalk.IRSequence);
  927. smalltalk.addMethod(
  928. "_appendInstruction_",
  929. smalltalk.method({
  930. selector: "appendInstruction:",
  931. fn: function (anIRInstruction) {
  932. var self=this;
  933. smalltalk.send(smalltalk.send(self, "_instructions", []), "_add_", [smalltalk.send(smalltalk.send((smalltalk.IRStatement || IRStatement), "_on_", [smalltalk.send(self, "_builder", [])]), "_with_", [anIRInstruction])]);
  934. return self;}
  935. }),
  936. smalltalk.IRSequence);
  937. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  938. smalltalk.addMethod(
  939. "_accept_",
  940. smalltalk.method({
  941. selector: "accept:",
  942. fn: function (aVisitor) {
  943. var self=this;
  944. smalltalk.send(aVisitor, "_visitIRBlockSequence_", [self]);
  945. return self;}
  946. }),
  947. smalltalk.IRBlockSequence);
  948. smalltalk.addClass('IRStatement', smalltalk.IRInstruction, ['pc'], 'Compiler-IR');
  949. smalltalk.addMethod(
  950. "_accept_",
  951. smalltalk.method({
  952. selector: "accept:",
  953. fn: function (aVisitor) {
  954. var self=this;
  955. smalltalk.send(aVisitor, "_visitIRStatement_", [self]);
  956. return self;}
  957. }),
  958. smalltalk.IRStatement);
  959. smalltalk.addMethod(
  960. "_isReturn",
  961. smalltalk.method({
  962. selector: "isReturn",
  963. fn: function (){
  964. var self=this;
  965. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instructions", []), "_first", []), "_isReturn", []);
  966. return self;}
  967. }),
  968. smalltalk.IRStatement);
  969. smalltalk.addMethod(
  970. "_pc",
  971. smalltalk.method({
  972. selector: "pc",
  973. fn: function () {
  974. var self=this;
  975. return (($receiver = self['@pc']) == nil || $receiver == undefined) ? (function(){return (self['@pc']=smalltalk.send(smalltalk.send(self, "_builder", []), "_nextPc", []));})() : $receiver;
  976. return self;}
  977. }),
  978. smalltalk.IRStatement);
  979. smalltalk.addClass('IRTempDeclaration', smalltalk.IRInstruction, ['name'], 'Compiler-IR');
  980. smalltalk.addMethod(
  981. "_accept_",
  982. smalltalk.method({
  983. selector: "accept:",
  984. fn: function (aVisitor) {
  985. var self=this;
  986. smalltalk.send(aVisitor, "_visitIRTempDeclaration_", [self]);
  987. return self;}
  988. }),
  989. smalltalk.IRTempDeclaration);
  990. smalltalk.addMethod(
  991. "_name",
  992. smalltalk.method({
  993. selector: "name",
  994. fn: function () {
  995. var self=this;
  996. return self['@name'];
  997. return self;}
  998. }),
  999. smalltalk.IRTempDeclaration);
  1000. smalltalk.addMethod(
  1001. "_name_",
  1002. smalltalk.method({
  1003. selector: "name:",
  1004. fn: function (aString) {
  1005. var self=this;
  1006. (self['@name']=aString);
  1007. return self;}
  1008. }),
  1009. smalltalk.IRTempDeclaration);
  1010. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1011. smalltalk.addMethod(
  1012. "_accept_",
  1013. smalltalk.method({
  1014. selector: "accept:",
  1015. fn: function (aVisitor) {
  1016. var self=this;
  1017. smalltalk.send(aVisitor, "_visitIRValue_", [self]);
  1018. return self;}
  1019. }),
  1020. smalltalk.IRValue);
  1021. smalltalk.addMethod(
  1022. "_value",
  1023. smalltalk.method({
  1024. selector: "value",
  1025. fn: function () {
  1026. var self=this;
  1027. return self['@value'];
  1028. return self;}
  1029. }),
  1030. smalltalk.IRValue);
  1031. smalltalk.addMethod(
  1032. "_value_",
  1033. smalltalk.method({
  1034. selector: "value:",
  1035. fn: function (aString) {
  1036. var self=this;
  1037. (self['@value']=aString);
  1038. return self;}
  1039. }),
  1040. smalltalk.IRValue);
  1041. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], '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, "_visitIRVariable_", [self]);
  1049. return self;}
  1050. }),
  1051. smalltalk.IRVariable);
  1052. smalltalk.addMethod(
  1053. "_variable",
  1054. smalltalk.method({
  1055. selector: "variable",
  1056. fn: function () {
  1057. var self=this;
  1058. return self['@variable'];
  1059. return self;}
  1060. }),
  1061. smalltalk.IRVariable);
  1062. smalltalk.addMethod(
  1063. "_variable_",
  1064. smalltalk.method({
  1065. selector: "variable:",
  1066. fn: function (aScopeVariable) {
  1067. var self=this;
  1068. (self['@variable']=aScopeVariable);
  1069. return self;}
  1070. }),
  1071. smalltalk.IRVariable);
  1072. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], '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, "_visitIRVerbatim_", [self]);
  1080. return self;}
  1081. }),
  1082. smalltalk.IRVerbatim);
  1083. smalltalk.addMethod(
  1084. "_source",
  1085. smalltalk.method({
  1086. selector: "source",
  1087. fn: function () {
  1088. var self=this;
  1089. return self['@source'];
  1090. return self;}
  1091. }),
  1092. smalltalk.IRVerbatim);
  1093. smalltalk.addMethod(
  1094. "_source_",
  1095. smalltalk.method({
  1096. selector: "source:",
  1097. fn: function (aString) {
  1098. var self=this;
  1099. (self['@source']=aString);
  1100. return self;}
  1101. }),
  1102. smalltalk.IRVerbatim);
  1103. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  1104. smalltalk.addMethod(
  1105. "_visit_",
  1106. smalltalk.method({
  1107. selector: "visit:",
  1108. fn: function (anIRInstruction) {
  1109. var self=this;
  1110. smalltalk.send(anIRInstruction, "_accept_", [self]);
  1111. return self;}
  1112. }),
  1113. smalltalk.IRVisitor);
  1114. smalltalk.addMethod(
  1115. "_visitIRAlias_",
  1116. smalltalk.method({
  1117. selector: "visitIRAlias:",
  1118. fn: function (anIRAlias) {
  1119. var self=this;
  1120. smalltalk.send(self, "_visitIRAssignment_", [anIRAlias]);
  1121. return self;}
  1122. }),
  1123. smalltalk.IRVisitor);
  1124. smalltalk.addMethod(
  1125. "_visitIRAssignment_",
  1126. smalltalk.method({
  1127. selector: "visitIRAssignment:",
  1128. fn: function (anIRAssignment) {
  1129. var self=this;
  1130. smalltalk.send(self, "_visitIRInstruction_", [anIRAssignment]);
  1131. return self;}
  1132. }),
  1133. smalltalk.IRVisitor);
  1134. smalltalk.addMethod(
  1135. "_visitIRBlockSequence_",
  1136. smalltalk.method({
  1137. selector: "visitIRBlockSequence:",
  1138. fn: function (anIRBlockSequence) {
  1139. var self=this;
  1140. smalltalk.send(self, "_visitIRSequence_", [anIRBlockSequence]);
  1141. return self;}
  1142. }),
  1143. smalltalk.IRVisitor);
  1144. smalltalk.addMethod(
  1145. "_visitIRClosure_",
  1146. smalltalk.method({
  1147. selector: "visitIRClosure:",
  1148. fn: function (anIRClosure) {
  1149. var self=this;
  1150. smalltalk.send(self, "_visitIRInstruction_", [anIRClosure]);
  1151. return self;}
  1152. }),
  1153. smalltalk.IRVisitor);
  1154. smalltalk.addMethod(
  1155. "_visitIRInlinedClosure_",
  1156. smalltalk.method({
  1157. selector: "visitIRInlinedClosure:",
  1158. fn: function (anIRClosure){
  1159. var self=this;
  1160. smalltalk.send(self, "_visitIRClosure_", [anIRClosure]);
  1161. return self;}
  1162. }),
  1163. smalltalk.IRVisitor);
  1164. smalltalk.addMethod(
  1165. "_visitIRInlinedIfTrue_",
  1166. smalltalk.method({
  1167. selector: "visitIRInlinedIfTrue:",
  1168. fn: function (anIRInlinedIfTrue) {
  1169. var self=this;
  1170. smalltalk.send(self, "_visitIRInlinedSend_", [anIRInlinedIfTrue]);
  1171. return self;}
  1172. }),
  1173. smalltalk.IRVisitor);
  1174. smalltalk.addMethod(
  1175. "_visitIRInlinedSend_",
  1176. smalltalk.method({
  1177. selector: "visitIRInlinedSend:",
  1178. fn: function (anIRInlinedSend) {
  1179. var self=this;
  1180. smalltalk.send(self, "_visitIRSend_", [anIRInlinedSend]);
  1181. return self;}
  1182. }),
  1183. smalltalk.IRVisitor);
  1184. smalltalk.addMethod(
  1185. "_visitIRInstruction_",
  1186. smalltalk.method({
  1187. selector: "visitIRInstruction:",
  1188. fn: function (anIRInstruction) {
  1189. var self=this;
  1190. smalltalk.send(smalltalk.send(anIRInstruction, "_instructions", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  1191. return self;}
  1192. }),
  1193. smalltalk.IRVisitor);
  1194. smalltalk.addMethod(
  1195. "_visitIRMethod_",
  1196. smalltalk.method({
  1197. selector: "visitIRMethod:",
  1198. fn: function (anIRMethod) {
  1199. var self=this;
  1200. smalltalk.send(self, "_visitIRInstruction_", [anIRMethod]);
  1201. return self;}
  1202. }),
  1203. smalltalk.IRVisitor);
  1204. smalltalk.addMethod(
  1205. "_visitIRNonLocalReturn_",
  1206. smalltalk.method({
  1207. selector: "visitIRNonLocalReturn:",
  1208. fn: function (anIRNonLocalReturn) {
  1209. var self=this;
  1210. smalltalk.send(self, "_visitIRInstruction_", [anIRNonLocalReturn]);
  1211. return self;}
  1212. }),
  1213. smalltalk.IRVisitor);
  1214. smalltalk.addMethod(
  1215. "_visitIRNonLocalReturnHandling_",
  1216. smalltalk.method({
  1217. selector: "visitIRNonLocalReturnHandling:",
  1218. fn: function (anIRNonLocalReturnHandling) {
  1219. var self=this;
  1220. smalltalk.send(self, "_visitIRInstruction_", [anIRNonLocalReturnHandling]);
  1221. return self;}
  1222. }),
  1223. smalltalk.IRVisitor);
  1224. smalltalk.addMethod(
  1225. "_visitIRReturn_",
  1226. smalltalk.method({
  1227. selector: "visitIRReturn:",
  1228. fn: function (anIRReturn) {
  1229. var self=this;
  1230. smalltalk.send(self, "_visitIRInstruction_", [anIRReturn]);
  1231. return self;}
  1232. }),
  1233. smalltalk.IRVisitor);
  1234. smalltalk.addMethod(
  1235. "_visitIRSend_",
  1236. smalltalk.method({
  1237. selector: "visitIRSend:",
  1238. fn: function (anIRSend) {
  1239. var self=this;
  1240. smalltalk.send(self, "_visitIRInstruction_", [anIRSend]);
  1241. return self;}
  1242. }),
  1243. smalltalk.IRVisitor);
  1244. smalltalk.addMethod(
  1245. "_visitIRSequence_",
  1246. smalltalk.method({
  1247. selector: "visitIRSequence:",
  1248. fn: function (anIRSequence) {
  1249. var self=this;
  1250. smalltalk.send(self, "_visitIRInstruction_", [anIRSequence]);
  1251. return self;}
  1252. }),
  1253. smalltalk.IRVisitor);
  1254. smalltalk.addMethod(
  1255. "_visitIRStatement_",
  1256. smalltalk.method({
  1257. selector: "visitIRStatement:",
  1258. fn: function (anIRStatement) {
  1259. var self=this;
  1260. smalltalk.send(self, "_visitIRInstruction_", [anIRStatement]);
  1261. return self;}
  1262. }),
  1263. smalltalk.IRVisitor);
  1264. smalltalk.addMethod(
  1265. "_visitIRTempDeclaration_",
  1266. smalltalk.method({
  1267. selector: "visitIRTempDeclaration:",
  1268. fn: function (anIRTempDeclaration) {
  1269. var self=this;
  1270. smalltalk.send(self, "_visitIRInstruction_", [anIRTempDeclaration]);
  1271. return self;}
  1272. }),
  1273. smalltalk.IRVisitor);
  1274. smalltalk.addMethod(
  1275. "_visitIRValue_",
  1276. smalltalk.method({
  1277. selector: "visitIRValue:",
  1278. fn: function (anIRValue) {
  1279. var self=this;
  1280. smalltalk.send(self, "_visitIRInstruction_", [anIRValue]);
  1281. return self;}
  1282. }),
  1283. smalltalk.IRVisitor);
  1284. smalltalk.addMethod(
  1285. "_visitIRVariable_",
  1286. smalltalk.method({
  1287. selector: "visitIRVariable:",
  1288. fn: function (anIRVariable) {
  1289. var self=this;
  1290. smalltalk.send(self, "_visitIRInstruction_", [anIRVariable]);
  1291. return self;}
  1292. }),
  1293. smalltalk.IRVisitor);
  1294. smalltalk.addMethod(
  1295. "_visitIRVerbatim_",
  1296. smalltalk.method({
  1297. selector: "visitIRVerbatim:",
  1298. fn: function (anIRVerbatim) {
  1299. var self=this;
  1300. smalltalk.send(self, "_visitIRInstruction_", [anIRVerbatim]);
  1301. return self;}
  1302. }),
  1303. smalltalk.IRVisitor);
  1304. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  1305. smalltalk.addMethod(
  1306. "_contents",
  1307. smalltalk.method({
  1308. selector: "contents",
  1309. fn: function () {
  1310. var self=this;
  1311. return smalltalk.send(smalltalk.send(self, "_stream", []), "_contents", []);
  1312. return self;}
  1313. }),
  1314. smalltalk.IRJSTranslator);
  1315. smalltalk.addMethod(
  1316. "_initialize",
  1317. smalltalk.method({
  1318. selector: "initialize",
  1319. fn: function () {
  1320. var self=this;
  1321. smalltalk.send(self, "_initialize", [], smalltalk.IRJSTranslator.superclass || nil);
  1322. (self['@stream']=smalltalk.send((smalltalk.JSStream || JSStream), "_new", []));
  1323. return self;}
  1324. }),
  1325. smalltalk.IRJSTranslator);
  1326. smalltalk.addMethod(
  1327. "_stream",
  1328. smalltalk.method({
  1329. selector: "stream",
  1330. fn: function () {
  1331. var self=this;
  1332. return self['@stream'];
  1333. return self;}
  1334. }),
  1335. smalltalk.IRJSTranslator);
  1336. smalltalk.addMethod(
  1337. "_stream_",
  1338. smalltalk.method({
  1339. selector: "stream:",
  1340. fn: function (aStream) {
  1341. var self=this;
  1342. (self['@stream']=aStream);
  1343. return self;}
  1344. }),
  1345. smalltalk.IRJSTranslator);
  1346. smalltalk.addMethod(
  1347. "_visitIRAssignment_",
  1348. smalltalk.method({
  1349. selector: "visitIRAssignment:",
  1350. fn: function (anIRAssignment) {
  1351. var self=this;
  1352. smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRAssignment, "_instructions", []), "_first", [])]);
  1353. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAssignment", []);
  1354. smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRAssignment, "_instructions", []), "_last", [])]);
  1355. return self;}
  1356. }),
  1357. smalltalk.IRJSTranslator);
  1358. smalltalk.addMethod(
  1359. "_visitIRBlockSequence_",
  1360. smalltalk.method({
  1361. selector: "visitIRBlockSequence:",
  1362. fn: function (anIRBlockSequence){
  1363. var self=this;
  1364. 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", [])]);})]));})]);
  1365. return self;}
  1366. }),
  1367. smalltalk.IRJSTranslator);
  1368. smalltalk.addMethod(
  1369. "_visitIRClosure_",
  1370. smalltalk.method({
  1371. selector: "visitIRClosure:",
  1372. fn: function (anIRClosure) {
  1373. var self=this;
  1374. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutClosureWith_arguments_", [(function(){return smalltalk.send(self, "_visitIRClosure_", [anIRClosure], smalltalk.IRJSTranslator.superclass || nil);}), smalltalk.send(anIRClosure, "_arguments", [])]);
  1375. return self;}
  1376. }),
  1377. smalltalk.IRJSTranslator);
  1378. smalltalk.addMethod(
  1379. "_visitIRMethod_",
  1380. smalltalk.method({
  1381. selector: "visitIRMethod:",
  1382. fn: function (anIRMethod) {
  1383. var self=this;
  1384. 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", [])]);})]);
  1385. return self;}
  1386. }),
  1387. smalltalk.IRJSTranslator);
  1388. smalltalk.addMethod(
  1389. "_visitIRNonLocalReturn_",
  1390. smalltalk.method({
  1391. selector: "visitIRNonLocalReturn:",
  1392. fn: function (anIRNonLocalReturn) {
  1393. var self=this;
  1394. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutNonLocalReturnWith_", [(function(){return smalltalk.send(self, "_visitIRNonLocalReturn_", [anIRNonLocalReturn], smalltalk.IRJSTranslator.superclass || nil);})]);
  1395. return self;}
  1396. }),
  1397. smalltalk.IRJSTranslator);
  1398. smalltalk.addMethod(
  1399. "_visitIRNonLocalReturnHandling_",
  1400. smalltalk.method({
  1401. selector: "visitIRNonLocalReturnHandling:",
  1402. fn: function (anIRNonLocalReturnHandling) {
  1403. var self=this;
  1404. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutNonLocalReturnHandlingWith_", [(function(){return smalltalk.send(self, "_visitIRNonLocalReturnHandling_", [anIRNonLocalReturnHandling], smalltalk.IRJSTranslator.superclass || nil);})]);
  1405. return self;}
  1406. }),
  1407. smalltalk.IRJSTranslator);
  1408. smalltalk.addMethod(
  1409. "_visitIRReturn_",
  1410. smalltalk.method({
  1411. selector: "visitIRReturn:",
  1412. fn: function (anIRReturn) {
  1413. var self=this;
  1414. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutReturnWith_", [(function(){return smalltalk.send(self, "_visitIRReturn_", [anIRReturn], smalltalk.IRJSTranslator.superclass || nil);})]);
  1415. return self;}
  1416. }),
  1417. smalltalk.IRJSTranslator);
  1418. smalltalk.addMethod(
  1419. "_visitIRSend_",
  1420. smalltalk.method({
  1421. selector: "visitIRSend:",
  1422. fn: function (anIRSend) {
  1423. var self=this;
  1424. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", ["smalltalk.send("]);
  1425. smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(anIRSend, "_instructions", []), "_first", [])]);
  1426. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(smalltalk.send(anIRSend, "_selector", []), "_asSelector", [])]), "__comma", ["\x22,["])]);
  1427. 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_", [","]);})]);
  1428. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", ["]"]);
  1429. (($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;
  1430. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [")"]);
  1431. return self;}
  1432. }),
  1433. smalltalk.IRJSTranslator);
  1434. smalltalk.addMethod(
  1435. "_visitIRSequence_",
  1436. smalltalk.method({
  1437. selector: "visitIRSequence:",
  1438. fn: function (anIRSequence) {
  1439. var self=this;
  1440. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutSequenceWith_", [(function(){return smalltalk.send(self, "_visitIRSequence_", [anIRSequence], smalltalk.IRJSTranslator.superclass || nil);})]);
  1441. return self;}
  1442. }),
  1443. smalltalk.IRJSTranslator);
  1444. smalltalk.addMethod(
  1445. "_visitIRStatement_",
  1446. smalltalk.method({
  1447. selector: "visitIRStatement:",
  1448. fn: function (anIRStatement) {
  1449. var self=this;
  1450. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutStatementWith_", [(function(){return smalltalk.send(self, "_visitIRStatement_", [anIRStatement], smalltalk.IRJSTranslator.superclass || nil);})]);
  1451. return self;}
  1452. }),
  1453. smalltalk.IRJSTranslator);
  1454. smalltalk.addMethod(
  1455. "_visitIRTempDeclaration_",
  1456. smalltalk.method({
  1457. selector: "visitIRTempDeclaration:",
  1458. fn: function (anIRTempDeclaration) {
  1459. var self=this;
  1460. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutVar_", [smalltalk.send(smalltalk.send(anIRTempDeclaration, "_name", []), "_asVariableName", [])]);
  1461. return self;}
  1462. }),
  1463. smalltalk.IRJSTranslator);
  1464. smalltalk.addMethod(
  1465. "_visitIRValue_",
  1466. smalltalk.method({
  1467. selector: "visitIRValue:",
  1468. fn: function (anIRValue) {
  1469. var self=this;
  1470. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(smalltalk.send(anIRValue, "_value", []), "_asJavascript", [])]);
  1471. return self;}
  1472. }),
  1473. smalltalk.IRJSTranslator);
  1474. smalltalk.addMethod(
  1475. "_visitIRVariable_",
  1476. smalltalk.method({
  1477. selector: "visitIRVariable:",
  1478. fn: function (anIRVariable) {
  1479. var self=this;
  1480. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(smalltalk.send(anIRVariable, "_variable", []), "_alias", [])]);
  1481. return self;}
  1482. }),
  1483. smalltalk.IRJSTranslator);
  1484. smalltalk.addMethod(
  1485. "_visitIRVerbatim_",
  1486. smalltalk.method({
  1487. selector: "visitIRVerbatim:",
  1488. fn: function (anIRVerbatim) {
  1489. var self=this;
  1490. smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutStatementWith_", [(function(){return smalltalk.send(smalltalk.send(self, "_stream", []), "_nextPutAll_", [smalltalk.send(anIRVerbatim, "_source", [])]);})]);
  1491. return self;}
  1492. }),
  1493. smalltalk.IRJSTranslator);
  1494. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  1495. smalltalk.addMethod(
  1496. "_contents",
  1497. smalltalk.method({
  1498. selector: "contents",
  1499. fn: function () {
  1500. var self=this;
  1501. return smalltalk.send(self['@stream'], "_contents", []);
  1502. return self;}
  1503. }),
  1504. smalltalk.JSStream);
  1505. smalltalk.addMethod(
  1506. "_initialize",
  1507. smalltalk.method({
  1508. selector: "initialize",
  1509. fn: function () {
  1510. var self=this;
  1511. smalltalk.send(self, "_initialize", [], smalltalk.JSStream.superclass || nil);
  1512. (self['@stream']=smalltalk.send("", "_writeStream", []));
  1513. return self;}
  1514. }),
  1515. smalltalk.JSStream);
  1516. smalltalk.addMethod(
  1517. "_lf",
  1518. smalltalk.method({
  1519. selector: "lf",
  1520. fn: function () {
  1521. var self=this;
  1522. smalltalk.send(self['@stream'], "_lf", []);
  1523. return self;}
  1524. }),
  1525. smalltalk.JSStream);
  1526. smalltalk.addMethod(
  1527. "_nextPut_",
  1528. smalltalk.method({
  1529. selector: "nextPut:",
  1530. fn: function (aString) {
  1531. var self=this;
  1532. smalltalk.send(self['@stream'], "_nextPut_", [aString]);
  1533. return self;}
  1534. }),
  1535. smalltalk.JSStream);
  1536. smalltalk.addMethod(
  1537. "_nextPutAll_",
  1538. smalltalk.method({
  1539. selector: "nextPutAll:",
  1540. fn: function (aString) {
  1541. var self=this;
  1542. smalltalk.send(self['@stream'], "_nextPutAll_", [aString]);
  1543. return self;}
  1544. }),
  1545. smalltalk.JSStream);
  1546. smalltalk.addMethod(
  1547. "_nextPutAssignment",
  1548. smalltalk.method({
  1549. selector: "nextPutAssignment",
  1550. fn: function () {
  1551. var self=this;
  1552. smalltalk.send(self['@stream'], "_nextPutAll_", ["="]);
  1553. return self;}
  1554. }),
  1555. smalltalk.JSStream);
  1556. smalltalk.addMethod(
  1557. "_nextPutClosureWith_arguments_",
  1558. smalltalk.method({
  1559. selector: "nextPutClosureWith:arguments:",
  1560. fn: function (aBlock, anArray) {
  1561. var self=this;
  1562. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
  1563. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asVariableName", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  1564. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1565. smalltalk.send(aBlock, "_value", []);
  1566. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  1567. return self;}
  1568. }),
  1569. smalltalk.JSStream);
  1570. smalltalk.addMethod(
  1571. "_nextPutFunctionWith_arguments_",
  1572. smalltalk.method({
  1573. selector: "nextPutFunctionWith:arguments:",
  1574. fn: function (aBlock, anArray) {
  1575. var self=this;
  1576. smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
  1577. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asVariableName", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  1578. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1579. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1580. smalltalk.send(aBlock, "_value", []);
  1581. smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
  1582. return self;}
  1583. }),
  1584. smalltalk.JSStream);
  1585. smalltalk.addMethod(
  1586. "_nextPutIf_with_",
  1587. smalltalk.method({
  1588. selector: "nextPutIf:with:",
  1589. fn: function (aBlock, anotherBlock){
  1590. var self=this;
  1591. smalltalk.send(self['@stream'], "_nextPutAll_", ["if("]);
  1592. smalltalk.send(aBlock, "_value", []);
  1593. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1594. smalltalk.send(anotherBlock, "_value", []);
  1595. smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
  1596. return self;}
  1597. }),
  1598. smalltalk.JSStream);
  1599. smalltalk.addMethod(
  1600. "_nextPutMethodDeclaration_with_",
  1601. smalltalk.method({
  1602. selector: "nextPutMethodDeclaration:with:",
  1603. fn: function (aMethod, aBlock) {
  1604. var self=this;
  1605. (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']);
  1606. smalltalk.send(aBlock, "_value", []);
  1607. (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']);
  1608. 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_", [","]);})]);
  1609. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["]"]);return smalltalk.send($rec, "_nextPutAll_", ["})"]);})(self['@stream']);
  1610. return self;}
  1611. }),
  1612. smalltalk.JSStream);
  1613. smalltalk.addMethod(
  1614. "_nextPutNonLocalReturnHandlingWith_",
  1615. smalltalk.method({
  1616. selector: "nextPutNonLocalReturnHandlingWith:",
  1617. fn: function (aBlock) {
  1618. var self=this;
  1619. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["try {"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1620. smalltalk.send(aBlock, "_value", []);
  1621. (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']);
  1622. return self;}
  1623. }),
  1624. smalltalk.JSStream);
  1625. smalltalk.addMethod(
  1626. "_nextPutNonLocalReturnWith_",
  1627. smalltalk.method({
  1628. selector: "nextPutNonLocalReturnWith:",
  1629. fn: function (aBlock){
  1630. var self=this;
  1631. smalltalk.send(self['@stream'], "_nextPutAll_", ["throw $early=["]);
  1632. smalltalk.send(aBlock, "_value", []);
  1633. smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
  1634. return self;}
  1635. }),
  1636. smalltalk.JSStream);
  1637. smalltalk.addMethod(
  1638. "_nextPutReturn",
  1639. smalltalk.method({
  1640. selector: "nextPutReturn",
  1641. fn: function () {
  1642. var self=this;
  1643. smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);
  1644. return self;}
  1645. }),
  1646. smalltalk.JSStream);
  1647. smalltalk.addMethod(
  1648. "_nextPutReturnWith_",
  1649. smalltalk.method({
  1650. selector: "nextPutReturnWith:",
  1651. fn: function (aBlock) {
  1652. var self=this;
  1653. smalltalk.send(self, "_nextPutReturn", []);
  1654. smalltalk.send(aBlock, "_value", []);
  1655. return self;}
  1656. }),
  1657. smalltalk.JSStream);
  1658. smalltalk.addMethod(
  1659. "_nextPutSendTo_selector_arguments_",
  1660. smalltalk.method({
  1661. selector: "nextPutSendTo:selector:arguments:",
  1662. fn: function (receiver, selector, arguments) {
  1663. var self=this;
  1664. smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.send("]);
  1665. smalltalk.send(receiver, "_emitOn_", [self]);
  1666. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(selector, "_asSelector", [])]), "__comma", ["\x22,["])]);
  1667. smalltalk.send(arguments, "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_emitOn_", [self]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1668. smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]);
  1669. return self;}
  1670. }),
  1671. smalltalk.JSStream);
  1672. smalltalk.addMethod(
  1673. "_nextPutSequenceWith_",
  1674. smalltalk.method({
  1675. selector: "nextPutSequenceWith:",
  1676. fn: function (aBlock) {
  1677. var self=this;
  1678. smalltalk.send(aBlock, "_value", []);
  1679. return self;}
  1680. }),
  1681. smalltalk.JSStream);
  1682. smalltalk.addMethod(
  1683. "_nextPutStatement_with_",
  1684. smalltalk.method({
  1685. selector: "nextPutStatement:with:",
  1686. fn: function (anInteger, aBlock) {
  1687. var self=this;
  1688. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("case ", "__comma", [smalltalk.send(anInteger, "_asString", [])]), "__comma", [":"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1689. smalltalk.send(self, "_nextPutStatementWith_", [aBlock]);
  1690. (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']);
  1691. return self;}
  1692. }),
  1693. smalltalk.JSStream);
  1694. smalltalk.addMethod(
  1695. "_nextPutStatementWith_",
  1696. smalltalk.method({
  1697. selector: "nextPutStatementWith:",
  1698. fn: function (aBlock) {
  1699. var self=this;
  1700. smalltalk.send(aBlock, "_value", []);
  1701. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1702. return self;}
  1703. }),
  1704. smalltalk.JSStream);
  1705. smalltalk.addMethod(
  1706. "_nextPutVar_",
  1707. smalltalk.method({
  1708. selector: "nextPutVar:",
  1709. fn: function (aString) {
  1710. var self=this;
  1711. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [aString]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1712. return self;}
  1713. }),
  1714. smalltalk.JSStream);
  1715. smalltalk.addMethod(
  1716. "_nextPutVars_",
  1717. smalltalk.method({
  1718. selector: "nextPutVars:",
  1719. fn: function (aCollection) {
  1720. var self=this;
  1721. smalltalk.send(self['@stream'], "_nextPutAll_", ["var "]);
  1722. smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1723. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1724. return self;}
  1725. }),
  1726. smalltalk.JSStream);
  1727. smalltalk.addMethod(
  1728. "_appendToInstruction_",
  1729. smalltalk.method({
  1730. selector: "appendToInstruction:",
  1731. fn: function (anIRInstruction) {
  1732. var self=this;
  1733. smalltalk.send(anIRInstruction, "_appendBlock_", [self]);
  1734. return self;}
  1735. }),
  1736. smalltalk.BlockClosure);
  1737. smalltalk.addMethod(
  1738. "_appendToInstruction_",
  1739. smalltalk.method({
  1740. selector: "appendToInstruction:",
  1741. fn: function (anInstruction) {
  1742. var self=this;
  1743. smalltalk.send(anInstruction, "_appendString_", [self]);
  1744. return self;}
  1745. }),
  1746. smalltalk.String);
  1747. smalltalk.addMethod(
  1748. "_asVariableName",
  1749. smalltalk.method({
  1750. selector: "asVariableName",
  1751. fn: function () {
  1752. var self=this;
  1753. 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;})]));
  1754. return self;}
  1755. }),
  1756. smalltalk.String);
  1757. smalltalk.addMethod(
  1758. "_emitOn_",
  1759. smalltalk.method({
  1760. selector: "emitOn:",
  1761. fn: function (aStream) {
  1762. var self=this;
  1763. smalltalk.send(aStream, "_nextPutAll_", [self]);
  1764. return self;}
  1765. }),
  1766. smalltalk.String);