Compiler-IR.js 130 KB

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