Compiler-IR.js 154 KB

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