Compiler-IR.js 129 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583
  1. smalltalk.addPackage('Compiler-IR', {});
  2. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
  3. smalltalk.IRASTTranslator.comment="I am the AST (abstract syntax tree) visitor responsible for building the intermediate representation graph.\x0aI rely on a builder object, instance of IRBuilder."
  4. smalltalk.addMethod(
  5. "_alias_",
  6. smalltalk.method({
  7. selector: "alias:",
  8. category: 'visiting',
  9. fn: function (aNode){
  10. var self=this;
  11. var variable;
  12. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7;
  13. $1=_st(aNode)._isImmutable();
  14. if(smalltalk.assert($1)){
  15. $2=_st(self)._visit_(aNode);
  16. return $2;
  17. };
  18. $3=_st((smalltalk.IRVariable || IRVariable))._new();
  19. _st($3)._variable_(_st(_st((smalltalk.AliasVar || AliasVar))._new())._name_(_st("$").__comma(_st(self)._nextAlias())));
  20. $4=_st($3)._yourself();
  21. variable=$4;
  22. $5=_st((smalltalk.IRAssignment || IRAssignment))._new();
  23. _st($5)._add_(variable);
  24. _st($5)._add_(_st(self)._visit_(aNode));
  25. $6=_st($5)._yourself();
  26. _st(_st(self)._sequence())._add_($6);
  27. _st(_st(_st(self)._method())._internalVariables())._add_(variable);
  28. $7=variable;
  29. return $7;
  30. }, function($ctx1) {$ctx1.fill(self,"alias:",{aNode:aNode,variable:variable}, smalltalk.IRASTTranslator)})},
  31. args: ["aNode"],
  32. source: "alias: aNode\x0a\x09| variable |\x0a\x0a\x09aNode isImmutable ifTrue: [ ^ self visit: aNode ].\x0a\x0a\x09variable := IRVariable new \x0a\x09\x09variable: (AliasVar new name: '$', self nextAlias); \x0a\x09\x09yourself.\x0a\x0a\x09self sequence add: (IRAssignment new\x0a\x09\x09add: variable;\x0a\x09\x09add: (self visit: aNode);\x0a\x09\x09yourself).\x0a\x0a\x09self method internalVariables add: variable.\x0a\x0a\x09^ variable",
  33. messageSends: ["ifTrue:", "visit:", "isImmutable", "variable:", "name:", ",", "nextAlias", "new", "yourself", "add:", "sequence", "internalVariables", "method"],
  34. referencedClasses: ["AliasVar", "IRVariable", "IRAssignment"]
  35. }),
  36. smalltalk.IRASTTranslator);
  37. smalltalk.addMethod(
  38. "_aliasTemporally_",
  39. smalltalk.method({
  40. selector: "aliasTemporally:",
  41. category: 'visiting',
  42. fn: function (aCollection){
  43. var self=this;
  44. var threshold,result;
  45. return smalltalk.withContext(function($ctx1) { var $1,$3,$2,$4,$6,$8,$7,$5,$9;
  46. threshold=(0);
  47. $1=aCollection;
  48. $2=(function(each,i){
  49. return smalltalk.withContext(function($ctx2) { $3=_st(each)._subtreeNeedsAliasing();
  50. if(smalltalk.assert($3)){
  51. threshold=i;
  52. return threshold;
  53. };
  54. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})});
  55. _st($1)._withIndexDo_($2);
  56. result=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  57. $4=aCollection;
  58. $5=(function(each,i){
  59. return smalltalk.withContext(function($ctx2) { $6=result;
  60. $8=_st(i).__lt_eq(threshold);
  61. if(smalltalk.assert($8)){
  62. $7=_st(self)._alias_(each);
  63. } else {
  64. $7=_st(self)._visit_(each);
  65. };
  66. return _st($6)._add_($7);
  67. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})});
  68. _st($4)._withIndexDo_($5);
  69. $9=result;
  70. return $9;
  71. }, function($ctx1) {$ctx1.fill(self,"aliasTemporally:",{aCollection:aCollection,threshold:threshold,result:result}, smalltalk.IRASTTranslator)})},
  72. args: ["aCollection"],
  73. source: "aliasTemporally: aCollection\x0a\x09\x22https://github.com/NicolasPetton/amber/issues/296\x0a \x0a If a node is aliased, all preceding ones are aliased as well.\x0a The tree is iterated twice. First we get the aliasing dependency, \x0a then the aliasing itself is done\x22\x0a\x0a\x09| threshold result |\x0a threshold := 0.\x0a \x0a aCollection withIndexDo: [ :each :i |\x0a each subtreeNeedsAliasing\x0a\x09\x09 ifTrue: [ threshold := i ]].\x0a\x0a\x09result := OrderedCollection new.\x0a\x09aCollection withIndexDo: [ :each :i | \x0a\x09\x09result add: (i <= threshold\x0a\x09\x09\x09ifTrue: [ self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ])].\x0a\x0a ^result",
  74. messageSends: ["withIndexDo:", "ifTrue:", "subtreeNeedsAliasing", "new", "add:", "ifTrue:ifFalse:", "alias:", "visit:", "<="],
  75. referencedClasses: ["OrderedCollection"]
  76. }),
  77. smalltalk.IRASTTranslator);
  78. smalltalk.addMethod(
  79. "_method",
  80. smalltalk.method({
  81. selector: "method",
  82. category: 'accessing',
  83. fn: function (){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx1) { var $1;
  86. $1=self["@method"];
  87. return $1;
  88. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.IRASTTranslator)})},
  89. args: [],
  90. source: "method\x0a\x09^ method",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. smalltalk.IRASTTranslator);
  95. smalltalk.addMethod(
  96. "_method_",
  97. smalltalk.method({
  98. selector: "method:",
  99. category: 'accessing',
  100. fn: function (anIRMethod){
  101. var self=this;
  102. return smalltalk.withContext(function($ctx1) { self["@method"]=anIRMethod;
  103. return self}, function($ctx1) {$ctx1.fill(self,"method:",{anIRMethod:anIRMethod}, smalltalk.IRASTTranslator)})},
  104. args: ["anIRMethod"],
  105. source: "method: anIRMethod\x0a\x09method := anIRMethod",
  106. messageSends: [],
  107. referencedClasses: []
  108. }),
  109. smalltalk.IRASTTranslator);
  110. smalltalk.addMethod(
  111. "_nextAlias",
  112. smalltalk.method({
  113. selector: "nextAlias",
  114. category: 'accessing',
  115. fn: function (){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) { var $1,$2;
  118. $1=self["@nextAlias"];
  119. if(($receiver = $1) == nil || $receiver == undefined){
  120. self["@nextAlias"]=(0);
  121. self["@nextAlias"];
  122. } else {
  123. $1;
  124. };
  125. self["@nextAlias"]=_st(self["@nextAlias"]).__plus((1));
  126. $2=_st(self["@nextAlias"])._asString();
  127. return $2;
  128. }, function($ctx1) {$ctx1.fill(self,"nextAlias",{}, smalltalk.IRASTTranslator)})},
  129. args: [],
  130. source: "nextAlias\x0a\x09nextAlias ifNil: [ nextAlias := 0 ].\x0a\x09nextAlias := nextAlias + 1.\x0a\x09^ nextAlias asString",
  131. messageSends: ["ifNil:", "+", "asString"],
  132. referencedClasses: []
  133. }),
  134. smalltalk.IRASTTranslator);
  135. smalltalk.addMethod(
  136. "_sequence",
  137. smalltalk.method({
  138. selector: "sequence",
  139. category: 'accessing',
  140. fn: function (){
  141. var self=this;
  142. return smalltalk.withContext(function($ctx1) { var $1;
  143. $1=self["@sequence"];
  144. return $1;
  145. }, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRASTTranslator)})},
  146. args: [],
  147. source: "sequence\x0a\x09^ sequence",
  148. messageSends: [],
  149. referencedClasses: []
  150. }),
  151. smalltalk.IRASTTranslator);
  152. smalltalk.addMethod(
  153. "_sequence_",
  154. smalltalk.method({
  155. selector: "sequence:",
  156. category: 'accessing',
  157. fn: function (anIRSequence){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) { self["@sequence"]=anIRSequence;
  160. return self}, function($ctx1) {$ctx1.fill(self,"sequence:",{anIRSequence:anIRSequence}, smalltalk.IRASTTranslator)})},
  161. args: ["anIRSequence"],
  162. source: "sequence: anIRSequence\x0a\x09sequence := anIRSequence",
  163. messageSends: [],
  164. referencedClasses: []
  165. }),
  166. smalltalk.IRASTTranslator);
  167. smalltalk.addMethod(
  168. "_source",
  169. smalltalk.method({
  170. selector: "source",
  171. category: 'accessing',
  172. fn: function (){
  173. var self=this;
  174. return smalltalk.withContext(function($ctx1) { var $1;
  175. $1=self["@source"];
  176. return $1;
  177. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRASTTranslator)})},
  178. args: [],
  179. source: "source\x0a\x09^ source",
  180. messageSends: [],
  181. referencedClasses: []
  182. }),
  183. smalltalk.IRASTTranslator);
  184. smalltalk.addMethod(
  185. "_source_",
  186. smalltalk.method({
  187. selector: "source:",
  188. category: 'accessing',
  189. fn: function (aString){
  190. var self=this;
  191. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  192. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRASTTranslator)})},
  193. args: ["aString"],
  194. source: "source: aString\x0a\x09source := aString",
  195. messageSends: [],
  196. referencedClasses: []
  197. }),
  198. smalltalk.IRASTTranslator);
  199. smalltalk.addMethod(
  200. "_theClass",
  201. smalltalk.method({
  202. selector: "theClass",
  203. category: 'accessing',
  204. fn: function (){
  205. var self=this;
  206. return smalltalk.withContext(function($ctx1) { var $1;
  207. $1=self["@theClass"];
  208. return $1;
  209. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.IRASTTranslator)})},
  210. args: [],
  211. source: "theClass\x0a\x09^ theClass",
  212. messageSends: [],
  213. referencedClasses: []
  214. }),
  215. smalltalk.IRASTTranslator);
  216. smalltalk.addMethod(
  217. "_theClass_",
  218. smalltalk.method({
  219. selector: "theClass:",
  220. category: 'accessing',
  221. fn: function (aClass){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  224. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.IRASTTranslator)})},
  225. args: ["aClass"],
  226. source: "theClass: aClass\x0a\x09theClass := aClass",
  227. messageSends: [],
  228. referencedClasses: []
  229. }),
  230. smalltalk.IRASTTranslator);
  231. smalltalk.addMethod(
  232. "_visitAssignmentNode_",
  233. smalltalk.method({
  234. selector: "visitAssignmentNode:",
  235. category: 'visiting',
  236. fn: function (aNode){
  237. var self=this;
  238. var left,right,assignment;
  239. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  240. right=_st(self)._visit_(_st(aNode)._right());
  241. left=_st(self)._visit_(_st(aNode)._left());
  242. $1=_st((smalltalk.IRAssignment || IRAssignment))._new();
  243. _st($1)._add_(left);
  244. _st($1)._add_(right);
  245. $2=_st($1)._yourself();
  246. _st(_st(self)._sequence())._add_($2);
  247. $3=left;
  248. return $3;
  249. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,left:left,right:right,assignment:assignment}, smalltalk.IRASTTranslator)})},
  250. args: ["aNode"],
  251. source: "visitAssignmentNode: aNode\x0a\x09| left right assignment |\x0a\x09right := self visit: aNode right.\x0a\x09left := self visit: aNode left.\x0a\x09self sequence add: (IRAssignment new \x0a\x09\x09add: left;\x0a\x09\x09add: right;\x0a\x09\x09yourself).\x0a\x09^ left",
  252. messageSends: ["visit:", "right", "left", "add:", "new", "yourself", "sequence"],
  253. referencedClasses: ["IRAssignment"]
  254. }),
  255. smalltalk.IRASTTranslator);
  256. smalltalk.addMethod(
  257. "_visitBlockNode_",
  258. smalltalk.method({
  259. selector: "visitBlockNode:",
  260. category: 'visiting',
  261. fn: function (aNode){
  262. var self=this;
  263. var closure;
  264. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  265. $1=_st((smalltalk.IRClosure || IRClosure))._new();
  266. _st($1)._arguments_(_st(aNode)._parameters());
  267. _st($1)._scope_(_st(aNode)._scope());
  268. $2=_st($1)._yourself();
  269. closure=$2;
  270. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  271. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  272. _st($3)._name_(_st(each)._name());
  273. _st($3)._scope_(_st(aNode)._scope());
  274. $4=_st($3)._yourself();
  275. return _st(closure)._add_($4);
  276. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  277. _st(_st(aNode)._nodes())._do_((function(each){
  278. return smalltalk.withContext(function($ctx2) { return _st(closure)._add_(_st(self)._visit_(each));
  279. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  280. $5=closure;
  281. return $5;
  282. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,closure:closure}, smalltalk.IRASTTranslator)})},
  283. args: ["aNode"],
  284. source: "visitBlockNode: aNode\x0a\x09| closure |\x0a\x09closure := IRClosure new\x0a\x09\x09arguments: aNode parameters;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself.\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09closure add: (IRTempDeclaration new \x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x09aNode nodes do: [ :each | closure add: (self visit: each) ].\x0a\x09^ closure",
  285. messageSends: ["arguments:", "parameters", "new", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "temps", "visit:", "nodes"],
  286. referencedClasses: ["IRClosure", "IRTempDeclaration"]
  287. }),
  288. smalltalk.IRASTTranslator);
  289. smalltalk.addMethod(
  290. "_visitBlockSequenceNode_",
  291. smalltalk.method({
  292. selector: "visitBlockSequenceNode:",
  293. category: 'visiting',
  294. fn: function (aNode){
  295. var self=this;
  296. return smalltalk.withContext(function($ctx1) { var $2,$3,$5,$7,$8,$9,$6,$4,$1;
  297. $2=self;
  298. $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
  299. $4=(function(){
  300. return smalltalk.withContext(function($ctx2) { $5=_st(aNode)._nodes();
  301. $6=(function(){
  302. return smalltalk.withContext(function($ctx3) { _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  303. return smalltalk.withContext(function($ctx4) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  304. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  305. $7=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
  306. if(smalltalk.assert($7)){
  307. return _st(_st(self)._sequence())._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  308. } else {
  309. $8=_st((smalltalk.IRBlockReturn || IRBlockReturn))._new();
  310. _st($8)._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  311. $9=_st($8)._yourself();
  312. return _st(_st(self)._sequence())._add_($9);
  313. };
  314. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
  315. return _st($5)._ifNotEmpty_($6);
  316. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  317. $1=_st($2)._withSequence_do_($3,$4);
  318. return $1;
  319. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  320. args: ["aNode"],
  321. source: "visitBlockSequenceNode: aNode\x0a\x09^ self\x0a\x09\x09withSequence: IRBlockSequence new\x0a\x09\x09do: [ \x0a\x09\x09\x09aNode nodes ifNotEmpty: [\x0a\x09\x09\x09\x09aNode nodes allButLast do: [ :each | \x0a\x09\x09\x09\x09\x09self sequence add: (self visit: each) ].\x0a\x09\x09\x09\x09aNode nodes last isReturnNode \x0a\x09\x09\x09\x09\x09ifFalse: [ self sequence add: (IRBlockReturn new add: (self visit: aNode nodes last); yourself) ]\x0a\x09\x09\x09\x09\x09ifTrue: [ self sequence add: (self visit: aNode nodes last) ]]]",
  322. messageSends: ["withSequence:do:", "new", "ifNotEmpty:", "do:", "add:", "visit:", "sequence", "allButLast", "nodes", "ifFalse:ifTrue:", "last", "yourself", "isReturnNode"],
  323. referencedClasses: ["IRBlockSequence", "IRBlockReturn"]
  324. }),
  325. smalltalk.IRASTTranslator);
  326. smalltalk.addMethod(
  327. "_visitCascadeNode_",
  328. smalltalk.method({
  329. selector: "visitCascadeNode:",
  330. category: 'visiting',
  331. fn: function (aNode){
  332. var self=this;
  333. var alias;
  334. return smalltalk.withContext(function($ctx1) { var $1,$2;
  335. $1=_st(_st(aNode)._receiver())._isImmutable();
  336. if(! smalltalk.assert($1)){
  337. alias=_st(self)._alias_(_st(aNode)._receiver());
  338. alias;
  339. _st(_st(aNode)._nodes())._do_((function(each){
  340. return smalltalk.withContext(function($ctx2) { return _st(each)._receiver_(_st(_st((smalltalk.VariableNode || VariableNode))._new())._binding_(_st(alias)._variable()));
  341. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  342. };
  343. _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  344. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  345. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  346. $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
  347. return $2;
  348. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode,alias:alias}, smalltalk.IRASTTranslator)})},
  349. args: ["aNode"],
  350. source: "visitCascadeNode: aNode\x0a\x09| alias |\x0a\x0a\x09aNode receiver isImmutable ifFalse: [ \x0a\x09\x09alias := self alias: aNode receiver.\x0a\x09\x09aNode nodes do: [ :each |\x0a\x09\x09\x09each receiver: (VariableNode new binding: alias variable) ]].\x0a\x0a\x09aNode nodes allButLast do: [ :each |\x0a\x09\x09self sequence add: (self visit: each) ].\x0a\x0a\x09^ self alias: aNode nodes last",
  351. messageSends: ["ifFalse:", "alias:", "receiver", "do:", "receiver:", "binding:", "variable", "new", "nodes", "isImmutable", "add:", "visit:", "sequence", "allButLast", "last"],
  352. referencedClasses: ["VariableNode"]
  353. }),
  354. smalltalk.IRASTTranslator);
  355. smalltalk.addMethod(
  356. "_visitDynamicArrayNode_",
  357. smalltalk.method({
  358. selector: "visitDynamicArrayNode:",
  359. category: 'visiting',
  360. fn: function (aNode){
  361. var self=this;
  362. var array;
  363. return smalltalk.withContext(function($ctx1) { var $1;
  364. array=_st((smalltalk.IRDynamicArray || IRDynamicArray))._new();
  365. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  366. return smalltalk.withContext(function($ctx2) { return _st(array)._add_(each);
  367. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  368. $1=array;
  369. return $1;
  370. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array}, smalltalk.IRASTTranslator)})},
  371. args: ["aNode"],
  372. source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09array := IRDynamicArray new.\x0a\x09(self aliasTemporally: aNode nodes) do: [:each | array add: each].\x0a\x09^ array",
  373. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
  374. referencedClasses: ["IRDynamicArray"]
  375. }),
  376. smalltalk.IRASTTranslator);
  377. smalltalk.addMethod(
  378. "_visitDynamicDictionaryNode_",
  379. smalltalk.method({
  380. selector: "visitDynamicDictionaryNode:",
  381. category: 'visiting',
  382. fn: function (aNode){
  383. var self=this;
  384. var dictionary;
  385. return smalltalk.withContext(function($ctx1) { var $1;
  386. dictionary=_st((smalltalk.IRDynamicDictionary || IRDynamicDictionary))._new();
  387. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  388. return smalltalk.withContext(function($ctx2) { return _st(dictionary)._add_(each);
  389. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  390. $1=dictionary;
  391. return $1;
  392. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,dictionary:dictionary}, smalltalk.IRASTTranslator)})},
  393. args: ["aNode"],
  394. source: "visitDynamicDictionaryNode: aNode\x0a\x09| dictionary |\x0a\x09dictionary := IRDynamicDictionary new.\x0a (self aliasTemporally: aNode nodes) do: [:each | dictionary add: each].\x0a\x09^ dictionary",
  395. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
  396. referencedClasses: ["IRDynamicDictionary"]
  397. }),
  398. smalltalk.IRASTTranslator);
  399. smalltalk.addMethod(
  400. "_visitJSStatementNode_",
  401. smalltalk.method({
  402. selector: "visitJSStatementNode:",
  403. category: 'visiting',
  404. fn: function (aNode){
  405. var self=this;
  406. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  407. $2=_st((smalltalk.IRVerbatim || IRVerbatim))._new();
  408. _st($2)._source_(_st(aNode)._source());
  409. $3=_st($2)._yourself();
  410. $1=$3;
  411. return $1;
  412. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  413. args: ["aNode"],
  414. source: "visitJSStatementNode: aNode\x0a\x09^ IRVerbatim new\x0a\x09\x09source: aNode source;\x0a\x09\x09yourself",
  415. messageSends: ["source:", "source", "new", "yourself"],
  416. referencedClasses: ["IRVerbatim"]
  417. }),
  418. smalltalk.IRASTTranslator);
  419. smalltalk.addMethod(
  420. "_visitMethodNode_",
  421. smalltalk.method({
  422. selector: "visitMethodNode:",
  423. category: 'visiting',
  424. fn: function (aNode){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  427. $1=_st((smalltalk.IRMethod || IRMethod))._new();
  428. _st($1)._source_(_st(self)._source());
  429. _st($1)._theClass_(_st(self)._theClass());
  430. _st($1)._arguments_(_st(aNode)._arguments());
  431. _st($1)._selector_(_st(aNode)._selector());
  432. _st($1)._messageSends_(_st(aNode)._messageSends());
  433. _st($1)._superSends_(_st(aNode)._superSends());
  434. _st($1)._classReferences_(_st(aNode)._classReferences());
  435. _st($1)._scope_(_st(aNode)._scope());
  436. $2=_st($1)._yourself();
  437. _st(self)._method_($2);
  438. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  439. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  440. _st($3)._name_(_st(each)._name());
  441. _st($3)._scope_(_st(aNode)._scope());
  442. $4=_st($3)._yourself();
  443. return _st(_st(self)._method())._add_($4);
  444. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  445. _st(_st(aNode)._nodes())._do_((function(each){
  446. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._method())._add_(_st(self)._visit_(each));
  447. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  448. $5=_st(_st(aNode)._scope())._hasLocalReturn();
  449. if(! smalltalk.assert($5)){
  450. $6=_st((smalltalk.IRVariable || IRVariable))._new();
  451. _st($6)._variable_(_st(_st(_st(aNode)._scope())._pseudoVars())._at_("self"));
  452. $7=_st($6)._yourself();
  453. _st(_st(_st(self)._method())._add_(_st((smalltalk.IRReturn || IRReturn))._new()))._add_($7);
  454. };
  455. $8=_st(self)._method();
  456. return $8;
  457. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  458. args: ["aNode"],
  459. source: "visitMethodNode: aNode\x0a\x0a\x09self method: (IRMethod new\x0a\x09\x09source: self source;\x0a theClass: self theClass;\x0a\x09\x09arguments: aNode arguments;\x0a\x09\x09selector: aNode selector;\x0a\x09\x09messageSends: aNode messageSends;\x0a superSends: aNode superSends;\x0a\x09\x09classReferences: aNode classReferences;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself).\x0a\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09self method add: (IRTempDeclaration new\x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09aNode nodes do: [ :each | self method add: (self visit: each) ].\x0a\x0a\x09aNode scope hasLocalReturn ifFalse: [\x0a\x09\x09(self method add: IRReturn new) add: (IRVariable new\x0a\x09\x09\x09variable: (aNode scope pseudoVars at: 'self');\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09^ self method",
  460. messageSends: ["method:", "source:", "source", "new", "theClass:", "theClass", "arguments:", "arguments", "selector:", "selector", "messageSends:", "messageSends", "superSends:", "superSends", "classReferences:", "classReferences", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "method", "temps", "visit:", "nodes", "ifFalse:", "variable:", "at:", "pseudoVars", "hasLocalReturn"],
  461. referencedClasses: ["IRMethod", "IRTempDeclaration", "IRVariable", "IRReturn"]
  462. }),
  463. smalltalk.IRASTTranslator);
  464. smalltalk.addMethod(
  465. "_visitReturnNode_",
  466. smalltalk.method({
  467. selector: "visitReturnNode:",
  468. category: 'visiting',
  469. fn: function (aNode){
  470. var self=this;
  471. var return_;
  472. return smalltalk.withContext(function($ctx1) { var $1,$2;
  473. $1=_st(aNode)._nonLocalReturn();
  474. if(smalltalk.assert($1)){
  475. return_=_st((smalltalk.IRNonLocalReturn || IRNonLocalReturn))._new();
  476. } else {
  477. return_=_st((smalltalk.IRReturn || IRReturn))._new();
  478. };
  479. _st(return_)._scope_(_st(aNode)._scope());
  480. _st(_st(aNode)._nodes())._do_((function(each){
  481. return smalltalk.withContext(function($ctx2) { return _st(return_)._add_(_st(self)._alias_(each));
  482. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  483. $2=return_;
  484. return $2;
  485. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode,return_:return_}, smalltalk.IRASTTranslator)})},
  486. args: ["aNode"],
  487. source: "visitReturnNode: aNode\x0a\x09| return |\x0a\x09return := aNode nonLocalReturn \x0a\x09\x09ifTrue: [ IRNonLocalReturn new ]\x0a\x09\x09ifFalse: [ IRReturn new ].\x0a\x09return scope: aNode scope.\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09return add: (self alias: each) ].\x0a\x09^ return",
  488. messageSends: ["ifTrue:ifFalse:", "new", "nonLocalReturn", "scope:", "scope", "do:", "add:", "alias:", "nodes"],
  489. referencedClasses: ["IRNonLocalReturn", "IRReturn"]
  490. }),
  491. smalltalk.IRASTTranslator);
  492. smalltalk.addMethod(
  493. "_visitSendNode_",
  494. smalltalk.method({
  495. selector: "visitSendNode:",
  496. category: 'visiting',
  497. fn: function (aNode){
  498. var self=this;
  499. var send,all,receiver,arguments;
  500. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  501. send=_st((smalltalk.IRSend || IRSend))._new();
  502. $1=send;
  503. _st($1)._selector_(_st(aNode)._selector());
  504. $2=_st($1)._index_(_st(aNode)._index());
  505. $3=_st(aNode)._superSend();
  506. if(smalltalk.assert($3)){
  507. _st(send)._classSend_(_st(_st(self)._theClass())._superclass());
  508. };
  509. all=_st(self)._aliasTemporally_(_st([_st(aNode)._receiver()]).__comma(_st(aNode)._arguments()));
  510. receiver=_st(all)._first();
  511. arguments=_st(all)._allButFirst();
  512. _st(send)._add_(receiver);
  513. _st(arguments)._do_((function(each){
  514. return smalltalk.withContext(function($ctx2) { return _st(send)._add_(each);
  515. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  516. $4=send;
  517. return $4;
  518. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,send:send,all:all,receiver:receiver,arguments:arguments}, smalltalk.IRASTTranslator)})},
  519. args: ["aNode"],
  520. source: "visitSendNode: aNode\x0a\x09| send all receiver arguments |\x0a\x09send := IRSend new.\x0a\x09send \x0a\x09\x09selector: aNode selector;\x0a\x09\x09index: aNode index.\x0a\x09aNode superSend ifTrue: [ send classSend: self theClass superclass ].\x0a \x0a all := self aliasTemporally: { aNode receiver }, aNode arguments.\x0a\x09receiver := all first.\x0a\x09arguments := all allButFirst.\x0a\x0a\x09send add: receiver.\x0a\x09arguments do: [ :each | send add: each ].\x0a\x0a\x09^ send",
  521. messageSends: ["new", "selector:", "selector", "index:", "index", "ifTrue:", "classSend:", "superclass", "theClass", "superSend", "aliasTemporally:", ",", "arguments", "receiver", "first", "allButFirst", "add:", "do:"],
  522. referencedClasses: ["IRSend"]
  523. }),
  524. smalltalk.IRASTTranslator);
  525. smalltalk.addMethod(
  526. "_visitSequenceNode_",
  527. smalltalk.method({
  528. selector: "visitSequenceNode:",
  529. category: 'visiting',
  530. fn: function (aNode){
  531. var self=this;
  532. return smalltalk.withContext(function($ctx1) { var $2,$3,$5,$7,$6,$4,$1;
  533. $2=self;
  534. $3=_st((smalltalk.IRSequence || IRSequence))._new();
  535. $4=(function(){
  536. return smalltalk.withContext(function($ctx2) { $5=_st(aNode)._nodes();
  537. $6=(function(each){
  538. var instruction;
  539. return smalltalk.withContext(function($ctx3) { instruction=_st(self)._visit_(each);
  540. instruction;
  541. $7=_st(instruction)._isVariable();
  542. if(! smalltalk.assert($7)){
  543. return _st(_st(self)._sequence())._add_(instruction);
  544. };
  545. }, function($ctx3) {$ctx3.fillBlock({each:each,instruction:instruction},$ctx1)})});
  546. return _st($5)._do_($6);
  547. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  548. $1=_st($2)._withSequence_do_($3,$4);
  549. return $1;
  550. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  551. args: ["aNode"],
  552. source: "visitSequenceNode: aNode\x0a\x09^ self \x0a\x09\x09withSequence: IRSequence new \x09\x0a\x09\x09do: [\x0a\x09\x09\x09aNode nodes do: [ :each | | instruction |\x0a\x09\x09\x09\x09instruction := self visit: each.\x0a\x09\x09\x09\x09instruction isVariable ifFalse: [\x0a\x09\x09\x09\x09\x09self sequence add: instruction ]]]",
  553. messageSends: ["withSequence:do:", "new", "do:", "visit:", "ifFalse:", "add:", "sequence", "isVariable", "nodes"],
  554. referencedClasses: ["IRSequence"]
  555. }),
  556. smalltalk.IRASTTranslator);
  557. smalltalk.addMethod(
  558. "_visitValueNode_",
  559. smalltalk.method({
  560. selector: "visitValueNode:",
  561. category: 'visiting',
  562. fn: function (aNode){
  563. var self=this;
  564. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  565. $2=_st((smalltalk.IRValue || IRValue))._new();
  566. _st($2)._value_(_st(aNode)._value());
  567. $3=_st($2)._yourself();
  568. $1=$3;
  569. return $1;
  570. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  571. args: ["aNode"],
  572. source: "visitValueNode: aNode\x0a\x09^ IRValue new \x0a\x09\x09value: aNode value; \x0a\x09\x09yourself",
  573. messageSends: ["value:", "value", "new", "yourself"],
  574. referencedClasses: ["IRValue"]
  575. }),
  576. smalltalk.IRASTTranslator);
  577. smalltalk.addMethod(
  578. "_visitVariableNode_",
  579. smalltalk.method({
  580. selector: "visitVariableNode:",
  581. category: 'visiting',
  582. fn: function (aNode){
  583. var self=this;
  584. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  585. $2=_st((smalltalk.IRVariable || IRVariable))._new();
  586. _st($2)._variable_(_st(aNode)._binding());
  587. $3=_st($2)._yourself();
  588. $1=$3;
  589. return $1;
  590. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.IRASTTranslator)})},
  591. args: ["aNode"],
  592. source: "visitVariableNode: aNode\x0a\x09^ IRVariable new \x0a\x09\x09variable: aNode binding; \x0a\x09\x09yourself",
  593. messageSends: ["variable:", "binding", "new", "yourself"],
  594. referencedClasses: ["IRVariable"]
  595. }),
  596. smalltalk.IRASTTranslator);
  597. smalltalk.addMethod(
  598. "_withSequence_do_",
  599. smalltalk.method({
  600. selector: "withSequence:do:",
  601. category: 'accessing',
  602. fn: function (aSequence,aBlock){
  603. var self=this;
  604. var outerSequence;
  605. return smalltalk.withContext(function($ctx1) { var $1;
  606. outerSequence=_st(self)._sequence();
  607. _st(self)._sequence_(aSequence);
  608. _st(aBlock)._value();
  609. _st(self)._sequence_(outerSequence);
  610. $1=aSequence;
  611. return $1;
  612. }, function($ctx1) {$ctx1.fill(self,"withSequence:do:",{aSequence:aSequence,aBlock:aBlock,outerSequence:outerSequence}, smalltalk.IRASTTranslator)})},
  613. args: ["aSequence", "aBlock"],
  614. source: "withSequence: aSequence do: aBlock\x0a\x09| outerSequence |\x0a\x09outerSequence := self sequence.\x0a\x09self sequence: aSequence.\x0a\x09aBlock value.\x0a\x09self sequence: outerSequence.\x0a\x09^ aSequence",
  615. messageSends: ["sequence", "sequence:", "value"],
  616. referencedClasses: []
  617. }),
  618. smalltalk.IRASTTranslator);
  619. smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler-IR');
  620. smalltalk.IRInstruction.comment="I am the abstract root class of the IR (intermediate representation) instructions class hierarchy.\x0aThe IR graph is used to emit JavaScript code using a JSStream."
  621. smalltalk.addMethod(
  622. "_accept_",
  623. smalltalk.method({
  624. selector: "accept:",
  625. category: 'visiting',
  626. fn: function (aVisitor){
  627. var self=this;
  628. return smalltalk.withContext(function($ctx1) { var $1;
  629. $1=_st(aVisitor)._visitIRInstruction_(self);
  630. return $1;
  631. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInstruction)})},
  632. args: ["aVisitor"],
  633. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInstruction: self",
  634. messageSends: ["visitIRInstruction:"],
  635. referencedClasses: []
  636. }),
  637. smalltalk.IRInstruction);
  638. smalltalk.addMethod(
  639. "_add_",
  640. smalltalk.method({
  641. selector: "add:",
  642. category: 'building',
  643. fn: function (anObject){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx1) { var $1;
  646. _st(anObject)._parent_(self);
  647. $1=_st(_st(self)._instructions())._add_(anObject);
  648. return $1;
  649. }, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject}, smalltalk.IRInstruction)})},
  650. args: ["anObject"],
  651. source: "add: anObject\x0a\x09anObject parent: self.\x0a\x09^ self instructions add: anObject",
  652. messageSends: ["parent:", "add:", "instructions"],
  653. referencedClasses: []
  654. }),
  655. smalltalk.IRInstruction);
  656. smalltalk.addMethod(
  657. "_canBeAssigned",
  658. smalltalk.method({
  659. selector: "canBeAssigned",
  660. category: 'testing',
  661. fn: function (){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) { return true;
  664. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{}, smalltalk.IRInstruction)})},
  665. args: [],
  666. source: "canBeAssigned\x0a\x09^ true",
  667. messageSends: [],
  668. referencedClasses: []
  669. }),
  670. smalltalk.IRInstruction);
  671. smalltalk.addMethod(
  672. "_instructions",
  673. smalltalk.method({
  674. selector: "instructions",
  675. category: 'accessing',
  676. fn: function (){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) { var $2,$1;
  679. $2=self["@instructions"];
  680. if(($receiver = $2) == nil || $receiver == undefined){
  681. self["@instructions"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  682. $1=self["@instructions"];
  683. } else {
  684. $1=$2;
  685. };
  686. return $1;
  687. }, function($ctx1) {$ctx1.fill(self,"instructions",{}, smalltalk.IRInstruction)})},
  688. args: [],
  689. source: "instructions\x0a\x09^ instructions ifNil: [ instructions := OrderedCollection new ]",
  690. messageSends: ["ifNil:", "new"],
  691. referencedClasses: ["OrderedCollection"]
  692. }),
  693. smalltalk.IRInstruction);
  694. smalltalk.addMethod(
  695. "_isClosure",
  696. smalltalk.method({
  697. selector: "isClosure",
  698. category: 'testing',
  699. fn: function (){
  700. var self=this;
  701. return smalltalk.withContext(function($ctx1) { return false;
  702. }, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRInstruction)})},
  703. args: [],
  704. source: "isClosure\x0a\x09^ false",
  705. messageSends: [],
  706. referencedClasses: []
  707. }),
  708. smalltalk.IRInstruction);
  709. smalltalk.addMethod(
  710. "_isInlined",
  711. smalltalk.method({
  712. selector: "isInlined",
  713. category: 'testing',
  714. fn: function (){
  715. var self=this;
  716. return smalltalk.withContext(function($ctx1) { return false;
  717. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInstruction)})},
  718. args: [],
  719. source: "isInlined\x0a\x09^ false",
  720. messageSends: [],
  721. referencedClasses: []
  722. }),
  723. smalltalk.IRInstruction);
  724. smalltalk.addMethod(
  725. "_isLocalReturn",
  726. smalltalk.method({
  727. selector: "isLocalReturn",
  728. category: 'testing',
  729. fn: function (){
  730. var self=this;
  731. return smalltalk.withContext(function($ctx1) { return false;
  732. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRInstruction)})},
  733. args: [],
  734. source: "isLocalReturn\x0a\x09^ false",
  735. messageSends: [],
  736. referencedClasses: []
  737. }),
  738. smalltalk.IRInstruction);
  739. smalltalk.addMethod(
  740. "_isMethod",
  741. smalltalk.method({
  742. selector: "isMethod",
  743. category: 'testing',
  744. fn: function (){
  745. var self=this;
  746. return smalltalk.withContext(function($ctx1) { return false;
  747. }, function($ctx1) {$ctx1.fill(self,"isMethod",{}, smalltalk.IRInstruction)})},
  748. args: [],
  749. source: "isMethod\x0a\x09^ false",
  750. messageSends: [],
  751. referencedClasses: []
  752. }),
  753. smalltalk.IRInstruction);
  754. smalltalk.addMethod(
  755. "_isReturn",
  756. smalltalk.method({
  757. selector: "isReturn",
  758. category: 'testing',
  759. fn: function (){
  760. var self=this;
  761. return smalltalk.withContext(function($ctx1) { return false;
  762. }, function($ctx1) {$ctx1.fill(self,"isReturn",{}, smalltalk.IRInstruction)})},
  763. args: [],
  764. source: "isReturn\x0a\x09^ false",
  765. messageSends: [],
  766. referencedClasses: []
  767. }),
  768. smalltalk.IRInstruction);
  769. smalltalk.addMethod(
  770. "_isSend",
  771. smalltalk.method({
  772. selector: "isSend",
  773. category: 'testing',
  774. fn: function (){
  775. var self=this;
  776. return smalltalk.withContext(function($ctx1) { return false;
  777. }, function($ctx1) {$ctx1.fill(self,"isSend",{}, smalltalk.IRInstruction)})},
  778. args: [],
  779. source: "isSend\x0a\x09^ false",
  780. messageSends: [],
  781. referencedClasses: []
  782. }),
  783. smalltalk.IRInstruction);
  784. smalltalk.addMethod(
  785. "_isSequence",
  786. smalltalk.method({
  787. selector: "isSequence",
  788. category: 'testing',
  789. fn: function (){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) { return false;
  792. }, function($ctx1) {$ctx1.fill(self,"isSequence",{}, smalltalk.IRInstruction)})},
  793. args: [],
  794. source: "isSequence\x0a\x09^ false",
  795. messageSends: [],
  796. referencedClasses: []
  797. }),
  798. smalltalk.IRInstruction);
  799. smalltalk.addMethod(
  800. "_isTempDeclaration",
  801. smalltalk.method({
  802. selector: "isTempDeclaration",
  803. category: 'testing',
  804. fn: function (){
  805. var self=this;
  806. return smalltalk.withContext(function($ctx1) { return false;
  807. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{}, smalltalk.IRInstruction)})},
  808. args: [],
  809. source: "isTempDeclaration\x0a\x09^ false",
  810. messageSends: [],
  811. referencedClasses: []
  812. }),
  813. smalltalk.IRInstruction);
  814. smalltalk.addMethod(
  815. "_isVariable",
  816. smalltalk.method({
  817. selector: "isVariable",
  818. category: 'testing',
  819. fn: function (){
  820. var self=this;
  821. return smalltalk.withContext(function($ctx1) { return false;
  822. }, function($ctx1) {$ctx1.fill(self,"isVariable",{}, smalltalk.IRInstruction)})},
  823. args: [],
  824. source: "isVariable\x0a\x09^ false",
  825. messageSends: [],
  826. referencedClasses: []
  827. }),
  828. smalltalk.IRInstruction);
  829. smalltalk.addMethod(
  830. "_method",
  831. smalltalk.method({
  832. selector: "method",
  833. category: 'accessing',
  834. fn: function (){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx1) { var $1;
  837. $1=_st(_st(self)._parent())._method();
  838. return $1;
  839. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.IRInstruction)})},
  840. args: [],
  841. source: "method\x0a\x09^ self parent method",
  842. messageSends: ["method", "parent"],
  843. referencedClasses: []
  844. }),
  845. smalltalk.IRInstruction);
  846. smalltalk.addMethod(
  847. "_parent",
  848. smalltalk.method({
  849. selector: "parent",
  850. category: 'accessing',
  851. fn: function (){
  852. var self=this;
  853. return smalltalk.withContext(function($ctx1) { var $1;
  854. $1=self["@parent"];
  855. return $1;
  856. }, function($ctx1) {$ctx1.fill(self,"parent",{}, smalltalk.IRInstruction)})},
  857. args: [],
  858. source: "parent\x0a\x09^ parent",
  859. messageSends: [],
  860. referencedClasses: []
  861. }),
  862. smalltalk.IRInstruction);
  863. smalltalk.addMethod(
  864. "_parent_",
  865. smalltalk.method({
  866. selector: "parent:",
  867. category: 'accessing',
  868. fn: function (anIRInstruction){
  869. var self=this;
  870. return smalltalk.withContext(function($ctx1) { self["@parent"]=anIRInstruction;
  871. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{anIRInstruction:anIRInstruction}, smalltalk.IRInstruction)})},
  872. args: ["anIRInstruction"],
  873. source: "parent: anIRInstruction\x0a\x09parent := anIRInstruction",
  874. messageSends: [],
  875. referencedClasses: []
  876. }),
  877. smalltalk.IRInstruction);
  878. smalltalk.addMethod(
  879. "_remove",
  880. smalltalk.method({
  881. selector: "remove",
  882. category: 'building',
  883. fn: function (){
  884. var self=this;
  885. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._remove_(self);
  886. return self}, function($ctx1) {$ctx1.fill(self,"remove",{}, smalltalk.IRInstruction)})},
  887. args: [],
  888. source: "remove\x0a\x09self parent remove: self",
  889. messageSends: ["remove:", "parent"],
  890. referencedClasses: []
  891. }),
  892. smalltalk.IRInstruction);
  893. smalltalk.addMethod(
  894. "_remove_",
  895. smalltalk.method({
  896. selector: "remove:",
  897. category: 'building',
  898. fn: function (anIRInstruction){
  899. var self=this;
  900. return smalltalk.withContext(function($ctx1) { _st(_st(self)._instructions())._remove_(anIRInstruction);
  901. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anIRInstruction:anIRInstruction}, smalltalk.IRInstruction)})},
  902. args: ["anIRInstruction"],
  903. source: "remove: anIRInstruction\x0a\x09self instructions remove: anIRInstruction",
  904. messageSends: ["remove:", "instructions"],
  905. referencedClasses: []
  906. }),
  907. smalltalk.IRInstruction);
  908. smalltalk.addMethod(
  909. "_replace_with_",
  910. smalltalk.method({
  911. selector: "replace:with:",
  912. category: 'building',
  913. fn: function (anIRInstruction,anotherIRInstruction){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) { _st(anotherIRInstruction)._parent_(self);
  916. _st(_st(self)._instructions())._at_put_(_st(_st(self)._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
  917. return self}, function($ctx1) {$ctx1.fill(self,"replace:with:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRInstruction)})},
  918. args: ["anIRInstruction", "anotherIRInstruction"],
  919. source: "replace: anIRInstruction with: anotherIRInstruction\x0a\x09anotherIRInstruction parent: self.\x0a\x09self instructions \x0a\x09\x09at: (self instructions indexOf: anIRInstruction)\x0a\x09\x09put: anotherIRInstruction",
  920. messageSends: ["parent:", "at:put:", "indexOf:", "instructions"],
  921. referencedClasses: []
  922. }),
  923. smalltalk.IRInstruction);
  924. smalltalk.addMethod(
  925. "_replaceWith_",
  926. smalltalk.method({
  927. selector: "replaceWith:",
  928. category: 'building',
  929. fn: function (anIRInstruction){
  930. var self=this;
  931. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._replace_with_(self,anIRInstruction);
  932. return self}, function($ctx1) {$ctx1.fill(self,"replaceWith:",{anIRInstruction:anIRInstruction}, smalltalk.IRInstruction)})},
  933. args: ["anIRInstruction"],
  934. source: "replaceWith: anIRInstruction\x0a\x09self parent replace: self with: anIRInstruction",
  935. messageSends: ["replace:with:", "parent"],
  936. referencedClasses: []
  937. }),
  938. smalltalk.IRInstruction);
  939. smalltalk.addMethod(
  940. "_on_",
  941. smalltalk.method({
  942. selector: "on:",
  943. category: 'instance creation',
  944. fn: function (aBuilder){
  945. var self=this;
  946. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  947. $2=_st(self)._new();
  948. _st($2)._builder_(aBuilder);
  949. $3=_st($2)._yourself();
  950. $1=$3;
  951. return $1;
  952. }, function($ctx1) {$ctx1.fill(self,"on:",{aBuilder:aBuilder}, smalltalk.IRInstruction.klass)})},
  953. args: ["aBuilder"],
  954. source: "on: aBuilder\x0a\x09^ self new\x0a\x09\x09builder: aBuilder;\x0a\x09\x09yourself",
  955. messageSends: ["builder:", "new", "yourself"],
  956. referencedClasses: []
  957. }),
  958. smalltalk.IRInstruction.klass);
  959. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  960. smalltalk.addMethod(
  961. "_accept_",
  962. smalltalk.method({
  963. selector: "accept:",
  964. category: 'visiting',
  965. fn: function (aVisitor){
  966. var self=this;
  967. return smalltalk.withContext(function($ctx1) { var $1;
  968. $1=_st(aVisitor)._visitIRAssignment_(self);
  969. return $1;
  970. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRAssignment)})},
  971. args: ["aVisitor"],
  972. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRAssignment: self",
  973. messageSends: ["visitIRAssignment:"],
  974. referencedClasses: []
  975. }),
  976. smalltalk.IRAssignment);
  977. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  978. smalltalk.addMethod(
  979. "_accept_",
  980. smalltalk.method({
  981. selector: "accept:",
  982. category: 'visiting',
  983. fn: function (aVisitor){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) { var $1;
  986. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  987. return $1;
  988. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRDynamicArray)})},
  989. args: ["aVisitor"],
  990. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicArray: self",
  991. messageSends: ["visitIRDynamicArray:"],
  992. referencedClasses: []
  993. }),
  994. smalltalk.IRDynamicArray);
  995. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  996. smalltalk.addMethod(
  997. "_accept_",
  998. smalltalk.method({
  999. selector: "accept:",
  1000. category: 'visiting',
  1001. fn: function (aVisitor){
  1002. var self=this;
  1003. return smalltalk.withContext(function($ctx1) { var $1;
  1004. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  1005. return $1;
  1006. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRDynamicDictionary)})},
  1007. args: ["aVisitor"],
  1008. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicDictionary: self",
  1009. messageSends: ["visitIRDynamicDictionary:"],
  1010. referencedClasses: []
  1011. }),
  1012. smalltalk.IRDynamicDictionary);
  1013. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  1014. smalltalk.addMethod(
  1015. "_scope",
  1016. smalltalk.method({
  1017. selector: "scope",
  1018. category: 'accessing',
  1019. fn: function (){
  1020. var self=this;
  1021. return smalltalk.withContext(function($ctx1) { var $1;
  1022. $1=self["@scope"];
  1023. return $1;
  1024. }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.IRScopedInstruction)})},
  1025. args: [],
  1026. source: "scope\x0a\x09^ scope",
  1027. messageSends: [],
  1028. referencedClasses: []
  1029. }),
  1030. smalltalk.IRScopedInstruction);
  1031. smalltalk.addMethod(
  1032. "_scope_",
  1033. smalltalk.method({
  1034. selector: "scope:",
  1035. category: 'accessing',
  1036. fn: function (aScope){
  1037. var self=this;
  1038. return smalltalk.withContext(function($ctx1) { self["@scope"]=aScope;
  1039. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRScopedInstruction)})},
  1040. args: ["aScope"],
  1041. source: "scope: aScope\x0a\x09scope := aScope",
  1042. messageSends: [],
  1043. referencedClasses: []
  1044. }),
  1045. smalltalk.IRScopedInstruction);
  1046. smalltalk.addClass('IRClosure', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  1047. smalltalk.addMethod(
  1048. "_accept_",
  1049. smalltalk.method({
  1050. selector: "accept:",
  1051. category: 'visiting',
  1052. fn: function (aVisitor){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx1) { var $1;
  1055. $1=_st(aVisitor)._visitIRClosure_(self);
  1056. return $1;
  1057. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRClosure)})},
  1058. args: ["aVisitor"],
  1059. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
  1060. messageSends: ["visitIRClosure:"],
  1061. referencedClasses: []
  1062. }),
  1063. smalltalk.IRClosure);
  1064. smalltalk.addMethod(
  1065. "_arguments",
  1066. smalltalk.method({
  1067. selector: "arguments",
  1068. category: 'accessing',
  1069. fn: function (){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1072. $2=self["@arguments"];
  1073. if(($receiver = $2) == nil || $receiver == undefined){
  1074. $1=[];
  1075. } else {
  1076. $1=$2;
  1077. };
  1078. return $1;
  1079. }, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRClosure)})},
  1080. args: [],
  1081. source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
  1082. messageSends: ["ifNil:"],
  1083. referencedClasses: []
  1084. }),
  1085. smalltalk.IRClosure);
  1086. smalltalk.addMethod(
  1087. "_arguments_",
  1088. smalltalk.method({
  1089. selector: "arguments:",
  1090. category: 'accessing',
  1091. fn: function (aCollection){
  1092. var self=this;
  1093. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  1094. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRClosure)})},
  1095. args: ["aCollection"],
  1096. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1097. messageSends: [],
  1098. referencedClasses: []
  1099. }),
  1100. smalltalk.IRClosure);
  1101. smalltalk.addMethod(
  1102. "_isClosure",
  1103. smalltalk.method({
  1104. selector: "isClosure",
  1105. category: 'testing',
  1106. fn: function (){
  1107. var self=this;
  1108. return smalltalk.withContext(function($ctx1) { return true;
  1109. }, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRClosure)})},
  1110. args: [],
  1111. source: "isClosure\x0a\x09^ true",
  1112. messageSends: [],
  1113. referencedClasses: []
  1114. }),
  1115. smalltalk.IRClosure);
  1116. smalltalk.addMethod(
  1117. "_locals",
  1118. smalltalk.method({
  1119. selector: "locals",
  1120. category: 'accessing',
  1121. fn: function (){
  1122. var self=this;
  1123. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1124. $2=_st(_st(self)._arguments())._copy();
  1125. _st($2)._addAll_(_st(_st(self)._tempDeclarations())._collect_((function(each){
  1126. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  1127. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1128. $3=_st($2)._yourself();
  1129. $1=$3;
  1130. return $1;
  1131. }, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRClosure)})},
  1132. args: [],
  1133. source: "locals\x0a\x09^ self arguments copy\x0a \x09addAll: (self tempDeclarations collect: [ :each | each name ]); \x0a yourself",
  1134. messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"],
  1135. referencedClasses: []
  1136. }),
  1137. smalltalk.IRClosure);
  1138. smalltalk.addMethod(
  1139. "_scope_",
  1140. smalltalk.method({
  1141. selector: "scope:",
  1142. category: 'accessing',
  1143. fn: function (aScope){
  1144. var self=this;
  1145. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  1146. _st(aScope)._instruction_(self);
  1147. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRClosure)})},
  1148. args: ["aScope"],
  1149. source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
  1150. messageSends: ["scope:", "instruction:"],
  1151. referencedClasses: []
  1152. }),
  1153. smalltalk.IRClosure);
  1154. smalltalk.addMethod(
  1155. "_sequence",
  1156. smalltalk.method({
  1157. selector: "sequence",
  1158. category: 'accessing',
  1159. fn: function (){
  1160. var self=this;
  1161. return smalltalk.withContext(function($ctx1) { var $1;
  1162. $1=_st(_st(self)._instructions())._last();
  1163. return $1;
  1164. }, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRClosure)})},
  1165. args: [],
  1166. source: "sequence\x0a\x09^ self instructions last",
  1167. messageSends: ["last", "instructions"],
  1168. referencedClasses: []
  1169. }),
  1170. smalltalk.IRClosure);
  1171. smalltalk.addMethod(
  1172. "_tempDeclarations",
  1173. smalltalk.method({
  1174. selector: "tempDeclarations",
  1175. category: 'accessing',
  1176. fn: function (){
  1177. var self=this;
  1178. return smalltalk.withContext(function($ctx1) { var $1;
  1179. $1=_st(_st(self)._instructions())._select_((function(each){
  1180. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  1181. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1182. return $1;
  1183. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRClosure)})},
  1184. args: [],
  1185. source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a \x09each isTempDeclaration ]",
  1186. messageSends: ["select:", "isTempDeclaration", "instructions"],
  1187. referencedClasses: []
  1188. }),
  1189. smalltalk.IRClosure);
  1190. smalltalk.addClass('IRMethod', smalltalk.IRScopedInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'arguments', 'internalVariables'], 'Compiler-IR');
  1191. smalltalk.IRMethod.comment="I am a method instruction"
  1192. smalltalk.addMethod(
  1193. "_accept_",
  1194. smalltalk.method({
  1195. selector: "accept:",
  1196. category: 'visiting',
  1197. fn: function (aVisitor){
  1198. var self=this;
  1199. return smalltalk.withContext(function($ctx1) { var $1;
  1200. $1=_st(aVisitor)._visitIRMethod_(self);
  1201. return $1;
  1202. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRMethod)})},
  1203. args: ["aVisitor"],
  1204. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
  1205. messageSends: ["visitIRMethod:"],
  1206. referencedClasses: []
  1207. }),
  1208. smalltalk.IRMethod);
  1209. smalltalk.addMethod(
  1210. "_arguments",
  1211. smalltalk.method({
  1212. selector: "arguments",
  1213. category: 'accessing',
  1214. fn: function (){
  1215. var self=this;
  1216. return smalltalk.withContext(function($ctx1) { var $1;
  1217. $1=self["@arguments"];
  1218. return $1;
  1219. }, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRMethod)})},
  1220. args: [],
  1221. source: "arguments\x0a\x09^ arguments",
  1222. messageSends: [],
  1223. referencedClasses: []
  1224. }),
  1225. smalltalk.IRMethod);
  1226. smalltalk.addMethod(
  1227. "_arguments_",
  1228. smalltalk.method({
  1229. selector: "arguments:",
  1230. category: 'accessing',
  1231. fn: function (aCollection){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  1234. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  1235. args: ["aCollection"],
  1236. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1237. messageSends: [],
  1238. referencedClasses: []
  1239. }),
  1240. smalltalk.IRMethod);
  1241. smalltalk.addMethod(
  1242. "_classReferences",
  1243. smalltalk.method({
  1244. selector: "classReferences",
  1245. category: 'accessing',
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) { var $1;
  1249. $1=self["@classReferences"];
  1250. return $1;
  1251. }, function($ctx1) {$ctx1.fill(self,"classReferences",{}, smalltalk.IRMethod)})},
  1252. args: [],
  1253. source: "classReferences\x0a\x09^ classReferences",
  1254. messageSends: [],
  1255. referencedClasses: []
  1256. }),
  1257. smalltalk.IRMethod);
  1258. smalltalk.addMethod(
  1259. "_classReferences_",
  1260. smalltalk.method({
  1261. selector: "classReferences:",
  1262. category: 'accessing',
  1263. fn: function (aCollection){
  1264. var self=this;
  1265. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  1266. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  1267. args: ["aCollection"],
  1268. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  1269. messageSends: [],
  1270. referencedClasses: []
  1271. }),
  1272. smalltalk.IRMethod);
  1273. smalltalk.addMethod(
  1274. "_internalVariables",
  1275. smalltalk.method({
  1276. selector: "internalVariables",
  1277. category: 'accessing',
  1278. fn: function (){
  1279. var self=this;
  1280. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1281. $2=self["@internalVariables"];
  1282. if(($receiver = $2) == nil || $receiver == undefined){
  1283. self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
  1284. $1=self["@internalVariables"];
  1285. } else {
  1286. $1=$2;
  1287. };
  1288. return $1;
  1289. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{}, smalltalk.IRMethod)})},
  1290. args: [],
  1291. source: "internalVariables\x0a\x09^ internalVariables ifNil: [ internalVariables := Set new ]",
  1292. messageSends: ["ifNil:", "new"],
  1293. referencedClasses: ["Set"]
  1294. }),
  1295. smalltalk.IRMethod);
  1296. smalltalk.addMethod(
  1297. "_isMethod",
  1298. smalltalk.method({
  1299. selector: "isMethod",
  1300. category: 'accessing',
  1301. fn: function (){
  1302. var self=this;
  1303. return smalltalk.withContext(function($ctx1) { return true;
  1304. }, function($ctx1) {$ctx1.fill(self,"isMethod",{}, smalltalk.IRMethod)})},
  1305. args: [],
  1306. source: "isMethod\x0a\x09^ true",
  1307. messageSends: [],
  1308. referencedClasses: []
  1309. }),
  1310. smalltalk.IRMethod);
  1311. smalltalk.addMethod(
  1312. "_locals",
  1313. smalltalk.method({
  1314. selector: "locals",
  1315. category: 'accessing',
  1316. fn: function (){
  1317. var self=this;
  1318. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1319. $2=_st(_st(self)._arguments())._copy();
  1320. _st($2)._addAll_(_st(_st(self)._tempDeclarations())._collect_((function(each){
  1321. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  1322. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1323. $3=_st($2)._yourself();
  1324. $1=$3;
  1325. return $1;
  1326. }, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRMethod)})},
  1327. args: [],
  1328. source: "locals\x0a\x09^ self arguments copy\x0a \x09addAll: (self tempDeclarations collect: [ :each | each name ]); \x0a yourself",
  1329. messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"],
  1330. referencedClasses: []
  1331. }),
  1332. smalltalk.IRMethod);
  1333. smalltalk.addMethod(
  1334. "_messageSends",
  1335. smalltalk.method({
  1336. selector: "messageSends",
  1337. category: 'accessing',
  1338. fn: function (){
  1339. var self=this;
  1340. return smalltalk.withContext(function($ctx1) { var $1;
  1341. $1=self["@messageSends"];
  1342. return $1;
  1343. }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.IRMethod)})},
  1344. args: [],
  1345. source: "messageSends\x0a\x09^ messageSends",
  1346. messageSends: [],
  1347. referencedClasses: []
  1348. }),
  1349. smalltalk.IRMethod);
  1350. smalltalk.addMethod(
  1351. "_messageSends_",
  1352. smalltalk.method({
  1353. selector: "messageSends:",
  1354. category: 'accessing',
  1355. fn: function (aCollection){
  1356. var self=this;
  1357. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  1358. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  1359. args: ["aCollection"],
  1360. source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
  1361. messageSends: [],
  1362. referencedClasses: []
  1363. }),
  1364. smalltalk.IRMethod);
  1365. smalltalk.addMethod(
  1366. "_method",
  1367. smalltalk.method({
  1368. selector: "method",
  1369. category: 'accessing',
  1370. fn: function (){
  1371. var self=this;
  1372. return smalltalk.withContext(function($ctx1) { var $1;
  1373. $1=self;
  1374. return $1;
  1375. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.IRMethod)})},
  1376. args: [],
  1377. source: "method\x0a\x09^ self",
  1378. messageSends: [],
  1379. referencedClasses: []
  1380. }),
  1381. smalltalk.IRMethod);
  1382. smalltalk.addMethod(
  1383. "_scope_",
  1384. smalltalk.method({
  1385. selector: "scope:",
  1386. category: 'accessing',
  1387. fn: function (aScope){
  1388. var self=this;
  1389. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  1390. _st(aScope)._instruction_(self);
  1391. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRMethod)})},
  1392. args: ["aScope"],
  1393. source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
  1394. messageSends: ["scope:", "instruction:"],
  1395. referencedClasses: []
  1396. }),
  1397. smalltalk.IRMethod);
  1398. smalltalk.addMethod(
  1399. "_selector",
  1400. smalltalk.method({
  1401. selector: "selector",
  1402. category: 'accessing',
  1403. fn: function (){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx1) { var $1;
  1406. $1=self["@selector"];
  1407. return $1;
  1408. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.IRMethod)})},
  1409. args: [],
  1410. source: "selector\x0a\x09^ selector",
  1411. messageSends: [],
  1412. referencedClasses: []
  1413. }),
  1414. smalltalk.IRMethod);
  1415. smalltalk.addMethod(
  1416. "_selector_",
  1417. smalltalk.method({
  1418. selector: "selector:",
  1419. category: 'accessing',
  1420. fn: function (aString){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1423. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.IRMethod)})},
  1424. args: ["aString"],
  1425. source: "selector: aString\x0a\x09selector := aString",
  1426. messageSends: [],
  1427. referencedClasses: []
  1428. }),
  1429. smalltalk.IRMethod);
  1430. smalltalk.addMethod(
  1431. "_source",
  1432. smalltalk.method({
  1433. selector: "source",
  1434. category: 'accessing',
  1435. fn: function (){
  1436. var self=this;
  1437. return smalltalk.withContext(function($ctx1) { var $1;
  1438. $1=self["@source"];
  1439. return $1;
  1440. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRMethod)})},
  1441. args: [],
  1442. source: "source\x0a\x09^ source",
  1443. messageSends: [],
  1444. referencedClasses: []
  1445. }),
  1446. smalltalk.IRMethod);
  1447. smalltalk.addMethod(
  1448. "_source_",
  1449. smalltalk.method({
  1450. selector: "source:",
  1451. category: 'accessing',
  1452. fn: function (aString){
  1453. var self=this;
  1454. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1455. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRMethod)})},
  1456. args: ["aString"],
  1457. source: "source: aString\x0a\x09source := aString",
  1458. messageSends: [],
  1459. referencedClasses: []
  1460. }),
  1461. smalltalk.IRMethod);
  1462. smalltalk.addMethod(
  1463. "_superSends",
  1464. smalltalk.method({
  1465. selector: "superSends",
  1466. category: 'accessing',
  1467. fn: function (){
  1468. var self=this;
  1469. return smalltalk.withContext(function($ctx1) { var $1;
  1470. $1=self["@superSends"];
  1471. return $1;
  1472. }, function($ctx1) {$ctx1.fill(self,"superSends",{}, smalltalk.IRMethod)})},
  1473. args: [],
  1474. source: "superSends\x0a\x09^ superSends",
  1475. messageSends: [],
  1476. referencedClasses: []
  1477. }),
  1478. smalltalk.IRMethod);
  1479. smalltalk.addMethod(
  1480. "_superSends_",
  1481. smalltalk.method({
  1482. selector: "superSends:",
  1483. category: 'accessing',
  1484. fn: function (aCollection){
  1485. var self=this;
  1486. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  1487. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  1488. args: ["aCollection"],
  1489. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  1490. messageSends: [],
  1491. referencedClasses: []
  1492. }),
  1493. smalltalk.IRMethod);
  1494. smalltalk.addMethod(
  1495. "_tempDeclarations",
  1496. smalltalk.method({
  1497. selector: "tempDeclarations",
  1498. category: 'accessing',
  1499. fn: function (){
  1500. var self=this;
  1501. return smalltalk.withContext(function($ctx1) { var $1;
  1502. $1=_st(_st(self)._instructions())._select_((function(each){
  1503. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  1504. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1505. return $1;
  1506. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRMethod)})},
  1507. args: [],
  1508. source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a \x09each isTempDeclaration ]",
  1509. messageSends: ["select:", "isTempDeclaration", "instructions"],
  1510. referencedClasses: []
  1511. }),
  1512. smalltalk.IRMethod);
  1513. smalltalk.addMethod(
  1514. "_theClass",
  1515. smalltalk.method({
  1516. selector: "theClass",
  1517. category: 'accessing',
  1518. fn: function (){
  1519. var self=this;
  1520. return smalltalk.withContext(function($ctx1) { var $1;
  1521. $1=self["@theClass"];
  1522. return $1;
  1523. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.IRMethod)})},
  1524. args: [],
  1525. source: "theClass\x0a\x09^ theClass",
  1526. messageSends: [],
  1527. referencedClasses: []
  1528. }),
  1529. smalltalk.IRMethod);
  1530. smalltalk.addMethod(
  1531. "_theClass_",
  1532. smalltalk.method({
  1533. selector: "theClass:",
  1534. category: 'accessing',
  1535. fn: function (aClass){
  1536. var self=this;
  1537. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  1538. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.IRMethod)})},
  1539. args: ["aClass"],
  1540. source: "theClass: aClass\x0a\x09theClass := aClass",
  1541. messageSends: [],
  1542. referencedClasses: []
  1543. }),
  1544. smalltalk.IRMethod);
  1545. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1546. smalltalk.IRReturn.comment="I am a local return instruction."
  1547. smalltalk.addMethod(
  1548. "_accept_",
  1549. smalltalk.method({
  1550. selector: "accept:",
  1551. category: 'visiting',
  1552. fn: function (aVisitor){
  1553. var self=this;
  1554. return smalltalk.withContext(function($ctx1) { var $1;
  1555. $1=_st(aVisitor)._visitIRReturn_(self);
  1556. return $1;
  1557. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRReturn)})},
  1558. args: ["aVisitor"],
  1559. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRReturn: self",
  1560. messageSends: ["visitIRReturn:"],
  1561. referencedClasses: []
  1562. }),
  1563. smalltalk.IRReturn);
  1564. smalltalk.addMethod(
  1565. "_canBeAssigned",
  1566. smalltalk.method({
  1567. selector: "canBeAssigned",
  1568. category: 'testing',
  1569. fn: function (){
  1570. var self=this;
  1571. return smalltalk.withContext(function($ctx1) { return false;
  1572. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{}, smalltalk.IRReturn)})},
  1573. args: [],
  1574. source: "canBeAssigned\x0a\x09^ false",
  1575. messageSends: [],
  1576. referencedClasses: []
  1577. }),
  1578. smalltalk.IRReturn);
  1579. smalltalk.addMethod(
  1580. "_isBlockReturn",
  1581. smalltalk.method({
  1582. selector: "isBlockReturn",
  1583. category: 'testing',
  1584. fn: function (){
  1585. var self=this;
  1586. return smalltalk.withContext(function($ctx1) { return false;
  1587. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{}, smalltalk.IRReturn)})},
  1588. args: [],
  1589. source: "isBlockReturn\x0a\x09^ false",
  1590. messageSends: [],
  1591. referencedClasses: []
  1592. }),
  1593. smalltalk.IRReturn);
  1594. smalltalk.addMethod(
  1595. "_isLocalReturn",
  1596. smalltalk.method({
  1597. selector: "isLocalReturn",
  1598. category: 'testing',
  1599. fn: function (){
  1600. var self=this;
  1601. return smalltalk.withContext(function($ctx1) { return true;
  1602. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRReturn)})},
  1603. args: [],
  1604. source: "isLocalReturn\x0a\x09^ true",
  1605. messageSends: [],
  1606. referencedClasses: []
  1607. }),
  1608. smalltalk.IRReturn);
  1609. smalltalk.addMethod(
  1610. "_isNonLocalReturn",
  1611. smalltalk.method({
  1612. selector: "isNonLocalReturn",
  1613. category: 'testing',
  1614. fn: function (){
  1615. var self=this;
  1616. return smalltalk.withContext(function($ctx1) { var $1;
  1617. $1=_st(_st(self)._isLocalReturn())._not();
  1618. return $1;
  1619. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn",{}, smalltalk.IRReturn)})},
  1620. args: [],
  1621. source: "isNonLocalReturn\x0a\x09^ self isLocalReturn not",
  1622. messageSends: ["not", "isLocalReturn"],
  1623. referencedClasses: []
  1624. }),
  1625. smalltalk.IRReturn);
  1626. smalltalk.addMethod(
  1627. "_isReturn",
  1628. smalltalk.method({
  1629. selector: "isReturn",
  1630. category: 'testing',
  1631. fn: function (){
  1632. var self=this;
  1633. return smalltalk.withContext(function($ctx1) { return true;
  1634. }, function($ctx1) {$ctx1.fill(self,"isReturn",{}, smalltalk.IRReturn)})},
  1635. args: [],
  1636. source: "isReturn\x0a\x09^ true",
  1637. messageSends: [],
  1638. referencedClasses: []
  1639. }),
  1640. smalltalk.IRReturn);
  1641. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1642. smalltalk.IRBlockReturn.comment="Smalltalk blocks return their last statement. I am a implicit block return instruction."
  1643. smalltalk.addMethod(
  1644. "_accept_",
  1645. smalltalk.method({
  1646. selector: "accept:",
  1647. category: 'visiting',
  1648. fn: function (aVisitor){
  1649. var self=this;
  1650. return smalltalk.withContext(function($ctx1) { var $1;
  1651. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1652. return $1;
  1653. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRBlockReturn)})},
  1654. args: ["aVisitor"],
  1655. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockReturn: self",
  1656. messageSends: ["visitIRBlockReturn:"],
  1657. referencedClasses: []
  1658. }),
  1659. smalltalk.IRBlockReturn);
  1660. smalltalk.addMethod(
  1661. "_isBlockReturn",
  1662. smalltalk.method({
  1663. selector: "isBlockReturn",
  1664. category: 'testing',
  1665. fn: function (){
  1666. var self=this;
  1667. return smalltalk.withContext(function($ctx1) { return true;
  1668. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{}, smalltalk.IRBlockReturn)})},
  1669. args: [],
  1670. source: "isBlockReturn\x0a\x09^ true",
  1671. messageSends: [],
  1672. referencedClasses: []
  1673. }),
  1674. smalltalk.IRBlockReturn);
  1675. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1676. smalltalk.IRNonLocalReturn.comment="I am a non local return instruction.\x0aNon local returns are handled using a try/catch JS statement.\x0a\x0aSee IRNonLocalReturnHandling class"
  1677. smalltalk.addMethod(
  1678. "_accept_",
  1679. smalltalk.method({
  1680. selector: "accept:",
  1681. category: 'visiting',
  1682. fn: function (aVisitor){
  1683. var self=this;
  1684. return smalltalk.withContext(function($ctx1) { var $1;
  1685. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1686. return $1;
  1687. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRNonLocalReturn)})},
  1688. args: ["aVisitor"],
  1689. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRNonLocalReturn: self",
  1690. messageSends: ["visitIRNonLocalReturn:"],
  1691. referencedClasses: []
  1692. }),
  1693. smalltalk.IRNonLocalReturn);
  1694. smalltalk.addMethod(
  1695. "_isLocalReturn",
  1696. smalltalk.method({
  1697. selector: "isLocalReturn",
  1698. category: 'testing',
  1699. fn: function (){
  1700. var self=this;
  1701. return smalltalk.withContext(function($ctx1) { return false;
  1702. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRNonLocalReturn)})},
  1703. args: [],
  1704. source: "isLocalReturn\x0a\x09^ false",
  1705. messageSends: [],
  1706. referencedClasses: []
  1707. }),
  1708. smalltalk.IRNonLocalReturn);
  1709. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1710. smalltalk.addMethod(
  1711. "_accept_",
  1712. smalltalk.method({
  1713. selector: "accept:",
  1714. category: 'visiting',
  1715. fn: function (aVisitor){
  1716. var self=this;
  1717. return smalltalk.withContext(function($ctx1) { var $1;
  1718. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1719. return $1;
  1720. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRTempDeclaration)})},
  1721. args: ["aVisitor"],
  1722. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRTempDeclaration: self",
  1723. messageSends: ["visitIRTempDeclaration:"],
  1724. referencedClasses: []
  1725. }),
  1726. smalltalk.IRTempDeclaration);
  1727. smalltalk.addMethod(
  1728. "_isTempDeclaration",
  1729. smalltalk.method({
  1730. selector: "isTempDeclaration",
  1731. category: 'testing',
  1732. fn: function (){
  1733. var self=this;
  1734. return smalltalk.withContext(function($ctx1) { return true;
  1735. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{}, smalltalk.IRTempDeclaration)})},
  1736. args: [],
  1737. source: "isTempDeclaration\x0a\x09^ true",
  1738. messageSends: [],
  1739. referencedClasses: []
  1740. }),
  1741. smalltalk.IRTempDeclaration);
  1742. smalltalk.addMethod(
  1743. "_name",
  1744. smalltalk.method({
  1745. selector: "name",
  1746. category: 'accessing',
  1747. fn: function (){
  1748. var self=this;
  1749. return smalltalk.withContext(function($ctx1) { var $1;
  1750. $1=self["@name"];
  1751. return $1;
  1752. }, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.IRTempDeclaration)})},
  1753. args: [],
  1754. source: "name\x0a\x09^ name",
  1755. messageSends: [],
  1756. referencedClasses: []
  1757. }),
  1758. smalltalk.IRTempDeclaration);
  1759. smalltalk.addMethod(
  1760. "_name_",
  1761. smalltalk.method({
  1762. selector: "name:",
  1763. category: 'accessing',
  1764. fn: function (aString){
  1765. var self=this;
  1766. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  1767. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString}, smalltalk.IRTempDeclaration)})},
  1768. args: ["aString"],
  1769. source: "name: aString\x0a\x09name := aString",
  1770. messageSends: [],
  1771. referencedClasses: []
  1772. }),
  1773. smalltalk.IRTempDeclaration);
  1774. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1775. smalltalk.IRSend.comment="I am a message send instruction."
  1776. smalltalk.addMethod(
  1777. "_accept_",
  1778. smalltalk.method({
  1779. selector: "accept:",
  1780. category: 'visiting',
  1781. fn: function (aVisitor){
  1782. var self=this;
  1783. return smalltalk.withContext(function($ctx1) { var $1;
  1784. $1=_st(aVisitor)._visitIRSend_(self);
  1785. return $1;
  1786. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRSend)})},
  1787. args: ["aVisitor"],
  1788. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSend: self",
  1789. messageSends: ["visitIRSend:"],
  1790. referencedClasses: []
  1791. }),
  1792. smalltalk.IRSend);
  1793. smalltalk.addMethod(
  1794. "_classSend",
  1795. smalltalk.method({
  1796. selector: "classSend",
  1797. category: 'accessing',
  1798. fn: function (){
  1799. var self=this;
  1800. return smalltalk.withContext(function($ctx1) { var $1;
  1801. $1=self["@classSend"];
  1802. return $1;
  1803. }, function($ctx1) {$ctx1.fill(self,"classSend",{}, smalltalk.IRSend)})},
  1804. args: [],
  1805. source: "classSend\x0a\x09^ classSend",
  1806. messageSends: [],
  1807. referencedClasses: []
  1808. }),
  1809. smalltalk.IRSend);
  1810. smalltalk.addMethod(
  1811. "_classSend_",
  1812. smalltalk.method({
  1813. selector: "classSend:",
  1814. category: 'accessing',
  1815. fn: function (aClass){
  1816. var self=this;
  1817. return smalltalk.withContext(function($ctx1) { self["@classSend"]=aClass;
  1818. return self}, function($ctx1) {$ctx1.fill(self,"classSend:",{aClass:aClass}, smalltalk.IRSend)})},
  1819. args: ["aClass"],
  1820. source: "classSend: aClass\x0a\x09classSend := aClass",
  1821. messageSends: [],
  1822. referencedClasses: []
  1823. }),
  1824. smalltalk.IRSend);
  1825. smalltalk.addMethod(
  1826. "_index",
  1827. smalltalk.method({
  1828. selector: "index",
  1829. category: 'accessing',
  1830. fn: function (){
  1831. var self=this;
  1832. return smalltalk.withContext(function($ctx1) { var $1;
  1833. $1=self["@index"];
  1834. return $1;
  1835. }, function($ctx1) {$ctx1.fill(self,"index",{}, smalltalk.IRSend)})},
  1836. args: [],
  1837. source: "index\x0a\x09^ index",
  1838. messageSends: [],
  1839. referencedClasses: []
  1840. }),
  1841. smalltalk.IRSend);
  1842. smalltalk.addMethod(
  1843. "_index_",
  1844. smalltalk.method({
  1845. selector: "index:",
  1846. category: 'accessing',
  1847. fn: function (anInteger){
  1848. var self=this;
  1849. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  1850. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger}, smalltalk.IRSend)})},
  1851. args: ["anInteger"],
  1852. source: "index: anInteger\x0a\x09index := anInteger",
  1853. messageSends: [],
  1854. referencedClasses: []
  1855. }),
  1856. smalltalk.IRSend);
  1857. smalltalk.addMethod(
  1858. "_isSend",
  1859. smalltalk.method({
  1860. selector: "isSend",
  1861. category: 'testing',
  1862. fn: function (){
  1863. var self=this;
  1864. return smalltalk.withContext(function($ctx1) { return true;
  1865. }, function($ctx1) {$ctx1.fill(self,"isSend",{}, smalltalk.IRSend)})},
  1866. args: [],
  1867. source: "isSend\x0a\x09^ true",
  1868. messageSends: [],
  1869. referencedClasses: []
  1870. }),
  1871. smalltalk.IRSend);
  1872. smalltalk.addMethod(
  1873. "_javascriptSelector",
  1874. smalltalk.method({
  1875. selector: "javascriptSelector",
  1876. category: 'accessing',
  1877. fn: function (){
  1878. var self=this;
  1879. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1880. $2=_st(self)._classSend();
  1881. if(($receiver = $2) == nil || $receiver == undefined){
  1882. $1=_st(_st(self)._selector())._asSelector();
  1883. } else {
  1884. $1=_st(_st(self)._selector())._asSuperSelector();
  1885. };
  1886. return $1;
  1887. }, function($ctx1) {$ctx1.fill(self,"javascriptSelector",{}, smalltalk.IRSend)})},
  1888. args: [],
  1889. source: "javascriptSelector\x0a\x09^ self classSend \x0a \x09ifNil: [ self selector asSelector ]\x0a \x09ifNotNil: [ self selector asSuperSelector ]",
  1890. messageSends: ["ifNil:ifNotNil:", "asSelector", "selector", "asSuperSelector", "classSend"],
  1891. referencedClasses: []
  1892. }),
  1893. smalltalk.IRSend);
  1894. smalltalk.addMethod(
  1895. "_selector",
  1896. smalltalk.method({
  1897. selector: "selector",
  1898. category: 'accessing',
  1899. fn: function (){
  1900. var self=this;
  1901. return smalltalk.withContext(function($ctx1) { var $1;
  1902. $1=self["@selector"];
  1903. return $1;
  1904. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.IRSend)})},
  1905. args: [],
  1906. source: "selector\x0a\x09^ selector",
  1907. messageSends: [],
  1908. referencedClasses: []
  1909. }),
  1910. smalltalk.IRSend);
  1911. smalltalk.addMethod(
  1912. "_selector_",
  1913. smalltalk.method({
  1914. selector: "selector:",
  1915. category: 'accessing',
  1916. fn: function (aString){
  1917. var self=this;
  1918. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1919. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.IRSend)})},
  1920. args: ["aString"],
  1921. source: "selector: aString\x0a\x09selector := aString",
  1922. messageSends: [],
  1923. referencedClasses: []
  1924. }),
  1925. smalltalk.IRSend);
  1926. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1927. smalltalk.addMethod(
  1928. "_accept_",
  1929. smalltalk.method({
  1930. selector: "accept:",
  1931. category: 'visiting',
  1932. fn: function (aVisitor){
  1933. var self=this;
  1934. return smalltalk.withContext(function($ctx1) { var $1;
  1935. $1=_st(aVisitor)._visitIRSequence_(self);
  1936. return $1;
  1937. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRSequence)})},
  1938. args: ["aVisitor"],
  1939. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSequence: self",
  1940. messageSends: ["visitIRSequence:"],
  1941. referencedClasses: []
  1942. }),
  1943. smalltalk.IRSequence);
  1944. smalltalk.addMethod(
  1945. "_isSequence",
  1946. smalltalk.method({
  1947. selector: "isSequence",
  1948. category: 'testing',
  1949. fn: function (){
  1950. var self=this;
  1951. return smalltalk.withContext(function($ctx1) { return true;
  1952. }, function($ctx1) {$ctx1.fill(self,"isSequence",{}, smalltalk.IRSequence)})},
  1953. args: [],
  1954. source: "isSequence\x0a\x09^ true",
  1955. messageSends: [],
  1956. referencedClasses: []
  1957. }),
  1958. smalltalk.IRSequence);
  1959. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1960. smalltalk.addMethod(
  1961. "_accept_",
  1962. smalltalk.method({
  1963. selector: "accept:",
  1964. category: 'visiting',
  1965. fn: function (aVisitor){
  1966. var self=this;
  1967. return smalltalk.withContext(function($ctx1) { var $1;
  1968. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1969. return $1;
  1970. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRBlockSequence)})},
  1971. args: ["aVisitor"],
  1972. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockSequence: self",
  1973. messageSends: ["visitIRBlockSequence:"],
  1974. referencedClasses: []
  1975. }),
  1976. smalltalk.IRBlockSequence);
  1977. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1978. smalltalk.IRValue.comment="I am the simplest possible instruction. I represent a value."
  1979. smalltalk.addMethod(
  1980. "_accept_",
  1981. smalltalk.method({
  1982. selector: "accept:",
  1983. category: 'visiting',
  1984. fn: function (aVisitor){
  1985. var self=this;
  1986. return smalltalk.withContext(function($ctx1) { var $1;
  1987. $1=_st(aVisitor)._visitIRValue_(self);
  1988. return $1;
  1989. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRValue)})},
  1990. args: ["aVisitor"],
  1991. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRValue: self",
  1992. messageSends: ["visitIRValue:"],
  1993. referencedClasses: []
  1994. }),
  1995. smalltalk.IRValue);
  1996. smalltalk.addMethod(
  1997. "_value",
  1998. smalltalk.method({
  1999. selector: "value",
  2000. category: 'accessing',
  2001. fn: function (){
  2002. var self=this;
  2003. return smalltalk.withContext(function($ctx1) { var $1;
  2004. $1=self["@value"];
  2005. return $1;
  2006. }, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.IRValue)})},
  2007. args: [],
  2008. source: "value\x0a\x09^value",
  2009. messageSends: [],
  2010. referencedClasses: []
  2011. }),
  2012. smalltalk.IRValue);
  2013. smalltalk.addMethod(
  2014. "_value_",
  2015. smalltalk.method({
  2016. selector: "value:",
  2017. category: 'accessing',
  2018. fn: function (aString){
  2019. var self=this;
  2020. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  2021. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString}, smalltalk.IRValue)})},
  2022. args: ["aString"],
  2023. source: "value: aString\x0a\x09value := aString",
  2024. messageSends: [],
  2025. referencedClasses: []
  2026. }),
  2027. smalltalk.IRValue);
  2028. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  2029. smalltalk.IRVariable.comment="I am a variable instruction."
  2030. smalltalk.addMethod(
  2031. "_accept_",
  2032. smalltalk.method({
  2033. selector: "accept:",
  2034. category: 'visiting',
  2035. fn: function (aVisitor){
  2036. var self=this;
  2037. return smalltalk.withContext(function($ctx1) { var $1;
  2038. $1=_st(aVisitor)._visitIRVariable_(self);
  2039. return $1;
  2040. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRVariable)})},
  2041. args: ["aVisitor"],
  2042. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVariable: self",
  2043. messageSends: ["visitIRVariable:"],
  2044. referencedClasses: []
  2045. }),
  2046. smalltalk.IRVariable);
  2047. smalltalk.addMethod(
  2048. "_isVariable",
  2049. smalltalk.method({
  2050. selector: "isVariable",
  2051. category: 'testing',
  2052. fn: function (){
  2053. var self=this;
  2054. return smalltalk.withContext(function($ctx1) { return true;
  2055. }, function($ctx1) {$ctx1.fill(self,"isVariable",{}, smalltalk.IRVariable)})},
  2056. args: [],
  2057. source: "isVariable\x0a\x09^ true",
  2058. messageSends: [],
  2059. referencedClasses: []
  2060. }),
  2061. smalltalk.IRVariable);
  2062. smalltalk.addMethod(
  2063. "_variable",
  2064. smalltalk.method({
  2065. selector: "variable",
  2066. category: 'accessing',
  2067. fn: function (){
  2068. var self=this;
  2069. return smalltalk.withContext(function($ctx1) { var $1;
  2070. $1=self["@variable"];
  2071. return $1;
  2072. }, function($ctx1) {$ctx1.fill(self,"variable",{}, smalltalk.IRVariable)})},
  2073. args: [],
  2074. source: "variable\x0a\x09^ variable",
  2075. messageSends: [],
  2076. referencedClasses: []
  2077. }),
  2078. smalltalk.IRVariable);
  2079. smalltalk.addMethod(
  2080. "_variable_",
  2081. smalltalk.method({
  2082. selector: "variable:",
  2083. category: 'accessing',
  2084. fn: function (aScopeVariable){
  2085. var self=this;
  2086. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  2087. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable}, smalltalk.IRVariable)})},
  2088. args: ["aScopeVariable"],
  2089. source: "variable: aScopeVariable\x0a\x09variable := aScopeVariable",
  2090. messageSends: [],
  2091. referencedClasses: []
  2092. }),
  2093. smalltalk.IRVariable);
  2094. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  2095. smalltalk.addMethod(
  2096. "_accept_",
  2097. smalltalk.method({
  2098. selector: "accept:",
  2099. category: 'visiting',
  2100. fn: function (aVisitor){
  2101. var self=this;
  2102. return smalltalk.withContext(function($ctx1) { var $1;
  2103. $1=_st(aVisitor)._visitIRVerbatim_(self);
  2104. return $1;
  2105. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRVerbatim)})},
  2106. args: ["aVisitor"],
  2107. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVerbatim: self",
  2108. messageSends: ["visitIRVerbatim:"],
  2109. referencedClasses: []
  2110. }),
  2111. smalltalk.IRVerbatim);
  2112. smalltalk.addMethod(
  2113. "_source",
  2114. smalltalk.method({
  2115. selector: "source",
  2116. category: 'accessing',
  2117. fn: function (){
  2118. var self=this;
  2119. return smalltalk.withContext(function($ctx1) { var $1;
  2120. $1=self["@source"];
  2121. return $1;
  2122. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRVerbatim)})},
  2123. args: [],
  2124. source: "source\x0a\x09^ source",
  2125. messageSends: [],
  2126. referencedClasses: []
  2127. }),
  2128. smalltalk.IRVerbatim);
  2129. smalltalk.addMethod(
  2130. "_source_",
  2131. smalltalk.method({
  2132. selector: "source:",
  2133. category: 'accessing',
  2134. fn: function (aString){
  2135. var self=this;
  2136. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  2137. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRVerbatim)})},
  2138. args: ["aString"],
  2139. source: "source: aString\x0a\x09source := aString",
  2140. messageSends: [],
  2141. referencedClasses: []
  2142. }),
  2143. smalltalk.IRVerbatim);
  2144. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  2145. smalltalk.addMethod(
  2146. "_visit_",
  2147. smalltalk.method({
  2148. selector: "visit:",
  2149. category: 'visiting',
  2150. fn: function (anIRInstruction){
  2151. var self=this;
  2152. return smalltalk.withContext(function($ctx1) { var $1;
  2153. $1=_st(anIRInstruction)._accept_(self);
  2154. return $1;
  2155. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction}, smalltalk.IRVisitor)})},
  2156. args: ["anIRInstruction"],
  2157. source: "visit: anIRInstruction\x0a\x09^ anIRInstruction accept: self",
  2158. messageSends: ["accept:"],
  2159. referencedClasses: []
  2160. }),
  2161. smalltalk.IRVisitor);
  2162. smalltalk.addMethod(
  2163. "_visitIRAssignment_",
  2164. smalltalk.method({
  2165. selector: "visitIRAssignment:",
  2166. category: 'visiting',
  2167. fn: function (anIRAssignment){
  2168. var self=this;
  2169. return smalltalk.withContext(function($ctx1) { var $1;
  2170. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  2171. return $1;
  2172. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRVisitor)})},
  2173. args: ["anIRAssignment"],
  2174. source: "visitIRAssignment: anIRAssignment\x0a\x09^ self visitIRInstruction: anIRAssignment",
  2175. messageSends: ["visitIRInstruction:"],
  2176. referencedClasses: []
  2177. }),
  2178. smalltalk.IRVisitor);
  2179. smalltalk.addMethod(
  2180. "_visitIRBlockReturn_",
  2181. smalltalk.method({
  2182. selector: "visitIRBlockReturn:",
  2183. category: 'visiting',
  2184. fn: function (anIRBlockReturn){
  2185. var self=this;
  2186. return smalltalk.withContext(function($ctx1) { var $1;
  2187. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  2188. return $1;
  2189. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn}, smalltalk.IRVisitor)})},
  2190. args: ["anIRBlockReturn"],
  2191. source: "visitIRBlockReturn: anIRBlockReturn\x0a\x09^ self visitIRReturn: anIRBlockReturn",
  2192. messageSends: ["visitIRReturn:"],
  2193. referencedClasses: []
  2194. }),
  2195. smalltalk.IRVisitor);
  2196. smalltalk.addMethod(
  2197. "_visitIRBlockSequence_",
  2198. smalltalk.method({
  2199. selector: "visitIRBlockSequence:",
  2200. category: 'visiting',
  2201. fn: function (anIRBlockSequence){
  2202. var self=this;
  2203. return smalltalk.withContext(function($ctx1) { var $1;
  2204. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  2205. return $1;
  2206. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence}, smalltalk.IRVisitor)})},
  2207. args: ["anIRBlockSequence"],
  2208. source: "visitIRBlockSequence: anIRBlockSequence\x0a\x09^ self visitIRSequence: anIRBlockSequence",
  2209. messageSends: ["visitIRSequence:"],
  2210. referencedClasses: []
  2211. }),
  2212. smalltalk.IRVisitor);
  2213. smalltalk.addMethod(
  2214. "_visitIRClosure_",
  2215. smalltalk.method({
  2216. selector: "visitIRClosure:",
  2217. category: 'visiting',
  2218. fn: function (anIRClosure){
  2219. var self=this;
  2220. return smalltalk.withContext(function($ctx1) { var $1;
  2221. $1=_st(self)._visitIRInstruction_(anIRClosure);
  2222. return $1;
  2223. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure}, smalltalk.IRVisitor)})},
  2224. args: ["anIRClosure"],
  2225. source: "visitIRClosure: anIRClosure\x0a\x09^ self visitIRInstruction: anIRClosure",
  2226. messageSends: ["visitIRInstruction:"],
  2227. referencedClasses: []
  2228. }),
  2229. smalltalk.IRVisitor);
  2230. smalltalk.addMethod(
  2231. "_visitIRDynamicArray_",
  2232. smalltalk.method({
  2233. selector: "visitIRDynamicArray:",
  2234. category: 'visiting',
  2235. fn: function (anIRDynamicArray){
  2236. var self=this;
  2237. return smalltalk.withContext(function($ctx1) { var $1;
  2238. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  2239. return $1;
  2240. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray}, smalltalk.IRVisitor)})},
  2241. args: ["anIRDynamicArray"],
  2242. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09^ self visitIRInstruction: anIRDynamicArray",
  2243. messageSends: ["visitIRInstruction:"],
  2244. referencedClasses: []
  2245. }),
  2246. smalltalk.IRVisitor);
  2247. smalltalk.addMethod(
  2248. "_visitIRDynamicDictionary_",
  2249. smalltalk.method({
  2250. selector: "visitIRDynamicDictionary:",
  2251. category: 'visiting',
  2252. fn: function (anIRDynamicDictionary){
  2253. var self=this;
  2254. return smalltalk.withContext(function($ctx1) { var $1;
  2255. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  2256. return $1;
  2257. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary}, smalltalk.IRVisitor)})},
  2258. args: ["anIRDynamicDictionary"],
  2259. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09^ self visitIRInstruction: anIRDynamicDictionary",
  2260. messageSends: ["visitIRInstruction:"],
  2261. referencedClasses: []
  2262. }),
  2263. smalltalk.IRVisitor);
  2264. smalltalk.addMethod(
  2265. "_visitIRInlinedClosure_",
  2266. smalltalk.method({
  2267. selector: "visitIRInlinedClosure:",
  2268. category: 'visiting',
  2269. fn: function (anIRInlinedClosure){
  2270. var self=this;
  2271. return smalltalk.withContext(function($ctx1) { var $1;
  2272. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  2273. return $1;
  2274. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure}, smalltalk.IRVisitor)})},
  2275. args: ["anIRInlinedClosure"],
  2276. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09^ self visitIRClosure: anIRInlinedClosure",
  2277. messageSends: ["visitIRClosure:"],
  2278. referencedClasses: []
  2279. }),
  2280. smalltalk.IRVisitor);
  2281. smalltalk.addMethod(
  2282. "_visitIRInlinedSequence_",
  2283. smalltalk.method({
  2284. selector: "visitIRInlinedSequence:",
  2285. category: 'visiting',
  2286. fn: function (anIRInlinedSequence){
  2287. var self=this;
  2288. return smalltalk.withContext(function($ctx1) { var $1;
  2289. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  2290. return $1;
  2291. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence}, smalltalk.IRVisitor)})},
  2292. args: ["anIRInlinedSequence"],
  2293. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09^ self visitIRSequence: anIRInlinedSequence",
  2294. messageSends: ["visitIRSequence:"],
  2295. referencedClasses: []
  2296. }),
  2297. smalltalk.IRVisitor);
  2298. smalltalk.addMethod(
  2299. "_visitIRInstruction_",
  2300. smalltalk.method({
  2301. selector: "visitIRInstruction:",
  2302. category: 'visiting',
  2303. fn: function (anIRInstruction){
  2304. var self=this;
  2305. return smalltalk.withContext(function($ctx1) { var $1;
  2306. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  2307. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2308. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2309. $1=anIRInstruction;
  2310. return $1;
  2311. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction}, smalltalk.IRVisitor)})},
  2312. args: ["anIRInstruction"],
  2313. source: "visitIRInstruction: anIRInstruction\x0a\x09anIRInstruction instructions do: [ :each | self visit: each ].\x0a\x09^ anIRInstruction",
  2314. messageSends: ["do:", "visit:", "instructions"],
  2315. referencedClasses: []
  2316. }),
  2317. smalltalk.IRVisitor);
  2318. smalltalk.addMethod(
  2319. "_visitIRMethod_",
  2320. smalltalk.method({
  2321. selector: "visitIRMethod:",
  2322. category: 'visiting',
  2323. fn: function (anIRMethod){
  2324. var self=this;
  2325. return smalltalk.withContext(function($ctx1) { var $1;
  2326. $1=_st(self)._visitIRInstruction_(anIRMethod);
  2327. return $1;
  2328. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod}, smalltalk.IRVisitor)})},
  2329. args: ["anIRMethod"],
  2330. source: "visitIRMethod: anIRMethod\x0a\x09^ self visitIRInstruction: anIRMethod",
  2331. messageSends: ["visitIRInstruction:"],
  2332. referencedClasses: []
  2333. }),
  2334. smalltalk.IRVisitor);
  2335. smalltalk.addMethod(
  2336. "_visitIRNonLocalReturn_",
  2337. smalltalk.method({
  2338. selector: "visitIRNonLocalReturn:",
  2339. category: 'visiting',
  2340. fn: function (anIRNonLocalReturn){
  2341. var self=this;
  2342. return smalltalk.withContext(function($ctx1) { var $1;
  2343. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  2344. return $1;
  2345. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRVisitor)})},
  2346. args: ["anIRNonLocalReturn"],
  2347. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self visitIRInstruction: anIRNonLocalReturn",
  2348. messageSends: ["visitIRInstruction:"],
  2349. referencedClasses: []
  2350. }),
  2351. smalltalk.IRVisitor);
  2352. smalltalk.addMethod(
  2353. "_visitIRNonLocalReturnHandling_",
  2354. smalltalk.method({
  2355. selector: "visitIRNonLocalReturnHandling:",
  2356. category: 'visiting',
  2357. fn: function (anIRNonLocalReturnHandling){
  2358. var self=this;
  2359. return smalltalk.withContext(function($ctx1) { var $1;
  2360. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  2361. return $1;
  2362. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling}, smalltalk.IRVisitor)})},
  2363. args: ["anIRNonLocalReturnHandling"],
  2364. source: "visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling\x0a\x09^ self visitIRInstruction: anIRNonLocalReturnHandling",
  2365. messageSends: ["visitIRInstruction:"],
  2366. referencedClasses: []
  2367. }),
  2368. smalltalk.IRVisitor);
  2369. smalltalk.addMethod(
  2370. "_visitIRReturn_",
  2371. smalltalk.method({
  2372. selector: "visitIRReturn:",
  2373. category: 'visiting',
  2374. fn: function (anIRReturn){
  2375. var self=this;
  2376. return smalltalk.withContext(function($ctx1) { var $1;
  2377. $1=_st(self)._visitIRInstruction_(anIRReturn);
  2378. return $1;
  2379. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRVisitor)})},
  2380. args: ["anIRReturn"],
  2381. source: "visitIRReturn: anIRReturn\x0a\x09^ self visitIRInstruction: anIRReturn",
  2382. messageSends: ["visitIRInstruction:"],
  2383. referencedClasses: []
  2384. }),
  2385. smalltalk.IRVisitor);
  2386. smalltalk.addMethod(
  2387. "_visitIRSend_",
  2388. smalltalk.method({
  2389. selector: "visitIRSend:",
  2390. category: 'visiting',
  2391. fn: function (anIRSend){
  2392. var self=this;
  2393. return smalltalk.withContext(function($ctx1) { var $1;
  2394. $1=_st(self)._visitIRInstruction_(anIRSend);
  2395. return $1;
  2396. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRVisitor)})},
  2397. args: ["anIRSend"],
  2398. source: "visitIRSend: anIRSend\x0a\x09^ self visitIRInstruction: anIRSend",
  2399. messageSends: ["visitIRInstruction:"],
  2400. referencedClasses: []
  2401. }),
  2402. smalltalk.IRVisitor);
  2403. smalltalk.addMethod(
  2404. "_visitIRSequence_",
  2405. smalltalk.method({
  2406. selector: "visitIRSequence:",
  2407. category: 'visiting',
  2408. fn: function (anIRSequence){
  2409. var self=this;
  2410. return smalltalk.withContext(function($ctx1) { var $1;
  2411. $1=_st(self)._visitIRInstruction_(anIRSequence);
  2412. return $1;
  2413. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence}, smalltalk.IRVisitor)})},
  2414. args: ["anIRSequence"],
  2415. source: "visitIRSequence: anIRSequence\x0a\x09^ self visitIRInstruction: anIRSequence",
  2416. messageSends: ["visitIRInstruction:"],
  2417. referencedClasses: []
  2418. }),
  2419. smalltalk.IRVisitor);
  2420. smalltalk.addMethod(
  2421. "_visitIRTempDeclaration_",
  2422. smalltalk.method({
  2423. selector: "visitIRTempDeclaration:",
  2424. category: 'visiting',
  2425. fn: function (anIRTempDeclaration){
  2426. var self=this;
  2427. return smalltalk.withContext(function($ctx1) { var $1;
  2428. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  2429. return $1;
  2430. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration}, smalltalk.IRVisitor)})},
  2431. args: ["anIRTempDeclaration"],
  2432. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09^ self visitIRInstruction: anIRTempDeclaration",
  2433. messageSends: ["visitIRInstruction:"],
  2434. referencedClasses: []
  2435. }),
  2436. smalltalk.IRVisitor);
  2437. smalltalk.addMethod(
  2438. "_visitIRValue_",
  2439. smalltalk.method({
  2440. selector: "visitIRValue:",
  2441. category: 'visiting',
  2442. fn: function (anIRValue){
  2443. var self=this;
  2444. return smalltalk.withContext(function($ctx1) { var $1;
  2445. $1=_st(self)._visitIRInstruction_(anIRValue);
  2446. return $1;
  2447. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue}, smalltalk.IRVisitor)})},
  2448. args: ["anIRValue"],
  2449. source: "visitIRValue: anIRValue\x0a\x09^ self visitIRInstruction: anIRValue",
  2450. messageSends: ["visitIRInstruction:"],
  2451. referencedClasses: []
  2452. }),
  2453. smalltalk.IRVisitor);
  2454. smalltalk.addMethod(
  2455. "_visitIRVariable_",
  2456. smalltalk.method({
  2457. selector: "visitIRVariable:",
  2458. category: 'visiting',
  2459. fn: function (anIRVariable){
  2460. var self=this;
  2461. return smalltalk.withContext(function($ctx1) { var $1;
  2462. $1=_st(self)._visitIRInstruction_(anIRVariable);
  2463. return $1;
  2464. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable}, smalltalk.IRVisitor)})},
  2465. args: ["anIRVariable"],
  2466. source: "visitIRVariable: anIRVariable\x0a\x09^ self visitIRInstruction: anIRVariable",
  2467. messageSends: ["visitIRInstruction:"],
  2468. referencedClasses: []
  2469. }),
  2470. smalltalk.IRVisitor);
  2471. smalltalk.addMethod(
  2472. "_visitIRVerbatim_",
  2473. smalltalk.method({
  2474. selector: "visitIRVerbatim:",
  2475. category: 'visiting',
  2476. fn: function (anIRVerbatim){
  2477. var self=this;
  2478. return smalltalk.withContext(function($ctx1) { var $1;
  2479. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  2480. return $1;
  2481. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim}, smalltalk.IRVisitor)})},
  2482. args: ["anIRVerbatim"],
  2483. source: "visitIRVerbatim: anIRVerbatim\x0a\x09^ self visitIRInstruction: anIRVerbatim",
  2484. messageSends: ["visitIRInstruction:"],
  2485. referencedClasses: []
  2486. }),
  2487. smalltalk.IRVisitor);
  2488. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  2489. smalltalk.addMethod(
  2490. "_contents",
  2491. smalltalk.method({
  2492. selector: "contents",
  2493. category: 'accessing',
  2494. fn: function (){
  2495. var self=this;
  2496. return smalltalk.withContext(function($ctx1) { var $1;
  2497. $1=_st(_st(self)._stream())._contents();
  2498. return $1;
  2499. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.IRJSTranslator)})},
  2500. args: [],
  2501. source: "contents\x0a\x09^ self stream contents",
  2502. messageSends: ["contents", "stream"],
  2503. referencedClasses: []
  2504. }),
  2505. smalltalk.IRJSTranslator);
  2506. smalltalk.addMethod(
  2507. "_initialize",
  2508. smalltalk.method({
  2509. selector: "initialize",
  2510. category: 'initialization',
  2511. fn: function (){
  2512. var self=this;
  2513. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  2514. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  2515. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.IRJSTranslator)})},
  2516. args: [],
  2517. source: "initialize\x0a\x09super initialize.\x0a\x09stream := JSStream new.",
  2518. messageSends: ["initialize", "new"],
  2519. referencedClasses: ["JSStream"]
  2520. }),
  2521. smalltalk.IRJSTranslator);
  2522. smalltalk.addMethod(
  2523. "_stream",
  2524. smalltalk.method({
  2525. selector: "stream",
  2526. category: 'accessing',
  2527. fn: function (){
  2528. var self=this;
  2529. return smalltalk.withContext(function($ctx1) { var $1;
  2530. $1=self["@stream"];
  2531. return $1;
  2532. }, function($ctx1) {$ctx1.fill(self,"stream",{}, smalltalk.IRJSTranslator)})},
  2533. args: [],
  2534. source: "stream\x0a\x09^ stream",
  2535. messageSends: [],
  2536. referencedClasses: []
  2537. }),
  2538. smalltalk.IRJSTranslator);
  2539. smalltalk.addMethod(
  2540. "_stream_",
  2541. smalltalk.method({
  2542. selector: "stream:",
  2543. category: 'accessing',
  2544. fn: function (aStream){
  2545. var self=this;
  2546. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  2547. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.IRJSTranslator)})},
  2548. args: ["aStream"],
  2549. source: "stream: aStream\x0a\x09stream := aStream",
  2550. messageSends: [],
  2551. referencedClasses: []
  2552. }),
  2553. smalltalk.IRJSTranslator);
  2554. smalltalk.addMethod(
  2555. "_visitIRAssignment_",
  2556. smalltalk.method({
  2557. selector: "visitIRAssignment:",
  2558. category: 'visiting',
  2559. fn: function (anIRAssignment){
  2560. var self=this;
  2561. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  2562. _st(_st(self)._stream())._nextPutAssignment();
  2563. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  2564. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRJSTranslator)})},
  2565. args: ["anIRAssignment"],
  2566. source: "visitIRAssignment: anIRAssignment\x0a\x09self visit: anIRAssignment instructions first.\x0a\x09self stream nextPutAssignment.\x0a\x09self visit: anIRAssignment instructions last.",
  2567. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"],
  2568. referencedClasses: []
  2569. }),
  2570. smalltalk.IRJSTranslator);
  2571. smalltalk.addMethod(
  2572. "_visitIRClosure_",
  2573. smalltalk.method({
  2574. selector: "visitIRClosure:",
  2575. category: 'visiting',
  2576. fn: function (anIRClosure){
  2577. var self=this;
  2578. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  2579. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  2580. return smalltalk.withContext(function($ctx3) { return _st(_st(each)._name())._asVariableName();
  2581. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})})));
  2582. return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  2583. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  2584. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2585. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),_st(anIRClosure)._arguments());
  2586. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure}, smalltalk.IRJSTranslator)})},
  2587. args: ["anIRClosure"],
  2588. source: "visitIRClosure: anIRClosure\x0a\x09self stream \x0a\x09\x09nextPutClosureWith: [ \x0a \x09self stream nextPutVars: (anIRClosure tempDeclarations collect: [ :each |\x0a \x09\x09\x09\x09each name asVariableName ]).\x0a \x09self stream \x0a \x09nextPutBlockContextFor: anIRClosure\x0a during: [ super visitIRClosure: anIRClosure ] ]\x0a\x09\x09arguments: anIRClosure arguments",
  2589. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"],
  2590. referencedClasses: []
  2591. }),
  2592. smalltalk.IRJSTranslator);
  2593. smalltalk.addMethod(
  2594. "_visitIRDynamicArray_",
  2595. smalltalk.method({
  2596. selector: "visitIRDynamicArray:",
  2597. category: 'visiting',
  2598. fn: function (anIRDynamicArray){
  2599. var self=this;
  2600. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  2601. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  2602. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2603. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2604. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2605. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2606. _st(self["@stream"])._nextPutAll_("]");
  2607. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray}, smalltalk.IRJSTranslator)})},
  2608. args: ["anIRDynamicArray"],
  2609. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09self stream nextPutAll: '['.\x0a\x09anIRDynamicArray instructions\x0a\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ']'",
  2610. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2611. referencedClasses: []
  2612. }),
  2613. smalltalk.IRJSTranslator);
  2614. smalltalk.addMethod(
  2615. "_visitIRDynamicDictionary_",
  2616. smalltalk.method({
  2617. selector: "visitIRDynamicDictionary:",
  2618. category: 'visiting',
  2619. fn: function (anIRDynamicDictionary){
  2620. var self=this;
  2621. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  2622. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  2623. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2624. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2625. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2626. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2627. _st(_st(self)._stream())._nextPutAll_("])");
  2628. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary}, smalltalk.IRJSTranslator)})},
  2629. args: ["anIRDynamicDictionary"],
  2630. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09self stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09anIRDynamicDictionary instructions \x0a\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09separatedBy: [self stream nextPutAll: ',' ].\x0a\x09self stream nextPutAll: '])'",
  2631. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2632. referencedClasses: []
  2633. }),
  2634. smalltalk.IRJSTranslator);
  2635. smalltalk.addMethod(
  2636. "_visitIRMethod_",
  2637. smalltalk.method({
  2638. selector: "visitIRMethod:",
  2639. category: 'visiting',
  2640. fn: function (anIRMethod){
  2641. var self=this;
  2642. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$6,$7,$9,$10,$8,$5,$3;
  2643. $1=_st(self)._stream();
  2644. $2=anIRMethod;
  2645. $3=(function(){
  2646. return smalltalk.withContext(function($ctx2) { $4=_st(self)._stream();
  2647. $5=(function(){
  2648. return smalltalk.withContext(function($ctx3) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  2649. return smalltalk.withContext(function($ctx4) { return _st(_st(each)._name())._asVariableName();
  2650. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})));
  2651. $6=_st(self)._stream();
  2652. $7=anIRMethod;
  2653. $8=(function(){
  2654. return smalltalk.withContext(function($ctx4) { $9=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  2655. if(smalltalk.assert($9)){
  2656. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  2657. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  2658. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx1)})})));
  2659. };
  2660. $10=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  2661. if(smalltalk.assert($10)){
  2662. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  2663. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2664. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2665. } else {
  2666. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2667. };
  2668. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})});
  2669. return _st($6)._nextPutContextFor_during_($7,$8);
  2670. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
  2671. return _st($4)._nextPutFunctionWith_arguments_($5,_st(anIRMethod)._arguments());
  2672. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  2673. _st($1)._nextPutMethodDeclaration_with_($2,$3);
  2674. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod}, smalltalk.IRJSTranslator)})},
  2675. args: ["anIRMethod"],
  2676. source: "visitIRMethod: anIRMethod\x0a\x0a\x09self stream\x0a\x09\x09nextPutMethodDeclaration: anIRMethod \x0a\x09\x09with: [ self stream \x0a\x09\x09\x09nextPutFunctionWith: [ \x0a \x09self stream nextPutVars: (anIRMethod tempDeclarations collect: [ :each |\x0a \x09\x09\x09\x09each name asVariableName ]).\x0a \x09self stream nextPutContextFor: anIRMethod during: [\x0a\x09\x09\x09\x09anIRMethod internalVariables notEmpty ifTrue: [\x0a\x09\x09\x09\x09\x09self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |\x0a\x09\x09\x09\x09\x09\x09each variable alias ]) ].\x0a\x09\x09\x09\x09anIRMethod scope hasNonLocalReturn \x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09self stream nextPutNonLocalReturnHandlingWith: [\x0a\x09\x09\x09\x09\x09\x09\x09super visitIRMethod: anIRMethod ]]\x0a\x09\x09\x09\x09\x09ifFalse: [ super visitIRMethod: anIRMethod ]]]\x0a\x09\x09\x09arguments: anIRMethod arguments ]",
  2677. messageSends: ["nextPutMethodDeclaration:with:", "nextPutFunctionWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutContextFor:during:", "ifTrue:", "alias", "variable", "asArray", "internalVariables", "notEmpty", "ifTrue:ifFalse:", "nextPutNonLocalReturnHandlingWith:", "visitIRMethod:", "hasNonLocalReturn", "scope", "arguments"],
  2678. referencedClasses: []
  2679. }),
  2680. smalltalk.IRJSTranslator);
  2681. smalltalk.addMethod(
  2682. "_visitIRNonLocalReturn_",
  2683. smalltalk.method({
  2684. selector: "visitIRNonLocalReturn:",
  2685. category: 'visiting',
  2686. fn: function (anIRNonLocalReturn){
  2687. var self=this;
  2688. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  2689. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  2690. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2691. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRJSTranslator)})},
  2692. args: ["anIRNonLocalReturn"],
  2693. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09self stream nextPutNonLocalReturnWith: [\x0a\x09\x09super visitIRNonLocalReturn: anIRNonLocalReturn ]",
  2694. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"],
  2695. referencedClasses: []
  2696. }),
  2697. smalltalk.IRJSTranslator);
  2698. smalltalk.addMethod(
  2699. "_visitIRReturn_",
  2700. smalltalk.method({
  2701. selector: "visitIRReturn:",
  2702. category: 'visiting',
  2703. fn: function (anIRReturn){
  2704. var self=this;
  2705. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  2706. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  2707. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2708. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRJSTranslator)})},
  2709. args: ["anIRReturn"],
  2710. source: "visitIRReturn: anIRReturn\x0a\x09self stream nextPutReturnWith: [\x0a\x09\x09super visitIRReturn: anIRReturn ]",
  2711. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"],
  2712. referencedClasses: []
  2713. }),
  2714. smalltalk.IRJSTranslator);
  2715. smalltalk.addMethod(
  2716. "_visitIRSend_",
  2717. smalltalk.method({
  2718. selector: "visitIRSend:",
  2719. category: 'visiting',
  2720. fn: function (anIRSend){
  2721. var self=this;
  2722. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2723. $1=_st(anIRSend)._classSend();
  2724. if(($receiver = $1) == nil || $receiver == undefined){
  2725. _st(_st(self)._stream())._nextPutAll_("_st(");
  2726. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2727. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  2728. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2729. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2730. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2731. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2732. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2733. _st(_st(self)._stream())._nextPutAll_(")");
  2734. } else {
  2735. $2=_st(self)._stream();
  2736. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  2737. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  2738. $3=_st($2)._nextPutAll_("_st(");
  2739. $3;
  2740. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2741. _st(_st(self)._stream())._nextPutAll_("), [");
  2742. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2743. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2744. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2745. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2746. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2747. _st(_st(self)._stream())._nextPutAll_("])");
  2748. };
  2749. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRJSTranslator)})},
  2750. args: ["anIRSend"],
  2751. source: "visitIRSend: anIRSend\x0a\x09anIRSend classSend \x0a \x09ifNil: [\x0a\x09\x09\x09self stream nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a \x09\x09 \x09self stream nextPutAll: ').', anIRSend selector asSelector, '('.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09ifNotNil: [ \x0a\x09\x09\x09self stream \x0a \x09nextPutAll: anIRSend classSend asJavascript, '.fn.prototype.';\x0a\x09\x09\x09\x09nextPutAll: anIRSend selector asSelector, '.apply(';\x0a\x09\x09\x09\x09nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a\x09\x09\x09self stream nextPutAll: '), ['.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: '])' ]",
  2752. messageSends: ["ifNil:ifNotNil:", "nextPutAll:", "stream", "visit:", "first", "instructions", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "asJavascript", "classSend"],
  2753. referencedClasses: []
  2754. }),
  2755. smalltalk.IRJSTranslator);
  2756. smalltalk.addMethod(
  2757. "_visitIRSequence_",
  2758. smalltalk.method({
  2759. selector: "visitIRSequence:",
  2760. category: 'visiting',
  2761. fn: function (anIRSequence){
  2762. var self=this;
  2763. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  2764. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  2765. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  2766. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  2767. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2768. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence}, smalltalk.IRJSTranslator)})},
  2769. args: ["anIRSequence"],
  2770. source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence instructions do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ]]",
  2771. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
  2772. referencedClasses: []
  2773. }),
  2774. smalltalk.IRJSTranslator);
  2775. smalltalk.addMethod(
  2776. "_visitIRTempDeclaration_",
  2777. smalltalk.method({
  2778. selector: "visitIRTempDeclaration:",
  2779. category: 'visiting',
  2780. fn: function (anIRTempDeclaration){
  2781. var self=this;
  2782. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration}, smalltalk.IRJSTranslator)})},
  2783. args: ["anIRTempDeclaration"],
  2784. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09\x22self stream \x0a \x09nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';'; \x0a lf\x22",
  2785. messageSends: [],
  2786. referencedClasses: []
  2787. }),
  2788. smalltalk.IRJSTranslator);
  2789. smalltalk.addMethod(
  2790. "_visitIRValue_",
  2791. smalltalk.method({
  2792. selector: "visitIRValue:",
  2793. category: 'visiting',
  2794. fn: function (anIRValue){
  2795. var self=this;
  2796. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2797. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue}, smalltalk.IRJSTranslator)})},
  2798. args: ["anIRValue"],
  2799. source: "visitIRValue: anIRValue\x0a\x09self stream nextPutAll: anIRValue value asJavascript",
  2800. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"],
  2801. referencedClasses: []
  2802. }),
  2803. smalltalk.IRJSTranslator);
  2804. smalltalk.addMethod(
  2805. "_visitIRVariable_",
  2806. smalltalk.method({
  2807. selector: "visitIRVariable:",
  2808. category: 'visiting',
  2809. fn: function (anIRVariable){
  2810. var self=this;
  2811. return smalltalk.withContext(function($ctx1) { var $1;
  2812. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2813. if(smalltalk.assert($1)){
  2814. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  2815. } else {
  2816. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2817. };
  2818. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable}, smalltalk.IRJSTranslator)})},
  2819. args: ["anIRVariable"],
  2820. source: "visitIRVariable: anIRVariable\x0a\x09anIRVariable variable name = 'thisContext'\x0a \x09ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]\x0a \x09ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]",
  2821. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"],
  2822. referencedClasses: []
  2823. }),
  2824. smalltalk.IRJSTranslator);
  2825. smalltalk.addMethod(
  2826. "_visitIRVerbatim_",
  2827. smalltalk.method({
  2828. selector: "visitIRVerbatim:",
  2829. category: 'visiting',
  2830. fn: function (anIRVerbatim){
  2831. var self=this;
  2832. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  2833. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2834. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2835. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim}, smalltalk.IRJSTranslator)})},
  2836. args: ["anIRVerbatim"],
  2837. source: "visitIRVerbatim: anIRVerbatim\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self stream nextPutAll: anIRVerbatim source ]",
  2838. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"],
  2839. referencedClasses: []
  2840. }),
  2841. smalltalk.IRJSTranslator);
  2842. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2843. smalltalk.addMethod(
  2844. "_contents",
  2845. smalltalk.method({
  2846. selector: "contents",
  2847. category: 'accessing',
  2848. fn: function (){
  2849. var self=this;
  2850. return smalltalk.withContext(function($ctx1) { var $1;
  2851. $1=_st(self["@stream"])._contents();
  2852. return $1;
  2853. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.JSStream)})},
  2854. args: [],
  2855. source: "contents\x0a\x09^ stream contents",
  2856. messageSends: ["contents"],
  2857. referencedClasses: []
  2858. }),
  2859. smalltalk.JSStream);
  2860. smalltalk.addMethod(
  2861. "_initialize",
  2862. smalltalk.method({
  2863. selector: "initialize",
  2864. category: 'initialization',
  2865. fn: function (){
  2866. var self=this;
  2867. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  2868. self["@stream"]=_st("")._writeStream();
  2869. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.JSStream)})},
  2870. args: [],
  2871. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.",
  2872. messageSends: ["initialize", "writeStream"],
  2873. referencedClasses: []
  2874. }),
  2875. smalltalk.JSStream);
  2876. smalltalk.addMethod(
  2877. "_lf",
  2878. smalltalk.method({
  2879. selector: "lf",
  2880. category: 'streaming',
  2881. fn: function (){
  2882. var self=this;
  2883. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  2884. return self}, function($ctx1) {$ctx1.fill(self,"lf",{}, smalltalk.JSStream)})},
  2885. args: [],
  2886. source: "lf\x0a\x09stream lf",
  2887. messageSends: ["lf"],
  2888. referencedClasses: []
  2889. }),
  2890. smalltalk.JSStream);
  2891. smalltalk.addMethod(
  2892. "_nextPut_",
  2893. smalltalk.method({
  2894. selector: "nextPut:",
  2895. category: 'streaming',
  2896. fn: function (aString){
  2897. var self=this;
  2898. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  2899. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString}, smalltalk.JSStream)})},
  2900. args: ["aString"],
  2901. source: "nextPut: aString\x0a\x09stream nextPut: aString",
  2902. messageSends: ["nextPut:"],
  2903. referencedClasses: []
  2904. }),
  2905. smalltalk.JSStream);
  2906. smalltalk.addMethod(
  2907. "_nextPutAll_",
  2908. smalltalk.method({
  2909. selector: "nextPutAll:",
  2910. category: 'streaming',
  2911. fn: function (aString){
  2912. var self=this;
  2913. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  2914. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString}, smalltalk.JSStream)})},
  2915. args: ["aString"],
  2916. source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString",
  2917. messageSends: ["nextPutAll:"],
  2918. referencedClasses: []
  2919. }),
  2920. smalltalk.JSStream);
  2921. smalltalk.addMethod(
  2922. "_nextPutAssignment",
  2923. smalltalk.method({
  2924. selector: "nextPutAssignment",
  2925. category: 'streaming',
  2926. fn: function (){
  2927. var self=this;
  2928. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  2929. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{}, smalltalk.JSStream)})},
  2930. args: [],
  2931. source: "nextPutAssignment\x0a\x09stream nextPutAll: '='",
  2932. messageSends: ["nextPutAll:"],
  2933. referencedClasses: []
  2934. }),
  2935. smalltalk.JSStream);
  2936. smalltalk.addMethod(
  2937. "_nextPutBlockContextFor_during_",
  2938. smalltalk.method({
  2939. selector: "nextPutBlockContextFor:during:",
  2940. category: 'streaming',
  2941. fn: function (anIRClosure,aBlock){
  2942. var self=this;
  2943. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2944. $1=self;
  2945. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2946. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2947. _st(aBlock)._value();
  2948. $3=self;
  2949. _st($3)._nextPutAll_(_st(_st("}, function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2950. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  2951. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  2952. return smalltalk.withContext(function($ctx2) { $5=self;
  2953. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2954. _st($5)._nextPutAll_(":");
  2955. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2956. return $6;
  2957. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2958. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2959. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2960. $7=self;
  2961. _st($7)._nextPutAll_("},");
  2962. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._method())._scope())._alias()).__comma(")})"));
  2963. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock}, smalltalk.JSStream)})},
  2964. args: ["anIRClosure", "aBlock"],
  2965. source: "nextPutBlockContextFor: anIRClosure during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {'; \x0a nextPutAll: String cr.\x0a \x0a aBlock value.\x0a \x0a self \x0a \x09nextPutAll: '}, function(', anIRClosure scope alias, ') {';\x0a nextPutAll: anIRClosure scope alias, '.fillBlock({'.\x0a \x0a anIRClosure locals \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '},';\x0a nextPutAll: anIRClosure method scope alias, ')})'",
  2966. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "do:separatedBy:", "asVariableName", "locals", "method"],
  2967. referencedClasses: ["String"]
  2968. }),
  2969. smalltalk.JSStream);
  2970. smalltalk.addMethod(
  2971. "_nextPutClosureWith_arguments_",
  2972. smalltalk.method({
  2973. selector: "nextPutClosureWith:arguments:",
  2974. category: 'streaming',
  2975. fn: function (aBlock,anArray){
  2976. var self=this;
  2977. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2978. _st(self["@stream"])._nextPutAll_("(function(");
  2979. _st(anArray)._do_separatedBy_((function(each){
  2980. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2981. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2982. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2983. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2984. $1=self["@stream"];
  2985. _st($1)._nextPutAll_("){");
  2986. $2=_st($1)._lf();
  2987. _st(aBlock)._value();
  2988. _st(self["@stream"])._nextPutAll_("})");
  2989. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray}, smalltalk.JSStream)})},
  2990. args: ["aBlock", "anArray"],
  2991. source: "nextPutClosureWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: '(function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '})'",
  2992. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  2993. referencedClasses: []
  2994. }),
  2995. smalltalk.JSStream);
  2996. smalltalk.addMethod(
  2997. "_nextPutContextFor_during_",
  2998. smalltalk.method({
  2999. selector: "nextPutContextFor:during:",
  3000. category: 'streaming',
  3001. fn: function (aMethod,aBlock){
  3002. var self=this;
  3003. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  3004. $1=self;
  3005. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  3006. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  3007. _st(aBlock)._value();
  3008. $3=self;
  3009. _st($3)._nextPutAll_(_st(_st(_st("}, function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  3010. $4=_st($3)._nextPutAll_(_st(_st(".fill(self,").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  3011. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  3012. return smalltalk.withContext(function($ctx2) { $5=self;
  3013. _st($5)._nextPutAll_(_st(each)._asVariableName());
  3014. _st($5)._nextPutAll_(":");
  3015. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  3016. return $6;
  3017. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3018. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  3019. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3020. $7=self;
  3021. _st($7)._nextPutAll_("}, ");
  3022. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  3023. $8=_st($7)._nextPutAll_(")})");
  3024. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock}, smalltalk.JSStream)})},
  3025. args: ["aMethod", "aBlock"],
  3026. source: "nextPutContextFor: aMethod during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; \x0a nextPutAll: String cr.\x0a aBlock value.\x0a \x0a self \x0a \x09nextPutAll: '}, function(', aMethod scope alias, ') {', aMethod scope alias; \x0a nextPutAll: '.fill(self,', aMethod selector asJavascript, ',{'.\x0a\x0a aMethod locals \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '}, ';\x0a nextPutAll: aMethod theClass asJavascript;\x0a nextPutAll: ')})'",
  3027. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "locals", "theClass"],
  3028. referencedClasses: ["String"]
  3029. }),
  3030. smalltalk.JSStream);
  3031. smalltalk.addMethod(
  3032. "_nextPutFunctionWith_arguments_",
  3033. smalltalk.method({
  3034. selector: "nextPutFunctionWith:arguments:",
  3035. category: 'streaming',
  3036. fn: function (aBlock,anArray){
  3037. var self=this;
  3038. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3039. _st(self["@stream"])._nextPutAll_("fn: function(");
  3040. _st(anArray)._do_separatedBy_((function(each){
  3041. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  3042. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3043. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  3044. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3045. $1=self["@stream"];
  3046. _st($1)._nextPutAll_("){");
  3047. $2=_st($1)._lf();
  3048. $3=self["@stream"];
  3049. _st($3)._nextPutAll_("var self=this;");
  3050. $4=_st($3)._lf();
  3051. _st(aBlock)._value();
  3052. _st(self["@stream"])._nextPutAll_("}");
  3053. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray}, smalltalk.JSStream)})},
  3054. args: ["aBlock", "anArray"],
  3055. source: "nextPutFunctionWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09stream nextPutAll: 'var self=this;'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '}'",
  3056. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  3057. referencedClasses: []
  3058. }),
  3059. smalltalk.JSStream);
  3060. smalltalk.addMethod(
  3061. "_nextPutIf_with_",
  3062. smalltalk.method({
  3063. selector: "nextPutIf:with:",
  3064. category: 'streaming',
  3065. fn: function (aBlock,anotherBlock){
  3066. var self=this;
  3067. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3068. _st(self["@stream"])._nextPutAll_("if(");
  3069. _st(aBlock)._value();
  3070. $1=self["@stream"];
  3071. _st($1)._nextPutAll_("){");
  3072. $2=_st($1)._lf();
  3073. _st(anotherBlock)._value();
  3074. _st(self["@stream"])._nextPutAll_("}");
  3075. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.JSStream)})},
  3076. args: ["aBlock", "anotherBlock"],
  3077. source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
  3078. messageSends: ["nextPutAll:", "value", "lf"],
  3079. referencedClasses: []
  3080. }),
  3081. smalltalk.JSStream);
  3082. smalltalk.addMethod(
  3083. "_nextPutIfElse_with_with_",
  3084. smalltalk.method({
  3085. selector: "nextPutIfElse:with:with:",
  3086. category: 'streaming',
  3087. fn: function (aBlock,ifBlock,elseBlock){
  3088. var self=this;
  3089. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3090. _st(self["@stream"])._nextPutAll_("if(");
  3091. _st(aBlock)._value();
  3092. $1=self["@stream"];
  3093. _st($1)._nextPutAll_("){");
  3094. $2=_st($1)._lf();
  3095. _st(ifBlock)._value();
  3096. $3=self["@stream"];
  3097. _st($3)._nextPutAll_("} else {");
  3098. $4=_st($3)._lf();
  3099. _st(elseBlock)._value();
  3100. _st(self["@stream"])._nextPutAll_("}");
  3101. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock}, smalltalk.JSStream)})},
  3102. args: ["aBlock", "ifBlock", "elseBlock"],
  3103. source: "nextPutIfElse: aBlock with: ifBlock with: elseBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09ifBlock value.\x0a\x09stream nextPutAll: '} else {'; lf.\x0a\x09elseBlock value.\x0a\x09stream nextPutAll: '}'",
  3104. messageSends: ["nextPutAll:", "value", "lf"],
  3105. referencedClasses: []
  3106. }),
  3107. smalltalk.JSStream);
  3108. smalltalk.addMethod(
  3109. "_nextPutMethodDeclaration_with_",
  3110. smalltalk.method({
  3111. selector: "nextPutMethodDeclaration:with:",
  3112. category: 'streaming',
  3113. fn: function (aMethod,aBlock){
  3114. var self=this;
  3115. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  3116. $1=self["@stream"];
  3117. _st($1)._nextPutAll_("smalltalk.method({");
  3118. _st($1)._lf();
  3119. _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  3120. _st($1)._lf();
  3121. _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  3122. $2=_st($1)._lf();
  3123. _st(aBlock)._value();
  3124. $3=self["@stream"];
  3125. _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  3126. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  3127. _st($3)._lf();
  3128. _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  3129. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  3130. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asArray())._asJavascript())).__comma(","));
  3131. _st($3)._lf();
  3132. $4=_st($3)._nextPutAll_("referencedClasses: [");
  3133. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  3134. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  3135. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3136. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3137. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3138. $5=self["@stream"];
  3139. _st($5)._nextPutAll_("]");
  3140. $6=_st($5)._nextPutAll_("})");
  3141. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock}, smalltalk.JSStream)})},
  3142. args: ["aMethod", "aBlock"],
  3143. source: "nextPutMethodDeclaration: aMethod with: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'smalltalk.method({'; lf;\x0a\x09\x09nextPutAll: 'selector: \x22', aMethod selector, '\x22,'; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf. \x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: aMethod messageSends asArray asJavascript, ','; lf;\x0a nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09aMethod classReferences \x0a\x09\x09do: [:each | stream nextPutAll: each asJavascript]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream \x0a\x09\x09nextPutAll: ']';\x0a\x09\x09nextPutAll: '})'",
  3144. messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"],
  3145. referencedClasses: ["String"]
  3146. }),
  3147. smalltalk.JSStream);
  3148. smalltalk.addMethod(
  3149. "_nextPutNonLocalReturnHandlingWith_",
  3150. smalltalk.method({
  3151. selector: "nextPutNonLocalReturnHandlingWith:",
  3152. category: 'streaming',
  3153. fn: function (aBlock){
  3154. var self=this;
  3155. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3156. $1=self["@stream"];
  3157. _st($1)._nextPutAll_("var $early={};");
  3158. _st($1)._lf();
  3159. _st($1)._nextPutAll_("try {");
  3160. $2=_st($1)._lf();
  3161. _st(aBlock)._value();
  3162. $3=self["@stream"];
  3163. _st($3)._nextPutAll_("}");
  3164. _st($3)._lf();
  3165. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  3166. $4=_st($3)._lf();
  3167. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3168. args: ["aBlock"],
  3169. source: "nextPutNonLocalReturnHandlingWith: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'var $early={};'; lf;\x0a\x09\x09nextPutAll: 'try {'; lf.\x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: '}'; lf;\x0a\x09\x09nextPutAll: 'catch(e) {if(e===$early)return e[0]; throw e}'; lf",
  3170. messageSends: ["nextPutAll:", "lf", "value"],
  3171. referencedClasses: []
  3172. }),
  3173. smalltalk.JSStream);
  3174. smalltalk.addMethod(
  3175. "_nextPutNonLocalReturnWith_",
  3176. smalltalk.method({
  3177. selector: "nextPutNonLocalReturnWith:",
  3178. category: 'streaming',
  3179. fn: function (aBlock){
  3180. var self=this;
  3181. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  3182. _st(aBlock)._value();
  3183. _st(self["@stream"])._nextPutAll_("]");
  3184. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3185. args: ["aBlock"],
  3186. source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: 'throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']'",
  3187. messageSends: ["nextPutAll:", "value"],
  3188. referencedClasses: []
  3189. }),
  3190. smalltalk.JSStream);
  3191. smalltalk.addMethod(
  3192. "_nextPutReturn",
  3193. smalltalk.method({
  3194. selector: "nextPutReturn",
  3195. category: 'streaming',
  3196. fn: function (){
  3197. var self=this;
  3198. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  3199. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{}, smalltalk.JSStream)})},
  3200. args: [],
  3201. source: "nextPutReturn\x0a\x09stream nextPutAll: 'return '",
  3202. messageSends: ["nextPutAll:"],
  3203. referencedClasses: []
  3204. }),
  3205. smalltalk.JSStream);
  3206. smalltalk.addMethod(
  3207. "_nextPutReturnWith_",
  3208. smalltalk.method({
  3209. selector: "nextPutReturnWith:",
  3210. category: 'streaming',
  3211. fn: function (aBlock){
  3212. var self=this;
  3213. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  3214. _st(aBlock)._value();
  3215. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3216. args: ["aBlock"],
  3217. source: "nextPutReturnWith: aBlock\x0a\x09self nextPutReturn.\x0a\x09aBlock value",
  3218. messageSends: ["nextPutReturn", "value"],
  3219. referencedClasses: []
  3220. }),
  3221. smalltalk.JSStream);
  3222. smalltalk.addMethod(
  3223. "_nextPutSequenceWith_",
  3224. smalltalk.method({
  3225. selector: "nextPutSequenceWith:",
  3226. category: 'streaming',
  3227. fn: function (aBlock){
  3228. var self=this;
  3229. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  3230. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3231. args: ["aBlock"],
  3232. source: "nextPutSequenceWith: aBlock\x0a\x09\x22stream \x0a\x09\x09nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf.\x22\x0a\x09aBlock value.\x0a\x09\x22stream \x0a\x09\x09nextPutAll: '};'; lf\x22",
  3233. messageSends: ["value"],
  3234. referencedClasses: []
  3235. }),
  3236. smalltalk.JSStream);
  3237. smalltalk.addMethod(
  3238. "_nextPutStatement_with_",
  3239. smalltalk.method({
  3240. selector: "nextPutStatement:with:",
  3241. category: 'streaming',
  3242. fn: function (anInteger,aBlock){
  3243. var self=this;
  3244. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3245. $1=self["@stream"];
  3246. _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  3247. $2=_st($1)._lf();
  3248. _st(self)._nextPutStatementWith_(aBlock);
  3249. $3=self["@stream"];
  3250. _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  3251. $4=_st($3)._lf();
  3252. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:",{anInteger:anInteger,aBlock:aBlock}, smalltalk.JSStream)})},
  3253. args: ["anInteger", "aBlock"],
  3254. source: "nextPutStatement: anInteger with: aBlock\x0a\x09stream nextPutAll: 'case ', anInteger asString, ':'; lf.\x0a\x09self nextPutStatementWith: aBlock.\x0a\x09stream nextPutAll: 'smalltalk.thisContext.pc=', (anInteger + 1) asString, ';'; lf",
  3255. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"],
  3256. referencedClasses: []
  3257. }),
  3258. smalltalk.JSStream);
  3259. smalltalk.addMethod(
  3260. "_nextPutStatementWith_",
  3261. smalltalk.method({
  3262. selector: "nextPutStatementWith:",
  3263. category: 'streaming',
  3264. fn: function (aBlock){
  3265. var self=this;
  3266. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3267. _st(aBlock)._value();
  3268. $1=self["@stream"];
  3269. _st($1)._nextPutAll_(";");
  3270. $2=_st($1)._lf();
  3271. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3272. args: ["aBlock"],
  3273. source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
  3274. messageSends: ["value", "nextPutAll:", "lf"],
  3275. referencedClasses: []
  3276. }),
  3277. smalltalk.JSStream);
  3278. smalltalk.addMethod(
  3279. "_nextPutVar_",
  3280. smalltalk.method({
  3281. selector: "nextPutVar:",
  3282. category: 'streaming',
  3283. fn: function (aString){
  3284. var self=this;
  3285. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3286. $1=self["@stream"];
  3287. _st($1)._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
  3288. $2=_st($1)._lf();
  3289. return self}, function($ctx1) {$ctx1.fill(self,"nextPutVar:",{aString:aString}, smalltalk.JSStream)})},
  3290. args: ["aString"],
  3291. source: "nextPutVar: aString\x0a\x09stream nextPutAll: 'var ', aString, ';'; lf",
  3292. messageSends: ["nextPutAll:", ",", "lf"],
  3293. referencedClasses: []
  3294. }),
  3295. smalltalk.JSStream);
  3296. smalltalk.addMethod(
  3297. "_nextPutVars_",
  3298. smalltalk.method({
  3299. selector: "nextPutVars:",
  3300. category: 'streaming',
  3301. fn: function (aCollection){
  3302. var self=this;
  3303. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  3304. var $early={};
  3305. try {
  3306. _st(aCollection)._ifEmpty_((function(){
  3307. return smalltalk.withContext(function($ctx2) { $1=self;
  3308. throw $early=[$1];
  3309. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3310. _st(self["@stream"])._nextPutAll_("var ");
  3311. _st(aCollection)._do_separatedBy_((function(each){
  3312. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  3313. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3314. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3315. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3316. $2=self["@stream"];
  3317. _st($2)._nextPutAll_(";");
  3318. $3=_st($2)._lf();
  3319. return self}
  3320. catch(e) {if(e===$early)return e[0]; throw e}
  3321. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection}, smalltalk.JSStream)})},
  3322. args: ["aCollection"],
  3323. source: "nextPutVars: aCollection\x0a\x09aCollection ifEmpty: [ ^self ].\x0a \x0a\x09stream nextPutAll: 'var '.\x0a\x09aCollection \x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ';'; lf",
  3324. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"],
  3325. referencedClasses: []
  3326. }),
  3327. smalltalk.JSStream);
  3328. smalltalk.addMethod(
  3329. "_appendToInstruction_",
  3330. smalltalk.method({
  3331. selector: "appendToInstruction:",
  3332. category: '*Compiler-IR',
  3333. fn: function (anIRInstruction){
  3334. var self=this;
  3335. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  3336. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction}, smalltalk.BlockClosure)})},
  3337. args: ["anIRInstruction"],
  3338. source: "appendToInstruction: anIRInstruction\x0a anIRInstruction appendBlock: self",
  3339. messageSends: ["appendBlock:"],
  3340. referencedClasses: []
  3341. }),
  3342. smalltalk.BlockClosure);
  3343. smalltalk.addMethod(
  3344. "_asVariableName",
  3345. smalltalk.method({
  3346. selector: "asVariableName",
  3347. category: '*Compiler-IR',
  3348. fn: function (){
  3349. var self=this;
  3350. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3351. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  3352. if(smalltalk.assert($2)){
  3353. $1=_st(self).__comma("_");
  3354. } else {
  3355. $1=self;
  3356. };
  3357. return $1;
  3358. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{}, smalltalk.String)})},
  3359. args: [],
  3360. source: "asVariableName\x0a\x09^ (Smalltalk current reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
  3361. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  3362. referencedClasses: ["Smalltalk"]
  3363. }),
  3364. smalltalk.String);