Compiler-IR.deploy.js 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665
  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], {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,i], {})})});
  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,i], {})})});
  61. _st($4)._withIndexDo_($5);
  62. $9=result;
  63. return $9;
  64. }, function($ctx1) {$ctx1.fill(self,"aliasTemporally:", [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], {}, 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], {}, 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], {}, 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], {}, 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], {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], {})})}));
  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], {})})}));
  218. $5=closure;
  219. return $5;
  220. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:", [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], {})})}));
  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([], {})})});
  248. return _st($5)._ifNotEmpty_($6);
  249. }, function($ctx2) {$ctx2.fillBlock([], {})})});
  250. $1=_st($2)._withSequence_do_($3,$4);
  251. return $1;
  252. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:", [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], {})})}));
  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], {})})}));
  274. $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
  275. return $2;
  276. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:", [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], {})})}));
  291. $1=array;
  292. return $1;
  293. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:", [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], {})})}));
  308. $1=dictionary;
  309. return $1;
  310. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:", [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], {}, 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], {})})}));
  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], {})})}));
  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], {}, 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], {})})}));
  386. $2=return_;
  387. return $2;
  388. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:", [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], {})})}));
  414. $4=send;
  415. return $4;
  416. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:", [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], {instruction:instruction})})});
  439. return _st($5)._do_($6);
  440. }, function($ctx2) {$ctx2.fillBlock([], {})})});
  441. $1=_st($2)._withSequence_do_($3,$4);
  442. return $1;
  443. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:", [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], {}, 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], {}, 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,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], {}, 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], {}, 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], {}, 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], {}, 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,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], {}, 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], {}, 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], {}, 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], {}, 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], {}, 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], {}, 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], {}, 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], {}, 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. "_scope_",
  841. smalltalk.method({
  842. selector: "scope:",
  843. fn: function (aScope){
  844. var self=this;
  845. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  846. _st(aScope)._instruction_(self);
  847. return self}, function($ctx1) {$ctx1.fill(self,"scope:", [aScope], {}, smalltalk.IRClosure)})}
  848. }),
  849. smalltalk.IRClosure);
  850. smalltalk.addMethod(
  851. "_sequence",
  852. smalltalk.method({
  853. selector: "sequence",
  854. fn: function (){
  855. var self=this;
  856. return smalltalk.withContext(function($ctx1) { var $1;
  857. $1=_st(_st(self)._instructions())._last();
  858. return $1;
  859. }, function($ctx1) {$ctx1.fill(self,"sequence", [], {}, smalltalk.IRClosure)})}
  860. }),
  861. smalltalk.IRClosure);
  862. smalltalk.addMethod(
  863. "_tempDeclarations",
  864. smalltalk.method({
  865. selector: "tempDeclarations",
  866. fn: function (){
  867. var self=this;
  868. return smalltalk.withContext(function($ctx1) { var $1;
  869. $1=_st(_st(self)._instructions())._select_((function(each){
  870. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  871. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  872. return $1;
  873. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations", [], {}, smalltalk.IRClosure)})}
  874. }),
  875. smalltalk.IRClosure);
  876. smalltalk.addClass('IRMethod', smalltalk.IRScopedInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'arguments', 'internalVariables'], 'Compiler-IR');
  877. smalltalk.addMethod(
  878. "_accept_",
  879. smalltalk.method({
  880. selector: "accept:",
  881. fn: function (aVisitor){
  882. var self=this;
  883. return smalltalk.withContext(function($ctx1) { var $1;
  884. $1=_st(aVisitor)._visitIRMethod_(self);
  885. return $1;
  886. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRMethod)})}
  887. }),
  888. smalltalk.IRMethod);
  889. smalltalk.addMethod(
  890. "_arguments",
  891. smalltalk.method({
  892. selector: "arguments",
  893. fn: function (){
  894. var self=this;
  895. return smalltalk.withContext(function($ctx1) { var $1;
  896. $1=self["@arguments"];
  897. return $1;
  898. }, function($ctx1) {$ctx1.fill(self,"arguments", [], {}, smalltalk.IRMethod)})}
  899. }),
  900. smalltalk.IRMethod);
  901. smalltalk.addMethod(
  902. "_arguments_",
  903. smalltalk.method({
  904. selector: "arguments:",
  905. fn: function (aCollection){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  908. return self}, function($ctx1) {$ctx1.fill(self,"arguments:", [aCollection], {}, smalltalk.IRMethod)})}
  909. }),
  910. smalltalk.IRMethod);
  911. smalltalk.addMethod(
  912. "_classReferences",
  913. smalltalk.method({
  914. selector: "classReferences",
  915. fn: function (){
  916. var self=this;
  917. return smalltalk.withContext(function($ctx1) { var $1;
  918. $1=self["@classReferences"];
  919. return $1;
  920. }, function($ctx1) {$ctx1.fill(self,"classReferences", [], {}, smalltalk.IRMethod)})}
  921. }),
  922. smalltalk.IRMethod);
  923. smalltalk.addMethod(
  924. "_classReferences_",
  925. smalltalk.method({
  926. selector: "classReferences:",
  927. fn: function (aCollection){
  928. var self=this;
  929. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  930. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:", [aCollection], {}, smalltalk.IRMethod)})}
  931. }),
  932. smalltalk.IRMethod);
  933. smalltalk.addMethod(
  934. "_internalVariables",
  935. smalltalk.method({
  936. selector: "internalVariables",
  937. fn: function (){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) { var $2,$1;
  940. $2=self["@internalVariables"];
  941. if(($receiver = $2) == nil || $receiver == undefined){
  942. self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
  943. $1=self["@internalVariables"];
  944. } else {
  945. $1=$2;
  946. };
  947. return $1;
  948. }, function($ctx1) {$ctx1.fill(self,"internalVariables", [], {}, smalltalk.IRMethod)})}
  949. }),
  950. smalltalk.IRMethod);
  951. smalltalk.addMethod(
  952. "_isMethod",
  953. smalltalk.method({
  954. selector: "isMethod",
  955. fn: function (){
  956. var self=this;
  957. return smalltalk.withContext(function($ctx1) { return true;
  958. }, function($ctx1) {$ctx1.fill(self,"isMethod", [], {}, smalltalk.IRMethod)})}
  959. }),
  960. smalltalk.IRMethod);
  961. smalltalk.addMethod(
  962. "_messageSends",
  963. smalltalk.method({
  964. selector: "messageSends",
  965. fn: function (){
  966. var self=this;
  967. return smalltalk.withContext(function($ctx1) { var $1;
  968. $1=self["@messageSends"];
  969. return $1;
  970. }, function($ctx1) {$ctx1.fill(self,"messageSends", [], {}, smalltalk.IRMethod)})}
  971. }),
  972. smalltalk.IRMethod);
  973. smalltalk.addMethod(
  974. "_messageSends_",
  975. smalltalk.method({
  976. selector: "messageSends:",
  977. fn: function (aCollection){
  978. var self=this;
  979. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  980. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:", [aCollection], {}, smalltalk.IRMethod)})}
  981. }),
  982. smalltalk.IRMethod);
  983. smalltalk.addMethod(
  984. "_method",
  985. smalltalk.method({
  986. selector: "method",
  987. fn: function (){
  988. var self=this;
  989. return smalltalk.withContext(function($ctx1) { var $1;
  990. $1=self;
  991. return $1;
  992. }, function($ctx1) {$ctx1.fill(self,"method", [], {}, smalltalk.IRMethod)})}
  993. }),
  994. smalltalk.IRMethod);
  995. smalltalk.addMethod(
  996. "_scope_",
  997. smalltalk.method({
  998. selector: "scope:",
  999. fn: function (aScope){
  1000. var self=this;
  1001. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  1002. _st(aScope)._instruction_(self);
  1003. return self}, function($ctx1) {$ctx1.fill(self,"scope:", [aScope], {}, smalltalk.IRMethod)})}
  1004. }),
  1005. smalltalk.IRMethod);
  1006. smalltalk.addMethod(
  1007. "_selector",
  1008. smalltalk.method({
  1009. selector: "selector",
  1010. fn: function (){
  1011. var self=this;
  1012. return smalltalk.withContext(function($ctx1) { var $1;
  1013. $1=self["@selector"];
  1014. return $1;
  1015. }, function($ctx1) {$ctx1.fill(self,"selector", [], {}, smalltalk.IRMethod)})}
  1016. }),
  1017. smalltalk.IRMethod);
  1018. smalltalk.addMethod(
  1019. "_selector_",
  1020. smalltalk.method({
  1021. selector: "selector:",
  1022. fn: function (aString){
  1023. var self=this;
  1024. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1025. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], {}, smalltalk.IRMethod)})}
  1026. }),
  1027. smalltalk.IRMethod);
  1028. smalltalk.addMethod(
  1029. "_source",
  1030. smalltalk.method({
  1031. selector: "source",
  1032. fn: function (){
  1033. var self=this;
  1034. return smalltalk.withContext(function($ctx1) { var $1;
  1035. $1=self["@source"];
  1036. return $1;
  1037. }, function($ctx1) {$ctx1.fill(self,"source", [], {}, smalltalk.IRMethod)})}
  1038. }),
  1039. smalltalk.IRMethod);
  1040. smalltalk.addMethod(
  1041. "_source_",
  1042. smalltalk.method({
  1043. selector: "source:",
  1044. fn: function (aString){
  1045. var self=this;
  1046. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1047. return self}, function($ctx1) {$ctx1.fill(self,"source:", [aString], {}, smalltalk.IRMethod)})}
  1048. }),
  1049. smalltalk.IRMethod);
  1050. smalltalk.addMethod(
  1051. "_superSends",
  1052. smalltalk.method({
  1053. selector: "superSends",
  1054. fn: function (){
  1055. var self=this;
  1056. return smalltalk.withContext(function($ctx1) { var $1;
  1057. $1=self["@superSends"];
  1058. return $1;
  1059. }, function($ctx1) {$ctx1.fill(self,"superSends", [], {}, smalltalk.IRMethod)})}
  1060. }),
  1061. smalltalk.IRMethod);
  1062. smalltalk.addMethod(
  1063. "_superSends_",
  1064. smalltalk.method({
  1065. selector: "superSends:",
  1066. fn: function (aCollection){
  1067. var self=this;
  1068. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  1069. return self}, function($ctx1) {$ctx1.fill(self,"superSends:", [aCollection], {}, smalltalk.IRMethod)})}
  1070. }),
  1071. smalltalk.IRMethod);
  1072. smalltalk.addMethod(
  1073. "_tempDeclarations",
  1074. smalltalk.method({
  1075. selector: "tempDeclarations",
  1076. fn: function (){
  1077. var self=this;
  1078. return smalltalk.withContext(function($ctx1) { var $1;
  1079. $1=_st(_st(self)._instructions())._select_((function(each){
  1080. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  1081. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  1082. return $1;
  1083. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations", [], {}, smalltalk.IRMethod)})}
  1084. }),
  1085. smalltalk.IRMethod);
  1086. smalltalk.addMethod(
  1087. "_theClass",
  1088. smalltalk.method({
  1089. selector: "theClass",
  1090. fn: function (){
  1091. var self=this;
  1092. return smalltalk.withContext(function($ctx1) { var $1;
  1093. $1=self["@theClass"];
  1094. return $1;
  1095. }, function($ctx1) {$ctx1.fill(self,"theClass", [], {}, smalltalk.IRMethod)})}
  1096. }),
  1097. smalltalk.IRMethod);
  1098. smalltalk.addMethod(
  1099. "_theClass_",
  1100. smalltalk.method({
  1101. selector: "theClass:",
  1102. fn: function (aClass){
  1103. var self=this;
  1104. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  1105. return self}, function($ctx1) {$ctx1.fill(self,"theClass:", [aClass], {}, smalltalk.IRMethod)})}
  1106. }),
  1107. smalltalk.IRMethod);
  1108. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1109. smalltalk.addMethod(
  1110. "_accept_",
  1111. smalltalk.method({
  1112. selector: "accept:",
  1113. fn: function (aVisitor){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) { var $1;
  1116. $1=_st(aVisitor)._visitIRReturn_(self);
  1117. return $1;
  1118. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRReturn)})}
  1119. }),
  1120. smalltalk.IRReturn);
  1121. smalltalk.addMethod(
  1122. "_canBeAssigned",
  1123. smalltalk.method({
  1124. selector: "canBeAssigned",
  1125. fn: function (){
  1126. var self=this;
  1127. return smalltalk.withContext(function($ctx1) { return false;
  1128. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned", [], {}, smalltalk.IRReturn)})}
  1129. }),
  1130. smalltalk.IRReturn);
  1131. smalltalk.addMethod(
  1132. "_isBlockReturn",
  1133. smalltalk.method({
  1134. selector: "isBlockReturn",
  1135. fn: function (){
  1136. var self=this;
  1137. return smalltalk.withContext(function($ctx1) { return false;
  1138. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn", [], {}, smalltalk.IRReturn)})}
  1139. }),
  1140. smalltalk.IRReturn);
  1141. smalltalk.addMethod(
  1142. "_isLocalReturn",
  1143. smalltalk.method({
  1144. selector: "isLocalReturn",
  1145. fn: function (){
  1146. var self=this;
  1147. return smalltalk.withContext(function($ctx1) { return true;
  1148. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn", [], {}, smalltalk.IRReturn)})}
  1149. }),
  1150. smalltalk.IRReturn);
  1151. smalltalk.addMethod(
  1152. "_isNonLocalReturn",
  1153. smalltalk.method({
  1154. selector: "isNonLocalReturn",
  1155. fn: function (){
  1156. var self=this;
  1157. return smalltalk.withContext(function($ctx1) { var $1;
  1158. $1=_st(_st(self)._isLocalReturn())._not();
  1159. return $1;
  1160. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn", [], {}, smalltalk.IRReturn)})}
  1161. }),
  1162. smalltalk.IRReturn);
  1163. smalltalk.addMethod(
  1164. "_isReturn",
  1165. smalltalk.method({
  1166. selector: "isReturn",
  1167. fn: function (){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) { return true;
  1170. }, function($ctx1) {$ctx1.fill(self,"isReturn", [], {}, smalltalk.IRReturn)})}
  1171. }),
  1172. smalltalk.IRReturn);
  1173. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1174. smalltalk.addMethod(
  1175. "_accept_",
  1176. smalltalk.method({
  1177. selector: "accept:",
  1178. fn: function (aVisitor){
  1179. var self=this;
  1180. return smalltalk.withContext(function($ctx1) { var $1;
  1181. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1182. return $1;
  1183. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRBlockReturn)})}
  1184. }),
  1185. smalltalk.IRBlockReturn);
  1186. smalltalk.addMethod(
  1187. "_isBlockReturn",
  1188. smalltalk.method({
  1189. selector: "isBlockReturn",
  1190. fn: function (){
  1191. var self=this;
  1192. return smalltalk.withContext(function($ctx1) { return true;
  1193. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn", [], {}, smalltalk.IRBlockReturn)})}
  1194. }),
  1195. smalltalk.IRBlockReturn);
  1196. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1197. smalltalk.addMethod(
  1198. "_accept_",
  1199. smalltalk.method({
  1200. selector: "accept:",
  1201. fn: function (aVisitor){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) { var $1;
  1204. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1205. return $1;
  1206. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRNonLocalReturn)})}
  1207. }),
  1208. smalltalk.IRNonLocalReturn);
  1209. smalltalk.addMethod(
  1210. "_isLocalReturn",
  1211. smalltalk.method({
  1212. selector: "isLocalReturn",
  1213. fn: function (){
  1214. var self=this;
  1215. return smalltalk.withContext(function($ctx1) { return false;
  1216. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn", [], {}, smalltalk.IRNonLocalReturn)})}
  1217. }),
  1218. smalltalk.IRNonLocalReturn);
  1219. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1220. smalltalk.addMethod(
  1221. "_accept_",
  1222. smalltalk.method({
  1223. selector: "accept:",
  1224. fn: function (aVisitor){
  1225. var self=this;
  1226. return smalltalk.withContext(function($ctx1) { var $1;
  1227. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1228. return $1;
  1229. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRTempDeclaration)})}
  1230. }),
  1231. smalltalk.IRTempDeclaration);
  1232. smalltalk.addMethod(
  1233. "_isTempDeclaration",
  1234. smalltalk.method({
  1235. selector: "isTempDeclaration",
  1236. fn: function (){
  1237. var self=this;
  1238. return smalltalk.withContext(function($ctx1) { return true;
  1239. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration", [], {}, smalltalk.IRTempDeclaration)})}
  1240. }),
  1241. smalltalk.IRTempDeclaration);
  1242. smalltalk.addMethod(
  1243. "_name",
  1244. smalltalk.method({
  1245. selector: "name",
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) { var $1;
  1249. $1=self["@name"];
  1250. return $1;
  1251. }, function($ctx1) {$ctx1.fill(self,"name", [], {}, smalltalk.IRTempDeclaration)})}
  1252. }),
  1253. smalltalk.IRTempDeclaration);
  1254. smalltalk.addMethod(
  1255. "_name_",
  1256. smalltalk.method({
  1257. selector: "name:",
  1258. fn: function (aString){
  1259. var self=this;
  1260. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  1261. return self}, function($ctx1) {$ctx1.fill(self,"name:", [aString], {}, smalltalk.IRTempDeclaration)})}
  1262. }),
  1263. smalltalk.IRTempDeclaration);
  1264. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1265. smalltalk.addMethod(
  1266. "_accept_",
  1267. smalltalk.method({
  1268. selector: "accept:",
  1269. fn: function (aVisitor){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) { var $1;
  1272. $1=_st(aVisitor)._visitIRSend_(self);
  1273. return $1;
  1274. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRSend)})}
  1275. }),
  1276. smalltalk.IRSend);
  1277. smalltalk.addMethod(
  1278. "_classSend",
  1279. smalltalk.method({
  1280. selector: "classSend",
  1281. fn: function (){
  1282. var self=this;
  1283. return smalltalk.withContext(function($ctx1) { var $1;
  1284. $1=self["@classSend"];
  1285. return $1;
  1286. }, function($ctx1) {$ctx1.fill(self,"classSend", [], {}, smalltalk.IRSend)})}
  1287. }),
  1288. smalltalk.IRSend);
  1289. smalltalk.addMethod(
  1290. "_classSend_",
  1291. smalltalk.method({
  1292. selector: "classSend:",
  1293. fn: function (aClass){
  1294. var self=this;
  1295. return smalltalk.withContext(function($ctx1) { self["@classSend"]=aClass;
  1296. return self}, function($ctx1) {$ctx1.fill(self,"classSend:", [aClass], {}, smalltalk.IRSend)})}
  1297. }),
  1298. smalltalk.IRSend);
  1299. smalltalk.addMethod(
  1300. "_index",
  1301. smalltalk.method({
  1302. selector: "index",
  1303. fn: function (){
  1304. var self=this;
  1305. return smalltalk.withContext(function($ctx1) { var $1;
  1306. $1=self["@index"];
  1307. return $1;
  1308. }, function($ctx1) {$ctx1.fill(self,"index", [], {}, smalltalk.IRSend)})}
  1309. }),
  1310. smalltalk.IRSend);
  1311. smalltalk.addMethod(
  1312. "_index_",
  1313. smalltalk.method({
  1314. selector: "index:",
  1315. fn: function (anInteger){
  1316. var self=this;
  1317. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  1318. return self}, function($ctx1) {$ctx1.fill(self,"index:", [anInteger], {}, smalltalk.IRSend)})}
  1319. }),
  1320. smalltalk.IRSend);
  1321. smalltalk.addMethod(
  1322. "_isSend",
  1323. smalltalk.method({
  1324. selector: "isSend",
  1325. fn: function (){
  1326. var self=this;
  1327. return smalltalk.withContext(function($ctx1) { return true;
  1328. }, function($ctx1) {$ctx1.fill(self,"isSend", [], {}, smalltalk.IRSend)})}
  1329. }),
  1330. smalltalk.IRSend);
  1331. smalltalk.addMethod(
  1332. "_javascriptSelector",
  1333. smalltalk.method({
  1334. selector: "javascriptSelector",
  1335. fn: function (){
  1336. var self=this;
  1337. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1338. $2=_st(self)._classSend();
  1339. if(($receiver = $2) == nil || $receiver == undefined){
  1340. $1=_st(_st(self)._selector())._asSelector();
  1341. } else {
  1342. $1=_st(_st(self)._selector())._asSuperSelector();
  1343. };
  1344. return $1;
  1345. }, function($ctx1) {$ctx1.fill(self,"javascriptSelector", [], {}, smalltalk.IRSend)})}
  1346. }),
  1347. smalltalk.IRSend);
  1348. smalltalk.addMethod(
  1349. "_selector",
  1350. smalltalk.method({
  1351. selector: "selector",
  1352. fn: function (){
  1353. var self=this;
  1354. return smalltalk.withContext(function($ctx1) { var $1;
  1355. $1=self["@selector"];
  1356. return $1;
  1357. }, function($ctx1) {$ctx1.fill(self,"selector", [], {}, smalltalk.IRSend)})}
  1358. }),
  1359. smalltalk.IRSend);
  1360. smalltalk.addMethod(
  1361. "_selector_",
  1362. smalltalk.method({
  1363. selector: "selector:",
  1364. fn: function (aString){
  1365. var self=this;
  1366. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1367. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], {}, smalltalk.IRSend)})}
  1368. }),
  1369. smalltalk.IRSend);
  1370. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1371. smalltalk.addMethod(
  1372. "_accept_",
  1373. smalltalk.method({
  1374. selector: "accept:",
  1375. fn: function (aVisitor){
  1376. var self=this;
  1377. return smalltalk.withContext(function($ctx1) { var $1;
  1378. $1=_st(aVisitor)._visitIRSequence_(self);
  1379. return $1;
  1380. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRSequence)})}
  1381. }),
  1382. smalltalk.IRSequence);
  1383. smalltalk.addMethod(
  1384. "_isSequence",
  1385. smalltalk.method({
  1386. selector: "isSequence",
  1387. fn: function (){
  1388. var self=this;
  1389. return smalltalk.withContext(function($ctx1) { return true;
  1390. }, function($ctx1) {$ctx1.fill(self,"isSequence", [], {}, smalltalk.IRSequence)})}
  1391. }),
  1392. smalltalk.IRSequence);
  1393. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1394. smalltalk.addMethod(
  1395. "_accept_",
  1396. smalltalk.method({
  1397. selector: "accept:",
  1398. fn: function (aVisitor){
  1399. var self=this;
  1400. return smalltalk.withContext(function($ctx1) { var $1;
  1401. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1402. return $1;
  1403. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRBlockSequence)})}
  1404. }),
  1405. smalltalk.IRBlockSequence);
  1406. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1407. smalltalk.addMethod(
  1408. "_accept_",
  1409. smalltalk.method({
  1410. selector: "accept:",
  1411. fn: function (aVisitor){
  1412. var self=this;
  1413. return smalltalk.withContext(function($ctx1) { var $1;
  1414. $1=_st(aVisitor)._visitIRValue_(self);
  1415. return $1;
  1416. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRValue)})}
  1417. }),
  1418. smalltalk.IRValue);
  1419. smalltalk.addMethod(
  1420. "_value",
  1421. smalltalk.method({
  1422. selector: "value",
  1423. fn: function (){
  1424. var self=this;
  1425. return smalltalk.withContext(function($ctx1) { var $1;
  1426. $1=self["@value"];
  1427. return $1;
  1428. }, function($ctx1) {$ctx1.fill(self,"value", [], {}, smalltalk.IRValue)})}
  1429. }),
  1430. smalltalk.IRValue);
  1431. smalltalk.addMethod(
  1432. "_value_",
  1433. smalltalk.method({
  1434. selector: "value:",
  1435. fn: function (aString){
  1436. var self=this;
  1437. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  1438. return self}, function($ctx1) {$ctx1.fill(self,"value:", [aString], {}, smalltalk.IRValue)})}
  1439. }),
  1440. smalltalk.IRValue);
  1441. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1442. smalltalk.addMethod(
  1443. "_accept_",
  1444. smalltalk.method({
  1445. selector: "accept:",
  1446. fn: function (aVisitor){
  1447. var self=this;
  1448. return smalltalk.withContext(function($ctx1) { var $1;
  1449. $1=_st(aVisitor)._visitIRVariable_(self);
  1450. return $1;
  1451. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRVariable)})}
  1452. }),
  1453. smalltalk.IRVariable);
  1454. smalltalk.addMethod(
  1455. "_isVariable",
  1456. smalltalk.method({
  1457. selector: "isVariable",
  1458. fn: function (){
  1459. var self=this;
  1460. return smalltalk.withContext(function($ctx1) { return true;
  1461. }, function($ctx1) {$ctx1.fill(self,"isVariable", [], {}, smalltalk.IRVariable)})}
  1462. }),
  1463. smalltalk.IRVariable);
  1464. smalltalk.addMethod(
  1465. "_variable",
  1466. smalltalk.method({
  1467. selector: "variable",
  1468. fn: function (){
  1469. var self=this;
  1470. return smalltalk.withContext(function($ctx1) { var $1;
  1471. $1=self["@variable"];
  1472. return $1;
  1473. }, function($ctx1) {$ctx1.fill(self,"variable", [], {}, smalltalk.IRVariable)})}
  1474. }),
  1475. smalltalk.IRVariable);
  1476. smalltalk.addMethod(
  1477. "_variable_",
  1478. smalltalk.method({
  1479. selector: "variable:",
  1480. fn: function (aScopeVariable){
  1481. var self=this;
  1482. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  1483. return self}, function($ctx1) {$ctx1.fill(self,"variable:", [aScopeVariable], {}, smalltalk.IRVariable)})}
  1484. }),
  1485. smalltalk.IRVariable);
  1486. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1487. smalltalk.addMethod(
  1488. "_accept_",
  1489. smalltalk.method({
  1490. selector: "accept:",
  1491. fn: function (aVisitor){
  1492. var self=this;
  1493. return smalltalk.withContext(function($ctx1) { var $1;
  1494. $1=_st(aVisitor)._visitIRVerbatim_(self);
  1495. return $1;
  1496. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRVerbatim)})}
  1497. }),
  1498. smalltalk.IRVerbatim);
  1499. smalltalk.addMethod(
  1500. "_source",
  1501. smalltalk.method({
  1502. selector: "source",
  1503. fn: function (){
  1504. var self=this;
  1505. return smalltalk.withContext(function($ctx1) { var $1;
  1506. $1=self["@source"];
  1507. return $1;
  1508. }, function($ctx1) {$ctx1.fill(self,"source", [], {}, smalltalk.IRVerbatim)})}
  1509. }),
  1510. smalltalk.IRVerbatim);
  1511. smalltalk.addMethod(
  1512. "_source_",
  1513. smalltalk.method({
  1514. selector: "source:",
  1515. fn: function (aString){
  1516. var self=this;
  1517. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1518. return self}, function($ctx1) {$ctx1.fill(self,"source:", [aString], {}, smalltalk.IRVerbatim)})}
  1519. }),
  1520. smalltalk.IRVerbatim);
  1521. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  1522. smalltalk.addMethod(
  1523. "_visit_",
  1524. smalltalk.method({
  1525. selector: "visit:",
  1526. fn: function (anIRInstruction){
  1527. var self=this;
  1528. return smalltalk.withContext(function($ctx1) { var $1;
  1529. $1=_st(anIRInstruction)._accept_(self);
  1530. return $1;
  1531. }, function($ctx1) {$ctx1.fill(self,"visit:", [anIRInstruction], {}, smalltalk.IRVisitor)})}
  1532. }),
  1533. smalltalk.IRVisitor);
  1534. smalltalk.addMethod(
  1535. "_visitIRAssignment_",
  1536. smalltalk.method({
  1537. selector: "visitIRAssignment:",
  1538. fn: function (anIRAssignment){
  1539. var self=this;
  1540. return smalltalk.withContext(function($ctx1) { var $1;
  1541. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  1542. return $1;
  1543. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:", [anIRAssignment], {}, smalltalk.IRVisitor)})}
  1544. }),
  1545. smalltalk.IRVisitor);
  1546. smalltalk.addMethod(
  1547. "_visitIRBlockReturn_",
  1548. smalltalk.method({
  1549. selector: "visitIRBlockReturn:",
  1550. fn: function (anIRBlockReturn){
  1551. var self=this;
  1552. return smalltalk.withContext(function($ctx1) { var $1;
  1553. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  1554. return $1;
  1555. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:", [anIRBlockReturn], {}, smalltalk.IRVisitor)})}
  1556. }),
  1557. smalltalk.IRVisitor);
  1558. smalltalk.addMethod(
  1559. "_visitIRBlockSequence_",
  1560. smalltalk.method({
  1561. selector: "visitIRBlockSequence:",
  1562. fn: function (anIRBlockSequence){
  1563. var self=this;
  1564. return smalltalk.withContext(function($ctx1) { var $1;
  1565. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  1566. return $1;
  1567. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:", [anIRBlockSequence], {}, smalltalk.IRVisitor)})}
  1568. }),
  1569. smalltalk.IRVisitor);
  1570. smalltalk.addMethod(
  1571. "_visitIRClosure_",
  1572. smalltalk.method({
  1573. selector: "visitIRClosure:",
  1574. fn: function (anIRClosure){
  1575. var self=this;
  1576. return smalltalk.withContext(function($ctx1) { var $1;
  1577. $1=_st(self)._visitIRInstruction_(anIRClosure);
  1578. return $1;
  1579. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:", [anIRClosure], {}, smalltalk.IRVisitor)})}
  1580. }),
  1581. smalltalk.IRVisitor);
  1582. smalltalk.addMethod(
  1583. "_visitIRDynamicArray_",
  1584. smalltalk.method({
  1585. selector: "visitIRDynamicArray:",
  1586. fn: function (anIRDynamicArray){
  1587. var self=this;
  1588. return smalltalk.withContext(function($ctx1) { var $1;
  1589. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  1590. return $1;
  1591. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:", [anIRDynamicArray], {}, smalltalk.IRVisitor)})}
  1592. }),
  1593. smalltalk.IRVisitor);
  1594. smalltalk.addMethod(
  1595. "_visitIRDynamicDictionary_",
  1596. smalltalk.method({
  1597. selector: "visitIRDynamicDictionary:",
  1598. fn: function (anIRDynamicDictionary){
  1599. var self=this;
  1600. return smalltalk.withContext(function($ctx1) { var $1;
  1601. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  1602. return $1;
  1603. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:", [anIRDynamicDictionary], {}, smalltalk.IRVisitor)})}
  1604. }),
  1605. smalltalk.IRVisitor);
  1606. smalltalk.addMethod(
  1607. "_visitIRInlinedClosure_",
  1608. smalltalk.method({
  1609. selector: "visitIRInlinedClosure:",
  1610. fn: function (anIRInlinedClosure){
  1611. var self=this;
  1612. return smalltalk.withContext(function($ctx1) { var $1;
  1613. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  1614. return $1;
  1615. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:", [anIRInlinedClosure], {}, smalltalk.IRVisitor)})}
  1616. }),
  1617. smalltalk.IRVisitor);
  1618. smalltalk.addMethod(
  1619. "_visitIRInlinedSequence_",
  1620. smalltalk.method({
  1621. selector: "visitIRInlinedSequence:",
  1622. fn: function (anIRInlinedSequence){
  1623. var self=this;
  1624. return smalltalk.withContext(function($ctx1) { var $1;
  1625. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  1626. return $1;
  1627. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:", [anIRInlinedSequence], {}, smalltalk.IRVisitor)})}
  1628. }),
  1629. smalltalk.IRVisitor);
  1630. smalltalk.addMethod(
  1631. "_visitIRInstruction_",
  1632. smalltalk.method({
  1633. selector: "visitIRInstruction:",
  1634. fn: function (anIRInstruction){
  1635. var self=this;
  1636. return smalltalk.withContext(function($ctx1) { var $1;
  1637. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  1638. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1639. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  1640. $1=anIRInstruction;
  1641. return $1;
  1642. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:", [anIRInstruction], {}, smalltalk.IRVisitor)})}
  1643. }),
  1644. smalltalk.IRVisitor);
  1645. smalltalk.addMethod(
  1646. "_visitIRMethod_",
  1647. smalltalk.method({
  1648. selector: "visitIRMethod:",
  1649. fn: function (anIRMethod){
  1650. var self=this;
  1651. return smalltalk.withContext(function($ctx1) { var $1;
  1652. $1=_st(self)._visitIRInstruction_(anIRMethod);
  1653. return $1;
  1654. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:", [anIRMethod], {}, smalltalk.IRVisitor)})}
  1655. }),
  1656. smalltalk.IRVisitor);
  1657. smalltalk.addMethod(
  1658. "_visitIRNonLocalReturn_",
  1659. smalltalk.method({
  1660. selector: "visitIRNonLocalReturn:",
  1661. fn: function (anIRNonLocalReturn){
  1662. var self=this;
  1663. return smalltalk.withContext(function($ctx1) { var $1;
  1664. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  1665. return $1;
  1666. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:", [anIRNonLocalReturn], {}, smalltalk.IRVisitor)})}
  1667. }),
  1668. smalltalk.IRVisitor);
  1669. smalltalk.addMethod(
  1670. "_visitIRNonLocalReturnHandling_",
  1671. smalltalk.method({
  1672. selector: "visitIRNonLocalReturnHandling:",
  1673. fn: function (anIRNonLocalReturnHandling){
  1674. var self=this;
  1675. return smalltalk.withContext(function($ctx1) { var $1;
  1676. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  1677. return $1;
  1678. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:", [anIRNonLocalReturnHandling], {}, smalltalk.IRVisitor)})}
  1679. }),
  1680. smalltalk.IRVisitor);
  1681. smalltalk.addMethod(
  1682. "_visitIRReturn_",
  1683. smalltalk.method({
  1684. selector: "visitIRReturn:",
  1685. fn: function (anIRReturn){
  1686. var self=this;
  1687. return smalltalk.withContext(function($ctx1) { var $1;
  1688. $1=_st(self)._visitIRInstruction_(anIRReturn);
  1689. return $1;
  1690. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:", [anIRReturn], {}, smalltalk.IRVisitor)})}
  1691. }),
  1692. smalltalk.IRVisitor);
  1693. smalltalk.addMethod(
  1694. "_visitIRSend_",
  1695. smalltalk.method({
  1696. selector: "visitIRSend:",
  1697. fn: function (anIRSend){
  1698. var self=this;
  1699. return smalltalk.withContext(function($ctx1) { var $1;
  1700. $1=_st(self)._visitIRInstruction_(anIRSend);
  1701. return $1;
  1702. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:", [anIRSend], {}, smalltalk.IRVisitor)})}
  1703. }),
  1704. smalltalk.IRVisitor);
  1705. smalltalk.addMethod(
  1706. "_visitIRSequence_",
  1707. smalltalk.method({
  1708. selector: "visitIRSequence:",
  1709. fn: function (anIRSequence){
  1710. var self=this;
  1711. return smalltalk.withContext(function($ctx1) { var $1;
  1712. $1=_st(self)._visitIRInstruction_(anIRSequence);
  1713. return $1;
  1714. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:", [anIRSequence], {}, smalltalk.IRVisitor)})}
  1715. }),
  1716. smalltalk.IRVisitor);
  1717. smalltalk.addMethod(
  1718. "_visitIRTempDeclaration_",
  1719. smalltalk.method({
  1720. selector: "visitIRTempDeclaration:",
  1721. fn: function (anIRTempDeclaration){
  1722. var self=this;
  1723. return smalltalk.withContext(function($ctx1) { var $1;
  1724. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  1725. return $1;
  1726. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:", [anIRTempDeclaration], {}, smalltalk.IRVisitor)})}
  1727. }),
  1728. smalltalk.IRVisitor);
  1729. smalltalk.addMethod(
  1730. "_visitIRValue_",
  1731. smalltalk.method({
  1732. selector: "visitIRValue:",
  1733. fn: function (anIRValue){
  1734. var self=this;
  1735. return smalltalk.withContext(function($ctx1) { var $1;
  1736. $1=_st(self)._visitIRInstruction_(anIRValue);
  1737. return $1;
  1738. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:", [anIRValue], {}, smalltalk.IRVisitor)})}
  1739. }),
  1740. smalltalk.IRVisitor);
  1741. smalltalk.addMethod(
  1742. "_visitIRVariable_",
  1743. smalltalk.method({
  1744. selector: "visitIRVariable:",
  1745. fn: function (anIRVariable){
  1746. var self=this;
  1747. return smalltalk.withContext(function($ctx1) { var $1;
  1748. $1=_st(self)._visitIRInstruction_(anIRVariable);
  1749. return $1;
  1750. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:", [anIRVariable], {}, smalltalk.IRVisitor)})}
  1751. }),
  1752. smalltalk.IRVisitor);
  1753. smalltalk.addMethod(
  1754. "_visitIRVerbatim_",
  1755. smalltalk.method({
  1756. selector: "visitIRVerbatim:",
  1757. fn: function (anIRVerbatim){
  1758. var self=this;
  1759. return smalltalk.withContext(function($ctx1) { var $1;
  1760. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  1761. return $1;
  1762. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:", [anIRVerbatim], {}, smalltalk.IRVisitor)})}
  1763. }),
  1764. smalltalk.IRVisitor);
  1765. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  1766. smalltalk.addMethod(
  1767. "_contents",
  1768. smalltalk.method({
  1769. selector: "contents",
  1770. fn: function (){
  1771. var self=this;
  1772. return smalltalk.withContext(function($ctx1) { var $1;
  1773. $1=_st(_st(self)._stream())._contents();
  1774. return $1;
  1775. }, function($ctx1) {$ctx1.fill(self,"contents", [], {}, smalltalk.IRJSTranslator)})}
  1776. }),
  1777. smalltalk.IRJSTranslator);
  1778. smalltalk.addMethod(
  1779. "_initialize",
  1780. smalltalk.method({
  1781. selector: "initialize",
  1782. fn: function (){
  1783. var self=this;
  1784. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  1785. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  1786. return self}, function($ctx1) {$ctx1.fill(self,"initialize", [], {}, smalltalk.IRJSTranslator)})}
  1787. }),
  1788. smalltalk.IRJSTranslator);
  1789. smalltalk.addMethod(
  1790. "_stream",
  1791. smalltalk.method({
  1792. selector: "stream",
  1793. fn: function (){
  1794. var self=this;
  1795. return smalltalk.withContext(function($ctx1) { var $1;
  1796. $1=self["@stream"];
  1797. return $1;
  1798. }, function($ctx1) {$ctx1.fill(self,"stream", [], {}, smalltalk.IRJSTranslator)})}
  1799. }),
  1800. smalltalk.IRJSTranslator);
  1801. smalltalk.addMethod(
  1802. "_stream_",
  1803. smalltalk.method({
  1804. selector: "stream:",
  1805. fn: function (aStream){
  1806. var self=this;
  1807. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  1808. return self}, function($ctx1) {$ctx1.fill(self,"stream:", [aStream], {}, smalltalk.IRJSTranslator)})}
  1809. }),
  1810. smalltalk.IRJSTranslator);
  1811. smalltalk.addMethod(
  1812. "_visitIRAssignment_",
  1813. smalltalk.method({
  1814. selector: "visitIRAssignment:",
  1815. fn: function (anIRAssignment){
  1816. var self=this;
  1817. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  1818. _st(_st(self)._stream())._nextPutAssignment();
  1819. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  1820. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:", [anIRAssignment], {}, smalltalk.IRJSTranslator)})}
  1821. }),
  1822. smalltalk.IRJSTranslator);
  1823. smalltalk.addMethod(
  1824. "_visitIRClosure_",
  1825. smalltalk.method({
  1826. selector: "visitIRClosure:",
  1827. fn: function (anIRClosure){
  1828. var self=this;
  1829. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  1830. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  1831. return smalltalk.withContext(function($ctx3) { return _st(_st(each)._name())._asVariableName();
  1832. }, function($ctx3) {$ctx3.fillBlock([each], {})})})));
  1833. return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  1834. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  1835. }, function($ctx3) {$ctx3.fillBlock([], {})})}));
  1836. }, function($ctx2) {$ctx2.fillBlock([], {})})}),_st(anIRClosure)._arguments());
  1837. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:", [anIRClosure], {}, smalltalk.IRJSTranslator)})}
  1838. }),
  1839. smalltalk.IRJSTranslator);
  1840. smalltalk.addMethod(
  1841. "_visitIRDynamicArray_",
  1842. smalltalk.method({
  1843. selector: "visitIRDynamicArray:",
  1844. fn: function (anIRDynamicArray){
  1845. var self=this;
  1846. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  1847. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  1848. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1849. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  1850. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1851. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  1852. _st(self["@stream"])._nextPutAll_("]");
  1853. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:", [anIRDynamicArray], {}, smalltalk.IRJSTranslator)})}
  1854. }),
  1855. smalltalk.IRJSTranslator);
  1856. smalltalk.addMethod(
  1857. "_visitIRDynamicDictionary_",
  1858. smalltalk.method({
  1859. selector: "visitIRDynamicDictionary:",
  1860. fn: function (anIRDynamicDictionary){
  1861. var self=this;
  1862. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  1863. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  1864. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1865. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  1866. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1867. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  1868. _st(_st(self)._stream())._nextPutAll_("])");
  1869. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:", [anIRDynamicDictionary], {}, smalltalk.IRJSTranslator)})}
  1870. }),
  1871. smalltalk.IRJSTranslator);
  1872. smalltalk.addMethod(
  1873. "_visitIRMethod_",
  1874. smalltalk.method({
  1875. selector: "visitIRMethod:",
  1876. fn: function (anIRMethod){
  1877. var self=this;
  1878. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$6,$7,$9,$10,$8,$5,$3;
  1879. $1=_st(self)._stream();
  1880. $2=anIRMethod;
  1881. $3=(function(){
  1882. return smalltalk.withContext(function($ctx2) { $4=_st(self)._stream();
  1883. $5=(function(){
  1884. return smalltalk.withContext(function($ctx3) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  1885. return smalltalk.withContext(function($ctx4) { return _st(_st(each)._name())._asVariableName();
  1886. }, function($ctx4) {$ctx4.fillBlock([each], {})})})));
  1887. $6=_st(self)._stream();
  1888. $7=anIRMethod;
  1889. $8=(function(){
  1890. return smalltalk.withContext(function($ctx4) { $9=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  1891. if(smalltalk.assert($9)){
  1892. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  1893. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  1894. }, function($ctx5) {$ctx5.fillBlock([each], {})})})));
  1895. };
  1896. $10=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  1897. if(smalltalk.assert($10)){
  1898. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  1899. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1900. }, function($ctx5) {$ctx5.fillBlock([], {})})}));
  1901. } else {
  1902. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1903. };
  1904. }, function($ctx4) {$ctx4.fillBlock([], {})})});
  1905. return _st($6)._nextPutContextFor_during_($7,$8);
  1906. }, function($ctx3) {$ctx3.fillBlock([], {})})});
  1907. return _st($4)._nextPutFunctionWith_arguments_($5,_st(anIRMethod)._arguments());
  1908. }, function($ctx2) {$ctx2.fillBlock([], {})})});
  1909. _st($1)._nextPutMethodDeclaration_with_($2,$3);
  1910. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:", [anIRMethod], {}, smalltalk.IRJSTranslator)})}
  1911. }),
  1912. smalltalk.IRJSTranslator);
  1913. smalltalk.addMethod(
  1914. "_visitIRNonLocalReturn_",
  1915. smalltalk.method({
  1916. selector: "visitIRNonLocalReturn:",
  1917. fn: function (anIRNonLocalReturn){
  1918. var self=this;
  1919. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  1920. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  1921. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  1922. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:", [anIRNonLocalReturn], {}, smalltalk.IRJSTranslator)})}
  1923. }),
  1924. smalltalk.IRJSTranslator);
  1925. smalltalk.addMethod(
  1926. "_visitIRReturn_",
  1927. smalltalk.method({
  1928. selector: "visitIRReturn:",
  1929. fn: function (anIRReturn){
  1930. var self=this;
  1931. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  1932. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  1933. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  1934. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:", [anIRReturn], {}, smalltalk.IRJSTranslator)})}
  1935. }),
  1936. smalltalk.IRJSTranslator);
  1937. smalltalk.addMethod(
  1938. "_visitIRSend_",
  1939. smalltalk.method({
  1940. selector: "visitIRSend:",
  1941. fn: function (anIRSend){
  1942. var self=this;
  1943. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  1944. $1=_st(anIRSend)._classSend();
  1945. if(($receiver = $1) == nil || $receiver == undefined){
  1946. _st(_st(self)._stream())._nextPutAll_("_st(");
  1947. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  1948. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  1949. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  1950. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1951. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  1952. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1953. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  1954. _st(_st(self)._stream())._nextPutAll_(")");
  1955. } else {
  1956. $2=_st(self)._stream();
  1957. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  1958. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  1959. $3=_st($2)._nextPutAll_("_st(");
  1960. $3;
  1961. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  1962. _st(_st(self)._stream())._nextPutAll_("), [");
  1963. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  1964. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1965. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  1966. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1967. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  1968. _st(_st(self)._stream())._nextPutAll_("])");
  1969. };
  1970. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:", [anIRSend], {}, smalltalk.IRJSTranslator)})}
  1971. }),
  1972. smalltalk.IRJSTranslator);
  1973. smalltalk.addMethod(
  1974. "_visitIRSequence_",
  1975. smalltalk.method({
  1976. selector: "visitIRSequence:",
  1977. fn: function (anIRSequence){
  1978. var self=this;
  1979. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  1980. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  1981. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  1982. }, function($ctx3) {$ctx3.fillBlock([each], {})})}));
  1983. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  1984. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:", [anIRSequence], {}, smalltalk.IRJSTranslator)})}
  1985. }),
  1986. smalltalk.IRJSTranslator);
  1987. smalltalk.addMethod(
  1988. "_visitIRTempDeclaration_",
  1989. smalltalk.method({
  1990. selector: "visitIRTempDeclaration:",
  1991. fn: function (anIRTempDeclaration){
  1992. var self=this;
  1993. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:", [anIRTempDeclaration], {}, smalltalk.IRJSTranslator)})}
  1994. }),
  1995. smalltalk.IRJSTranslator);
  1996. smalltalk.addMethod(
  1997. "_visitIRValue_",
  1998. smalltalk.method({
  1999. selector: "visitIRValue:",
  2000. fn: function (anIRValue){
  2001. var self=this;
  2002. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2003. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:", [anIRValue], {}, smalltalk.IRJSTranslator)})}
  2004. }),
  2005. smalltalk.IRJSTranslator);
  2006. smalltalk.addMethod(
  2007. "_visitIRVariable_",
  2008. smalltalk.method({
  2009. selector: "visitIRVariable:",
  2010. fn: function (anIRVariable){
  2011. var self=this;
  2012. return smalltalk.withContext(function($ctx1) { var $1;
  2013. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2014. if(smalltalk.assert($1)){
  2015. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  2016. } else {
  2017. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2018. };
  2019. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:", [anIRVariable], {}, smalltalk.IRJSTranslator)})}
  2020. }),
  2021. smalltalk.IRJSTranslator);
  2022. smalltalk.addMethod(
  2023. "_visitIRVerbatim_",
  2024. smalltalk.method({
  2025. selector: "visitIRVerbatim:",
  2026. fn: function (anIRVerbatim){
  2027. var self=this;
  2028. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  2029. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2030. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2031. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:", [anIRVerbatim], {}, smalltalk.IRJSTranslator)})}
  2032. }),
  2033. smalltalk.IRJSTranslator);
  2034. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2035. smalltalk.addMethod(
  2036. "_contents",
  2037. smalltalk.method({
  2038. selector: "contents",
  2039. fn: function (){
  2040. var self=this;
  2041. return smalltalk.withContext(function($ctx1) { var $1;
  2042. $1=_st(self["@stream"])._contents();
  2043. return $1;
  2044. }, function($ctx1) {$ctx1.fill(self,"contents", [], {}, smalltalk.JSStream)})}
  2045. }),
  2046. smalltalk.JSStream);
  2047. smalltalk.addMethod(
  2048. "_initialize",
  2049. smalltalk.method({
  2050. selector: "initialize",
  2051. fn: function (){
  2052. var self=this;
  2053. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  2054. self["@stream"]=_st("")._writeStream();
  2055. return self}, function($ctx1) {$ctx1.fill(self,"initialize", [], {}, smalltalk.JSStream)})}
  2056. }),
  2057. smalltalk.JSStream);
  2058. smalltalk.addMethod(
  2059. "_lf",
  2060. smalltalk.method({
  2061. selector: "lf",
  2062. fn: function (){
  2063. var self=this;
  2064. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  2065. return self}, function($ctx1) {$ctx1.fill(self,"lf", [], {}, smalltalk.JSStream)})}
  2066. }),
  2067. smalltalk.JSStream);
  2068. smalltalk.addMethod(
  2069. "_nextPut_",
  2070. smalltalk.method({
  2071. selector: "nextPut:",
  2072. fn: function (aString){
  2073. var self=this;
  2074. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  2075. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:", [aString], {}, smalltalk.JSStream)})}
  2076. }),
  2077. smalltalk.JSStream);
  2078. smalltalk.addMethod(
  2079. "_nextPutAll_",
  2080. smalltalk.method({
  2081. selector: "nextPutAll:",
  2082. fn: function (aString){
  2083. var self=this;
  2084. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  2085. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:", [aString], {}, smalltalk.JSStream)})}
  2086. }),
  2087. smalltalk.JSStream);
  2088. smalltalk.addMethod(
  2089. "_nextPutAssignment",
  2090. smalltalk.method({
  2091. selector: "nextPutAssignment",
  2092. fn: function (){
  2093. var self=this;
  2094. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  2095. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment", [], {}, smalltalk.JSStream)})}
  2096. }),
  2097. smalltalk.JSStream);
  2098. smalltalk.addMethod(
  2099. "_nextPutBlockContextFor_during_",
  2100. smalltalk.method({
  2101. selector: "nextPutBlockContextFor:during:",
  2102. fn: function (anIRClosure,aBlock){
  2103. var self=this;
  2104. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2105. $1=self;
  2106. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2107. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2108. _st(aBlock)._value();
  2109. $3=self;
  2110. _st($3)._nextPutAll_(_st(_st("}, function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2111. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock(["));
  2112. _st(_st(anIRClosure)._arguments())._do_separatedBy_((function(each){
  2113. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(_st(each)._asVariableName());
  2114. }, function($ctx2) {$ctx2.fillBlock([each], {},$ctx1)})}),(function(){
  2115. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2116. }, function($ctx2) {$ctx2.fillBlock([], {},$ctx1)})}));
  2117. _st(self)._nextPutAll_("], {");
  2118. _st(_st(anIRClosure)._tempDeclarations())._do_separatedBy_((function(each){
  2119. return smalltalk.withContext(function($ctx2) { $5=self;
  2120. _st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2121. _st($5)._nextPutAll_(":");
  2122. $6=_st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2123. return $6;
  2124. }, function($ctx2) {$ctx2.fillBlock([each], {},$ctx1)})}),(function(){
  2125. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2126. }, function($ctx2) {$ctx2.fillBlock([], {},$ctx1)})}));
  2127. $7=self;
  2128. _st($7)._nextPutAll_("},");
  2129. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._method())._scope())._alias()).__comma(")})"));
  2130. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:", [anIRClosure,aBlock], {}, smalltalk.JSStream)})}
  2131. }),
  2132. smalltalk.JSStream);
  2133. smalltalk.addMethod(
  2134. "_nextPutClosureWith_arguments_",
  2135. smalltalk.method({
  2136. selector: "nextPutClosureWith:arguments:",
  2137. fn: function (aBlock,anArray){
  2138. var self=this;
  2139. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2140. _st(self["@stream"])._nextPutAll_("(function(");
  2141. _st(anArray)._do_separatedBy_((function(each){
  2142. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2143. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2144. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2145. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2146. $1=self["@stream"];
  2147. _st($1)._nextPutAll_("){");
  2148. $2=_st($1)._lf();
  2149. _st(aBlock)._value();
  2150. _st(self["@stream"])._nextPutAll_("})");
  2151. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:", [aBlock,anArray], {}, smalltalk.JSStream)})}
  2152. }),
  2153. smalltalk.JSStream);
  2154. smalltalk.addMethod(
  2155. "_nextPutContextFor_during_",
  2156. smalltalk.method({
  2157. selector: "nextPutContextFor:during:",
  2158. fn: function (aMethod,aBlock){
  2159. var self=this;
  2160. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2161. $1=self;
  2162. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  2163. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2164. _st(aBlock)._value();
  2165. $3=self;
  2166. _st($3)._nextPutAll_(_st(_st(_st("}, function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  2167. $4=_st($3)._nextPutAll_(_st(_st(".fill(self,").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(", ["));
  2168. _st(_st(aMethod)._arguments())._do_separatedBy_((function(each){
  2169. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(_st(each)._asVariableName());
  2170. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2171. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2172. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2173. _st(self)._nextPutAll_("], {");
  2174. _st(_st(aMethod)._tempDeclarations())._do_separatedBy_((function(each){
  2175. return smalltalk.withContext(function($ctx2) { $5=self;
  2176. _st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2177. _st($5)._nextPutAll_(":");
  2178. $6=_st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2179. return $6;
  2180. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2181. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2182. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2183. $7=self;
  2184. _st($7)._nextPutAll_("}, ");
  2185. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  2186. $8=_st($7)._nextPutAll_(")})");
  2187. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:", [aMethod,aBlock], {}, smalltalk.JSStream)})}
  2188. }),
  2189. smalltalk.JSStream);
  2190. smalltalk.addMethod(
  2191. "_nextPutFunctionWith_arguments_",
  2192. smalltalk.method({
  2193. selector: "nextPutFunctionWith:arguments:",
  2194. fn: function (aBlock,anArray){
  2195. var self=this;
  2196. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2197. _st(self["@stream"])._nextPutAll_("fn: function(");
  2198. _st(anArray)._do_separatedBy_((function(each){
  2199. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2200. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2201. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2202. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2203. $1=self["@stream"];
  2204. _st($1)._nextPutAll_("){");
  2205. $2=_st($1)._lf();
  2206. $3=self["@stream"];
  2207. _st($3)._nextPutAll_("var self=this;");
  2208. $4=_st($3)._lf();
  2209. _st(aBlock)._value();
  2210. _st(self["@stream"])._nextPutAll_("}");
  2211. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:", [aBlock,anArray], {}, smalltalk.JSStream)})}
  2212. }),
  2213. smalltalk.JSStream);
  2214. smalltalk.addMethod(
  2215. "_nextPutIf_with_",
  2216. smalltalk.method({
  2217. selector: "nextPutIf:with:",
  2218. fn: function (aBlock,anotherBlock){
  2219. var self=this;
  2220. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2221. _st(self["@stream"])._nextPutAll_("if(");
  2222. _st(aBlock)._value();
  2223. $1=self["@stream"];
  2224. _st($1)._nextPutAll_("){");
  2225. $2=_st($1)._lf();
  2226. _st(anotherBlock)._value();
  2227. _st(self["@stream"])._nextPutAll_("}");
  2228. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:", [aBlock,anotherBlock], {}, smalltalk.JSStream)})}
  2229. }),
  2230. smalltalk.JSStream);
  2231. smalltalk.addMethod(
  2232. "_nextPutIfElse_with_with_",
  2233. smalltalk.method({
  2234. selector: "nextPutIfElse:with:with:",
  2235. fn: function (aBlock,ifBlock,elseBlock){
  2236. var self=this;
  2237. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2238. _st(self["@stream"])._nextPutAll_("if(");
  2239. _st(aBlock)._value();
  2240. $1=self["@stream"];
  2241. _st($1)._nextPutAll_("){");
  2242. $2=_st($1)._lf();
  2243. _st(ifBlock)._value();
  2244. $3=self["@stream"];
  2245. _st($3)._nextPutAll_("} else {");
  2246. $4=_st($3)._lf();
  2247. _st(elseBlock)._value();
  2248. _st(self["@stream"])._nextPutAll_("}");
  2249. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:", [aBlock,ifBlock,elseBlock], {}, smalltalk.JSStream)})}
  2250. }),
  2251. smalltalk.JSStream);
  2252. smalltalk.addMethod(
  2253. "_nextPutMethodDeclaration_with_",
  2254. smalltalk.method({
  2255. selector: "nextPutMethodDeclaration:with:",
  2256. fn: function (aMethod,aBlock){
  2257. var self=this;
  2258. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  2259. $1=self["@stream"];
  2260. _st($1)._nextPutAll_("smalltalk.method({");
  2261. _st($1)._lf();
  2262. _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  2263. _st($1)._lf();
  2264. _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  2265. $2=_st($1)._lf();
  2266. _st(aBlock)._value();
  2267. $3=self["@stream"];
  2268. _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  2269. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  2270. _st($3)._lf();
  2271. _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  2272. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  2273. }, function($ctx2) {$ctx2.fillBlock([each], {})})})))._asArray())._asJavascript())).__comma(","));
  2274. _st($3)._lf();
  2275. $4=_st($3)._nextPutAll_("referencedClasses: [");
  2276. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  2277. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  2278. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2279. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  2280. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2281. $5=self["@stream"];
  2282. _st($5)._nextPutAll_("]");
  2283. $6=_st($5)._nextPutAll_("})");
  2284. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:", [aMethod,aBlock], {}, smalltalk.JSStream)})}
  2285. }),
  2286. smalltalk.JSStream);
  2287. smalltalk.addMethod(
  2288. "_nextPutNonLocalReturnHandlingWith_",
  2289. smalltalk.method({
  2290. selector: "nextPutNonLocalReturnHandlingWith:",
  2291. fn: function (aBlock){
  2292. var self=this;
  2293. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2294. $1=self["@stream"];
  2295. _st($1)._nextPutAll_("var $early={};");
  2296. _st($1)._lf();
  2297. _st($1)._nextPutAll_("try {");
  2298. $2=_st($1)._lf();
  2299. _st(aBlock)._value();
  2300. $3=self["@stream"];
  2301. _st($3)._nextPutAll_("}");
  2302. _st($3)._lf();
  2303. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  2304. $4=_st($3)._lf();
  2305. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:", [aBlock], {}, smalltalk.JSStream)})}
  2306. }),
  2307. smalltalk.JSStream);
  2308. smalltalk.addMethod(
  2309. "_nextPutNonLocalReturnWith_",
  2310. smalltalk.method({
  2311. selector: "nextPutNonLocalReturnWith:",
  2312. fn: function (aBlock){
  2313. var self=this;
  2314. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  2315. _st(aBlock)._value();
  2316. _st(self["@stream"])._nextPutAll_("]");
  2317. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:", [aBlock], {}, smalltalk.JSStream)})}
  2318. }),
  2319. smalltalk.JSStream);
  2320. smalltalk.addMethod(
  2321. "_nextPutReturn",
  2322. smalltalk.method({
  2323. selector: "nextPutReturn",
  2324. fn: function (){
  2325. var self=this;
  2326. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  2327. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn", [], {}, smalltalk.JSStream)})}
  2328. }),
  2329. smalltalk.JSStream);
  2330. smalltalk.addMethod(
  2331. "_nextPutReturnWith_",
  2332. smalltalk.method({
  2333. selector: "nextPutReturnWith:",
  2334. fn: function (aBlock){
  2335. var self=this;
  2336. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  2337. _st(aBlock)._value();
  2338. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:", [aBlock], {}, smalltalk.JSStream)})}
  2339. }),
  2340. smalltalk.JSStream);
  2341. smalltalk.addMethod(
  2342. "_nextPutSequenceWith_",
  2343. smalltalk.method({
  2344. selector: "nextPutSequenceWith:",
  2345. fn: function (aBlock){
  2346. var self=this;
  2347. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  2348. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:", [aBlock], {}, smalltalk.JSStream)})}
  2349. }),
  2350. smalltalk.JSStream);
  2351. smalltalk.addMethod(
  2352. "_nextPutStatement_with_",
  2353. smalltalk.method({
  2354. selector: "nextPutStatement:with:",
  2355. fn: function (anInteger,aBlock){
  2356. var self=this;
  2357. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2358. $1=self["@stream"];
  2359. _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  2360. $2=_st($1)._lf();
  2361. _st(self)._nextPutStatementWith_(aBlock);
  2362. $3=self["@stream"];
  2363. _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  2364. $4=_st($3)._lf();
  2365. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:", [anInteger,aBlock], {}, smalltalk.JSStream)})}
  2366. }),
  2367. smalltalk.JSStream);
  2368. smalltalk.addMethod(
  2369. "_nextPutStatementWith_",
  2370. smalltalk.method({
  2371. selector: "nextPutStatementWith:",
  2372. fn: function (aBlock){
  2373. var self=this;
  2374. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2375. _st(aBlock)._value();
  2376. $1=self["@stream"];
  2377. _st($1)._nextPutAll_(";");
  2378. $2=_st($1)._lf();
  2379. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:", [aBlock], {}, smalltalk.JSStream)})}
  2380. }),
  2381. smalltalk.JSStream);
  2382. smalltalk.addMethod(
  2383. "_nextPutVar_",
  2384. smalltalk.method({
  2385. selector: "nextPutVar:",
  2386. fn: function (aString){
  2387. var self=this;
  2388. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2389. $1=self["@stream"];
  2390. _st($1)._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
  2391. $2=_st($1)._lf();
  2392. return self}, function($ctx1) {$ctx1.fill(self,"nextPutVar:", [aString], {}, smalltalk.JSStream)})}
  2393. }),
  2394. smalltalk.JSStream);
  2395. smalltalk.addMethod(
  2396. "_nextPutVars_",
  2397. smalltalk.method({
  2398. selector: "nextPutVars:",
  2399. fn: function (aCollection){
  2400. var self=this;
  2401. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2402. var $early={};
  2403. try {
  2404. _st(aCollection)._ifEmpty_((function(){
  2405. return smalltalk.withContext(function($ctx2) { $1=self;
  2406. throw $early=[$1];
  2407. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2408. _st(self["@stream"])._nextPutAll_("var ");
  2409. _st(aCollection)._do_separatedBy_((function(each){
  2410. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  2411. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2412. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  2413. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2414. $2=self["@stream"];
  2415. _st($2)._nextPutAll_(";");
  2416. $3=_st($2)._lf();
  2417. return self}
  2418. catch(e) {if(e===$early)return e[0]; throw e}
  2419. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:", [aCollection], {}, smalltalk.JSStream)})}
  2420. }),
  2421. smalltalk.JSStream);
  2422. smalltalk.addMethod(
  2423. "_appendToInstruction_",
  2424. smalltalk.method({
  2425. selector: "appendToInstruction:",
  2426. fn: function (anIRInstruction){
  2427. var self=this;
  2428. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  2429. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:", [anIRInstruction], {}, smalltalk.BlockClosure)})}
  2430. }),
  2431. smalltalk.BlockClosure);
  2432. smalltalk.addMethod(
  2433. "_asVariableName",
  2434. smalltalk.method({
  2435. selector: "asVariableName",
  2436. fn: function (){
  2437. var self=this;
  2438. return smalltalk.withContext(function($ctx1) { var $2,$1;
  2439. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  2440. if(smalltalk.assert($2)){
  2441. $1=_st(self).__comma("_");
  2442. } else {
  2443. $1=self;
  2444. };
  2445. return $1;
  2446. }, function($ctx1) {$ctx1.fill(self,"asVariableName", [], {}, smalltalk.String)})}
  2447. }),
  2448. smalltalk.String);