1
0

Compiler-IR.deploy.js 84 KB

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