Compiler-IR.js 130 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709
  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. $1=_st(self["@parent"]).__or(_st(self["@parent"])._scope());
  996. };
  997. return $1;
  998. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.IRInstruction)})},
  999. args: [],
  1000. source: "scope\x0a\x09^ self parent ifNotNil: [ parent | \x0a\x09\x09parent scope ]",
  1001. messageSends: ["ifNotNil:", "parent", "|", "scope"],
  1002. referencedClasses: []
  1003. }),
  1004. smalltalk.IRInstruction);
  1005. smalltalk.addMethod(
  1006. smalltalk.method({
  1007. selector: "on:",
  1008. category: 'instance creation',
  1009. fn: function (aBuilder){
  1010. var self=this;
  1011. return smalltalk.withContext(function($ctx1) {
  1012. var $2,$3,$1;
  1013. $2=self._new();
  1014. _st($2)._builder_(aBuilder);
  1015. $3=_st($2)._yourself();
  1016. $1=$3;
  1017. return $1;
  1018. }, function($ctx1) {$ctx1.fill(self,"on:",{aBuilder:aBuilder},smalltalk.IRInstruction.klass)})},
  1019. args: ["aBuilder"],
  1020. source: "on: aBuilder\x0a\x09^ self new\x0a\x09\x09builder: aBuilder;\x0a\x09\x09yourself",
  1021. messageSends: ["builder:", "new", "yourself"],
  1022. referencedClasses: []
  1023. }),
  1024. smalltalk.IRInstruction.klass);
  1025. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  1026. smalltalk.addMethod(
  1027. smalltalk.method({
  1028. selector: "accept:",
  1029. category: 'visiting',
  1030. fn: function (aVisitor){
  1031. var self=this;
  1032. return smalltalk.withContext(function($ctx1) {
  1033. var $1;
  1034. $1=_st(aVisitor)._visitIRAssignment_(self);
  1035. return $1;
  1036. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRAssignment)})},
  1037. args: ["aVisitor"],
  1038. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRAssignment: self",
  1039. messageSends: ["visitIRAssignment:"],
  1040. referencedClasses: []
  1041. }),
  1042. smalltalk.IRAssignment);
  1043. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  1044. smalltalk.addMethod(
  1045. smalltalk.method({
  1046. selector: "accept:",
  1047. category: 'visiting',
  1048. fn: function (aVisitor){
  1049. var self=this;
  1050. return smalltalk.withContext(function($ctx1) {
  1051. var $1;
  1052. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  1053. return $1;
  1054. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicArray)})},
  1055. args: ["aVisitor"],
  1056. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicArray: self",
  1057. messageSends: ["visitIRDynamicArray:"],
  1058. referencedClasses: []
  1059. }),
  1060. smalltalk.IRDynamicArray);
  1061. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  1062. smalltalk.addMethod(
  1063. smalltalk.method({
  1064. selector: "accept:",
  1065. category: 'visiting',
  1066. fn: function (aVisitor){
  1067. var self=this;
  1068. return smalltalk.withContext(function($ctx1) {
  1069. var $1;
  1070. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  1071. return $1;
  1072. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicDictionary)})},
  1073. args: ["aVisitor"],
  1074. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicDictionary: self",
  1075. messageSends: ["visitIRDynamicDictionary:"],
  1076. referencedClasses: []
  1077. }),
  1078. smalltalk.IRDynamicDictionary);
  1079. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  1080. smalltalk.addMethod(
  1081. smalltalk.method({
  1082. selector: "scope",
  1083. category: 'accessing',
  1084. fn: function (){
  1085. var self=this;
  1086. return smalltalk.withContext(function($ctx1) {
  1087. var $1;
  1088. $1=self["@scope"];
  1089. return $1;
  1090. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.IRScopedInstruction)})},
  1091. args: [],
  1092. source: "scope\x0a\x09^ scope",
  1093. messageSends: [],
  1094. referencedClasses: []
  1095. }),
  1096. smalltalk.IRScopedInstruction);
  1097. smalltalk.addMethod(
  1098. smalltalk.method({
  1099. selector: "scope:",
  1100. category: 'accessing',
  1101. fn: function (aScope){
  1102. var self=this;
  1103. return smalltalk.withContext(function($ctx1) {
  1104. self["@scope"]=aScope;
  1105. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRScopedInstruction)})},
  1106. args: ["aScope"],
  1107. source: "scope: aScope\x0a\x09scope := aScope",
  1108. messageSends: [],
  1109. referencedClasses: []
  1110. }),
  1111. smalltalk.IRScopedInstruction);
  1112. smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  1113. smalltalk.addMethod(
  1114. smalltalk.method({
  1115. selector: "arguments",
  1116. category: 'accessing',
  1117. fn: function (){
  1118. var self=this;
  1119. return smalltalk.withContext(function($ctx1) {
  1120. var $2,$1;
  1121. $2=self["@arguments"];
  1122. if(($receiver = $2) == nil || $receiver == null){
  1123. $1=[];
  1124. } else {
  1125. $1=$2;
  1126. };
  1127. return $1;
  1128. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.IRClosureInstruction)})},
  1129. args: [],
  1130. source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
  1131. messageSends: ["ifNil:"],
  1132. referencedClasses: []
  1133. }),
  1134. smalltalk.IRClosureInstruction);
  1135. smalltalk.addMethod(
  1136. smalltalk.method({
  1137. selector: "arguments:",
  1138. category: 'accessing',
  1139. fn: function (aCollection){
  1140. var self=this;
  1141. return smalltalk.withContext(function($ctx1) {
  1142. self["@arguments"]=aCollection;
  1143. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.IRClosureInstruction)})},
  1144. args: ["aCollection"],
  1145. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1146. messageSends: [],
  1147. referencedClasses: []
  1148. }),
  1149. smalltalk.IRClosureInstruction);
  1150. smalltalk.addMethod(
  1151. smalltalk.method({
  1152. selector: "locals",
  1153. category: 'accessing',
  1154. fn: function (){
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) {
  1157. var $2,$3,$1;
  1158. $2=_st(self._arguments())._copy();
  1159. _st($2)._addAll_(_st(self._tempDeclarations())._collect_((function(each){
  1160. return smalltalk.withContext(function($ctx2) {
  1161. return _st(each)._name();
  1162. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})));
  1163. $3=_st($2)._yourself();
  1164. $1=$3;
  1165. return $1;
  1166. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.IRClosureInstruction)})},
  1167. args: [],
  1168. source: "locals\x0a\x09^ self arguments copy\x0a\x09\x09addAll: (self tempDeclarations collect: [ :each | each name ]);\x0a\x09\x09yourself",
  1169. messageSends: ["addAll:", "copy", "arguments", "collect:", "tempDeclarations", "name", "yourself"],
  1170. referencedClasses: []
  1171. }),
  1172. smalltalk.IRClosureInstruction);
  1173. smalltalk.addMethod(
  1174. smalltalk.method({
  1175. selector: "scope:",
  1176. category: 'accessing',
  1177. fn: function (aScope){
  1178. var self=this;
  1179. return smalltalk.withContext(function($ctx1) {
  1180. smalltalk.IRClosureInstruction.superclass.fn.prototype._scope_.apply(_st(self), [aScope]);
  1181. _st(aScope)._instruction_(self);
  1182. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRClosureInstruction)})},
  1183. args: ["aScope"],
  1184. source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
  1185. messageSends: ["scope:", "instruction:"],
  1186. referencedClasses: []
  1187. }),
  1188. smalltalk.IRClosureInstruction);
  1189. smalltalk.addMethod(
  1190. smalltalk.method({
  1191. selector: "tempDeclarations",
  1192. category: 'accessing',
  1193. fn: function (){
  1194. var self=this;
  1195. return smalltalk.withContext(function($ctx1) {
  1196. var $1;
  1197. $1=_st(self._instructions())._select_((function(each){
  1198. return smalltalk.withContext(function($ctx2) {
  1199. return _st(each)._isTempDeclaration();
  1200. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1201. return $1;
  1202. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{},smalltalk.IRClosureInstruction)})},
  1203. args: [],
  1204. source: "tempDeclarations\x0a\x09^ self instructions select: [ :each |\x0a\x09\x09each isTempDeclaration ]",
  1205. messageSends: ["select:", "instructions", "isTempDeclaration"],
  1206. referencedClasses: []
  1207. }),
  1208. smalltalk.IRClosureInstruction);
  1209. smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
  1210. smalltalk.addMethod(
  1211. smalltalk.method({
  1212. selector: "accept:",
  1213. category: 'visiting',
  1214. fn: function (aVisitor){
  1215. var self=this;
  1216. return smalltalk.withContext(function($ctx1) {
  1217. var $1;
  1218. $1=_st(aVisitor)._visitIRClosure_(self);
  1219. return $1;
  1220. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRClosure)})},
  1221. args: ["aVisitor"],
  1222. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
  1223. messageSends: ["visitIRClosure:"],
  1224. referencedClasses: []
  1225. }),
  1226. smalltalk.IRClosure);
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "isClosure",
  1230. category: 'testing',
  1231. fn: function (){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. return true;
  1235. }, function($ctx1) {$ctx1.fill(self,"isClosure",{},smalltalk.IRClosure)})},
  1236. args: [],
  1237. source: "isClosure\x0a\x09^ true",
  1238. messageSends: [],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.IRClosure);
  1242. smalltalk.addMethod(
  1243. smalltalk.method({
  1244. selector: "sequence",
  1245. category: 'accessing',
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. var $1;
  1250. $1=_st(self._instructions())._last();
  1251. return $1;
  1252. }, function($ctx1) {$ctx1.fill(self,"sequence",{},smalltalk.IRClosure)})},
  1253. args: [],
  1254. source: "sequence\x0a\x09^ self instructions last",
  1255. messageSends: ["last", "instructions"],
  1256. referencedClasses: []
  1257. }),
  1258. smalltalk.IRClosure);
  1259. smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
  1260. smalltalk.IRMethod.comment="I am a method instruction";
  1261. smalltalk.addMethod(
  1262. smalltalk.method({
  1263. selector: "accept:",
  1264. category: 'visiting',
  1265. fn: function (aVisitor){
  1266. var self=this;
  1267. return smalltalk.withContext(function($ctx1) {
  1268. var $1;
  1269. $1=_st(aVisitor)._visitIRMethod_(self);
  1270. return $1;
  1271. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRMethod)})},
  1272. args: ["aVisitor"],
  1273. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
  1274. messageSends: ["visitIRMethod:"],
  1275. referencedClasses: []
  1276. }),
  1277. smalltalk.IRMethod);
  1278. smalltalk.addMethod(
  1279. smalltalk.method({
  1280. selector: "classReferences",
  1281. category: 'accessing',
  1282. fn: function (){
  1283. var self=this;
  1284. return smalltalk.withContext(function($ctx1) {
  1285. var $1;
  1286. $1=self["@classReferences"];
  1287. return $1;
  1288. }, function($ctx1) {$ctx1.fill(self,"classReferences",{},smalltalk.IRMethod)})},
  1289. args: [],
  1290. source: "classReferences\x0a\x09^ classReferences",
  1291. messageSends: [],
  1292. referencedClasses: []
  1293. }),
  1294. smalltalk.IRMethod);
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "classReferences:",
  1298. category: 'accessing',
  1299. fn: function (aCollection){
  1300. var self=this;
  1301. return smalltalk.withContext(function($ctx1) {
  1302. self["@classReferences"]=aCollection;
  1303. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1304. args: ["aCollection"],
  1305. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  1306. messageSends: [],
  1307. referencedClasses: []
  1308. }),
  1309. smalltalk.IRMethod);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "internalVariables",
  1313. category: 'accessing',
  1314. fn: function (){
  1315. var self=this;
  1316. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  1317. return smalltalk.withContext(function($ctx1) {
  1318. var $2,$1;
  1319. $2=self["@internalVariables"];
  1320. if(($receiver = $2) == nil || $receiver == null){
  1321. self["@internalVariables"]=_st($Set())._new();
  1322. $1=self["@internalVariables"];
  1323. } else {
  1324. $1=$2;
  1325. };
  1326. return $1;
  1327. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{},smalltalk.IRMethod)})},
  1328. args: [],
  1329. source: "internalVariables\x0a\x09^ internalVariables ifNil: [ internalVariables := Set new ]",
  1330. messageSends: ["ifNil:", "new"],
  1331. referencedClasses: ["Set"]
  1332. }),
  1333. smalltalk.IRMethod);
  1334. smalltalk.addMethod(
  1335. smalltalk.method({
  1336. selector: "isMethod",
  1337. category: 'accessing',
  1338. fn: function (){
  1339. var self=this;
  1340. return smalltalk.withContext(function($ctx1) {
  1341. return true;
  1342. }, function($ctx1) {$ctx1.fill(self,"isMethod",{},smalltalk.IRMethod)})},
  1343. args: [],
  1344. source: "isMethod\x0a\x09^ true",
  1345. messageSends: [],
  1346. referencedClasses: []
  1347. }),
  1348. smalltalk.IRMethod);
  1349. smalltalk.addMethod(
  1350. smalltalk.method({
  1351. selector: "messageSends",
  1352. category: 'accessing',
  1353. fn: function (){
  1354. var self=this;
  1355. return smalltalk.withContext(function($ctx1) {
  1356. var $1;
  1357. $1=self["@messageSends"];
  1358. return $1;
  1359. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.IRMethod)})},
  1360. args: [],
  1361. source: "messageSends\x0a\x09^ messageSends",
  1362. messageSends: [],
  1363. referencedClasses: []
  1364. }),
  1365. smalltalk.IRMethod);
  1366. smalltalk.addMethod(
  1367. smalltalk.method({
  1368. selector: "messageSends:",
  1369. category: 'accessing',
  1370. fn: function (aCollection){
  1371. var self=this;
  1372. return smalltalk.withContext(function($ctx1) {
  1373. self["@messageSends"]=aCollection;
  1374. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1375. args: ["aCollection"],
  1376. source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
  1377. messageSends: [],
  1378. referencedClasses: []
  1379. }),
  1380. smalltalk.IRMethod);
  1381. smalltalk.addMethod(
  1382. smalltalk.method({
  1383. selector: "method",
  1384. category: 'accessing',
  1385. fn: function (){
  1386. var self=this;
  1387. return smalltalk.withContext(function($ctx1) {
  1388. var $1;
  1389. $1=self;
  1390. return $1;
  1391. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRMethod)})},
  1392. args: [],
  1393. source: "method\x0a\x09^ self",
  1394. messageSends: [],
  1395. referencedClasses: []
  1396. }),
  1397. smalltalk.IRMethod);
  1398. smalltalk.addMethod(
  1399. smalltalk.method({
  1400. selector: "selector",
  1401. category: 'accessing',
  1402. fn: function (){
  1403. var self=this;
  1404. return smalltalk.withContext(function($ctx1) {
  1405. var $1;
  1406. $1=self["@selector"];
  1407. return $1;
  1408. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRMethod)})},
  1409. args: [],
  1410. source: "selector\x0a\x09^ selector",
  1411. messageSends: [],
  1412. referencedClasses: []
  1413. }),
  1414. smalltalk.IRMethod);
  1415. smalltalk.addMethod(
  1416. smalltalk.method({
  1417. selector: "selector:",
  1418. category: 'accessing',
  1419. fn: function (aString){
  1420. var self=this;
  1421. return smalltalk.withContext(function($ctx1) {
  1422. self["@selector"]=aString;
  1423. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRMethod)})},
  1424. args: ["aString"],
  1425. source: "selector: aString\x0a\x09selector := aString",
  1426. messageSends: [],
  1427. referencedClasses: []
  1428. }),
  1429. smalltalk.IRMethod);
  1430. smalltalk.addMethod(
  1431. smalltalk.method({
  1432. selector: "source",
  1433. category: 'accessing',
  1434. fn: function (){
  1435. var self=this;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. var $1;
  1438. $1=self["@source"];
  1439. return $1;
  1440. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRMethod)})},
  1441. args: [],
  1442. source: "source\x0a\x09^ source",
  1443. messageSends: [],
  1444. referencedClasses: []
  1445. }),
  1446. smalltalk.IRMethod);
  1447. smalltalk.addMethod(
  1448. smalltalk.method({
  1449. selector: "source:",
  1450. category: 'accessing',
  1451. fn: function (aString){
  1452. var self=this;
  1453. return smalltalk.withContext(function($ctx1) {
  1454. self["@source"]=aString;
  1455. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRMethod)})},
  1456. args: ["aString"],
  1457. source: "source: aString\x0a\x09source := aString",
  1458. messageSends: [],
  1459. referencedClasses: []
  1460. }),
  1461. smalltalk.IRMethod);
  1462. smalltalk.addMethod(
  1463. smalltalk.method({
  1464. selector: "superSends",
  1465. category: 'accessing',
  1466. fn: function (){
  1467. var self=this;
  1468. return smalltalk.withContext(function($ctx1) {
  1469. var $1;
  1470. $1=self["@superSends"];
  1471. return $1;
  1472. }, function($ctx1) {$ctx1.fill(self,"superSends",{},smalltalk.IRMethod)})},
  1473. args: [],
  1474. source: "superSends\x0a\x09^ superSends",
  1475. messageSends: [],
  1476. referencedClasses: []
  1477. }),
  1478. smalltalk.IRMethod);
  1479. smalltalk.addMethod(
  1480. smalltalk.method({
  1481. selector: "superSends:",
  1482. category: 'accessing',
  1483. fn: function (aCollection){
  1484. var self=this;
  1485. return smalltalk.withContext(function($ctx1) {
  1486. self["@superSends"]=aCollection;
  1487. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1488. args: ["aCollection"],
  1489. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  1490. messageSends: [],
  1491. referencedClasses: []
  1492. }),
  1493. smalltalk.IRMethod);
  1494. smalltalk.addMethod(
  1495. smalltalk.method({
  1496. selector: "theClass",
  1497. category: 'accessing',
  1498. fn: function (){
  1499. var self=this;
  1500. return smalltalk.withContext(function($ctx1) {
  1501. var $1;
  1502. $1=self["@theClass"];
  1503. return $1;
  1504. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.IRMethod)})},
  1505. args: [],
  1506. source: "theClass\x0a\x09^ theClass",
  1507. messageSends: [],
  1508. referencedClasses: []
  1509. }),
  1510. smalltalk.IRMethod);
  1511. smalltalk.addMethod(
  1512. smalltalk.method({
  1513. selector: "theClass:",
  1514. category: 'accessing',
  1515. fn: function (aClass){
  1516. var self=this;
  1517. return smalltalk.withContext(function($ctx1) {
  1518. self["@theClass"]=aClass;
  1519. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.IRMethod)})},
  1520. args: ["aClass"],
  1521. source: "theClass: aClass\x0a\x09theClass := aClass",
  1522. messageSends: [],
  1523. referencedClasses: []
  1524. }),
  1525. smalltalk.IRMethod);
  1526. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1527. smalltalk.IRReturn.comment="I am a local return instruction.";
  1528. smalltalk.addMethod(
  1529. smalltalk.method({
  1530. selector: "accept:",
  1531. category: 'visiting',
  1532. fn: function (aVisitor){
  1533. var self=this;
  1534. return smalltalk.withContext(function($ctx1) {
  1535. var $1;
  1536. $1=_st(aVisitor)._visitIRReturn_(self);
  1537. return $1;
  1538. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRReturn)})},
  1539. args: ["aVisitor"],
  1540. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRReturn: self",
  1541. messageSends: ["visitIRReturn:"],
  1542. referencedClasses: []
  1543. }),
  1544. smalltalk.IRReturn);
  1545. smalltalk.addMethod(
  1546. smalltalk.method({
  1547. selector: "canBeAssigned",
  1548. category: 'testing',
  1549. fn: function (){
  1550. var self=this;
  1551. return smalltalk.withContext(function($ctx1) {
  1552. return false;
  1553. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{},smalltalk.IRReturn)})},
  1554. args: [],
  1555. source: "canBeAssigned\x0a\x09^ false",
  1556. messageSends: [],
  1557. referencedClasses: []
  1558. }),
  1559. smalltalk.IRReturn);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "isBlockReturn",
  1563. category: 'testing',
  1564. fn: function (){
  1565. var self=this;
  1566. return smalltalk.withContext(function($ctx1) {
  1567. return false;
  1568. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRReturn)})},
  1569. args: [],
  1570. source: "isBlockReturn\x0a\x09^ false",
  1571. messageSends: [],
  1572. referencedClasses: []
  1573. }),
  1574. smalltalk.IRReturn);
  1575. smalltalk.addMethod(
  1576. smalltalk.method({
  1577. selector: "isLocalReturn",
  1578. category: 'testing',
  1579. fn: function (){
  1580. var self=this;
  1581. return smalltalk.withContext(function($ctx1) {
  1582. return true;
  1583. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRReturn)})},
  1584. args: [],
  1585. source: "isLocalReturn\x0a\x09^ true",
  1586. messageSends: [],
  1587. referencedClasses: []
  1588. }),
  1589. smalltalk.IRReturn);
  1590. smalltalk.addMethod(
  1591. smalltalk.method({
  1592. selector: "isNonLocalReturn",
  1593. category: 'testing',
  1594. fn: function (){
  1595. var self=this;
  1596. return smalltalk.withContext(function($ctx1) {
  1597. var $1;
  1598. $1=_st(self._isLocalReturn())._not();
  1599. return $1;
  1600. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn",{},smalltalk.IRReturn)})},
  1601. args: [],
  1602. source: "isNonLocalReturn\x0a\x09^ self isLocalReturn not",
  1603. messageSends: ["not", "isLocalReturn"],
  1604. referencedClasses: []
  1605. }),
  1606. smalltalk.IRReturn);
  1607. smalltalk.addMethod(
  1608. smalltalk.method({
  1609. selector: "isReturn",
  1610. category: 'testing',
  1611. fn: function (){
  1612. var self=this;
  1613. return smalltalk.withContext(function($ctx1) {
  1614. return true;
  1615. }, function($ctx1) {$ctx1.fill(self,"isReturn",{},smalltalk.IRReturn)})},
  1616. args: [],
  1617. source: "isReturn\x0a\x09^ true",
  1618. messageSends: [],
  1619. referencedClasses: []
  1620. }),
  1621. smalltalk.IRReturn);
  1622. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1623. smalltalk.IRBlockReturn.comment="Smalltalk blocks return their last statement. I am a implicit block return instruction.";
  1624. smalltalk.addMethod(
  1625. smalltalk.method({
  1626. selector: "accept:",
  1627. category: 'visiting',
  1628. fn: function (aVisitor){
  1629. var self=this;
  1630. return smalltalk.withContext(function($ctx1) {
  1631. var $1;
  1632. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1633. return $1;
  1634. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockReturn)})},
  1635. args: ["aVisitor"],
  1636. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockReturn: self",
  1637. messageSends: ["visitIRBlockReturn:"],
  1638. referencedClasses: []
  1639. }),
  1640. smalltalk.IRBlockReturn);
  1641. smalltalk.addMethod(
  1642. smalltalk.method({
  1643. selector: "isBlockReturn",
  1644. category: 'testing',
  1645. fn: function (){
  1646. var self=this;
  1647. return smalltalk.withContext(function($ctx1) {
  1648. return true;
  1649. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRBlockReturn)})},
  1650. args: [],
  1651. source: "isBlockReturn\x0a\x09^ true",
  1652. messageSends: [],
  1653. referencedClasses: []
  1654. }),
  1655. smalltalk.IRBlockReturn);
  1656. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1657. 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.";
  1658. smalltalk.addMethod(
  1659. smalltalk.method({
  1660. selector: "accept:",
  1661. category: 'visiting',
  1662. fn: function (aVisitor){
  1663. var self=this;
  1664. return smalltalk.withContext(function($ctx1) {
  1665. var $1;
  1666. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1667. return $1;
  1668. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRNonLocalReturn)})},
  1669. args: ["aVisitor"],
  1670. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRNonLocalReturn: self",
  1671. messageSends: ["visitIRNonLocalReturn:"],
  1672. referencedClasses: []
  1673. }),
  1674. smalltalk.IRNonLocalReturn);
  1675. smalltalk.addMethod(
  1676. smalltalk.method({
  1677. selector: "isLocalReturn",
  1678. category: 'testing',
  1679. fn: function (){
  1680. var self=this;
  1681. return smalltalk.withContext(function($ctx1) {
  1682. return false;
  1683. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRNonLocalReturn)})},
  1684. args: [],
  1685. source: "isLocalReturn\x0a\x09^ false",
  1686. messageSends: [],
  1687. referencedClasses: []
  1688. }),
  1689. smalltalk.IRNonLocalReturn);
  1690. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1691. smalltalk.addMethod(
  1692. smalltalk.method({
  1693. selector: "accept:",
  1694. category: 'visiting',
  1695. fn: function (aVisitor){
  1696. var self=this;
  1697. return smalltalk.withContext(function($ctx1) {
  1698. var $1;
  1699. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1700. return $1;
  1701. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRTempDeclaration)})},
  1702. args: ["aVisitor"],
  1703. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRTempDeclaration: self",
  1704. messageSends: ["visitIRTempDeclaration:"],
  1705. referencedClasses: []
  1706. }),
  1707. smalltalk.IRTempDeclaration);
  1708. smalltalk.addMethod(
  1709. smalltalk.method({
  1710. selector: "isTempDeclaration",
  1711. category: 'testing',
  1712. fn: function (){
  1713. var self=this;
  1714. return smalltalk.withContext(function($ctx1) {
  1715. return true;
  1716. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{},smalltalk.IRTempDeclaration)})},
  1717. args: [],
  1718. source: "isTempDeclaration\x0a\x09^ true",
  1719. messageSends: [],
  1720. referencedClasses: []
  1721. }),
  1722. smalltalk.IRTempDeclaration);
  1723. smalltalk.addMethod(
  1724. smalltalk.method({
  1725. selector: "name",
  1726. category: 'accessing',
  1727. fn: function (){
  1728. var self=this;
  1729. return smalltalk.withContext(function($ctx1) {
  1730. var $1;
  1731. $1=self["@name"];
  1732. return $1;
  1733. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.IRTempDeclaration)})},
  1734. args: [],
  1735. source: "name\x0a\x09^ name",
  1736. messageSends: [],
  1737. referencedClasses: []
  1738. }),
  1739. smalltalk.IRTempDeclaration);
  1740. smalltalk.addMethod(
  1741. smalltalk.method({
  1742. selector: "name:",
  1743. category: 'accessing',
  1744. fn: function (aString){
  1745. var self=this;
  1746. return smalltalk.withContext(function($ctx1) {
  1747. self["@name"]=aString;
  1748. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.IRTempDeclaration)})},
  1749. args: ["aString"],
  1750. source: "name: aString\x0a\x09name := aString",
  1751. messageSends: [],
  1752. referencedClasses: []
  1753. }),
  1754. smalltalk.IRTempDeclaration);
  1755. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1756. smalltalk.IRSend.comment="I am a message send instruction.";
  1757. smalltalk.addMethod(
  1758. smalltalk.method({
  1759. selector: "accept:",
  1760. category: 'visiting',
  1761. fn: function (aVisitor){
  1762. var self=this;
  1763. return smalltalk.withContext(function($ctx1) {
  1764. var $1;
  1765. $1=_st(aVisitor)._visitIRSend_(self);
  1766. return $1;
  1767. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSend)})},
  1768. args: ["aVisitor"],
  1769. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSend: self",
  1770. messageSends: ["visitIRSend:"],
  1771. referencedClasses: []
  1772. }),
  1773. smalltalk.IRSend);
  1774. smalltalk.addMethod(
  1775. smalltalk.method({
  1776. selector: "classSend",
  1777. category: 'accessing',
  1778. fn: function (){
  1779. var self=this;
  1780. return smalltalk.withContext(function($ctx1) {
  1781. var $1;
  1782. $1=self["@classSend"];
  1783. return $1;
  1784. }, function($ctx1) {$ctx1.fill(self,"classSend",{},smalltalk.IRSend)})},
  1785. args: [],
  1786. source: "classSend\x0a\x09^ classSend",
  1787. messageSends: [],
  1788. referencedClasses: []
  1789. }),
  1790. smalltalk.IRSend);
  1791. smalltalk.addMethod(
  1792. smalltalk.method({
  1793. selector: "classSend:",
  1794. category: 'accessing',
  1795. fn: function (aClass){
  1796. var self=this;
  1797. return smalltalk.withContext(function($ctx1) {
  1798. self["@classSend"]=aClass;
  1799. return self}, function($ctx1) {$ctx1.fill(self,"classSend:",{aClass:aClass},smalltalk.IRSend)})},
  1800. args: ["aClass"],
  1801. source: "classSend: aClass\x0a\x09classSend := aClass",
  1802. messageSends: [],
  1803. referencedClasses: []
  1804. }),
  1805. smalltalk.IRSend);
  1806. smalltalk.addMethod(
  1807. smalltalk.method({
  1808. selector: "index",
  1809. category: 'accessing',
  1810. fn: function (){
  1811. var self=this;
  1812. return smalltalk.withContext(function($ctx1) {
  1813. var $1;
  1814. $1=self["@index"];
  1815. return $1;
  1816. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.IRSend)})},
  1817. args: [],
  1818. source: "index\x0a\x09^ index",
  1819. messageSends: [],
  1820. referencedClasses: []
  1821. }),
  1822. smalltalk.IRSend);
  1823. smalltalk.addMethod(
  1824. smalltalk.method({
  1825. selector: "index:",
  1826. category: 'accessing',
  1827. fn: function (anInteger){
  1828. var self=this;
  1829. return smalltalk.withContext(function($ctx1) {
  1830. self["@index"]=anInteger;
  1831. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.IRSend)})},
  1832. args: ["anInteger"],
  1833. source: "index: anInteger\x0a\x09index := anInteger",
  1834. messageSends: [],
  1835. referencedClasses: []
  1836. }),
  1837. smalltalk.IRSend);
  1838. smalltalk.addMethod(
  1839. smalltalk.method({
  1840. selector: "isSend",
  1841. category: 'testing',
  1842. fn: function (){
  1843. var self=this;
  1844. return smalltalk.withContext(function($ctx1) {
  1845. return true;
  1846. }, function($ctx1) {$ctx1.fill(self,"isSend",{},smalltalk.IRSend)})},
  1847. args: [],
  1848. source: "isSend\x0a\x09^ true",
  1849. messageSends: [],
  1850. referencedClasses: []
  1851. }),
  1852. smalltalk.IRSend);
  1853. smalltalk.addMethod(
  1854. smalltalk.method({
  1855. selector: "selector",
  1856. category: 'accessing',
  1857. fn: function (){
  1858. var self=this;
  1859. return smalltalk.withContext(function($ctx1) {
  1860. var $1;
  1861. $1=self["@selector"];
  1862. return $1;
  1863. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRSend)})},
  1864. args: [],
  1865. source: "selector\x0a\x09^ selector",
  1866. messageSends: [],
  1867. referencedClasses: []
  1868. }),
  1869. smalltalk.IRSend);
  1870. smalltalk.addMethod(
  1871. smalltalk.method({
  1872. selector: "selector:",
  1873. category: 'accessing',
  1874. fn: function (aString){
  1875. var self=this;
  1876. return smalltalk.withContext(function($ctx1) {
  1877. self["@selector"]=aString;
  1878. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRSend)})},
  1879. args: ["aString"],
  1880. source: "selector: aString\x0a\x09selector := aString",
  1881. messageSends: [],
  1882. referencedClasses: []
  1883. }),
  1884. smalltalk.IRSend);
  1885. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1886. smalltalk.addMethod(
  1887. smalltalk.method({
  1888. selector: "accept:",
  1889. category: 'visiting',
  1890. fn: function (aVisitor){
  1891. var self=this;
  1892. return smalltalk.withContext(function($ctx1) {
  1893. var $1;
  1894. $1=_st(aVisitor)._visitIRSequence_(self);
  1895. return $1;
  1896. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSequence)})},
  1897. args: ["aVisitor"],
  1898. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSequence: self",
  1899. messageSends: ["visitIRSequence:"],
  1900. referencedClasses: []
  1901. }),
  1902. smalltalk.IRSequence);
  1903. smalltalk.addMethod(
  1904. smalltalk.method({
  1905. selector: "isSequence",
  1906. category: 'testing',
  1907. fn: function (){
  1908. var self=this;
  1909. return smalltalk.withContext(function($ctx1) {
  1910. return true;
  1911. }, function($ctx1) {$ctx1.fill(self,"isSequence",{},smalltalk.IRSequence)})},
  1912. args: [],
  1913. source: "isSequence\x0a\x09^ true",
  1914. messageSends: [],
  1915. referencedClasses: []
  1916. }),
  1917. smalltalk.IRSequence);
  1918. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1919. smalltalk.addMethod(
  1920. smalltalk.method({
  1921. selector: "accept:",
  1922. category: 'visiting',
  1923. fn: function (aVisitor){
  1924. var self=this;
  1925. return smalltalk.withContext(function($ctx1) {
  1926. var $1;
  1927. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1928. return $1;
  1929. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockSequence)})},
  1930. args: ["aVisitor"],
  1931. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockSequence: self",
  1932. messageSends: ["visitIRBlockSequence:"],
  1933. referencedClasses: []
  1934. }),
  1935. smalltalk.IRBlockSequence);
  1936. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1937. smalltalk.IRValue.comment="I am the simplest possible instruction. I represent a value.";
  1938. smalltalk.addMethod(
  1939. smalltalk.method({
  1940. selector: "accept:",
  1941. category: 'visiting',
  1942. fn: function (aVisitor){
  1943. var self=this;
  1944. return smalltalk.withContext(function($ctx1) {
  1945. var $1;
  1946. $1=_st(aVisitor)._visitIRValue_(self);
  1947. return $1;
  1948. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRValue)})},
  1949. args: ["aVisitor"],
  1950. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRValue: self",
  1951. messageSends: ["visitIRValue:"],
  1952. referencedClasses: []
  1953. }),
  1954. smalltalk.IRValue);
  1955. smalltalk.addMethod(
  1956. smalltalk.method({
  1957. selector: "needsBoxingAsReceiver",
  1958. category: 'testing',
  1959. fn: function (){
  1960. var self=this;
  1961. return smalltalk.withContext(function($ctx1) {
  1962. return false;
  1963. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRValue)})},
  1964. args: [],
  1965. source: "needsBoxingAsReceiver\x0a\x09^ false",
  1966. messageSends: [],
  1967. referencedClasses: []
  1968. }),
  1969. smalltalk.IRValue);
  1970. smalltalk.addMethod(
  1971. smalltalk.method({
  1972. selector: "value",
  1973. category: 'accessing',
  1974. fn: function (){
  1975. var self=this;
  1976. return smalltalk.withContext(function($ctx1) {
  1977. var $1;
  1978. $1=self["@value"];
  1979. return $1;
  1980. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.IRValue)})},
  1981. args: [],
  1982. source: "value\x0a\x09^value",
  1983. messageSends: [],
  1984. referencedClasses: []
  1985. }),
  1986. smalltalk.IRValue);
  1987. smalltalk.addMethod(
  1988. smalltalk.method({
  1989. selector: "value:",
  1990. category: 'accessing',
  1991. fn: function (aString){
  1992. var self=this;
  1993. return smalltalk.withContext(function($ctx1) {
  1994. self["@value"]=aString;
  1995. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.IRValue)})},
  1996. args: ["aString"],
  1997. source: "value: aString\x0a\x09value := aString",
  1998. messageSends: [],
  1999. referencedClasses: []
  2000. }),
  2001. smalltalk.IRValue);
  2002. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  2003. smalltalk.IRVariable.comment="I am a variable instruction.";
  2004. smalltalk.addMethod(
  2005. smalltalk.method({
  2006. selector: "accept:",
  2007. category: 'visiting',
  2008. fn: function (aVisitor){
  2009. var self=this;
  2010. return smalltalk.withContext(function($ctx1) {
  2011. var $1;
  2012. $1=_st(aVisitor)._visitIRVariable_(self);
  2013. return $1;
  2014. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVariable)})},
  2015. args: ["aVisitor"],
  2016. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVariable: self",
  2017. messageSends: ["visitIRVariable:"],
  2018. referencedClasses: []
  2019. }),
  2020. smalltalk.IRVariable);
  2021. smalltalk.addMethod(
  2022. smalltalk.method({
  2023. selector: "isVariable",
  2024. category: 'testing',
  2025. fn: function (){
  2026. var self=this;
  2027. return smalltalk.withContext(function($ctx1) {
  2028. return true;
  2029. }, function($ctx1) {$ctx1.fill(self,"isVariable",{},smalltalk.IRVariable)})},
  2030. args: [],
  2031. source: "isVariable\x0a\x09^ true",
  2032. messageSends: [],
  2033. referencedClasses: []
  2034. }),
  2035. smalltalk.IRVariable);
  2036. smalltalk.addMethod(
  2037. smalltalk.method({
  2038. selector: "needsBoxingAsReceiver",
  2039. category: 'testing',
  2040. fn: function (){
  2041. var self=this;
  2042. return smalltalk.withContext(function($ctx1) {
  2043. var $1;
  2044. $1=_st(_st(self._variable())._isPseudoVar())._not();
  2045. return $1;
  2046. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRVariable)})},
  2047. args: [],
  2048. source: "needsBoxingAsReceiver\x0a\x09^ self variable isPseudoVar not",
  2049. messageSends: ["not", "isPseudoVar", "variable"],
  2050. referencedClasses: []
  2051. }),
  2052. smalltalk.IRVariable);
  2053. smalltalk.addMethod(
  2054. smalltalk.method({
  2055. selector: "variable",
  2056. category: 'accessing',
  2057. fn: function (){
  2058. var self=this;
  2059. return smalltalk.withContext(function($ctx1) {
  2060. var $1;
  2061. $1=self["@variable"];
  2062. return $1;
  2063. }, function($ctx1) {$ctx1.fill(self,"variable",{},smalltalk.IRVariable)})},
  2064. args: [],
  2065. source: "variable\x0a\x09^ variable",
  2066. messageSends: [],
  2067. referencedClasses: []
  2068. }),
  2069. smalltalk.IRVariable);
  2070. smalltalk.addMethod(
  2071. smalltalk.method({
  2072. selector: "variable:",
  2073. category: 'accessing',
  2074. fn: function (aScopeVariable){
  2075. var self=this;
  2076. return smalltalk.withContext(function($ctx1) {
  2077. self["@variable"]=aScopeVariable;
  2078. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable},smalltalk.IRVariable)})},
  2079. args: ["aScopeVariable"],
  2080. source: "variable: aScopeVariable\x0a\x09variable := aScopeVariable",
  2081. messageSends: [],
  2082. referencedClasses: []
  2083. }),
  2084. smalltalk.IRVariable);
  2085. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  2086. smalltalk.addMethod(
  2087. smalltalk.method({
  2088. selector: "accept:",
  2089. category: 'visiting',
  2090. fn: function (aVisitor){
  2091. var self=this;
  2092. return smalltalk.withContext(function($ctx1) {
  2093. var $1;
  2094. $1=_st(aVisitor)._visitIRVerbatim_(self);
  2095. return $1;
  2096. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVerbatim)})},
  2097. args: ["aVisitor"],
  2098. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVerbatim: self",
  2099. messageSends: ["visitIRVerbatim:"],
  2100. referencedClasses: []
  2101. }),
  2102. smalltalk.IRVerbatim);
  2103. smalltalk.addMethod(
  2104. smalltalk.method({
  2105. selector: "source",
  2106. category: 'accessing',
  2107. fn: function (){
  2108. var self=this;
  2109. return smalltalk.withContext(function($ctx1) {
  2110. var $1;
  2111. $1=self["@source"];
  2112. return $1;
  2113. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRVerbatim)})},
  2114. args: [],
  2115. source: "source\x0a\x09^ source",
  2116. messageSends: [],
  2117. referencedClasses: []
  2118. }),
  2119. smalltalk.IRVerbatim);
  2120. smalltalk.addMethod(
  2121. smalltalk.method({
  2122. selector: "source:",
  2123. category: 'accessing',
  2124. fn: function (aString){
  2125. var self=this;
  2126. return smalltalk.withContext(function($ctx1) {
  2127. self["@source"]=aString;
  2128. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRVerbatim)})},
  2129. args: ["aString"],
  2130. source: "source: aString\x0a\x09source := aString",
  2131. messageSends: [],
  2132. referencedClasses: []
  2133. }),
  2134. smalltalk.IRVerbatim);
  2135. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  2136. smalltalk.addMethod(
  2137. smalltalk.method({
  2138. selector: "visit:",
  2139. category: 'visiting',
  2140. fn: function (anIRInstruction){
  2141. var self=this;
  2142. return smalltalk.withContext(function($ctx1) {
  2143. var $1;
  2144. $1=_st(anIRInstruction)._accept_(self);
  2145. return $1;
  2146. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  2147. args: ["anIRInstruction"],
  2148. source: "visit: anIRInstruction\x0a\x09^ anIRInstruction accept: self",
  2149. messageSends: ["accept:"],
  2150. referencedClasses: []
  2151. }),
  2152. smalltalk.IRVisitor);
  2153. smalltalk.addMethod(
  2154. smalltalk.method({
  2155. selector: "visitIRAssignment:",
  2156. category: 'visiting',
  2157. fn: function (anIRAssignment){
  2158. var self=this;
  2159. return smalltalk.withContext(function($ctx1) {
  2160. var $1;
  2161. $1=self._visitIRInstruction_(anIRAssignment);
  2162. return $1;
  2163. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRVisitor)})},
  2164. args: ["anIRAssignment"],
  2165. source: "visitIRAssignment: anIRAssignment\x0a\x09^ self visitIRInstruction: anIRAssignment",
  2166. messageSends: ["visitIRInstruction:"],
  2167. referencedClasses: []
  2168. }),
  2169. smalltalk.IRVisitor);
  2170. smalltalk.addMethod(
  2171. smalltalk.method({
  2172. selector: "visitIRBlockReturn:",
  2173. category: 'visiting',
  2174. fn: function (anIRBlockReturn){
  2175. var self=this;
  2176. return smalltalk.withContext(function($ctx1) {
  2177. var $1;
  2178. $1=self._visitIRReturn_(anIRBlockReturn);
  2179. return $1;
  2180. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn},smalltalk.IRVisitor)})},
  2181. args: ["anIRBlockReturn"],
  2182. source: "visitIRBlockReturn: anIRBlockReturn\x0a\x09^ self visitIRReturn: anIRBlockReturn",
  2183. messageSends: ["visitIRReturn:"],
  2184. referencedClasses: []
  2185. }),
  2186. smalltalk.IRVisitor);
  2187. smalltalk.addMethod(
  2188. smalltalk.method({
  2189. selector: "visitIRBlockSequence:",
  2190. category: 'visiting',
  2191. fn: function (anIRBlockSequence){
  2192. var self=this;
  2193. return smalltalk.withContext(function($ctx1) {
  2194. var $1;
  2195. $1=self._visitIRSequence_(anIRBlockSequence);
  2196. return $1;
  2197. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence},smalltalk.IRVisitor)})},
  2198. args: ["anIRBlockSequence"],
  2199. source: "visitIRBlockSequence: anIRBlockSequence\x0a\x09^ self visitIRSequence: anIRBlockSequence",
  2200. messageSends: ["visitIRSequence:"],
  2201. referencedClasses: []
  2202. }),
  2203. smalltalk.IRVisitor);
  2204. smalltalk.addMethod(
  2205. smalltalk.method({
  2206. selector: "visitIRClosure:",
  2207. category: 'visiting',
  2208. fn: function (anIRClosure){
  2209. var self=this;
  2210. return smalltalk.withContext(function($ctx1) {
  2211. var $1;
  2212. $1=self._visitIRInstruction_(anIRClosure);
  2213. return $1;
  2214. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRVisitor)})},
  2215. args: ["anIRClosure"],
  2216. source: "visitIRClosure: anIRClosure\x0a\x09^ self visitIRInstruction: anIRClosure",
  2217. messageSends: ["visitIRInstruction:"],
  2218. referencedClasses: []
  2219. }),
  2220. smalltalk.IRVisitor);
  2221. smalltalk.addMethod(
  2222. smalltalk.method({
  2223. selector: "visitIRDynamicArray:",
  2224. category: 'visiting',
  2225. fn: function (anIRDynamicArray){
  2226. var self=this;
  2227. return smalltalk.withContext(function($ctx1) {
  2228. var $1;
  2229. $1=self._visitIRInstruction_(anIRDynamicArray);
  2230. return $1;
  2231. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRVisitor)})},
  2232. args: ["anIRDynamicArray"],
  2233. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09^ self visitIRInstruction: anIRDynamicArray",
  2234. messageSends: ["visitIRInstruction:"],
  2235. referencedClasses: []
  2236. }),
  2237. smalltalk.IRVisitor);
  2238. smalltalk.addMethod(
  2239. smalltalk.method({
  2240. selector: "visitIRDynamicDictionary:",
  2241. category: 'visiting',
  2242. fn: function (anIRDynamicDictionary){
  2243. var self=this;
  2244. return smalltalk.withContext(function($ctx1) {
  2245. var $1;
  2246. $1=self._visitIRInstruction_(anIRDynamicDictionary);
  2247. return $1;
  2248. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRVisitor)})},
  2249. args: ["anIRDynamicDictionary"],
  2250. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09^ self visitIRInstruction: anIRDynamicDictionary",
  2251. messageSends: ["visitIRInstruction:"],
  2252. referencedClasses: []
  2253. }),
  2254. smalltalk.IRVisitor);
  2255. smalltalk.addMethod(
  2256. smalltalk.method({
  2257. selector: "visitIRInlinedClosure:",
  2258. category: 'visiting',
  2259. fn: function (anIRInlinedClosure){
  2260. var self=this;
  2261. return smalltalk.withContext(function($ctx1) {
  2262. var $1;
  2263. $1=self._visitIRClosure_(anIRInlinedClosure);
  2264. return $1;
  2265. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},smalltalk.IRVisitor)})},
  2266. args: ["anIRInlinedClosure"],
  2267. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09^ self visitIRClosure: anIRInlinedClosure",
  2268. messageSends: ["visitIRClosure:"],
  2269. referencedClasses: []
  2270. }),
  2271. smalltalk.IRVisitor);
  2272. smalltalk.addMethod(
  2273. smalltalk.method({
  2274. selector: "visitIRInlinedSequence:",
  2275. category: 'visiting',
  2276. fn: function (anIRInlinedSequence){
  2277. var self=this;
  2278. return smalltalk.withContext(function($ctx1) {
  2279. var $1;
  2280. $1=self._visitIRSequence_(anIRInlinedSequence);
  2281. return $1;
  2282. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence},smalltalk.IRVisitor)})},
  2283. args: ["anIRInlinedSequence"],
  2284. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09^ self visitIRSequence: anIRInlinedSequence",
  2285. messageSends: ["visitIRSequence:"],
  2286. referencedClasses: []
  2287. }),
  2288. smalltalk.IRVisitor);
  2289. smalltalk.addMethod(
  2290. smalltalk.method({
  2291. selector: "visitIRInstruction:",
  2292. category: 'visiting',
  2293. fn: function (anIRInstruction){
  2294. var self=this;
  2295. return smalltalk.withContext(function($ctx1) {
  2296. var $1;
  2297. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  2298. return smalltalk.withContext(function($ctx2) {
  2299. return self._visit_(each);
  2300. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  2301. $1=anIRInstruction;
  2302. return $1;
  2303. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  2304. args: ["anIRInstruction"],
  2305. source: "visitIRInstruction: anIRInstruction\x0a\x09anIRInstruction instructions do: [ :each | self visit: each ].\x0a\x09^ anIRInstruction",
  2306. messageSends: ["do:", "instructions", "visit:"],
  2307. referencedClasses: []
  2308. }),
  2309. smalltalk.IRVisitor);
  2310. smalltalk.addMethod(
  2311. smalltalk.method({
  2312. selector: "visitIRMethod:",
  2313. category: 'visiting',
  2314. fn: function (anIRMethod){
  2315. var self=this;
  2316. return smalltalk.withContext(function($ctx1) {
  2317. var $1;
  2318. $1=self._visitIRInstruction_(anIRMethod);
  2319. return $1;
  2320. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRVisitor)})},
  2321. args: ["anIRMethod"],
  2322. source: "visitIRMethod: anIRMethod\x0a\x09^ self visitIRInstruction: anIRMethod",
  2323. messageSends: ["visitIRInstruction:"],
  2324. referencedClasses: []
  2325. }),
  2326. smalltalk.IRVisitor);
  2327. smalltalk.addMethod(
  2328. smalltalk.method({
  2329. selector: "visitIRNonLocalReturn:",
  2330. category: 'visiting',
  2331. fn: function (anIRNonLocalReturn){
  2332. var self=this;
  2333. return smalltalk.withContext(function($ctx1) {
  2334. var $1;
  2335. $1=self._visitIRInstruction_(anIRNonLocalReturn);
  2336. return $1;
  2337. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRVisitor)})},
  2338. args: ["anIRNonLocalReturn"],
  2339. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self visitIRInstruction: anIRNonLocalReturn",
  2340. messageSends: ["visitIRInstruction:"],
  2341. referencedClasses: []
  2342. }),
  2343. smalltalk.IRVisitor);
  2344. smalltalk.addMethod(
  2345. smalltalk.method({
  2346. selector: "visitIRNonLocalReturnHandling:",
  2347. category: 'visiting',
  2348. fn: function (anIRNonLocalReturnHandling){
  2349. var self=this;
  2350. return smalltalk.withContext(function($ctx1) {
  2351. var $1;
  2352. $1=self._visitIRInstruction_(anIRNonLocalReturnHandling);
  2353. return $1;
  2354. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling},smalltalk.IRVisitor)})},
  2355. args: ["anIRNonLocalReturnHandling"],
  2356. source: "visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling\x0a\x09^ self visitIRInstruction: anIRNonLocalReturnHandling",
  2357. messageSends: ["visitIRInstruction:"],
  2358. referencedClasses: []
  2359. }),
  2360. smalltalk.IRVisitor);
  2361. smalltalk.addMethod(
  2362. smalltalk.method({
  2363. selector: "visitIRReturn:",
  2364. category: 'visiting',
  2365. fn: function (anIRReturn){
  2366. var self=this;
  2367. return smalltalk.withContext(function($ctx1) {
  2368. var $1;
  2369. $1=self._visitIRInstruction_(anIRReturn);
  2370. return $1;
  2371. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRVisitor)})},
  2372. args: ["anIRReturn"],
  2373. source: "visitIRReturn: anIRReturn\x0a\x09^ self visitIRInstruction: anIRReturn",
  2374. messageSends: ["visitIRInstruction:"],
  2375. referencedClasses: []
  2376. }),
  2377. smalltalk.IRVisitor);
  2378. smalltalk.addMethod(
  2379. smalltalk.method({
  2380. selector: "visitIRSend:",
  2381. category: 'visiting',
  2382. fn: function (anIRSend){
  2383. var self=this;
  2384. return smalltalk.withContext(function($ctx1) {
  2385. var $1;
  2386. $1=self._visitIRInstruction_(anIRSend);
  2387. return $1;
  2388. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRVisitor)})},
  2389. args: ["anIRSend"],
  2390. source: "visitIRSend: anIRSend\x0a\x09^ self visitIRInstruction: anIRSend",
  2391. messageSends: ["visitIRInstruction:"],
  2392. referencedClasses: []
  2393. }),
  2394. smalltalk.IRVisitor);
  2395. smalltalk.addMethod(
  2396. smalltalk.method({
  2397. selector: "visitIRSequence:",
  2398. category: 'visiting',
  2399. fn: function (anIRSequence){
  2400. var self=this;
  2401. return smalltalk.withContext(function($ctx1) {
  2402. var $1;
  2403. $1=self._visitIRInstruction_(anIRSequence);
  2404. return $1;
  2405. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRVisitor)})},
  2406. args: ["anIRSequence"],
  2407. source: "visitIRSequence: anIRSequence\x0a\x09^ self visitIRInstruction: anIRSequence",
  2408. messageSends: ["visitIRInstruction:"],
  2409. referencedClasses: []
  2410. }),
  2411. smalltalk.IRVisitor);
  2412. smalltalk.addMethod(
  2413. smalltalk.method({
  2414. selector: "visitIRTempDeclaration:",
  2415. category: 'visiting',
  2416. fn: function (anIRTempDeclaration){
  2417. var self=this;
  2418. return smalltalk.withContext(function($ctx1) {
  2419. var $1;
  2420. $1=self._visitIRInstruction_(anIRTempDeclaration);
  2421. return $1;
  2422. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRVisitor)})},
  2423. args: ["anIRTempDeclaration"],
  2424. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09^ self visitIRInstruction: anIRTempDeclaration",
  2425. messageSends: ["visitIRInstruction:"],
  2426. referencedClasses: []
  2427. }),
  2428. smalltalk.IRVisitor);
  2429. smalltalk.addMethod(
  2430. smalltalk.method({
  2431. selector: "visitIRValue:",
  2432. category: 'visiting',
  2433. fn: function (anIRValue){
  2434. var self=this;
  2435. return smalltalk.withContext(function($ctx1) {
  2436. var $1;
  2437. $1=self._visitIRInstruction_(anIRValue);
  2438. return $1;
  2439. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRVisitor)})},
  2440. args: ["anIRValue"],
  2441. source: "visitIRValue: anIRValue\x0a\x09^ self visitIRInstruction: anIRValue",
  2442. messageSends: ["visitIRInstruction:"],
  2443. referencedClasses: []
  2444. }),
  2445. smalltalk.IRVisitor);
  2446. smalltalk.addMethod(
  2447. smalltalk.method({
  2448. selector: "visitIRVariable:",
  2449. category: 'visiting',
  2450. fn: function (anIRVariable){
  2451. var self=this;
  2452. return smalltalk.withContext(function($ctx1) {
  2453. var $1;
  2454. $1=self._visitIRInstruction_(anIRVariable);
  2455. return $1;
  2456. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRVisitor)})},
  2457. args: ["anIRVariable"],
  2458. source: "visitIRVariable: anIRVariable\x0a\x09^ self visitIRInstruction: anIRVariable",
  2459. messageSends: ["visitIRInstruction:"],
  2460. referencedClasses: []
  2461. }),
  2462. smalltalk.IRVisitor);
  2463. smalltalk.addMethod(
  2464. smalltalk.method({
  2465. selector: "visitIRVerbatim:",
  2466. category: 'visiting',
  2467. fn: function (anIRVerbatim){
  2468. var self=this;
  2469. return smalltalk.withContext(function($ctx1) {
  2470. var $1;
  2471. $1=self._visitIRInstruction_(anIRVerbatim);
  2472. return $1;
  2473. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRVisitor)})},
  2474. args: ["anIRVerbatim"],
  2475. source: "visitIRVerbatim: anIRVerbatim\x0a\x09^ self visitIRInstruction: anIRVerbatim",
  2476. messageSends: ["visitIRInstruction:"],
  2477. referencedClasses: []
  2478. }),
  2479. smalltalk.IRVisitor);
  2480. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream', 'currentClass'], 'Compiler-IR');
  2481. smalltalk.addMethod(
  2482. smalltalk.method({
  2483. selector: "contents",
  2484. category: 'accessing',
  2485. fn: function (){
  2486. var self=this;
  2487. return smalltalk.withContext(function($ctx1) {
  2488. var $1;
  2489. $1=_st(self._stream())._contents();
  2490. return $1;
  2491. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.IRJSTranslator)})},
  2492. args: [],
  2493. source: "contents\x0a\x09^ self stream contents",
  2494. messageSends: ["contents", "stream"],
  2495. referencedClasses: []
  2496. }),
  2497. smalltalk.IRJSTranslator);
  2498. smalltalk.addMethod(
  2499. smalltalk.method({
  2500. selector: "currentClass",
  2501. category: 'accessing',
  2502. fn: function (){
  2503. var self=this;
  2504. return smalltalk.withContext(function($ctx1) {
  2505. var $1;
  2506. $1=self["@currentClass"];
  2507. return $1;
  2508. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.IRJSTranslator)})},
  2509. args: [],
  2510. source: "currentClass\x0a\x09^ currentClass",
  2511. messageSends: [],
  2512. referencedClasses: []
  2513. }),
  2514. smalltalk.IRJSTranslator);
  2515. smalltalk.addMethod(
  2516. smalltalk.method({
  2517. selector: "currentClass:",
  2518. category: 'accessing',
  2519. fn: function (aClass){
  2520. var self=this;
  2521. return smalltalk.withContext(function($ctx1) {
  2522. self["@currentClass"]=aClass;
  2523. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.IRJSTranslator)})},
  2524. args: ["aClass"],
  2525. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  2526. messageSends: [],
  2527. referencedClasses: []
  2528. }),
  2529. smalltalk.IRJSTranslator);
  2530. smalltalk.addMethod(
  2531. smalltalk.method({
  2532. selector: "initialize",
  2533. category: 'initialization',
  2534. fn: function (){
  2535. var self=this;
  2536. function $JSStream(){return smalltalk.JSStream||(typeof JSStream=="undefined"?nil:JSStream)}
  2537. return smalltalk.withContext(function($ctx1) {
  2538. smalltalk.IRJSTranslator.superclass.fn.prototype._initialize.apply(_st(self), []);
  2539. self["@stream"]=_st($JSStream())._new();
  2540. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.IRJSTranslator)})},
  2541. args: [],
  2542. source: "initialize\x0a\x09super initialize.\x0a\x09stream := JSStream new.",
  2543. messageSends: ["initialize", "new"],
  2544. referencedClasses: ["JSStream"]
  2545. }),
  2546. smalltalk.IRJSTranslator);
  2547. smalltalk.addMethod(
  2548. smalltalk.method({
  2549. selector: "stream",
  2550. category: 'accessing',
  2551. fn: function (){
  2552. var self=this;
  2553. return smalltalk.withContext(function($ctx1) {
  2554. var $1;
  2555. $1=self["@stream"];
  2556. return $1;
  2557. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.IRJSTranslator)})},
  2558. args: [],
  2559. source: "stream\x0a\x09^ stream",
  2560. messageSends: [],
  2561. referencedClasses: []
  2562. }),
  2563. smalltalk.IRJSTranslator);
  2564. smalltalk.addMethod(
  2565. smalltalk.method({
  2566. selector: "stream:",
  2567. category: 'accessing',
  2568. fn: function (aStream){
  2569. var self=this;
  2570. return smalltalk.withContext(function($ctx1) {
  2571. self["@stream"]=aStream;
  2572. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.IRJSTranslator)})},
  2573. args: ["aStream"],
  2574. source: "stream: aStream\x0a\x09stream := aStream",
  2575. messageSends: [],
  2576. referencedClasses: []
  2577. }),
  2578. smalltalk.IRJSTranslator);
  2579. smalltalk.addMethod(
  2580. smalltalk.method({
  2581. selector: "visitIRAssignment:",
  2582. category: 'visiting',
  2583. fn: function (anIRAssignment){
  2584. var self=this;
  2585. return smalltalk.withContext(function($ctx1) {
  2586. self._visit_(_st(_st(anIRAssignment)._instructions())._first());
  2587. _st(self._stream())._nextPutAssignment();
  2588. self._visit_(_st(_st(anIRAssignment)._instructions())._last());
  2589. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRJSTranslator)})},
  2590. args: ["anIRAssignment"],
  2591. source: "visitIRAssignment: anIRAssignment\x0a\x09self visit: anIRAssignment instructions first.\x0a\x09self stream nextPutAssignment.\x0a\x09self visit: anIRAssignment instructions last.",
  2592. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"],
  2593. referencedClasses: []
  2594. }),
  2595. smalltalk.IRJSTranslator);
  2596. smalltalk.addMethod(
  2597. smalltalk.method({
  2598. selector: "visitIRClosure:",
  2599. category: 'visiting',
  2600. fn: function (anIRClosure){
  2601. var self=this;
  2602. return smalltalk.withContext(function($ctx1) {
  2603. _st(self._stream())._nextPutClosureWith_arguments_((function(){
  2604. return smalltalk.withContext(function($ctx2) {
  2605. _st(self._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  2606. return smalltalk.withContext(function($ctx3) {
  2607. return _st(_st(each)._name())._asVariableName();
  2608. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})})));
  2609. return _st(self._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  2610. return smalltalk.withContext(function($ctx3) {
  2611. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  2612. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  2613. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),_st(anIRClosure)._arguments());
  2614. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRJSTranslator)})},
  2615. args: ["anIRClosure"],
  2616. 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",
  2617. messageSends: ["nextPutClosureWith:arguments:", "stream", "nextPutVars:", "collect:", "tempDeclarations", "asVariableName", "name", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"],
  2618. referencedClasses: []
  2619. }),
  2620. smalltalk.IRJSTranslator);
  2621. smalltalk.addMethod(
  2622. smalltalk.method({
  2623. selector: "visitIRDynamicArray:",
  2624. category: 'visiting',
  2625. fn: function (anIRDynamicArray){
  2626. var self=this;
  2627. return smalltalk.withContext(function($ctx1) {
  2628. _st(self._stream())._nextPutAll_("[");
  2629. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  2630. return smalltalk.withContext(function($ctx2) {
  2631. return self._visit_(each);
  2632. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  2633. return smalltalk.withContext(function($ctx2) {
  2634. return _st(self._stream())._nextPutAll_(",");
  2635. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2636. _st(self["@stream"])._nextPutAll_("]");
  2637. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRJSTranslator)})},
  2638. args: ["anIRDynamicArray"],
  2639. 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: ']'",
  2640. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "instructions", "visit:"],
  2641. referencedClasses: []
  2642. }),
  2643. smalltalk.IRJSTranslator);
  2644. smalltalk.addMethod(
  2645. smalltalk.method({
  2646. selector: "visitIRDynamicDictionary:",
  2647. category: 'visiting',
  2648. fn: function (anIRDynamicDictionary){
  2649. var self=this;
  2650. return smalltalk.withContext(function($ctx1) {
  2651. _st(self._stream())._nextPutAll_("smalltalk.HashedCollection._from_([");
  2652. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  2653. return smalltalk.withContext(function($ctx2) {
  2654. return self._visit_(each);
  2655. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  2656. return smalltalk.withContext(function($ctx2) {
  2657. return _st(self._stream())._nextPutAll_(",");
  2658. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2659. _st(self._stream())._nextPutAll_("])");
  2660. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRJSTranslator)})},
  2661. args: ["anIRDynamicDictionary"],
  2662. 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: '])'",
  2663. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "instructions", "visit:"],
  2664. referencedClasses: []
  2665. }),
  2666. smalltalk.IRJSTranslator);
  2667. smalltalk.addMethod(
  2668. smalltalk.method({
  2669. selector: "visitIRMethod:",
  2670. category: 'visiting',
  2671. fn: function (anIRMethod){
  2672. var self=this;
  2673. return smalltalk.withContext(function($ctx1) {
  2674. var $1,$2;
  2675. _st(self._stream())._nextPutMethodDeclaration_with_(anIRMethod,(function(){
  2676. return smalltalk.withContext(function($ctx2) {
  2677. return _st(self._stream())._nextPutFunctionWith_arguments_((function(){
  2678. return smalltalk.withContext(function($ctx3) {
  2679. _st(self._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  2680. return smalltalk.withContext(function($ctx4) {
  2681. return _st(_st(each)._name())._asVariableName();
  2682. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,3)})})));
  2683. _st(_st(anIRMethod)._classReferences())._do_((function(each){
  2684. return smalltalk.withContext(function($ctx4) {
  2685. return _st(self._stream())._nextPutClassRefFunction_(each);
  2686. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,4)})}));
  2687. return _st(self._stream())._nextPutContextFor_during_(anIRMethod,(function(){
  2688. return smalltalk.withContext(function($ctx4) {
  2689. $1=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  2690. if(smalltalk.assert($1)){
  2691. _st(self._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  2692. return smalltalk.withContext(function($ctx5) {
  2693. return _st(_st(each)._variable())._alias();
  2694. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx4,7)})})));
  2695. };
  2696. $2=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  2697. if(smalltalk.assert($2)){
  2698. return _st(self._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  2699. return smalltalk.withContext(function($ctx5) {
  2700. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2701. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,9)})}));
  2702. } else {
  2703. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2704. };
  2705. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  2706. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}),_st(anIRMethod)._arguments());
  2707. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2708. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRJSTranslator)})},
  2709. args: ["anIRMethod"],
  2710. 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 ]",
  2711. 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"],
  2712. referencedClasses: []
  2713. }),
  2714. smalltalk.IRJSTranslator);
  2715. smalltalk.addMethod(
  2716. smalltalk.method({
  2717. selector: "visitIRNonLocalReturn:",
  2718. category: 'visiting',
  2719. fn: function (anIRNonLocalReturn){
  2720. var self=this;
  2721. return smalltalk.withContext(function($ctx1) {
  2722. _st(self._stream())._nextPutNonLocalReturnWith_((function(){
  2723. return smalltalk.withContext(function($ctx2) {
  2724. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  2725. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2726. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRJSTranslator)})},
  2727. args: ["anIRNonLocalReturn"],
  2728. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09self stream nextPutNonLocalReturnWith: [\x0a\x09\x09super visitIRNonLocalReturn: anIRNonLocalReturn ]",
  2729. messageSends: ["nextPutNonLocalReturnWith:", "stream", "visitIRNonLocalReturn:"],
  2730. referencedClasses: []
  2731. }),
  2732. smalltalk.IRJSTranslator);
  2733. smalltalk.addMethod(
  2734. smalltalk.method({
  2735. selector: "visitIRReturn:",
  2736. category: 'visiting',
  2737. fn: function (anIRReturn){
  2738. var self=this;
  2739. return smalltalk.withContext(function($ctx1) {
  2740. _st(self._stream())._nextPutReturnWith_((function(){
  2741. return smalltalk.withContext(function($ctx2) {
  2742. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  2743. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2744. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRJSTranslator)})},
  2745. args: ["anIRReturn"],
  2746. source: "visitIRReturn: anIRReturn\x0a\x09self stream nextPutReturnWith: [\x0a\x09\x09super visitIRReturn: anIRReturn ]",
  2747. messageSends: ["nextPutReturnWith:", "stream", "visitIRReturn:"],
  2748. referencedClasses: []
  2749. }),
  2750. smalltalk.IRJSTranslator);
  2751. smalltalk.addMethod(
  2752. smalltalk.method({
  2753. selector: "visitIRSend:",
  2754. category: 'visiting',
  2755. fn: function (anIRSend){
  2756. var self=this;
  2757. return smalltalk.withContext(function($ctx1) {
  2758. var $1;
  2759. $1=_st(anIRSend)._classSend();
  2760. if(($receiver = $1) == nil || $receiver == null){
  2761. self._visitSend_(anIRSend);
  2762. } else {
  2763. self._visitSuperSend_(anIRSend);
  2764. };
  2765. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2766. args: ["anIRSend"],
  2767. source: "visitIRSend: anIRSend\x0a\x09anIRSend classSend\x0a\x09\x09ifNil: [ self visitSend: anIRSend ]\x0a\x09\x09ifNotNil: [ self visitSuperSend: anIRSend ]",
  2768. messageSends: ["ifNil:ifNotNil:", "classSend", "visitSend:", "visitSuperSend:"],
  2769. referencedClasses: []
  2770. }),
  2771. smalltalk.IRJSTranslator);
  2772. smalltalk.addMethod(
  2773. smalltalk.method({
  2774. selector: "visitIRSequence:",
  2775. category: 'visiting',
  2776. fn: function (anIRSequence){
  2777. var self=this;
  2778. return smalltalk.withContext(function($ctx1) {
  2779. _st(self._stream())._nextPutSequenceWith_((function(){
  2780. return smalltalk.withContext(function($ctx2) {
  2781. return _st(_st(anIRSequence)._instructions())._do_((function(each){
  2782. return smalltalk.withContext(function($ctx3) {
  2783. return _st(self._stream())._nextPutStatementWith_(self._visit_(each));
  2784. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  2785. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2786. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRJSTranslator)})},
  2787. args: ["anIRSequence"],
  2788. source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence instructions do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ]]",
  2789. messageSends: ["nextPutSequenceWith:", "stream", "do:", "instructions", "nextPutStatementWith:", "visit:"],
  2790. referencedClasses: []
  2791. }),
  2792. smalltalk.IRJSTranslator);
  2793. smalltalk.addMethod(
  2794. smalltalk.method({
  2795. selector: "visitIRTempDeclaration:",
  2796. category: 'visiting',
  2797. fn: function (anIRTempDeclaration){
  2798. var self=this;
  2799. return smalltalk.withContext(function($ctx1) {
  2800. return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRJSTranslator)})},
  2801. args: ["anIRTempDeclaration"],
  2802. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09\x22self stream\x0a\x09\x09nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';';\x0a\x09\x09lf\x22",
  2803. messageSends: [],
  2804. referencedClasses: []
  2805. }),
  2806. smalltalk.IRJSTranslator);
  2807. smalltalk.addMethod(
  2808. smalltalk.method({
  2809. selector: "visitIRValue:",
  2810. category: 'visiting',
  2811. fn: function (anIRValue){
  2812. var self=this;
  2813. return smalltalk.withContext(function($ctx1) {
  2814. _st(self._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2815. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRJSTranslator)})},
  2816. args: ["anIRValue"],
  2817. source: "visitIRValue: anIRValue\x0a\x09self stream nextPutAll: anIRValue value asJavascript",
  2818. messageSends: ["nextPutAll:", "stream", "asJavascript", "value"],
  2819. referencedClasses: []
  2820. }),
  2821. smalltalk.IRJSTranslator);
  2822. smalltalk.addMethod(
  2823. smalltalk.method({
  2824. selector: "visitIRVariable:",
  2825. category: 'visiting',
  2826. fn: function (anIRVariable){
  2827. var self=this;
  2828. return smalltalk.withContext(function($ctx1) {
  2829. var $1;
  2830. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2831. if(smalltalk.assert($1)){
  2832. _st(self._stream())._nextPutAll_("smalltalk.getThisContext()");
  2833. } else {
  2834. _st(self._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2835. };
  2836. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRJSTranslator)})},
  2837. args: ["anIRVariable"],
  2838. 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 ]",
  2839. messageSends: ["ifTrue:ifFalse:", "=", "name", "variable", "nextPutAll:", "stream", "alias"],
  2840. referencedClasses: []
  2841. }),
  2842. smalltalk.IRJSTranslator);
  2843. smalltalk.addMethod(
  2844. smalltalk.method({
  2845. selector: "visitIRVerbatim:",
  2846. category: 'visiting',
  2847. fn: function (anIRVerbatim){
  2848. var self=this;
  2849. return smalltalk.withContext(function($ctx1) {
  2850. _st(self._stream())._nextPutStatementWith_((function(){
  2851. return smalltalk.withContext(function($ctx2) {
  2852. return _st(self._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2853. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2854. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRJSTranslator)})},
  2855. args: ["anIRVerbatim"],
  2856. source: "visitIRVerbatim: anIRVerbatim\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self stream nextPutAll: anIRVerbatim source ]",
  2857. messageSends: ["nextPutStatementWith:", "stream", "nextPutAll:", "source"],
  2858. referencedClasses: []
  2859. }),
  2860. smalltalk.IRJSTranslator);
  2861. smalltalk.addMethod(
  2862. smalltalk.method({
  2863. selector: "visitReceiver:",
  2864. category: 'visiting',
  2865. fn: function (anIRInstruction){
  2866. var self=this;
  2867. return smalltalk.withContext(function($ctx1) {
  2868. var $1,$2;
  2869. $1=_st(anIRInstruction)._needsBoxingAsReceiver();
  2870. if(! smalltalk.assert($1)){
  2871. $2=self._visit_(anIRInstruction);
  2872. return $2;
  2873. };
  2874. _st(self._stream())._nextPutAll_("_st(");
  2875. self._visit_(anIRInstruction);
  2876. _st(self._stream())._nextPutAll_(")");
  2877. return self}, function($ctx1) {$ctx1.fill(self,"visitReceiver:",{anIRInstruction:anIRInstruction},smalltalk.IRJSTranslator)})},
  2878. args: ["anIRInstruction"],
  2879. 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: ')'",
  2880. messageSends: ["ifFalse:", "needsBoxingAsReceiver", "visit:", "nextPutAll:", "stream"],
  2881. referencedClasses: []
  2882. }),
  2883. smalltalk.IRJSTranslator);
  2884. smalltalk.addMethod(
  2885. smalltalk.method({
  2886. selector: "visitSend:",
  2887. category: 'visiting',
  2888. fn: function (anIRSend){
  2889. var self=this;
  2890. return smalltalk.withContext(function($ctx1) {
  2891. self._visitReceiver_(_st(_st(anIRSend)._instructions())._first());
  2892. _st(self._stream())._nextPutAll_(_st(".".__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  2893. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2894. return smalltalk.withContext(function($ctx2) {
  2895. return self._visit_(each);
  2896. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  2897. return smalltalk.withContext(function($ctx2) {
  2898. return _st(self._stream())._nextPutAll_(",");
  2899. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2900. _st(self._stream())._nextPutAll_(")");
  2901. return self}, function($ctx1) {$ctx1.fill(self,"visitSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2902. args: ["anIRSend"],
  2903. 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: ')'",
  2904. messageSends: ["visitReceiver:", "first", "instructions", "nextPutAll:", "stream", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "visit:"],
  2905. referencedClasses: []
  2906. }),
  2907. smalltalk.IRJSTranslator);
  2908. smalltalk.addMethod(
  2909. smalltalk.method({
  2910. selector: "visitSuperSend:",
  2911. category: 'visiting',
  2912. fn: function (anIRSend){
  2913. var self=this;
  2914. return smalltalk.withContext(function($ctx1) {
  2915. var $1,$2;
  2916. $1=self._stream();
  2917. _st($1)._nextPutAll_(_st(self._currentClass())._asJavascript());
  2918. _st($1)._nextPutAll_(".superclass.fn.prototype.");
  2919. _st($1)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  2920. $2=_st($1)._nextPutAll_("_st(");
  2921. self._visit_(_st(_st(anIRSend)._instructions())._first());
  2922. _st(self._stream())._nextPutAll_("), [");
  2923. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2924. return smalltalk.withContext(function($ctx2) {
  2925. return self._visit_(each);
  2926. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  2927. return smalltalk.withContext(function($ctx2) {
  2928. return _st(self._stream())._nextPutAll_(",");
  2929. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2930. _st(self._stream())._nextPutAll_("])");
  2931. return self}, function($ctx1) {$ctx1.fill(self,"visitSuperSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2932. args: ["anIRSend"],
  2933. 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: '])'",
  2934. messageSends: ["nextPutAll:", "stream", "asJavascript", "currentClass", ",", "asSelector", "selector", "visit:", "first", "instructions", "do:separatedBy:", "allButFirst"],
  2935. referencedClasses: []
  2936. }),
  2937. smalltalk.IRJSTranslator);
  2938. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2939. smalltalk.addMethod(
  2940. smalltalk.method({
  2941. selector: "contents",
  2942. category: 'accessing',
  2943. fn: function (){
  2944. var self=this;
  2945. return smalltalk.withContext(function($ctx1) {
  2946. var $1;
  2947. $1=_st(self["@stream"])._contents();
  2948. return $1;
  2949. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.JSStream)})},
  2950. args: [],
  2951. source: "contents\x0a\x09^ stream contents",
  2952. messageSends: ["contents"],
  2953. referencedClasses: []
  2954. }),
  2955. smalltalk.JSStream);
  2956. smalltalk.addMethod(
  2957. smalltalk.method({
  2958. selector: "initialize",
  2959. category: 'initialization',
  2960. fn: function (){
  2961. var self=this;
  2962. return smalltalk.withContext(function($ctx1) {
  2963. smalltalk.JSStream.superclass.fn.prototype._initialize.apply(_st(self), []);
  2964. self["@stream"]=""._writeStream();
  2965. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.JSStream)})},
  2966. args: [],
  2967. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.",
  2968. messageSends: ["initialize", "writeStream"],
  2969. referencedClasses: []
  2970. }),
  2971. smalltalk.JSStream);
  2972. smalltalk.addMethod(
  2973. smalltalk.method({
  2974. selector: "lf",
  2975. category: 'streaming',
  2976. fn: function (){
  2977. var self=this;
  2978. return smalltalk.withContext(function($ctx1) {
  2979. _st(self["@stream"])._lf();
  2980. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.JSStream)})},
  2981. args: [],
  2982. source: "lf\x0a\x09stream lf",
  2983. messageSends: ["lf"],
  2984. referencedClasses: []
  2985. }),
  2986. smalltalk.JSStream);
  2987. smalltalk.addMethod(
  2988. smalltalk.method({
  2989. selector: "nextPut:",
  2990. category: 'streaming',
  2991. fn: function (aString){
  2992. var self=this;
  2993. return smalltalk.withContext(function($ctx1) {
  2994. _st(self["@stream"])._nextPut_(aString);
  2995. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.JSStream)})},
  2996. args: ["aString"],
  2997. source: "nextPut: aString\x0a\x09stream nextPut: aString",
  2998. messageSends: ["nextPut:"],
  2999. referencedClasses: []
  3000. }),
  3001. smalltalk.JSStream);
  3002. smalltalk.addMethod(
  3003. smalltalk.method({
  3004. selector: "nextPutAll:",
  3005. category: 'streaming',
  3006. fn: function (aString){
  3007. var self=this;
  3008. return smalltalk.withContext(function($ctx1) {
  3009. _st(self["@stream"])._nextPutAll_(aString);
  3010. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString},smalltalk.JSStream)})},
  3011. args: ["aString"],
  3012. source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString",
  3013. messageSends: ["nextPutAll:"],
  3014. referencedClasses: []
  3015. }),
  3016. smalltalk.JSStream);
  3017. smalltalk.addMethod(
  3018. smalltalk.method({
  3019. selector: "nextPutAssignment",
  3020. category: 'streaming',
  3021. fn: function (){
  3022. var self=this;
  3023. return smalltalk.withContext(function($ctx1) {
  3024. _st(self["@stream"])._nextPutAll_("=");
  3025. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{},smalltalk.JSStream)})},
  3026. args: [],
  3027. source: "nextPutAssignment\x0a\x09stream nextPutAll: '='",
  3028. messageSends: ["nextPutAll:"],
  3029. referencedClasses: []
  3030. }),
  3031. smalltalk.JSStream);
  3032. smalltalk.addMethod(
  3033. smalltalk.method({
  3034. selector: "nextPutBlockContextFor:during:",
  3035. category: 'streaming',
  3036. fn: function (anIRClosure,aBlock){
  3037. var self=this;
  3038. return smalltalk.withContext(function($ctx1) {
  3039. var $1,$2,$3,$4,$5,$6,$7,$8;
  3040. $1=self;
  3041. _st($1)._nextPutAll_(_st("return smalltalk.withContext(function(".__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  3042. $2=_st($1)._lf();
  3043. _st(aBlock)._value();
  3044. $3=self;
  3045. _st($3)._nextPutAll_(_st("}, function(".__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  3046. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  3047. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  3048. return smalltalk.withContext(function($ctx2) {
  3049. $5=self;
  3050. _st($5)._nextPutAll_(_st(each)._asVariableName());
  3051. _st($5)._nextPutAll_(":");
  3052. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  3053. return $6;
  3054. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  3055. return smalltalk.withContext(function($ctx2) {
  3056. return self._nextPutAll_(",");
  3057. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  3058. $7=self;
  3059. _st($7)._nextPutAll_("},");
  3060. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(_st(_st(anIRClosure)._scope())._outerScope())._alias()).__comma(",")).__comma(_st(_st(_st(anIRClosure)._scope())._blockIndex())._asString())).__comma(")})"));
  3061. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock},smalltalk.JSStream)})},
  3062. args: ["anIRClosure", "aBlock"],
  3063. 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, ')})'",
  3064. messageSends: ["nextPutAll:", ",", "alias", "scope", "lf", "value", "do:separatedBy:", "locals", "asVariableName", "outerScope", "asString", "blockIndex"],
  3065. referencedClasses: []
  3066. }),
  3067. smalltalk.JSStream);
  3068. smalltalk.addMethod(
  3069. smalltalk.method({
  3070. selector: "nextPutClassRefFunction:",
  3071. category: 'streaming',
  3072. fn: function (aString){
  3073. var self=this;
  3074. return smalltalk.withContext(function($ctx1) {
  3075. var $1,$2;
  3076. $1=self["@stream"];
  3077. _st($1)._nextPutAll_("function $");
  3078. _st($1)._nextPutAll_(aString);
  3079. _st($1)._nextPutAll_("(){return smalltalk.");
  3080. _st($1)._nextPutAll_(aString);
  3081. _st($1)._nextPutAll_("||(typeof ");
  3082. _st($1)._nextPutAll_(aString);
  3083. _st($1)._nextPutAll_("==\x22undefined\x22?nil:");
  3084. _st($1)._nextPutAll_(aString);
  3085. _st($1)._nextPutAll_(")}");
  3086. $2=_st($1)._lf();
  3087. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClassRefFunction:",{aString:aString},smalltalk.JSStream)})},
  3088. args: ["aString"],
  3089. 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",
  3090. messageSends: ["nextPutAll:", "lf"],
  3091. referencedClasses: []
  3092. }),
  3093. smalltalk.JSStream);
  3094. smalltalk.addMethod(
  3095. smalltalk.method({
  3096. selector: "nextPutClosureWith:arguments:",
  3097. category: 'streaming',
  3098. fn: function (aBlock,anArray){
  3099. var self=this;
  3100. return smalltalk.withContext(function($ctx1) {
  3101. var $1,$2;
  3102. _st(self["@stream"])._nextPutAll_("(function(");
  3103. _st(anArray)._do_separatedBy_((function(each){
  3104. return smalltalk.withContext(function($ctx2) {
  3105. return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  3106. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  3107. return smalltalk.withContext(function($ctx2) {
  3108. return _st(self["@stream"])._nextPut_(",");
  3109. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  3110. $1=self["@stream"];
  3111. _st($1)._nextPutAll_("){");
  3112. $2=_st($1)._lf();
  3113. _st(aBlock)._value();
  3114. _st(self["@stream"])._nextPutAll_("})");
  3115. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  3116. args: ["aBlock", "anArray"],
  3117. 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: '})'",
  3118. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  3119. referencedClasses: []
  3120. }),
  3121. smalltalk.JSStream);
  3122. smalltalk.addMethod(
  3123. smalltalk.method({
  3124. selector: "nextPutContextFor:during:",
  3125. category: 'streaming',
  3126. fn: function (aMethod,aBlock){
  3127. var self=this;
  3128. return smalltalk.withContext(function($ctx1) {
  3129. var $1,$2,$3,$4,$5,$6,$7,$8;
  3130. $1=self;
  3131. _st($1)._nextPutAll_(_st("return smalltalk.withContext(function(".__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  3132. $2=_st($1)._lf();
  3133. _st(aBlock)._value();
  3134. $3=self;
  3135. _st($3)._nextPutAll_(_st(_st("}, function(".__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  3136. $4=_st($3)._nextPutAll_(_st(".fill(self,".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  3137. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  3138. return smalltalk.withContext(function($ctx2) {
  3139. $5=self;
  3140. _st($5)._nextPutAll_(_st(each)._asVariableName());
  3141. _st($5)._nextPutAll_(":");
  3142. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  3143. return $6;
  3144. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  3145. return smalltalk.withContext(function($ctx2) {
  3146. return self._nextPutAll_(",");
  3147. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  3148. $7=self;
  3149. _st($7)._nextPutAll_("},");
  3150. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  3151. $8=_st($7)._nextPutAll_(")})");
  3152. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  3153. args: ["aMethod", "aBlock"],
  3154. 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: ')})'",
  3155. messageSends: ["nextPutAll:", ",", "alias", "scope", "lf", "value", "asJavascript", "selector", "do:separatedBy:", "locals", "asVariableName", "theClass"],
  3156. referencedClasses: []
  3157. }),
  3158. smalltalk.JSStream);
  3159. smalltalk.addMethod(
  3160. smalltalk.method({
  3161. selector: "nextPutFunctionWith:arguments:",
  3162. category: 'streaming',
  3163. fn: function (aBlock,anArray){
  3164. var self=this;
  3165. return smalltalk.withContext(function($ctx1) {
  3166. var $1,$2,$3,$4;
  3167. _st(self["@stream"])._nextPutAll_("fn: function(");
  3168. _st(anArray)._do_separatedBy_((function(each){
  3169. return smalltalk.withContext(function($ctx2) {
  3170. return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  3171. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  3172. return smalltalk.withContext(function($ctx2) {
  3173. return _st(self["@stream"])._nextPut_(",");
  3174. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  3175. $1=self["@stream"];
  3176. _st($1)._nextPutAll_("){");
  3177. $2=_st($1)._lf();
  3178. $3=self["@stream"];
  3179. _st($3)._nextPutAll_("var self=this;");
  3180. $4=_st($3)._lf();
  3181. _st(aBlock)._value();
  3182. _st(self["@stream"])._nextPutAll_("}");
  3183. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  3184. args: ["aBlock", "anArray"],
  3185. 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: '}'",
  3186. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  3187. referencedClasses: []
  3188. }),
  3189. smalltalk.JSStream);
  3190. smalltalk.addMethod(
  3191. smalltalk.method({
  3192. selector: "nextPutIf:with:",
  3193. category: 'streaming',
  3194. fn: function (aBlock,anotherBlock){
  3195. var self=this;
  3196. return smalltalk.withContext(function($ctx1) {
  3197. var $1,$2;
  3198. _st(self["@stream"])._nextPutAll_("if(");
  3199. _st(aBlock)._value();
  3200. $1=self["@stream"];
  3201. _st($1)._nextPutAll_("){");
  3202. $2=_st($1)._lf();
  3203. _st(anotherBlock)._value();
  3204. _st(self["@stream"])._nextPutAll_("}");
  3205. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSStream)})},
  3206. args: ["aBlock", "anotherBlock"],
  3207. source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
  3208. messageSends: ["nextPutAll:", "value", "lf"],
  3209. referencedClasses: []
  3210. }),
  3211. smalltalk.JSStream);
  3212. smalltalk.addMethod(
  3213. smalltalk.method({
  3214. selector: "nextPutIfElse:with:with:",
  3215. category: 'streaming',
  3216. fn: function (aBlock,ifBlock,elseBlock){
  3217. var self=this;
  3218. return smalltalk.withContext(function($ctx1) {
  3219. var $1,$2,$3,$4;
  3220. _st(self["@stream"])._nextPutAll_("if(");
  3221. _st(aBlock)._value();
  3222. $1=self["@stream"];
  3223. _st($1)._nextPutAll_("){");
  3224. $2=_st($1)._lf();
  3225. _st(ifBlock)._value();
  3226. $3=self["@stream"];
  3227. _st($3)._nextPutAll_("} else {");
  3228. $4=_st($3)._lf();
  3229. _st(elseBlock)._value();
  3230. _st(self["@stream"])._nextPutAll_("}");
  3231. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},smalltalk.JSStream)})},
  3232. args: ["aBlock", "ifBlock", "elseBlock"],
  3233. 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: '}'",
  3234. messageSends: ["nextPutAll:", "value", "lf"],
  3235. referencedClasses: []
  3236. }),
  3237. smalltalk.JSStream);
  3238. smalltalk.addMethod(
  3239. smalltalk.method({
  3240. selector: "nextPutMethodDeclaration:with:",
  3241. category: 'streaming',
  3242. fn: function (aMethod,aBlock){
  3243. var self=this;
  3244. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  3245. return smalltalk.withContext(function($ctx1) {
  3246. var $1,$2,$3,$4,$5,$6;
  3247. $1=self["@stream"];
  3248. _st($1)._nextPutAll_("smalltalk.method({");
  3249. _st($1)._lf();
  3250. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  3251. _st($1)._lf();
  3252. _st($1)._nextPutAll_(_st("source: ".__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  3253. $2=_st($1)._lf();
  3254. _st(aBlock)._value();
  3255. $3=self["@stream"];
  3256. _st($3)._nextPutAll_(_st(",".__comma(_st($String())._lf())).__comma("messageSends: "));
  3257. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  3258. _st($3)._lf();
  3259. _st($3)._nextPutAll_(_st("args: ".__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  3260. return smalltalk.withContext(function($ctx2) {
  3261. return _st(each)._value();
  3262. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._asArray())._asJavascript())).__comma(","));
  3263. _st($3)._lf();
  3264. $4=_st($3)._nextPutAll_("referencedClasses: [");
  3265. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  3266. return smalltalk.withContext(function($ctx2) {
  3267. return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  3268. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
  3269. return smalltalk.withContext(function($ctx2) {
  3270. return _st(self["@stream"])._nextPutAll_(",");
  3271. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  3272. $5=self["@stream"];
  3273. _st($5)._nextPutAll_("]");
  3274. $6=_st($5)._nextPutAll_("})");
  3275. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  3276. args: ["aMethod", "aBlock"],
  3277. 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: '})'",
  3278. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"],
  3279. referencedClasses: ["String"]
  3280. }),
  3281. smalltalk.JSStream);
  3282. smalltalk.addMethod(
  3283. smalltalk.method({
  3284. selector: "nextPutNonLocalReturnHandlingWith:",
  3285. category: 'streaming',
  3286. fn: function (aBlock){
  3287. var self=this;
  3288. return smalltalk.withContext(function($ctx1) {
  3289. var $1,$2,$3,$4;
  3290. $1=self["@stream"];
  3291. _st($1)._nextPutAll_("var $early={};");
  3292. _st($1)._lf();
  3293. _st($1)._nextPutAll_("try {");
  3294. $2=_st($1)._lf();
  3295. _st(aBlock)._value();
  3296. $3=self["@stream"];
  3297. _st($3)._nextPutAll_("}");
  3298. _st($3)._lf();
  3299. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  3300. $4=_st($3)._lf();
  3301. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3302. args: ["aBlock"],
  3303. 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",
  3304. messageSends: ["nextPutAll:", "lf", "value"],
  3305. referencedClasses: []
  3306. }),
  3307. smalltalk.JSStream);
  3308. smalltalk.addMethod(
  3309. smalltalk.method({
  3310. selector: "nextPutNonLocalReturnWith:",
  3311. category: 'streaming',
  3312. fn: function (aBlock){
  3313. var self=this;
  3314. return smalltalk.withContext(function($ctx1) {
  3315. _st(self["@stream"])._nextPutAll_("throw $early=[");
  3316. _st(aBlock)._value();
  3317. _st(self["@stream"])._nextPutAll_("]");
  3318. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3319. args: ["aBlock"],
  3320. source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: 'throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']'",
  3321. messageSends: ["nextPutAll:", "value"],
  3322. referencedClasses: []
  3323. }),
  3324. smalltalk.JSStream);
  3325. smalltalk.addMethod(
  3326. smalltalk.method({
  3327. selector: "nextPutReturn",
  3328. category: 'streaming',
  3329. fn: function (){
  3330. var self=this;
  3331. return smalltalk.withContext(function($ctx1) {
  3332. _st(self["@stream"])._nextPutAll_("return ");
  3333. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{},smalltalk.JSStream)})},
  3334. args: [],
  3335. source: "nextPutReturn\x0a\x09stream nextPutAll: 'return '",
  3336. messageSends: ["nextPutAll:"],
  3337. referencedClasses: []
  3338. }),
  3339. smalltalk.JSStream);
  3340. smalltalk.addMethod(
  3341. smalltalk.method({
  3342. selector: "nextPutReturnWith:",
  3343. category: 'streaming',
  3344. fn: function (aBlock){
  3345. var self=this;
  3346. return smalltalk.withContext(function($ctx1) {
  3347. self._nextPutReturn();
  3348. _st(aBlock)._value();
  3349. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3350. args: ["aBlock"],
  3351. source: "nextPutReturnWith: aBlock\x0a\x09self nextPutReturn.\x0a\x09aBlock value",
  3352. messageSends: ["nextPutReturn", "value"],
  3353. referencedClasses: []
  3354. }),
  3355. smalltalk.JSStream);
  3356. smalltalk.addMethod(
  3357. smalltalk.method({
  3358. selector: "nextPutSendIndexFor:",
  3359. category: 'streaming',
  3360. fn: function (anIRSend){
  3361. var self=this;
  3362. return smalltalk.withContext(function($ctx1) {
  3363. var $1,$2;
  3364. $1=self;
  3365. _st($1)._nextPutAll_(_st(_st(anIRSend)._scope())._alias());
  3366. _st($1)._nextPutAll_(".sendIdx[\x22");
  3367. _st($1)._nextPutAll_(_st(anIRSend)._selector());
  3368. _st($1)._nextPutAll_("\x22]=");
  3369. _st($1)._nextPutAll_(_st(_st(anIRSend)._index())._asString());
  3370. $2=_st($1)._lf();
  3371. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSendIndexFor:",{anIRSend:anIRSend},smalltalk.JSStream)})},
  3372. args: ["anIRSend"],
  3373. 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",
  3374. messageSends: ["nextPutAll:", "alias", "scope", "selector", "asString", "index", "lf"],
  3375. referencedClasses: []
  3376. }),
  3377. smalltalk.JSStream);
  3378. smalltalk.addMethod(
  3379. smalltalk.method({
  3380. selector: "nextPutSequenceWith:",
  3381. category: 'streaming',
  3382. fn: function (aBlock){
  3383. var self=this;
  3384. return smalltalk.withContext(function($ctx1) {
  3385. _st(aBlock)._value();
  3386. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3387. args: ["aBlock"],
  3388. 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",
  3389. messageSends: ["value"],
  3390. referencedClasses: []
  3391. }),
  3392. smalltalk.JSStream);
  3393. smalltalk.addMethod(
  3394. smalltalk.method({
  3395. selector: "nextPutStatementWith:",
  3396. category: 'streaming',
  3397. fn: function (aBlock){
  3398. var self=this;
  3399. return smalltalk.withContext(function($ctx1) {
  3400. var $1,$2;
  3401. _st(aBlock)._value();
  3402. $1=self["@stream"];
  3403. _st($1)._nextPutAll_(";");
  3404. $2=_st($1)._lf();
  3405. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3406. args: ["aBlock"],
  3407. source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
  3408. messageSends: ["value", "nextPutAll:", "lf"],
  3409. referencedClasses: []
  3410. }),
  3411. smalltalk.JSStream);
  3412. smalltalk.addMethod(
  3413. smalltalk.method({
  3414. selector: "nextPutVars:",
  3415. category: 'streaming',
  3416. fn: function (aCollection){
  3417. var self=this;
  3418. return smalltalk.withContext(function($ctx1) {
  3419. var $1,$2,$3;
  3420. var $early={};
  3421. try {
  3422. _st(aCollection)._ifEmpty_((function(){
  3423. return smalltalk.withContext(function($ctx2) {
  3424. $1=self;
  3425. throw $early=[$1];
  3426. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  3427. _st(self["@stream"])._nextPutAll_("var ");
  3428. _st(aCollection)._do_separatedBy_((function(each){
  3429. return smalltalk.withContext(function($ctx2) {
  3430. return _st(self["@stream"])._nextPutAll_(each);
  3431. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
  3432. return smalltalk.withContext(function($ctx2) {
  3433. return _st(self["@stream"])._nextPutAll_(",");
  3434. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  3435. $2=self["@stream"];
  3436. _st($2)._nextPutAll_(";");
  3437. $3=_st($2)._lf();
  3438. return self}
  3439. catch(e) {if(e===$early)return e[0]; throw e}
  3440. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection},smalltalk.JSStream)})},
  3441. args: ["aCollection"],
  3442. 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",
  3443. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"],
  3444. referencedClasses: []
  3445. }),
  3446. smalltalk.JSStream);
  3447. smalltalk.addMethod(
  3448. smalltalk.method({
  3449. selector: "appendToInstruction:",
  3450. category: '*Compiler-IR',
  3451. fn: function (anIRInstruction){
  3452. var self=this;
  3453. return smalltalk.withContext(function($ctx1) {
  3454. _st(anIRInstruction)._appendBlock_(self);
  3455. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction},smalltalk.BlockClosure)})},
  3456. args: ["anIRInstruction"],
  3457. source: "appendToInstruction: anIRInstruction\x0a\x09anIRInstruction appendBlock: self",
  3458. messageSends: ["appendBlock:"],
  3459. referencedClasses: []
  3460. }),
  3461. smalltalk.BlockClosure);
  3462. smalltalk.addMethod(
  3463. smalltalk.method({
  3464. selector: "asVariableName",
  3465. category: '*Compiler-IR',
  3466. fn: function (){
  3467. var self=this;
  3468. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3469. return smalltalk.withContext(function($ctx1) {
  3470. var $2,$1;
  3471. $2=_st(_st(_st($Smalltalk())._current())._reservedWords())._includes_(self);
  3472. if(smalltalk.assert($2)){
  3473. $1=self.__comma("_");
  3474. } else {
  3475. $1=self;
  3476. };
  3477. return $1;
  3478. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{},smalltalk.String)})},
  3479. args: [],
  3480. source: "asVariableName\x0a\x09^ (Smalltalk current reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
  3481. messageSends: ["ifTrue:ifFalse:", "includes:", "reservedWords", "current", ","],
  3482. referencedClasses: ["Smalltalk"]
  3483. }),
  3484. smalltalk.String);
  3485. });