Compiler-IR.js 200 KB

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