Compiler-IR.deploy.js 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418
  1. smalltalk.addPackage('Compiler-IR', {});
  2. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
  3. smalltalk.addMethod(
  4. "_alias_",
  5. smalltalk.method({
  6. selector: "alias:",
  7. fn: function (aNode){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  10. $ctx1.variable=nil;
  11. $1=_st(aNode)._isValueNode();
  12. if(smalltalk.assert($1)){
  13. $2=_st(self)._visit_(aNode);
  14. return $2;
  15. };
  16. $3=_st((smalltalk.IRVariable || IRVariable))._new();
  17. _st($3)._variable_(_st(_st((smalltalk.AliasVar || AliasVar))._new())._name_(_st("$").__comma(_st(self)._nextAlias())));
  18. $4=_st($3)._yourself();
  19. $ctx1.locals.variable=$4;
  20. $5=_st((smalltalk.IRAssignment || IRAssignment))._new();
  21. _st($5)._add_($ctx1.locals.variable);
  22. _st($5)._add_(_st(self)._visit_(aNode));
  23. $6=_st($5)._yourself();
  24. _st(_st(self)._sequence())._add_($6);
  25. _st(_st(_st(self)._method())._internalVariables())._add_($ctx1.locals.variable);
  26. return $ctx1.locals.variable;
  27. }, self, "alias:", [aNode], smalltalk.IRASTTranslator)}
  28. }),
  29. smalltalk.IRASTTranslator);
  30. smalltalk.addMethod(
  31. "_method",
  32. smalltalk.method({
  33. selector: "method",
  34. fn: function (){
  35. var self=this;
  36. return smalltalk.withContext(function($ctx1) { return self["@method"];
  37. }, self, "method", [], smalltalk.IRASTTranslator)}
  38. }),
  39. smalltalk.IRASTTranslator);
  40. smalltalk.addMethod(
  41. "_method_",
  42. smalltalk.method({
  43. selector: "method:",
  44. fn: function (anIRMethod){
  45. var self=this;
  46. return smalltalk.withContext(function($ctx1) { self["@method"]=anIRMethod;
  47. return self}, self, "method:", [anIRMethod], smalltalk.IRASTTranslator)}
  48. }),
  49. smalltalk.IRASTTranslator);
  50. smalltalk.addMethod(
  51. "_nextAlias",
  52. smalltalk.method({
  53. selector: "nextAlias",
  54. fn: function (){
  55. var self=this;
  56. return smalltalk.withContext(function($ctx1) { var $1;
  57. if(($receiver = self["@nextAlias"]) == nil || $receiver == undefined){
  58. self["@nextAlias"]=(0);
  59. self["@nextAlias"];
  60. } else {
  61. self["@nextAlias"];
  62. };
  63. self["@nextAlias"]=_st(self["@nextAlias"]).__plus((1));
  64. $1=_st(self["@nextAlias"])._asString();
  65. return $1;
  66. }, self, "nextAlias", [], smalltalk.IRASTTranslator)}
  67. }),
  68. smalltalk.IRASTTranslator);
  69. smalltalk.addMethod(
  70. "_sequence",
  71. smalltalk.method({
  72. selector: "sequence",
  73. fn: function (){
  74. var self=this;
  75. return smalltalk.withContext(function($ctx1) { return self["@sequence"];
  76. }, self, "sequence", [], smalltalk.IRASTTranslator)}
  77. }),
  78. smalltalk.IRASTTranslator);
  79. smalltalk.addMethod(
  80. "_sequence_",
  81. smalltalk.method({
  82. selector: "sequence:",
  83. fn: function (anIRSequence){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx1) { self["@sequence"]=anIRSequence;
  86. return self}, self, "sequence:", [anIRSequence], smalltalk.IRASTTranslator)}
  87. }),
  88. smalltalk.IRASTTranslator);
  89. smalltalk.addMethod(
  90. "_source",
  91. smalltalk.method({
  92. selector: "source",
  93. fn: function (){
  94. var self=this;
  95. return smalltalk.withContext(function($ctx1) { return self["@source"];
  96. }, self, "source", [], smalltalk.IRASTTranslator)}
  97. }),
  98. smalltalk.IRASTTranslator);
  99. smalltalk.addMethod(
  100. "_source_",
  101. smalltalk.method({
  102. selector: "source:",
  103. fn: function (aString){
  104. var self=this;
  105. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  106. return self}, self, "source:", [aString], smalltalk.IRASTTranslator)}
  107. }),
  108. smalltalk.IRASTTranslator);
  109. smalltalk.addMethod(
  110. "_theClass",
  111. smalltalk.method({
  112. selector: "theClass",
  113. fn: function (){
  114. var self=this;
  115. return smalltalk.withContext(function($ctx1) { return self["@theClass"];
  116. }, self, "theClass", [], smalltalk.IRASTTranslator)}
  117. }),
  118. smalltalk.IRASTTranslator);
  119. smalltalk.addMethod(
  120. "_theClass_",
  121. smalltalk.method({
  122. selector: "theClass:",
  123. fn: function (aClass){
  124. var self=this;
  125. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  126. return self}, self, "theClass:", [aClass], smalltalk.IRASTTranslator)}
  127. }),
  128. smalltalk.IRASTTranslator);
  129. smalltalk.addMethod(
  130. "_visitAssignmentNode_",
  131. smalltalk.method({
  132. selector: "visitAssignmentNode:",
  133. fn: function (aNode){
  134. var self=this;
  135. return smalltalk.withContext(function($ctx1) { var $1,$2;
  136. $ctx1.left=nil;
  137. $ctx1.right=nil;
  138. $ctx1.assignment=nil;
  139. $ctx1.locals.right=_st(self)._visit_(_st(aNode)._right());
  140. $ctx1.locals.left=_st(self)._visit_(_st(aNode)._left());
  141. $1=_st((smalltalk.IRAssignment || IRAssignment))._new();
  142. _st($1)._add_($ctx1.locals.left);
  143. _st($1)._add_($ctx1.locals.right);
  144. $2=_st($1)._yourself();
  145. _st(_st(self)._sequence())._add_($2);
  146. return $ctx1.locals.left;
  147. }, self, "visitAssignmentNode:", [aNode], smalltalk.IRASTTranslator)}
  148. }),
  149. smalltalk.IRASTTranslator);
  150. smalltalk.addMethod(
  151. "_visitBlockNode_",
  152. smalltalk.method({
  153. selector: "visitBlockNode:",
  154. fn: function (aNode){
  155. var self=this;
  156. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  157. $ctx1.closure=nil;
  158. $1=_st((smalltalk.IRClosure || IRClosure))._new();
  159. _st($1)._arguments_(_st(aNode)._parameters());
  160. _st($1)._scope_(_st(aNode)._scope());
  161. $2=_st($1)._yourself();
  162. $ctx1.locals.closure=$2;
  163. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  164. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  165. _st($3)._name_(_st(each)._name());
  166. _st($3)._scope_(_st(aNode)._scope());
  167. $4=_st($3)._yourself();
  168. return _st($ctx1.locals.closure)._add_($4);
  169. })}));
  170. _st(_st(aNode)._nodes())._do_((function(each){
  171. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.closure)._add_(_st(self)._visit_(each));
  172. })}));
  173. return $ctx1.locals.closure;
  174. }, self, "visitBlockNode:", [aNode], smalltalk.IRASTTranslator)}
  175. }),
  176. smalltalk.IRASTTranslator);
  177. smalltalk.addMethod(
  178. "_visitBlockSequenceNode_",
  179. smalltalk.method({
  180. selector: "visitBlockSequenceNode:",
  181. fn: function (aNode){
  182. var self=this;
  183. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$1;
  184. $1=_st(self)._withSequence_do_(_st((smalltalk.IRBlockSequence || IRBlockSequence))._new(),(function(){
  185. return smalltalk.withContext(function($ctx2) { return _st(_st(aNode)._nodes())._ifNotEmpty_((function(){
  186. return smalltalk.withContext(function($ctx3) { _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  187. return smalltalk.withContext(function($ctx4) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  188. })}));
  189. $2=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
  190. if(smalltalk.assert($2)){
  191. return _st(_st(self)._sequence())._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  192. } else {
  193. $3=_st((smalltalk.IRBlockReturn || IRBlockReturn))._new();
  194. _st($3)._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  195. $4=_st($3)._yourself();
  196. return _st(_st(self)._sequence())._add_($4);
  197. };
  198. })}));
  199. })}));
  200. return $1;
  201. }, self, "visitBlockSequenceNode:", [aNode], smalltalk.IRASTTranslator)}
  202. }),
  203. smalltalk.IRASTTranslator);
  204. smalltalk.addMethod(
  205. "_visitCascadeNode_",
  206. smalltalk.method({
  207. selector: "visitCascadeNode:",
  208. fn: function (aNode){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) { var $1,$2;
  211. $ctx1.alias=nil;
  212. $1=_st(_st(aNode)._receiver())._isValueNode();
  213. if(! smalltalk.assert($1)){
  214. $ctx1.locals.alias=_st(self)._alias_(_st(aNode)._receiver());
  215. $ctx1.locals.alias;
  216. _st(_st(aNode)._nodes())._do_((function(each){
  217. return smalltalk.withContext(function($ctx2) { return _st(each)._receiver_(_st(_st((smalltalk.VariableNode || VariableNode))._new())._binding_(_st($ctx1.locals.alias)._variable()));
  218. })}));
  219. };
  220. _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  221. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  222. })}));
  223. $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
  224. return $2;
  225. }, self, "visitCascadeNode:", [aNode], smalltalk.IRASTTranslator)}
  226. }),
  227. smalltalk.IRASTTranslator);
  228. smalltalk.addMethod(
  229. "_visitDynamicArrayNode_",
  230. smalltalk.method({
  231. selector: "visitDynamicArrayNode:",
  232. fn: function (aNode){
  233. var self=this;
  234. return smalltalk.withContext(function($ctx1) { $ctx1.array=nil;
  235. $ctx1.locals.array=_st((smalltalk.IRDynamicArray || IRDynamicArray))._new();
  236. _st(_st(aNode)._nodes())._do_((function(each){
  237. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.array)._add_(_st(self)._visit_(each));
  238. })}));
  239. return $ctx1.locals.array;
  240. }, self, "visitDynamicArrayNode:", [aNode], smalltalk.IRASTTranslator)}
  241. }),
  242. smalltalk.IRASTTranslator);
  243. smalltalk.addMethod(
  244. "_visitDynamicDictionaryNode_",
  245. smalltalk.method({
  246. selector: "visitDynamicDictionaryNode:",
  247. fn: function (aNode){
  248. var self=this;
  249. return smalltalk.withContext(function($ctx1) { $ctx1.dictionary=nil;
  250. $ctx1.locals.dictionary=_st((smalltalk.IRDynamicDictionary || IRDynamicDictionary))._new();
  251. _st(_st(aNode)._nodes())._do_((function(each){
  252. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.dictionary)._add_(_st(self)._visit_(each));
  253. })}));
  254. return $ctx1.locals.dictionary;
  255. }, self, "visitDynamicDictionaryNode:", [aNode], smalltalk.IRASTTranslator)}
  256. }),
  257. smalltalk.IRASTTranslator);
  258. smalltalk.addMethod(
  259. "_visitJSStatementNode_",
  260. smalltalk.method({
  261. selector: "visitJSStatementNode:",
  262. fn: function (aNode){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  265. $2=_st((smalltalk.IRVerbatim || IRVerbatim))._new();
  266. _st($2)._source_(_st(aNode)._source());
  267. $3=_st($2)._yourself();
  268. $1=$3;
  269. return $1;
  270. }, self, "visitJSStatementNode:", [aNode], smalltalk.IRASTTranslator)}
  271. }),
  272. smalltalk.IRASTTranslator);
  273. smalltalk.addMethod(
  274. "_visitMethodNode_",
  275. smalltalk.method({
  276. selector: "visitMethodNode:",
  277. fn: function (aNode){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  280. $1=_st((smalltalk.IRMethod || IRMethod))._new();
  281. _st($1)._source_(_st(self)._source());
  282. _st($1)._theClass_(_st(self)._theClass());
  283. _st($1)._arguments_(_st(aNode)._arguments());
  284. _st($1)._selector_(_st(aNode)._selector());
  285. _st($1)._messageSends_(_st(aNode)._messageSends());
  286. _st($1)._superSends_(_st(aNode)._superSends());
  287. _st($1)._classReferences_(_st(aNode)._classReferences());
  288. _st($1)._scope_(_st(aNode)._scope());
  289. $2=_st($1)._yourself();
  290. _st(self)._method_($2);
  291. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  292. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  293. _st($3)._name_(_st(each)._name());
  294. _st($3)._scope_(_st(aNode)._scope());
  295. $4=_st($3)._yourself();
  296. return _st(_st(self)._method())._add_($4);
  297. })}));
  298. _st(_st(aNode)._nodes())._do_((function(each){
  299. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._method())._add_(_st(self)._visit_(each));
  300. })}));
  301. $5=_st(_st(aNode)._scope())._hasLocalReturn();
  302. if(! smalltalk.assert($5)){
  303. $6=_st((smalltalk.IRVariable || IRVariable))._new();
  304. _st($6)._variable_(_st(_st(_st(aNode)._scope())._pseudoVars())._at_("self"));
  305. $7=_st($6)._yourself();
  306. _st(_st(_st(self)._method())._add_(_st((smalltalk.IRReturn || IRReturn))._new()))._add_($7);
  307. };
  308. $8=_st(self)._method();
  309. return $8;
  310. }, self, "visitMethodNode:", [aNode], smalltalk.IRASTTranslator)}
  311. }),
  312. smalltalk.IRASTTranslator);
  313. smalltalk.addMethod(
  314. "_visitReturnNode_",
  315. smalltalk.method({
  316. selector: "visitReturnNode:",
  317. fn: function (aNode){
  318. var self=this;
  319. return smalltalk.withContext(function($ctx1) { var $1;
  320. $ctx1.return=nil;
  321. $1=_st(aNode)._nonLocalReturn();
  322. if(smalltalk.assert($1)){
  323. $ctx1.locals.return_=_st((smalltalk.IRNonLocalReturn || IRNonLocalReturn))._new();
  324. } else {
  325. $ctx1.locals.return_=_st((smalltalk.IRReturn || IRReturn))._new();
  326. };
  327. _st($ctx1.locals.return_)._scope_(_st(aNode)._scope());
  328. _st(_st(aNode)._nodes())._do_((function(each){
  329. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.return_)._add_(_st(self)._alias_(each));
  330. })}));
  331. return $ctx1.locals.return_;
  332. }, self, "visitReturnNode:", [aNode], smalltalk.IRASTTranslator)}
  333. }),
  334. smalltalk.IRASTTranslator);
  335. smalltalk.addMethod(
  336. "_visitSendNode_",
  337. smalltalk.method({
  338. selector: "visitSendNode:",
  339. fn: function (aNode){
  340. var self=this;
  341. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  342. $ctx1.send=nil;
  343. $ctx1.receiver=nil;
  344. $ctx1.arguments=nil;
  345. $ctx1.locals.send=_st((smalltalk.IRSend || IRSend))._new();
  346. _st($ctx1.locals.send)._selector_(_st(aNode)._selector());
  347. $1=_st($ctx1.locals.send)._index_(_st(aNode)._index());
  348. $2=_st(aNode)._superSend();
  349. if(smalltalk.assert($2)){
  350. _st($ctx1.locals.send)._classSend_(_st(_st(self)._theClass())._superclass());
  351. };
  352. $3=_st(_st(_st(aNode)._receiver())._shouldBeInlined())._or_((function(){
  353. return smalltalk.withContext(function($ctx2) { return _st(_st(aNode)._receiver())._shouldBeAliased();
  354. })}));
  355. if(smalltalk.assert($3)){
  356. $ctx1.locals.receiver=_st(self)._alias_(_st(aNode)._receiver());
  357. } else {
  358. $ctx1.locals.receiver=_st(self)._visit_(_st(aNode)._receiver());
  359. };
  360. $ctx1.locals.arguments=_st(_st(aNode)._arguments())._collect_((function(each){
  361. return smalltalk.withContext(function($ctx2) { $4=_st(each)._shouldBeInlined();
  362. if(smalltalk.assert($4)){
  363. return _st(self)._alias_(each);
  364. } else {
  365. return _st(self)._visit_(each);
  366. };
  367. })}));
  368. _st($ctx1.locals.send)._add_($ctx1.locals.receiver);
  369. _st($ctx1.locals.arguments)._do_((function(each){
  370. return smalltalk.withContext(function($ctx2) { return _st($ctx1.locals.send)._add_(each);
  371. })}));
  372. return $ctx1.locals.send;
  373. }, self, "visitSendNode:", [aNode], smalltalk.IRASTTranslator)}
  374. }),
  375. smalltalk.IRASTTranslator);
  376. smalltalk.addMethod(
  377. "_visitSequenceNode_",
  378. smalltalk.method({
  379. selector: "visitSequenceNode:",
  380. fn: function (aNode){
  381. var self=this;
  382. return smalltalk.withContext(function($ctx1) { var $2,$1;
  383. $1=_st(self)._withSequence_do_(_st((smalltalk.IRSequence || IRSequence))._new(),(function(){
  384. return smalltalk.withContext(function($ctx2) { return _st(_st(aNode)._nodes())._do_((function(each){
  385. return smalltalk.withContext(function($ctx3) { $ctx3.instruction=nil;
  386. $ctx3.locals.instruction=_st(self)._visit_(each);
  387. $ctx3.locals.instruction;
  388. $2=_st($ctx3.locals.instruction)._isVariable();
  389. if(! smalltalk.assert($2)){
  390. return _st(_st(self)._sequence())._add_($ctx3.locals.instruction);
  391. };
  392. })}));
  393. })}));
  394. return $1;
  395. }, self, "visitSequenceNode:", [aNode], smalltalk.IRASTTranslator)}
  396. }),
  397. smalltalk.IRASTTranslator);
  398. smalltalk.addMethod(
  399. "_visitValueNode_",
  400. smalltalk.method({
  401. selector: "visitValueNode:",
  402. fn: function (aNode){
  403. var self=this;
  404. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  405. $2=_st((smalltalk.IRValue || IRValue))._new();
  406. _st($2)._value_(_st(aNode)._value());
  407. $3=_st($2)._yourself();
  408. $1=$3;
  409. return $1;
  410. }, self, "visitValueNode:", [aNode], smalltalk.IRASTTranslator)}
  411. }),
  412. smalltalk.IRASTTranslator);
  413. smalltalk.addMethod(
  414. "_visitVariableNode_",
  415. smalltalk.method({
  416. selector: "visitVariableNode:",
  417. fn: function (aNode){
  418. var self=this;
  419. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  420. $2=_st((smalltalk.IRVariable || IRVariable))._new();
  421. _st($2)._variable_(_st(aNode)._binding());
  422. $3=_st($2)._yourself();
  423. $1=$3;
  424. return $1;
  425. }, self, "visitVariableNode:", [aNode], smalltalk.IRASTTranslator)}
  426. }),
  427. smalltalk.IRASTTranslator);
  428. smalltalk.addMethod(
  429. "_withSequence_do_",
  430. smalltalk.method({
  431. selector: "withSequence:do:",
  432. fn: function (aSequence,aBlock){
  433. var self=this;
  434. return smalltalk.withContext(function($ctx1) { $ctx1.outerSequence=nil;
  435. $ctx1.locals.outerSequence=_st(self)._sequence();
  436. _st(self)._sequence_(aSequence);
  437. _st(aBlock)._value();
  438. _st(self)._sequence_($ctx1.locals.outerSequence);
  439. return aSequence;
  440. }, self, "withSequence:do:", [aSequence,aBlock], smalltalk.IRASTTranslator)}
  441. }),
  442. smalltalk.IRASTTranslator);
  443. smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler-IR');
  444. smalltalk.addMethod(
  445. "_accept_",
  446. smalltalk.method({
  447. selector: "accept:",
  448. fn: function (aVisitor){
  449. var self=this;
  450. return smalltalk.withContext(function($ctx1) { var $1;
  451. $1=_st(aVisitor)._visitIRInstruction_(self);
  452. return $1;
  453. }, self, "accept:", [aVisitor], smalltalk.IRInstruction)}
  454. }),
  455. smalltalk.IRInstruction);
  456. smalltalk.addMethod(
  457. "_add_",
  458. smalltalk.method({
  459. selector: "add:",
  460. fn: function (anObject){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx1) { var $1;
  463. _st(anObject)._parent_(self);
  464. $1=_st(_st(self)._instructions())._add_(anObject);
  465. return $1;
  466. }, self, "add:", [anObject], smalltalk.IRInstruction)}
  467. }),
  468. smalltalk.IRInstruction);
  469. smalltalk.addMethod(
  470. "_canBeAssigned",
  471. smalltalk.method({
  472. selector: "canBeAssigned",
  473. fn: function (){
  474. var self=this;
  475. return smalltalk.withContext(function($ctx1) { return true;
  476. }, self, "canBeAssigned", [], smalltalk.IRInstruction)}
  477. }),
  478. smalltalk.IRInstruction);
  479. smalltalk.addMethod(
  480. "_instructions",
  481. smalltalk.method({
  482. selector: "instructions",
  483. fn: function (){
  484. var self=this;
  485. return smalltalk.withContext(function($ctx1) { var $1;
  486. if(($receiver = self["@instructions"]) == nil || $receiver == undefined){
  487. self["@instructions"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  488. $1=self["@instructions"];
  489. } else {
  490. $1=self["@instructions"];
  491. };
  492. return $1;
  493. }, self, "instructions", [], smalltalk.IRInstruction)}
  494. }),
  495. smalltalk.IRInstruction);
  496. smalltalk.addMethod(
  497. "_isClosure",
  498. smalltalk.method({
  499. selector: "isClosure",
  500. fn: function (){
  501. var self=this;
  502. return smalltalk.withContext(function($ctx1) { return false;
  503. }, self, "isClosure", [], smalltalk.IRInstruction)}
  504. }),
  505. smalltalk.IRInstruction);
  506. smalltalk.addMethod(
  507. "_isInlined",
  508. smalltalk.method({
  509. selector: "isInlined",
  510. fn: function (){
  511. var self=this;
  512. return smalltalk.withContext(function($ctx1) { return false;
  513. }, self, "isInlined", [], smalltalk.IRInstruction)}
  514. }),
  515. smalltalk.IRInstruction);
  516. smalltalk.addMethod(
  517. "_isLocalReturn",
  518. smalltalk.method({
  519. selector: "isLocalReturn",
  520. fn: function (){
  521. var self=this;
  522. return smalltalk.withContext(function($ctx1) { return false;
  523. }, self, "isLocalReturn", [], smalltalk.IRInstruction)}
  524. }),
  525. smalltalk.IRInstruction);
  526. smalltalk.addMethod(
  527. "_isReturn",
  528. smalltalk.method({
  529. selector: "isReturn",
  530. fn: function (){
  531. var self=this;
  532. return smalltalk.withContext(function($ctx1) { return false;
  533. }, self, "isReturn", [], smalltalk.IRInstruction)}
  534. }),
  535. smalltalk.IRInstruction);
  536. smalltalk.addMethod(
  537. "_isSend",
  538. smalltalk.method({
  539. selector: "isSend",
  540. fn: function (){
  541. var self=this;
  542. return smalltalk.withContext(function($ctx1) { return false;
  543. }, self, "isSend", [], smalltalk.IRInstruction)}
  544. }),
  545. smalltalk.IRInstruction);
  546. smalltalk.addMethod(
  547. "_isSequence",
  548. smalltalk.method({
  549. selector: "isSequence",
  550. fn: function (){
  551. var self=this;
  552. return smalltalk.withContext(function($ctx1) { return false;
  553. }, self, "isSequence", [], smalltalk.IRInstruction)}
  554. }),
  555. smalltalk.IRInstruction);
  556. smalltalk.addMethod(
  557. "_isTempDeclaration",
  558. smalltalk.method({
  559. selector: "isTempDeclaration",
  560. fn: function (){
  561. var self=this;
  562. return smalltalk.withContext(function($ctx1) { return false;
  563. }, self, "isTempDeclaration", [], smalltalk.IRInstruction)}
  564. }),
  565. smalltalk.IRInstruction);
  566. smalltalk.addMethod(
  567. "_isVariable",
  568. smalltalk.method({
  569. selector: "isVariable",
  570. fn: function (){
  571. var self=this;
  572. return smalltalk.withContext(function($ctx1) { return false;
  573. }, self, "isVariable", [], smalltalk.IRInstruction)}
  574. }),
  575. smalltalk.IRInstruction);
  576. smalltalk.addMethod(
  577. "_parent",
  578. smalltalk.method({
  579. selector: "parent",
  580. fn: function (){
  581. var self=this;
  582. return smalltalk.withContext(function($ctx1) { return self["@parent"];
  583. }, self, "parent", [], smalltalk.IRInstruction)}
  584. }),
  585. smalltalk.IRInstruction);
  586. smalltalk.addMethod(
  587. "_parent_",
  588. smalltalk.method({
  589. selector: "parent:",
  590. fn: function (anIRInstruction){
  591. var self=this;
  592. return smalltalk.withContext(function($ctx1) { self["@parent"]=anIRInstruction;
  593. return self}, self, "parent:", [anIRInstruction], smalltalk.IRInstruction)}
  594. }),
  595. smalltalk.IRInstruction);
  596. smalltalk.addMethod(
  597. "_remove",
  598. smalltalk.method({
  599. selector: "remove",
  600. fn: function (){
  601. var self=this;
  602. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._remove_(self);
  603. return self}, self, "remove", [], smalltalk.IRInstruction)}
  604. }),
  605. smalltalk.IRInstruction);
  606. smalltalk.addMethod(
  607. "_remove_",
  608. smalltalk.method({
  609. selector: "remove:",
  610. fn: function (anIRInstruction){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) { _st(_st(self)._instructions())._remove_(anIRInstruction);
  613. return self}, self, "remove:", [anIRInstruction], smalltalk.IRInstruction)}
  614. }),
  615. smalltalk.IRInstruction);
  616. smalltalk.addMethod(
  617. "_replace_with_",
  618. smalltalk.method({
  619. selector: "replace:with:",
  620. fn: function (anIRInstruction,anotherIRInstruction){
  621. var self=this;
  622. return smalltalk.withContext(function($ctx1) { _st(anotherIRInstruction)._parent_(self);
  623. _st(_st(self)._instructions())._at_put_(_st(_st(self)._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
  624. return self}, self, "replace:with:", [anIRInstruction,anotherIRInstruction], smalltalk.IRInstruction)}
  625. }),
  626. smalltalk.IRInstruction);
  627. smalltalk.addMethod(
  628. "_replaceWith_",
  629. smalltalk.method({
  630. selector: "replaceWith:",
  631. fn: function (anIRInstruction){
  632. var self=this;
  633. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._replace_with_(self,anIRInstruction);
  634. return self}, self, "replaceWith:", [anIRInstruction], smalltalk.IRInstruction)}
  635. }),
  636. smalltalk.IRInstruction);
  637. smalltalk.addMethod(
  638. "_on_",
  639. smalltalk.method({
  640. selector: "on:",
  641. fn: function (aBuilder){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  644. $2=_st(self)._new();
  645. _st($2)._builder_(aBuilder);
  646. $3=_st($2)._yourself();
  647. $1=$3;
  648. return $1;
  649. }, self, "on:", [aBuilder], smalltalk.IRInstruction.klass)}
  650. }),
  651. smalltalk.IRInstruction.klass);
  652. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  653. smalltalk.addMethod(
  654. "_accept_",
  655. smalltalk.method({
  656. selector: "accept:",
  657. fn: function (aVisitor){
  658. var self=this;
  659. return smalltalk.withContext(function($ctx1) { var $1;
  660. $1=_st(aVisitor)._visitIRAssignment_(self);
  661. return $1;
  662. }, self, "accept:", [aVisitor], smalltalk.IRAssignment)}
  663. }),
  664. smalltalk.IRAssignment);
  665. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  666. smalltalk.addMethod(
  667. "_accept_",
  668. smalltalk.method({
  669. selector: "accept:",
  670. fn: function (aVisitor){
  671. var self=this;
  672. return smalltalk.withContext(function($ctx1) { var $1;
  673. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  674. return $1;
  675. }, self, "accept:", [aVisitor], smalltalk.IRDynamicArray)}
  676. }),
  677. smalltalk.IRDynamicArray);
  678. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  679. smalltalk.addMethod(
  680. "_accept_",
  681. smalltalk.method({
  682. selector: "accept:",
  683. fn: function (aVisitor){
  684. var self=this;
  685. return smalltalk.withContext(function($ctx1) { var $1;
  686. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  687. return $1;
  688. }, self, "accept:", [aVisitor], smalltalk.IRDynamicDictionary)}
  689. }),
  690. smalltalk.IRDynamicDictionary);
  691. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  692. smalltalk.addMethod(
  693. "_scope",
  694. smalltalk.method({
  695. selector: "scope",
  696. fn: function (){
  697. var self=this;
  698. return smalltalk.withContext(function($ctx1) { return self["@scope"];
  699. }, self, "scope", [], smalltalk.IRScopedInstruction)}
  700. }),
  701. smalltalk.IRScopedInstruction);
  702. smalltalk.addMethod(
  703. "_scope_",
  704. smalltalk.method({
  705. selector: "scope:",
  706. fn: function (aScope){
  707. var self=this;
  708. return smalltalk.withContext(function($ctx1) { self["@scope"]=aScope;
  709. return self}, self, "scope:", [aScope], smalltalk.IRScopedInstruction)}
  710. }),
  711. smalltalk.IRScopedInstruction);
  712. smalltalk.addClass('IRClosure', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  713. smalltalk.addMethod(
  714. "_accept_",
  715. smalltalk.method({
  716. selector: "accept:",
  717. fn: function (aVisitor){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) { var $1;
  720. $1=_st(aVisitor)._visitIRClosure_(self);
  721. return $1;
  722. }, self, "accept:", [aVisitor], smalltalk.IRClosure)}
  723. }),
  724. smalltalk.IRClosure);
  725. smalltalk.addMethod(
  726. "_arguments",
  727. smalltalk.method({
  728. selector: "arguments",
  729. fn: function (){
  730. var self=this;
  731. return smalltalk.withContext(function($ctx1) { var $1;
  732. if(($receiver = self["@arguments"]) == nil || $receiver == undefined){
  733. $1=[];
  734. } else {
  735. $1=self["@arguments"];
  736. };
  737. return $1;
  738. }, self, "arguments", [], smalltalk.IRClosure)}
  739. }),
  740. smalltalk.IRClosure);
  741. smalltalk.addMethod(
  742. "_arguments_",
  743. smalltalk.method({
  744. selector: "arguments:",
  745. fn: function (aCollection){
  746. var self=this;
  747. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  748. return self}, self, "arguments:", [aCollection], smalltalk.IRClosure)}
  749. }),
  750. smalltalk.IRClosure);
  751. smalltalk.addMethod(
  752. "_isClosure",
  753. smalltalk.method({
  754. selector: "isClosure",
  755. fn: function (){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) { return true;
  758. }, self, "isClosure", [], smalltalk.IRClosure)}
  759. }),
  760. smalltalk.IRClosure);
  761. smalltalk.addMethod(
  762. "_scope_",
  763. smalltalk.method({
  764. selector: "scope:",
  765. fn: function (aScope){
  766. var self=this;
  767. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  768. _st(aScope)._instruction_(self);
  769. return self}, self, "scope:", [aScope], smalltalk.IRClosure)}
  770. }),
  771. smalltalk.IRClosure);
  772. smalltalk.addMethod(
  773. "_sequence",
  774. smalltalk.method({
  775. selector: "sequence",
  776. fn: function (){
  777. var self=this;
  778. return smalltalk.withContext(function($ctx1) { var $1;
  779. $1=_st(_st(self)._instructions())._last();
  780. return $1;
  781. }, self, "sequence", [], smalltalk.IRClosure)}
  782. }),
  783. smalltalk.IRClosure);
  784. smalltalk.addClass('IRMethod', smalltalk.IRScopedInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'arguments', 'internalVariables'], 'Compiler-IR');
  785. smalltalk.addMethod(
  786. "_accept_",
  787. smalltalk.method({
  788. selector: "accept:",
  789. fn: function (aVisitor){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) { var $1;
  792. $1=_st(aVisitor)._visitIRMethod_(self);
  793. return $1;
  794. }, self, "accept:", [aVisitor], smalltalk.IRMethod)}
  795. }),
  796. smalltalk.IRMethod);
  797. smalltalk.addMethod(
  798. "_arguments",
  799. smalltalk.method({
  800. selector: "arguments",
  801. fn: function (){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) { return self["@arguments"];
  804. }, self, "arguments", [], smalltalk.IRMethod)}
  805. }),
  806. smalltalk.IRMethod);
  807. smalltalk.addMethod(
  808. "_arguments_",
  809. smalltalk.method({
  810. selector: "arguments:",
  811. fn: function (aCollection){
  812. var self=this;
  813. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  814. return self}, self, "arguments:", [aCollection], smalltalk.IRMethod)}
  815. }),
  816. smalltalk.IRMethod);
  817. smalltalk.addMethod(
  818. "_classReferences",
  819. smalltalk.method({
  820. selector: "classReferences",
  821. fn: function (){
  822. var self=this;
  823. return smalltalk.withContext(function($ctx1) { return self["@classReferences"];
  824. }, self, "classReferences", [], smalltalk.IRMethod)}
  825. }),
  826. smalltalk.IRMethod);
  827. smalltalk.addMethod(
  828. "_classReferences_",
  829. smalltalk.method({
  830. selector: "classReferences:",
  831. fn: function (aCollection){
  832. var self=this;
  833. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  834. return self}, self, "classReferences:", [aCollection], smalltalk.IRMethod)}
  835. }),
  836. smalltalk.IRMethod);
  837. smalltalk.addMethod(
  838. "_internalVariables",
  839. smalltalk.method({
  840. selector: "internalVariables",
  841. fn: function (){
  842. var self=this;
  843. return smalltalk.withContext(function($ctx1) { var $1;
  844. if(($receiver = self["@internalVariables"]) == nil || $receiver == undefined){
  845. self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
  846. $1=self["@internalVariables"];
  847. } else {
  848. $1=self["@internalVariables"];
  849. };
  850. return $1;
  851. }, self, "internalVariables", [], smalltalk.IRMethod)}
  852. }),
  853. smalltalk.IRMethod);
  854. smalltalk.addMethod(
  855. "_messageSends",
  856. smalltalk.method({
  857. selector: "messageSends",
  858. fn: function (){
  859. var self=this;
  860. return smalltalk.withContext(function($ctx1) { return self["@messageSends"];
  861. }, self, "messageSends", [], smalltalk.IRMethod)}
  862. }),
  863. smalltalk.IRMethod);
  864. smalltalk.addMethod(
  865. "_messageSends_",
  866. smalltalk.method({
  867. selector: "messageSends:",
  868. fn: function (aCollection){
  869. var self=this;
  870. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  871. return self}, self, "messageSends:", [aCollection], smalltalk.IRMethod)}
  872. }),
  873. smalltalk.IRMethod);
  874. smalltalk.addMethod(
  875. "_scope_",
  876. smalltalk.method({
  877. selector: "scope:",
  878. fn: function (aScope){
  879. var self=this;
  880. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  881. _st(aScope)._instruction_(self);
  882. return self}, self, "scope:", [aScope], smalltalk.IRMethod)}
  883. }),
  884. smalltalk.IRMethod);
  885. smalltalk.addMethod(
  886. "_selector",
  887. smalltalk.method({
  888. selector: "selector",
  889. fn: function (){
  890. var self=this;
  891. return smalltalk.withContext(function($ctx1) { return self["@selector"];
  892. }, self, "selector", [], smalltalk.IRMethod)}
  893. }),
  894. smalltalk.IRMethod);
  895. smalltalk.addMethod(
  896. "_selector_",
  897. smalltalk.method({
  898. selector: "selector:",
  899. fn: function (aString){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  902. return self}, self, "selector:", [aString], smalltalk.IRMethod)}
  903. }),
  904. smalltalk.IRMethod);
  905. smalltalk.addMethod(
  906. "_source",
  907. smalltalk.method({
  908. selector: "source",
  909. fn: function (){
  910. var self=this;
  911. return smalltalk.withContext(function($ctx1) { return self["@source"];
  912. }, self, "source", [], smalltalk.IRMethod)}
  913. }),
  914. smalltalk.IRMethod);
  915. smalltalk.addMethod(
  916. "_source_",
  917. smalltalk.method({
  918. selector: "source:",
  919. fn: function (aString){
  920. var self=this;
  921. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  922. return self}, self, "source:", [aString], smalltalk.IRMethod)}
  923. }),
  924. smalltalk.IRMethod);
  925. smalltalk.addMethod(
  926. "_superSends",
  927. smalltalk.method({
  928. selector: "superSends",
  929. fn: function (){
  930. var self=this;
  931. return smalltalk.withContext(function($ctx1) { return self["@superSends"];
  932. }, self, "superSends", [], smalltalk.IRMethod)}
  933. }),
  934. smalltalk.IRMethod);
  935. smalltalk.addMethod(
  936. "_superSends_",
  937. smalltalk.method({
  938. selector: "superSends:",
  939. fn: function (aCollection){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  942. return self}, self, "superSends:", [aCollection], smalltalk.IRMethod)}
  943. }),
  944. smalltalk.IRMethod);
  945. smalltalk.addMethod(
  946. "_theClass",
  947. smalltalk.method({
  948. selector: "theClass",
  949. fn: function (){
  950. var self=this;
  951. return smalltalk.withContext(function($ctx1) { return self["@theClass"];
  952. }, self, "theClass", [], smalltalk.IRMethod)}
  953. }),
  954. smalltalk.IRMethod);
  955. smalltalk.addMethod(
  956. "_theClass_",
  957. smalltalk.method({
  958. selector: "theClass:",
  959. fn: function (aClass){
  960. var self=this;
  961. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  962. return self}, self, "theClass:", [aClass], smalltalk.IRMethod)}
  963. }),
  964. smalltalk.IRMethod);
  965. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  966. smalltalk.addMethod(
  967. "_accept_",
  968. smalltalk.method({
  969. selector: "accept:",
  970. fn: function (aVisitor){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) { var $1;
  973. $1=_st(aVisitor)._visitIRReturn_(self);
  974. return $1;
  975. }, self, "accept:", [aVisitor], smalltalk.IRReturn)}
  976. }),
  977. smalltalk.IRReturn);
  978. smalltalk.addMethod(
  979. "_canBeAssigned",
  980. smalltalk.method({
  981. selector: "canBeAssigned",
  982. fn: function (){
  983. var self=this;
  984. return smalltalk.withContext(function($ctx1) { return false;
  985. }, self, "canBeAssigned", [], smalltalk.IRReturn)}
  986. }),
  987. smalltalk.IRReturn);
  988. smalltalk.addMethod(
  989. "_isBlockReturn",
  990. smalltalk.method({
  991. selector: "isBlockReturn",
  992. fn: function (){
  993. var self=this;
  994. return smalltalk.withContext(function($ctx1) { return false;
  995. }, self, "isBlockReturn", [], smalltalk.IRReturn)}
  996. }),
  997. smalltalk.IRReturn);
  998. smalltalk.addMethod(
  999. "_isLocalReturn",
  1000. smalltalk.method({
  1001. selector: "isLocalReturn",
  1002. fn: function (){
  1003. var self=this;
  1004. return smalltalk.withContext(function($ctx1) { return true;
  1005. }, self, "isLocalReturn", [], smalltalk.IRReturn)}
  1006. }),
  1007. smalltalk.IRReturn);
  1008. smalltalk.addMethod(
  1009. "_isNonLocalReturn",
  1010. smalltalk.method({
  1011. selector: "isNonLocalReturn",
  1012. fn: function (){
  1013. var self=this;
  1014. return smalltalk.withContext(function($ctx1) { var $1;
  1015. $1=_st(_st(self)._isLocalReturn())._not();
  1016. return $1;
  1017. }, self, "isNonLocalReturn", [], smalltalk.IRReturn)}
  1018. }),
  1019. smalltalk.IRReturn);
  1020. smalltalk.addMethod(
  1021. "_isReturn",
  1022. smalltalk.method({
  1023. selector: "isReturn",
  1024. fn: function (){
  1025. var self=this;
  1026. return smalltalk.withContext(function($ctx1) { return true;
  1027. }, self, "isReturn", [], smalltalk.IRReturn)}
  1028. }),
  1029. smalltalk.IRReturn);
  1030. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1031. smalltalk.addMethod(
  1032. "_accept_",
  1033. smalltalk.method({
  1034. selector: "accept:",
  1035. fn: function (aVisitor){
  1036. var self=this;
  1037. return smalltalk.withContext(function($ctx1) { var $1;
  1038. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1039. return $1;
  1040. }, self, "accept:", [aVisitor], smalltalk.IRBlockReturn)}
  1041. }),
  1042. smalltalk.IRBlockReturn);
  1043. smalltalk.addMethod(
  1044. "_isBlockReturn",
  1045. smalltalk.method({
  1046. selector: "isBlockReturn",
  1047. fn: function (){
  1048. var self=this;
  1049. return smalltalk.withContext(function($ctx1) { return true;
  1050. }, self, "isBlockReturn", [], smalltalk.IRBlockReturn)}
  1051. }),
  1052. smalltalk.IRBlockReturn);
  1053. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1054. smalltalk.addMethod(
  1055. "_accept_",
  1056. smalltalk.method({
  1057. selector: "accept:",
  1058. fn: function (aVisitor){
  1059. var self=this;
  1060. return smalltalk.withContext(function($ctx1) { var $1;
  1061. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1062. return $1;
  1063. }, self, "accept:", [aVisitor], smalltalk.IRNonLocalReturn)}
  1064. }),
  1065. smalltalk.IRNonLocalReturn);
  1066. smalltalk.addMethod(
  1067. "_isLocalReturn",
  1068. smalltalk.method({
  1069. selector: "isLocalReturn",
  1070. fn: function (){
  1071. var self=this;
  1072. return smalltalk.withContext(function($ctx1) { return false;
  1073. }, self, "isLocalReturn", [], smalltalk.IRNonLocalReturn)}
  1074. }),
  1075. smalltalk.IRNonLocalReturn);
  1076. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1077. smalltalk.addMethod(
  1078. "_accept_",
  1079. smalltalk.method({
  1080. selector: "accept:",
  1081. fn: function (aVisitor){
  1082. var self=this;
  1083. return smalltalk.withContext(function($ctx1) { var $1;
  1084. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1085. return $1;
  1086. }, self, "accept:", [aVisitor], smalltalk.IRTempDeclaration)}
  1087. }),
  1088. smalltalk.IRTempDeclaration);
  1089. smalltalk.addMethod(
  1090. "_name",
  1091. smalltalk.method({
  1092. selector: "name",
  1093. fn: function (){
  1094. var self=this;
  1095. return smalltalk.withContext(function($ctx1) { return self["@name"];
  1096. }, self, "name", [], smalltalk.IRTempDeclaration)}
  1097. }),
  1098. smalltalk.IRTempDeclaration);
  1099. smalltalk.addMethod(
  1100. "_name_",
  1101. smalltalk.method({
  1102. selector: "name:",
  1103. fn: function (aString){
  1104. var self=this;
  1105. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  1106. return self}, self, "name:", [aString], smalltalk.IRTempDeclaration)}
  1107. }),
  1108. smalltalk.IRTempDeclaration);
  1109. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1110. smalltalk.addMethod(
  1111. "_accept_",
  1112. smalltalk.method({
  1113. selector: "accept:",
  1114. fn: function (aVisitor){
  1115. var self=this;
  1116. return smalltalk.withContext(function($ctx1) { var $1;
  1117. $1=_st(aVisitor)._visitIRSend_(self);
  1118. return $1;
  1119. }, self, "accept:", [aVisitor], smalltalk.IRSend)}
  1120. }),
  1121. smalltalk.IRSend);
  1122. smalltalk.addMethod(
  1123. "_classSend",
  1124. smalltalk.method({
  1125. selector: "classSend",
  1126. fn: function (){
  1127. var self=this;
  1128. return smalltalk.withContext(function($ctx1) { return self["@classSend"];
  1129. }, self, "classSend", [], smalltalk.IRSend)}
  1130. }),
  1131. smalltalk.IRSend);
  1132. smalltalk.addMethod(
  1133. "_classSend_",
  1134. smalltalk.method({
  1135. selector: "classSend:",
  1136. fn: function (aClass){
  1137. var self=this;
  1138. return smalltalk.withContext(function($ctx1) { self["@classSend"]=aClass;
  1139. return self}, self, "classSend:", [aClass], smalltalk.IRSend)}
  1140. }),
  1141. smalltalk.IRSend);
  1142. smalltalk.addMethod(
  1143. "_index",
  1144. smalltalk.method({
  1145. selector: "index",
  1146. fn: function (){
  1147. var self=this;
  1148. return smalltalk.withContext(function($ctx1) { return self["@index"];
  1149. }, self, "index", [], smalltalk.IRSend)}
  1150. }),
  1151. smalltalk.IRSend);
  1152. smalltalk.addMethod(
  1153. "_index_",
  1154. smalltalk.method({
  1155. selector: "index:",
  1156. fn: function (anInteger){
  1157. var self=this;
  1158. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  1159. return self}, self, "index:", [anInteger], smalltalk.IRSend)}
  1160. }),
  1161. smalltalk.IRSend);
  1162. smalltalk.addMethod(
  1163. "_isSend",
  1164. smalltalk.method({
  1165. selector: "isSend",
  1166. fn: function (){
  1167. var self=this;
  1168. return smalltalk.withContext(function($ctx1) { return true;
  1169. }, self, "isSend", [], smalltalk.IRSend)}
  1170. }),
  1171. smalltalk.IRSend);
  1172. smalltalk.addMethod(
  1173. "_javascriptSelector",
  1174. smalltalk.method({
  1175. selector: "javascriptSelector",
  1176. fn: function (){
  1177. var self=this;
  1178. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1179. $2=_st(self)._classSend();
  1180. if(($receiver = $2) == nil || $receiver == undefined){
  1181. $1=_st(_st(self)._selector())._asSelector();
  1182. } else {
  1183. $1=_st(_st(self)._selector())._asSuperSelector();
  1184. };
  1185. return $1;
  1186. }, self, "javascriptSelector", [], smalltalk.IRSend)}
  1187. }),
  1188. smalltalk.IRSend);
  1189. smalltalk.addMethod(
  1190. "_selector",
  1191. smalltalk.method({
  1192. selector: "selector",
  1193. fn: function (){
  1194. var self=this;
  1195. return smalltalk.withContext(function($ctx1) { return self["@selector"];
  1196. }, self, "selector", [], smalltalk.IRSend)}
  1197. }),
  1198. smalltalk.IRSend);
  1199. smalltalk.addMethod(
  1200. "_selector_",
  1201. smalltalk.method({
  1202. selector: "selector:",
  1203. fn: function (aString){
  1204. var self=this;
  1205. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1206. return self}, self, "selector:", [aString], smalltalk.IRSend)}
  1207. }),
  1208. smalltalk.IRSend);
  1209. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1210. smalltalk.addMethod(
  1211. "_accept_",
  1212. smalltalk.method({
  1213. selector: "accept:",
  1214. fn: function (aVisitor){
  1215. var self=this;
  1216. return smalltalk.withContext(function($ctx1) { var $1;
  1217. $1=_st(aVisitor)._visitIRSequence_(self);
  1218. return $1;
  1219. }, self, "accept:", [aVisitor], smalltalk.IRSequence)}
  1220. }),
  1221. smalltalk.IRSequence);
  1222. smalltalk.addMethod(
  1223. "_isSequence",
  1224. smalltalk.method({
  1225. selector: "isSequence",
  1226. fn: function (){
  1227. var self=this;
  1228. return smalltalk.withContext(function($ctx1) { return true;
  1229. }, self, "isSequence", [], smalltalk.IRSequence)}
  1230. }),
  1231. smalltalk.IRSequence);
  1232. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1233. smalltalk.addMethod(
  1234. "_accept_",
  1235. smalltalk.method({
  1236. selector: "accept:",
  1237. fn: function (aVisitor){
  1238. var self=this;
  1239. return smalltalk.withContext(function($ctx1) { var $1;
  1240. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1241. return $1;
  1242. }, self, "accept:", [aVisitor], smalltalk.IRBlockSequence)}
  1243. }),
  1244. smalltalk.IRBlockSequence);
  1245. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1246. smalltalk.addMethod(
  1247. "_accept_",
  1248. smalltalk.method({
  1249. selector: "accept:",
  1250. fn: function (aVisitor){
  1251. var self=this;
  1252. return smalltalk.withContext(function($ctx1) { var $1;
  1253. $1=_st(aVisitor)._visitIRValue_(self);
  1254. return $1;
  1255. }, self, "accept:", [aVisitor], smalltalk.IRValue)}
  1256. }),
  1257. smalltalk.IRValue);
  1258. smalltalk.addMethod(
  1259. "_value",
  1260. smalltalk.method({
  1261. selector: "value",
  1262. fn: function (){
  1263. var self=this;
  1264. return smalltalk.withContext(function($ctx1) { return self["@value"];
  1265. }, self, "value", [], smalltalk.IRValue)}
  1266. }),
  1267. smalltalk.IRValue);
  1268. smalltalk.addMethod(
  1269. "_value_",
  1270. smalltalk.method({
  1271. selector: "value:",
  1272. fn: function (aString){
  1273. var self=this;
  1274. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  1275. return self}, self, "value:", [aString], smalltalk.IRValue)}
  1276. }),
  1277. smalltalk.IRValue);
  1278. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1279. smalltalk.addMethod(
  1280. "_accept_",
  1281. smalltalk.method({
  1282. selector: "accept:",
  1283. fn: function (aVisitor){
  1284. var self=this;
  1285. return smalltalk.withContext(function($ctx1) { var $1;
  1286. $1=_st(aVisitor)._visitIRVariable_(self);
  1287. return $1;
  1288. }, self, "accept:", [aVisitor], smalltalk.IRVariable)}
  1289. }),
  1290. smalltalk.IRVariable);
  1291. smalltalk.addMethod(
  1292. "_isVariable",
  1293. smalltalk.method({
  1294. selector: "isVariable",
  1295. fn: function (){
  1296. var self=this;
  1297. return smalltalk.withContext(function($ctx1) { return true;
  1298. }, self, "isVariable", [], smalltalk.IRVariable)}
  1299. }),
  1300. smalltalk.IRVariable);
  1301. smalltalk.addMethod(
  1302. "_variable",
  1303. smalltalk.method({
  1304. selector: "variable",
  1305. fn: function (){
  1306. var self=this;
  1307. return smalltalk.withContext(function($ctx1) { return self["@variable"];
  1308. }, self, "variable", [], smalltalk.IRVariable)}
  1309. }),
  1310. smalltalk.IRVariable);
  1311. smalltalk.addMethod(
  1312. "_variable_",
  1313. smalltalk.method({
  1314. selector: "variable:",
  1315. fn: function (aScopeVariable){
  1316. var self=this;
  1317. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  1318. return self}, self, "variable:", [aScopeVariable], smalltalk.IRVariable)}
  1319. }),
  1320. smalltalk.IRVariable);
  1321. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1322. smalltalk.addMethod(
  1323. "_accept_",
  1324. smalltalk.method({
  1325. selector: "accept:",
  1326. fn: function (aVisitor){
  1327. var self=this;
  1328. return smalltalk.withContext(function($ctx1) { var $1;
  1329. $1=_st(aVisitor)._visitIRVerbatim_(self);
  1330. return $1;
  1331. }, self, "accept:", [aVisitor], smalltalk.IRVerbatim)}
  1332. }),
  1333. smalltalk.IRVerbatim);
  1334. smalltalk.addMethod(
  1335. "_source",
  1336. smalltalk.method({
  1337. selector: "source",
  1338. fn: function (){
  1339. var self=this;
  1340. return smalltalk.withContext(function($ctx1) { return self["@source"];
  1341. }, self, "source", [], smalltalk.IRVerbatim)}
  1342. }),
  1343. smalltalk.IRVerbatim);
  1344. smalltalk.addMethod(
  1345. "_source_",
  1346. smalltalk.method({
  1347. selector: "source:",
  1348. fn: function (aString){
  1349. var self=this;
  1350. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1351. return self}, self, "source:", [aString], smalltalk.IRVerbatim)}
  1352. }),
  1353. smalltalk.IRVerbatim);
  1354. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  1355. smalltalk.addMethod(
  1356. "_visit_",
  1357. smalltalk.method({
  1358. selector: "visit:",
  1359. fn: function (anIRInstruction){
  1360. var self=this;
  1361. return smalltalk.withContext(function($ctx1) { var $1;
  1362. $1=_st(anIRInstruction)._accept_(self);
  1363. return $1;
  1364. }, self, "visit:", [anIRInstruction], smalltalk.IRVisitor)}
  1365. }),
  1366. smalltalk.IRVisitor);
  1367. smalltalk.addMethod(
  1368. "_visitIRAssignment_",
  1369. smalltalk.method({
  1370. selector: "visitIRAssignment:",
  1371. fn: function (anIRAssignment){
  1372. var self=this;
  1373. return smalltalk.withContext(function($ctx1) { var $1;
  1374. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  1375. return $1;
  1376. }, self, "visitIRAssignment:", [anIRAssignment], smalltalk.IRVisitor)}
  1377. }),
  1378. smalltalk.IRVisitor);
  1379. smalltalk.addMethod(
  1380. "_visitIRBlockReturn_",
  1381. smalltalk.method({
  1382. selector: "visitIRBlockReturn:",
  1383. fn: function (anIRBlockReturn){
  1384. var self=this;
  1385. return smalltalk.withContext(function($ctx1) { var $1;
  1386. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  1387. return $1;
  1388. }, self, "visitIRBlockReturn:", [anIRBlockReturn], smalltalk.IRVisitor)}
  1389. }),
  1390. smalltalk.IRVisitor);
  1391. smalltalk.addMethod(
  1392. "_visitIRBlockSequence_",
  1393. smalltalk.method({
  1394. selector: "visitIRBlockSequence:",
  1395. fn: function (anIRBlockSequence){
  1396. var self=this;
  1397. return smalltalk.withContext(function($ctx1) { var $1;
  1398. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  1399. return $1;
  1400. }, self, "visitIRBlockSequence:", [anIRBlockSequence], smalltalk.IRVisitor)}
  1401. }),
  1402. smalltalk.IRVisitor);
  1403. smalltalk.addMethod(
  1404. "_visitIRClosure_",
  1405. smalltalk.method({
  1406. selector: "visitIRClosure:",
  1407. fn: function (anIRClosure){
  1408. var self=this;
  1409. return smalltalk.withContext(function($ctx1) { var $1;
  1410. $1=_st(self)._visitIRInstruction_(anIRClosure);
  1411. return $1;
  1412. }, self, "visitIRClosure:", [anIRClosure], smalltalk.IRVisitor)}
  1413. }),
  1414. smalltalk.IRVisitor);
  1415. smalltalk.addMethod(
  1416. "_visitIRDynamicArray_",
  1417. smalltalk.method({
  1418. selector: "visitIRDynamicArray:",
  1419. fn: function (anIRDynamicArray){
  1420. var self=this;
  1421. return smalltalk.withContext(function($ctx1) { var $1;
  1422. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  1423. return $1;
  1424. }, self, "visitIRDynamicArray:", [anIRDynamicArray], smalltalk.IRVisitor)}
  1425. }),
  1426. smalltalk.IRVisitor);
  1427. smalltalk.addMethod(
  1428. "_visitIRDynamicDictionary_",
  1429. smalltalk.method({
  1430. selector: "visitIRDynamicDictionary:",
  1431. fn: function (anIRDynamicDictionary){
  1432. var self=this;
  1433. return smalltalk.withContext(function($ctx1) { var $1;
  1434. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  1435. return $1;
  1436. }, self, "visitIRDynamicDictionary:", [anIRDynamicDictionary], smalltalk.IRVisitor)}
  1437. }),
  1438. smalltalk.IRVisitor);
  1439. smalltalk.addMethod(
  1440. "_visitIRInlinedClosure_",
  1441. smalltalk.method({
  1442. selector: "visitIRInlinedClosure:",
  1443. fn: function (anIRInlinedClosure){
  1444. var self=this;
  1445. return smalltalk.withContext(function($ctx1) { var $1;
  1446. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  1447. return $1;
  1448. }, self, "visitIRInlinedClosure:", [anIRInlinedClosure], smalltalk.IRVisitor)}
  1449. }),
  1450. smalltalk.IRVisitor);
  1451. smalltalk.addMethod(
  1452. "_visitIRInlinedSequence_",
  1453. smalltalk.method({
  1454. selector: "visitIRInlinedSequence:",
  1455. fn: function (anIRInlinedSequence){
  1456. var self=this;
  1457. return smalltalk.withContext(function($ctx1) { var $1;
  1458. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  1459. return $1;
  1460. }, self, "visitIRInlinedSequence:", [anIRInlinedSequence], smalltalk.IRVisitor)}
  1461. }),
  1462. smalltalk.IRVisitor);
  1463. smalltalk.addMethod(
  1464. "_visitIRInstruction_",
  1465. smalltalk.method({
  1466. selector: "visitIRInstruction:",
  1467. fn: function (anIRInstruction){
  1468. var self=this;
  1469. return smalltalk.withContext(function($ctx1) { _st(_st(anIRInstruction)._instructions())._do_((function(each){
  1470. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1471. })}));
  1472. return anIRInstruction;
  1473. }, self, "visitIRInstruction:", [anIRInstruction], smalltalk.IRVisitor)}
  1474. }),
  1475. smalltalk.IRVisitor);
  1476. smalltalk.addMethod(
  1477. "_visitIRMethod_",
  1478. smalltalk.method({
  1479. selector: "visitIRMethod:",
  1480. fn: function (anIRMethod){
  1481. var self=this;
  1482. return smalltalk.withContext(function($ctx1) { var $1;
  1483. $1=_st(self)._visitIRInstruction_(anIRMethod);
  1484. return $1;
  1485. }, self, "visitIRMethod:", [anIRMethod], smalltalk.IRVisitor)}
  1486. }),
  1487. smalltalk.IRVisitor);
  1488. smalltalk.addMethod(
  1489. "_visitIRNonLocalReturn_",
  1490. smalltalk.method({
  1491. selector: "visitIRNonLocalReturn:",
  1492. fn: function (anIRNonLocalReturn){
  1493. var self=this;
  1494. return smalltalk.withContext(function($ctx1) { var $1;
  1495. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  1496. return $1;
  1497. }, self, "visitIRNonLocalReturn:", [anIRNonLocalReturn], smalltalk.IRVisitor)}
  1498. }),
  1499. smalltalk.IRVisitor);
  1500. smalltalk.addMethod(
  1501. "_visitIRNonLocalReturnHandling_",
  1502. smalltalk.method({
  1503. selector: "visitIRNonLocalReturnHandling:",
  1504. fn: function (anIRNonLocalReturnHandling){
  1505. var self=this;
  1506. return smalltalk.withContext(function($ctx1) { var $1;
  1507. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  1508. return $1;
  1509. }, self, "visitIRNonLocalReturnHandling:", [anIRNonLocalReturnHandling], smalltalk.IRVisitor)}
  1510. }),
  1511. smalltalk.IRVisitor);
  1512. smalltalk.addMethod(
  1513. "_visitIRReturn_",
  1514. smalltalk.method({
  1515. selector: "visitIRReturn:",
  1516. fn: function (anIRReturn){
  1517. var self=this;
  1518. return smalltalk.withContext(function($ctx1) { var $1;
  1519. $1=_st(self)._visitIRInstruction_(anIRReturn);
  1520. return $1;
  1521. }, self, "visitIRReturn:", [anIRReturn], smalltalk.IRVisitor)}
  1522. }),
  1523. smalltalk.IRVisitor);
  1524. smalltalk.addMethod(
  1525. "_visitIRSend_",
  1526. smalltalk.method({
  1527. selector: "visitIRSend:",
  1528. fn: function (anIRSend){
  1529. var self=this;
  1530. return smalltalk.withContext(function($ctx1) { var $1;
  1531. $1=_st(self)._visitIRInstruction_(anIRSend);
  1532. return $1;
  1533. }, self, "visitIRSend:", [anIRSend], smalltalk.IRVisitor)}
  1534. }),
  1535. smalltalk.IRVisitor);
  1536. smalltalk.addMethod(
  1537. "_visitIRSequence_",
  1538. smalltalk.method({
  1539. selector: "visitIRSequence:",
  1540. fn: function (anIRSequence){
  1541. var self=this;
  1542. return smalltalk.withContext(function($ctx1) { var $1;
  1543. $1=_st(self)._visitIRInstruction_(anIRSequence);
  1544. return $1;
  1545. }, self, "visitIRSequence:", [anIRSequence], smalltalk.IRVisitor)}
  1546. }),
  1547. smalltalk.IRVisitor);
  1548. smalltalk.addMethod(
  1549. "_visitIRTempDeclaration_",
  1550. smalltalk.method({
  1551. selector: "visitIRTempDeclaration:",
  1552. fn: function (anIRTempDeclaration){
  1553. var self=this;
  1554. return smalltalk.withContext(function($ctx1) { var $1;
  1555. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  1556. return $1;
  1557. }, self, "visitIRTempDeclaration:", [anIRTempDeclaration], smalltalk.IRVisitor)}
  1558. }),
  1559. smalltalk.IRVisitor);
  1560. smalltalk.addMethod(
  1561. "_visitIRValue_",
  1562. smalltalk.method({
  1563. selector: "visitIRValue:",
  1564. fn: function (anIRValue){
  1565. var self=this;
  1566. return smalltalk.withContext(function($ctx1) { var $1;
  1567. $1=_st(self)._visitIRInstruction_(anIRValue);
  1568. return $1;
  1569. }, self, "visitIRValue:", [anIRValue], smalltalk.IRVisitor)}
  1570. }),
  1571. smalltalk.IRVisitor);
  1572. smalltalk.addMethod(
  1573. "_visitIRVariable_",
  1574. smalltalk.method({
  1575. selector: "visitIRVariable:",
  1576. fn: function (anIRVariable){
  1577. var self=this;
  1578. return smalltalk.withContext(function($ctx1) { var $1;
  1579. $1=_st(self)._visitIRInstruction_(anIRVariable);
  1580. return $1;
  1581. }, self, "visitIRVariable:", [anIRVariable], smalltalk.IRVisitor)}
  1582. }),
  1583. smalltalk.IRVisitor);
  1584. smalltalk.addMethod(
  1585. "_visitIRVerbatim_",
  1586. smalltalk.method({
  1587. selector: "visitIRVerbatim:",
  1588. fn: function (anIRVerbatim){
  1589. var self=this;
  1590. return smalltalk.withContext(function($ctx1) { var $1;
  1591. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  1592. return $1;
  1593. }, self, "visitIRVerbatim:", [anIRVerbatim], smalltalk.IRVisitor)}
  1594. }),
  1595. smalltalk.IRVisitor);
  1596. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  1597. smalltalk.addMethod(
  1598. "_contents",
  1599. smalltalk.method({
  1600. selector: "contents",
  1601. fn: function (){
  1602. var self=this;
  1603. return smalltalk.withContext(function($ctx1) { var $1;
  1604. $1=_st(_st(self)._stream())._contents();
  1605. return $1;
  1606. }, self, "contents", [], smalltalk.IRJSTranslator)}
  1607. }),
  1608. smalltalk.IRJSTranslator);
  1609. smalltalk.addMethod(
  1610. "_initialize",
  1611. smalltalk.method({
  1612. selector: "initialize",
  1613. fn: function (){
  1614. var self=this;
  1615. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  1616. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  1617. return self}, self, "initialize", [], smalltalk.IRJSTranslator)}
  1618. }),
  1619. smalltalk.IRJSTranslator);
  1620. smalltalk.addMethod(
  1621. "_stream",
  1622. smalltalk.method({
  1623. selector: "stream",
  1624. fn: function (){
  1625. var self=this;
  1626. return smalltalk.withContext(function($ctx1) { return self["@stream"];
  1627. }, self, "stream", [], smalltalk.IRJSTranslator)}
  1628. }),
  1629. smalltalk.IRJSTranslator);
  1630. smalltalk.addMethod(
  1631. "_stream_",
  1632. smalltalk.method({
  1633. selector: "stream:",
  1634. fn: function (aStream){
  1635. var self=this;
  1636. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  1637. return self}, self, "stream:", [aStream], smalltalk.IRJSTranslator)}
  1638. }),
  1639. smalltalk.IRJSTranslator);
  1640. smalltalk.addMethod(
  1641. "_visitIRAssignment_",
  1642. smalltalk.method({
  1643. selector: "visitIRAssignment:",
  1644. fn: function (anIRAssignment){
  1645. var self=this;
  1646. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  1647. _st(_st(self)._stream())._nextPutAssignment();
  1648. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  1649. return self}, self, "visitIRAssignment:", [anIRAssignment], smalltalk.IRJSTranslator)}
  1650. }),
  1651. smalltalk.IRJSTranslator);
  1652. smalltalk.addMethod(
  1653. "_visitIRClosure_",
  1654. smalltalk.method({
  1655. selector: "visitIRClosure:",
  1656. fn: function (anIRClosure){
  1657. var self=this;
  1658. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  1659. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  1660. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  1661. })}));
  1662. })}),_st(anIRClosure)._arguments());
  1663. return self}, self, "visitIRClosure:", [anIRClosure], smalltalk.IRJSTranslator)}
  1664. }),
  1665. smalltalk.IRJSTranslator);
  1666. smalltalk.addMethod(
  1667. "_visitIRDynamicArray_",
  1668. smalltalk.method({
  1669. selector: "visitIRDynamicArray:",
  1670. fn: function (anIRDynamicArray){
  1671. var self=this;
  1672. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  1673. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  1674. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1675. })}),(function(){
  1676. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1677. })}));
  1678. _st(self["@stream"])._nextPutAll_("]");
  1679. return self}, self, "visitIRDynamicArray:", [anIRDynamicArray], smalltalk.IRJSTranslator)}
  1680. }),
  1681. smalltalk.IRJSTranslator);
  1682. smalltalk.addMethod(
  1683. "_visitIRDynamicDictionary_",
  1684. smalltalk.method({
  1685. selector: "visitIRDynamicDictionary:",
  1686. fn: function (anIRDynamicDictionary){
  1687. var self=this;
  1688. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  1689. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  1690. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1691. })}),(function(){
  1692. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1693. })}));
  1694. _st(_st(self)._stream())._nextPutAll_("])");
  1695. return self}, self, "visitIRDynamicDictionary:", [anIRDynamicDictionary], smalltalk.IRJSTranslator)}
  1696. }),
  1697. smalltalk.IRJSTranslator);
  1698. smalltalk.addMethod(
  1699. "_visitIRMethod_",
  1700. smalltalk.method({
  1701. selector: "visitIRMethod:",
  1702. fn: function (anIRMethod){
  1703. var self=this;
  1704. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1705. _st(_st(self)._stream())._nextPutMethodDeclaration_with_(anIRMethod,(function(){
  1706. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutFunctionWith_arguments_((function(){
  1707. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutContextFor_during_(anIRMethod,(function(){
  1708. return smalltalk.withContext(function($ctx4) { $1=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  1709. if(smalltalk.assert($1)){
  1710. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  1711. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  1712. })})));
  1713. };
  1714. $2=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  1715. if(smalltalk.assert($2)){
  1716. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  1717. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1718. })}));
  1719. } else {
  1720. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1721. };
  1722. })}));
  1723. })}),_st(anIRMethod)._arguments());
  1724. })}));
  1725. return self}, self, "visitIRMethod:", [anIRMethod], smalltalk.IRJSTranslator)}
  1726. }),
  1727. smalltalk.IRJSTranslator);
  1728. smalltalk.addMethod(
  1729. "_visitIRNonLocalReturn_",
  1730. smalltalk.method({
  1731. selector: "visitIRNonLocalReturn:",
  1732. fn: function (anIRNonLocalReturn){
  1733. var self=this;
  1734. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  1735. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  1736. })}));
  1737. return self}, self, "visitIRNonLocalReturn:", [anIRNonLocalReturn], smalltalk.IRJSTranslator)}
  1738. }),
  1739. smalltalk.IRJSTranslator);
  1740. smalltalk.addMethod(
  1741. "_visitIRReturn_",
  1742. smalltalk.method({
  1743. selector: "visitIRReturn:",
  1744. fn: function (anIRReturn){
  1745. var self=this;
  1746. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  1747. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  1748. })}));
  1749. return self}, self, "visitIRReturn:", [anIRReturn], smalltalk.IRJSTranslator)}
  1750. }),
  1751. smalltalk.IRJSTranslator);
  1752. smalltalk.addMethod(
  1753. "_visitIRSend_",
  1754. smalltalk.method({
  1755. selector: "visitIRSend:",
  1756. fn: function (anIRSend){
  1757. var self=this;
  1758. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  1759. $1=_st(anIRSend)._classSend();
  1760. if(($receiver = $1) == nil || $receiver == undefined){
  1761. _st(_st(self)._stream())._nextPutAll_("_st(");
  1762. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  1763. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  1764. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  1765. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1766. })}),(function(){
  1767. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1768. })}));
  1769. _st(_st(self)._stream())._nextPutAll_(")");
  1770. } else {
  1771. $2=_st(self)._stream();
  1772. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  1773. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  1774. $3=_st($2)._nextPutAll_("_st(");
  1775. $3;
  1776. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  1777. _st(_st(self)._stream())._nextPutAll_("), [");
  1778. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  1779. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1780. })}),(function(){
  1781. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1782. })}));
  1783. _st(_st(self)._stream())._nextPutAll_("])");
  1784. };
  1785. return self}, self, "visitIRSend:", [anIRSend], smalltalk.IRJSTranslator)}
  1786. }),
  1787. smalltalk.IRJSTranslator);
  1788. smalltalk.addMethod(
  1789. "_visitIRSequence_",
  1790. smalltalk.method({
  1791. selector: "visitIRSequence:",
  1792. fn: function (anIRSequence){
  1793. var self=this;
  1794. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  1795. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  1796. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  1797. })}));
  1798. })}));
  1799. return self}, self, "visitIRSequence:", [anIRSequence], smalltalk.IRJSTranslator)}
  1800. }),
  1801. smalltalk.IRJSTranslator);
  1802. smalltalk.addMethod(
  1803. "_visitIRTempDeclaration_",
  1804. smalltalk.method({
  1805. selector: "visitIRTempDeclaration:",
  1806. fn: function (anIRTempDeclaration){
  1807. var self=this;
  1808. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1809. $1=_st(self)._stream();
  1810. _st($1)._nextPutAll_(_st(_st(_st(_st(_st(anIRTempDeclaration)._scope())._alias()).__comma(".locals.")).__comma(_st(anIRTempDeclaration)._name())).__comma("=nil;"));
  1811. $2=_st($1)._lf();
  1812. return self}, self, "visitIRTempDeclaration:", [anIRTempDeclaration], smalltalk.IRJSTranslator)}
  1813. }),
  1814. smalltalk.IRJSTranslator);
  1815. smalltalk.addMethod(
  1816. "_visitIRValue_",
  1817. smalltalk.method({
  1818. selector: "visitIRValue:",
  1819. fn: function (anIRValue){
  1820. var self=this;
  1821. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  1822. return self}, self, "visitIRValue:", [anIRValue], smalltalk.IRJSTranslator)}
  1823. }),
  1824. smalltalk.IRJSTranslator);
  1825. smalltalk.addMethod(
  1826. "_visitIRVariable_",
  1827. smalltalk.method({
  1828. selector: "visitIRVariable:",
  1829. fn: function (anIRVariable){
  1830. var self=this;
  1831. return smalltalk.withContext(function($ctx1) { var $1;
  1832. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  1833. if(smalltalk.assert($1)){
  1834. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  1835. } else {
  1836. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  1837. };
  1838. return self}, self, "visitIRVariable:", [anIRVariable], smalltalk.IRJSTranslator)}
  1839. }),
  1840. smalltalk.IRJSTranslator);
  1841. smalltalk.addMethod(
  1842. "_visitIRVerbatim_",
  1843. smalltalk.method({
  1844. selector: "visitIRVerbatim:",
  1845. fn: function (anIRVerbatim){
  1846. var self=this;
  1847. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  1848. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  1849. })}));
  1850. return self}, self, "visitIRVerbatim:", [anIRVerbatim], smalltalk.IRJSTranslator)}
  1851. }),
  1852. smalltalk.IRJSTranslator);
  1853. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  1854. smalltalk.addMethod(
  1855. "_contents",
  1856. smalltalk.method({
  1857. selector: "contents",
  1858. fn: function (){
  1859. var self=this;
  1860. return smalltalk.withContext(function($ctx1) { var $1;
  1861. $1=_st(self["@stream"])._contents();
  1862. return $1;
  1863. }, self, "contents", [], smalltalk.JSStream)}
  1864. }),
  1865. smalltalk.JSStream);
  1866. smalltalk.addMethod(
  1867. "_initialize",
  1868. smalltalk.method({
  1869. selector: "initialize",
  1870. fn: function (){
  1871. var self=this;
  1872. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  1873. self["@stream"]=_st("")._writeStream();
  1874. return self}, self, "initialize", [], smalltalk.JSStream)}
  1875. }),
  1876. smalltalk.JSStream);
  1877. smalltalk.addMethod(
  1878. "_lf",
  1879. smalltalk.method({
  1880. selector: "lf",
  1881. fn: function (){
  1882. var self=this;
  1883. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  1884. return self}, self, "lf", [], smalltalk.JSStream)}
  1885. }),
  1886. smalltalk.JSStream);
  1887. smalltalk.addMethod(
  1888. "_nextPut_",
  1889. smalltalk.method({
  1890. selector: "nextPut:",
  1891. fn: function (aString){
  1892. var self=this;
  1893. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  1894. return self}, self, "nextPut:", [aString], smalltalk.JSStream)}
  1895. }),
  1896. smalltalk.JSStream);
  1897. smalltalk.addMethod(
  1898. "_nextPutAll_",
  1899. smalltalk.method({
  1900. selector: "nextPutAll:",
  1901. fn: function (aString){
  1902. var self=this;
  1903. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  1904. return self}, self, "nextPutAll:", [aString], smalltalk.JSStream)}
  1905. }),
  1906. smalltalk.JSStream);
  1907. smalltalk.addMethod(
  1908. "_nextPutAssignment",
  1909. smalltalk.method({
  1910. selector: "nextPutAssignment",
  1911. fn: function (){
  1912. var self=this;
  1913. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  1914. return self}, self, "nextPutAssignment", [], smalltalk.JSStream)}
  1915. }),
  1916. smalltalk.JSStream);
  1917. smalltalk.addMethod(
  1918. "_nextPutBlockContextFor_during_",
  1919. smalltalk.method({
  1920. selector: "nextPutBlockContextFor:during:",
  1921. fn: function (anIRClosure,aBlock){
  1922. var self=this;
  1923. return smalltalk.withContext(function($ctx1) { var $1;
  1924. _st(self)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") { "));
  1925. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._cr());
  1926. _st(aBlock)._value();
  1927. _st(self)._nextPutAll_("})");
  1928. return self}, self, "nextPutBlockContextFor:during:", [anIRClosure,aBlock], smalltalk.JSStream)}
  1929. }),
  1930. smalltalk.JSStream);
  1931. smalltalk.addMethod(
  1932. "_nextPutClosureWith_arguments_",
  1933. smalltalk.method({
  1934. selector: "nextPutClosureWith:arguments:",
  1935. fn: function (aBlock,anArray){
  1936. var self=this;
  1937. return smalltalk.withContext(function($ctx1) { var $1;
  1938. _st(self["@stream"])._nextPutAll_("(function(");
  1939. _st(anArray)._do_separatedBy_((function(each){
  1940. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  1941. })}),(function(){
  1942. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  1943. })}));
  1944. _st(self["@stream"])._nextPutAll_("){");
  1945. $1=_st(self["@stream"])._lf();
  1946. _st(aBlock)._value();
  1947. _st(self["@stream"])._nextPutAll_("})");
  1948. return self}, self, "nextPutClosureWith:arguments:", [aBlock,anArray], smalltalk.JSStream)}
  1949. }),
  1950. smalltalk.JSStream);
  1951. smalltalk.addMethod(
  1952. "_nextPutContextFor_during_",
  1953. smalltalk.method({
  1954. selector: "nextPutContextFor:during:",
  1955. fn: function (aMethod,aBlock){
  1956. var self=this;
  1957. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  1958. _st(self)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  1959. $1=_st(self)._nextPutAll_(_st((smalltalk.String || String))._cr());
  1960. _st(aBlock)._value();
  1961. _st(self)._nextPutAll_("}, self, ");
  1962. $2=_st(self)._nextPutAll_(_st(_st(_st(aMethod)._selector())._asJavascript()).__comma(", ["));
  1963. _st(_st(aMethod)._arguments())._do_separatedBy_((function(each){
  1964. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(_st(each)._asVariableName());
  1965. })}),(function(){
  1966. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  1967. })}));
  1968. _st(self)._nextPutAll_("], ");
  1969. _st(self)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  1970. $3=_st(self)._nextPutAll_(")");
  1971. return self}, self, "nextPutContextFor:during:", [aMethod,aBlock], smalltalk.JSStream)}
  1972. }),
  1973. smalltalk.JSStream);
  1974. smalltalk.addMethod(
  1975. "_nextPutFunctionWith_arguments_",
  1976. smalltalk.method({
  1977. selector: "nextPutFunctionWith:arguments:",
  1978. fn: function (aBlock,anArray){
  1979. var self=this;
  1980. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1981. _st(self["@stream"])._nextPutAll_("fn: function(");
  1982. _st(anArray)._do_separatedBy_((function(each){
  1983. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  1984. })}),(function(){
  1985. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  1986. })}));
  1987. _st(self["@stream"])._nextPutAll_("){");
  1988. $1=_st(self["@stream"])._lf();
  1989. _st(self["@stream"])._nextPutAll_("var self=this;");
  1990. $2=_st(self["@stream"])._lf();
  1991. _st(aBlock)._value();
  1992. _st(self["@stream"])._nextPutAll_("}");
  1993. return self}, self, "nextPutFunctionWith:arguments:", [aBlock,anArray], smalltalk.JSStream)}
  1994. }),
  1995. smalltalk.JSStream);
  1996. smalltalk.addMethod(
  1997. "_nextPutIf_with_",
  1998. smalltalk.method({
  1999. selector: "nextPutIf:with:",
  2000. fn: function (aBlock,anotherBlock){
  2001. var self=this;
  2002. return smalltalk.withContext(function($ctx1) { var $1;
  2003. _st(self["@stream"])._nextPutAll_("if(");
  2004. _st(aBlock)._value();
  2005. _st(self["@stream"])._nextPutAll_("){");
  2006. $1=_st(self["@stream"])._lf();
  2007. _st(anotherBlock)._value();
  2008. _st(self["@stream"])._nextPutAll_("}");
  2009. return self}, self, "nextPutIf:with:", [aBlock,anotherBlock], smalltalk.JSStream)}
  2010. }),
  2011. smalltalk.JSStream);
  2012. smalltalk.addMethod(
  2013. "_nextPutIfElse_with_with_",
  2014. smalltalk.method({
  2015. selector: "nextPutIfElse:with:with:",
  2016. fn: function (aBlock,ifBlock,elseBlock){
  2017. var self=this;
  2018. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2019. _st(self["@stream"])._nextPutAll_("if(");
  2020. _st(aBlock)._value();
  2021. _st(self["@stream"])._nextPutAll_("){");
  2022. $1=_st(self["@stream"])._lf();
  2023. _st(ifBlock)._value();
  2024. _st(self["@stream"])._nextPutAll_("} else {");
  2025. $2=_st(self["@stream"])._lf();
  2026. _st(elseBlock)._value();
  2027. _st(self["@stream"])._nextPutAll_("}");
  2028. return self}, self, "nextPutIfElse:with:with:", [aBlock,ifBlock,elseBlock], smalltalk.JSStream)}
  2029. }),
  2030. smalltalk.JSStream);
  2031. smalltalk.addMethod(
  2032. "_nextPutMethodDeclaration_with_",
  2033. smalltalk.method({
  2034. selector: "nextPutMethodDeclaration:with:",
  2035. fn: function (aMethod,aBlock){
  2036. var self=this;
  2037. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2038. _st(self["@stream"])._nextPutAll_("smalltalk.method({");
  2039. _st(self["@stream"])._lf();
  2040. _st(self["@stream"])._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  2041. _st(self["@stream"])._lf();
  2042. _st(self["@stream"])._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  2043. $1=_st(self["@stream"])._lf();
  2044. _st(aBlock)._value();
  2045. _st(self["@stream"])._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  2046. _st(self["@stream"])._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  2047. _st(self["@stream"])._lf();
  2048. _st(self["@stream"])._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  2049. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  2050. })})))._asArray())._asJavascript())).__comma(","));
  2051. _st(self["@stream"])._lf();
  2052. $2=_st(self["@stream"])._nextPutAll_("referencedClasses: [");
  2053. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  2054. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  2055. })}),(function(){
  2056. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  2057. })}));
  2058. _st(self["@stream"])._nextPutAll_("]");
  2059. $3=_st(self["@stream"])._nextPutAll_("})");
  2060. return self}, self, "nextPutMethodDeclaration:with:", [aMethod,aBlock], smalltalk.JSStream)}
  2061. }),
  2062. smalltalk.JSStream);
  2063. smalltalk.addMethod(
  2064. "_nextPutNonLocalReturnHandlingWith_",
  2065. smalltalk.method({
  2066. selector: "nextPutNonLocalReturnHandlingWith:",
  2067. fn: function (aBlock){
  2068. var self=this;
  2069. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2070. _st(self["@stream"])._nextPutAll_("var $early={};");
  2071. _st(self["@stream"])._lf();
  2072. _st(self["@stream"])._nextPutAll_("try {");
  2073. $1=_st(self["@stream"])._lf();
  2074. _st(aBlock)._value();
  2075. _st(self["@stream"])._nextPutAll_("}");
  2076. _st(self["@stream"])._lf();
  2077. _st(self["@stream"])._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  2078. $2=_st(self["@stream"])._lf();
  2079. return self}, self, "nextPutNonLocalReturnHandlingWith:", [aBlock], smalltalk.JSStream)}
  2080. }),
  2081. smalltalk.JSStream);
  2082. smalltalk.addMethod(
  2083. "_nextPutNonLocalReturnWith_",
  2084. smalltalk.method({
  2085. selector: "nextPutNonLocalReturnWith:",
  2086. fn: function (aBlock){
  2087. var self=this;
  2088. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  2089. _st(aBlock)._value();
  2090. _st(self["@stream"])._nextPutAll_("]");
  2091. return self}, self, "nextPutNonLocalReturnWith:", [aBlock], smalltalk.JSStream)}
  2092. }),
  2093. smalltalk.JSStream);
  2094. smalltalk.addMethod(
  2095. "_nextPutReturn",
  2096. smalltalk.method({
  2097. selector: "nextPutReturn",
  2098. fn: function (){
  2099. var self=this;
  2100. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  2101. return self}, self, "nextPutReturn", [], smalltalk.JSStream)}
  2102. }),
  2103. smalltalk.JSStream);
  2104. smalltalk.addMethod(
  2105. "_nextPutReturnWith_",
  2106. smalltalk.method({
  2107. selector: "nextPutReturnWith:",
  2108. fn: function (aBlock){
  2109. var self=this;
  2110. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  2111. _st(aBlock)._value();
  2112. return self}, self, "nextPutReturnWith:", [aBlock], smalltalk.JSStream)}
  2113. }),
  2114. smalltalk.JSStream);
  2115. smalltalk.addMethod(
  2116. "_nextPutSequenceWith_",
  2117. smalltalk.method({
  2118. selector: "nextPutSequenceWith:",
  2119. fn: function (aBlock){
  2120. var self=this;
  2121. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  2122. return self}, self, "nextPutSequenceWith:", [aBlock], smalltalk.JSStream)}
  2123. }),
  2124. smalltalk.JSStream);
  2125. smalltalk.addMethod(
  2126. "_nextPutStatement_with_",
  2127. smalltalk.method({
  2128. selector: "nextPutStatement:with:",
  2129. fn: function (anInteger,aBlock){
  2130. var self=this;
  2131. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2132. _st(self["@stream"])._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  2133. $1=_st(self["@stream"])._lf();
  2134. _st(self)._nextPutStatementWith_(aBlock);
  2135. _st(self["@stream"])._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  2136. $2=_st(self["@stream"])._lf();
  2137. return self}, self, "nextPutStatement:with:", [anInteger,aBlock], smalltalk.JSStream)}
  2138. }),
  2139. smalltalk.JSStream);
  2140. smalltalk.addMethod(
  2141. "_nextPutStatementWith_",
  2142. smalltalk.method({
  2143. selector: "nextPutStatementWith:",
  2144. fn: function (aBlock){
  2145. var self=this;
  2146. return smalltalk.withContext(function($ctx1) { var $1;
  2147. _st(aBlock)._value();
  2148. _st(self["@stream"])._nextPutAll_(";");
  2149. $1=_st(self["@stream"])._lf();
  2150. return self}, self, "nextPutStatementWith:", [aBlock], smalltalk.JSStream)}
  2151. }),
  2152. smalltalk.JSStream);
  2153. smalltalk.addMethod(
  2154. "_nextPutVar_",
  2155. smalltalk.method({
  2156. selector: "nextPutVar:",
  2157. fn: function (aString){
  2158. var self=this;
  2159. return smalltalk.withContext(function($ctx1) { var $1;
  2160. _st(self["@stream"])._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
  2161. $1=_st(self["@stream"])._lf();
  2162. return self}, self, "nextPutVar:", [aString], smalltalk.JSStream)}
  2163. }),
  2164. smalltalk.JSStream);
  2165. smalltalk.addMethod(
  2166. "_nextPutVars_",
  2167. smalltalk.method({
  2168. selector: "nextPutVars:",
  2169. fn: function (aCollection){
  2170. var self=this;
  2171. return smalltalk.withContext(function($ctx1) { var $1;
  2172. _st(self["@stream"])._nextPutAll_("var ");
  2173. _st(aCollection)._do_separatedBy_((function(each){
  2174. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  2175. })}),(function(){
  2176. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  2177. })}));
  2178. _st(self["@stream"])._nextPutAll_(";");
  2179. $1=_st(self["@stream"])._lf();
  2180. return self}, self, "nextPutVars:", [aCollection], smalltalk.JSStream)}
  2181. }),
  2182. smalltalk.JSStream);
  2183. smalltalk.addMethod(
  2184. "_appendToInstruction_",
  2185. smalltalk.method({
  2186. selector: "appendToInstruction:",
  2187. fn: function (anIRInstruction){
  2188. var self=this;
  2189. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  2190. return self}, self, "appendToInstruction:", [anIRInstruction], smalltalk.BlockClosure)}
  2191. }),
  2192. smalltalk.BlockClosure);
  2193. smalltalk.addMethod(
  2194. "_asVariableName",
  2195. smalltalk.method({
  2196. selector: "asVariableName",
  2197. fn: function (){
  2198. var self=this;
  2199. return smalltalk.withContext(function($ctx1) { var $2,$1;
  2200. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  2201. if(smalltalk.assert($2)){
  2202. $1=_st(self).__comma("_");
  2203. } else {
  2204. $1=self;
  2205. };
  2206. return $1;
  2207. }, self, "asVariableName", [], smalltalk.String)}
  2208. }),
  2209. smalltalk.String);