Compiler-IR.js 140 KB

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