Compiler-IR.deploy.js 72 KB

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