1
0

Compiler-IR.deploy.js 67 KB

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