Compiler-IR.deploy.js 72 KB

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