Compiler-IR.deploy.js 89 KB

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