123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858 |
- smalltalk.addPackage('Compiler', {});
- smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Compiler');
- smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler');
- smalltalk.Compiler.comment="I provide the public interface for compiling Amber source code into JavaScript.\x0a\x0aThe code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`. \x0aThe default code generator is an instance of `InlinedCodeGenerator`"
- smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler');
- smalltalk.CompilerError.comment="I am the common superclass of all compiling errors."
- smalltalk.addClass('ParseError', smalltalk.CompilerError, [], 'Compiler');
- smalltalk.ParseError.comment="Instance of ParseError are signaled on any parsing error. \x0aSee `Smalltalk >> #parse:`"
- smalltalk.addClass('SemanticError', smalltalk.CompilerError, [], 'Compiler');
- smalltalk.SemanticError.comment="I represent an abstract semantic error thrown by the SemanticAnalyzer.\x0aSemantic errors can be unknown variable errors, etc.\x0aSee my subclasses for concrete errors.\x0a\x0aThe IDE should catch instances of Semantic error to deal with them when compiling"
- smalltalk.addClass('InliningError', smalltalk.SemanticError, [], 'Compiler');
- smalltalk.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`."
- smalltalk.addClass('InvalidAssignmentError', smalltalk.SemanticError, ['variableName'], 'Compiler');
- smalltalk.InvalidAssignmentError.comment="I get signaled when a pseudo variable gets assigned."
- smalltalk.addClass('ShadowingVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler');
- smalltalk.ShadowingVariableError.comment="I get signaled when a variable in a block or method scope shadows a variable of the same name in an outer scope."
- smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler');
- smalltalk.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects."
- smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler');
- smalltalk.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`."
- smalltalk.addClass('Exporter', smalltalk.Object, [], 'Compiler');
- smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Compiler');
- smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Compiler');
- smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler');
- smalltalk.IRInstruction.comment="I am the abstract root class of the IR (intermediate representation) instructions class hierarchy.\x0aThe IR graph is used to emit JavaScript code using a JSStream."
- smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler');
- smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler');
- smalltalk.IRInlinedAssignment.comment="I represent an inlined assignment instruction."
- smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler');
- smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler');
- smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler');
- smalltalk.addClass('IRClosure', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler');
- smalltalk.addClass('IRInlinedClosure', smalltalk.IRClosure, [], 'Compiler');
- smalltalk.IRInlinedClosure.comment="I represent an inlined closure instruction."
- smalltalk.addClass('IRMethod', smalltalk.IRScopedInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'arguments', 'internalVariables'], 'Compiler');
- smalltalk.IRMethod.comment="I am a method instruction"
- smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler');
- smalltalk.IRReturn.comment="I am a local return instruction."
- smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler');
- smalltalk.IRBlockReturn.comment="Smalltalk blocks return their last statement. I am a implicit block return instruction."
- smalltalk.addClass('IRInlinedReturn', smalltalk.IRReturn, [], 'Compiler');
- smalltalk.IRInlinedReturn.comment="I represent an inlined local return instruction."
- smalltalk.addClass('IRInlinedNonLocalReturn', smalltalk.IRInlinedReturn, [], 'Compiler');
- smalltalk.IRInlinedNonLocalReturn.comment="I represent an inlined non local return instruction."
- smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler');
- smalltalk.IRNonLocalReturn.comment="I am a non local return instruction.\x0aNon local returns are handled using a try/catch JS statement.\x0a\x0aSee IRNonLocalReturnHandling class"
- smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler');
- smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler');
- smalltalk.IRSend.comment="I am a message send instruction."
- smalltalk.addClass('IRInlinedSend', smalltalk.IRSend, [], 'Compiler');
- smalltalk.IRInlinedSend.comment="I am the abstract super class of inlined message send instructions."
- smalltalk.addClass('IRInlinedIfFalse', smalltalk.IRInlinedSend, [], 'Compiler');
- smalltalk.addClass('IRInlinedIfNilIfNotNil', smalltalk.IRInlinedSend, [], 'Compiler');
- smalltalk.addClass('IRInlinedIfTrue', smalltalk.IRInlinedSend, [], 'Compiler');
- smalltalk.addClass('IRInlinedIfTrueIfFalse', smalltalk.IRInlinedSend, [], 'Compiler');
- smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler');
- smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler');
- smalltalk.addClass('IRInlinedSequence', smalltalk.IRBlockSequence, [], 'Compiler');
- smalltalk.IRInlinedSequence.comment="I represent a (block) sequence inside an inlined closure instruction (instance of `IRInlinedClosure`)."
- smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler');
- smalltalk.IRValue.comment="I am the simplest possible instruction. I represent a value."
- smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler');
- smalltalk.IRVariable.comment="I am a variable instruction."
- smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler');
- smalltalk.addClass('IRSendInliner', smalltalk.Object, ['send', 'translator'], 'Compiler');
- smalltalk.IRSendInliner.comment="I inline some message sends and block closure arguments. I heavily rely on #perform: to dispatch inlining methods."
- smalltalk.addClass('IRAssignmentInliner', smalltalk.IRSendInliner, ['assignment'], 'Compiler');
- smalltalk.IRAssignmentInliner.comment="I inline message sends together with assignments by moving them around into the inline closure instructions. \x0a\x0a##Example\x0a\x0a\x09foo\x0a\x09\x09| a |\x0a\x09\x09a := true ifTrue: [ 1 ]\x0a\x0aWill produce:\x0a\x0a\x09if(smalltalk.assert(true) {\x0a\x09\x09a = 1;\x0a\x09};"
- smalltalk.addClass('IRNonLocalReturnInliner', smalltalk.IRSendInliner, [], 'Compiler');
- smalltalk.addClass('IRReturnInliner', smalltalk.IRSendInliner, [], 'Compiler');
- smalltalk.IRReturnInliner.comment="I inline message sends with inlined closure together with a return instruction."
- smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler');
- smalltalk.addClass('IRInliner', smalltalk.IRVisitor, [], 'Compiler');
- smalltalk.IRInliner.comment="I visit an IR tree, inlining message sends and block closures.\x0a\x0aMessage selectors that can be inlined are answered by `IRSendInliner >> #inlinedSelectors`"
- smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler');
- smalltalk.addClass('IRInliningJSTranslator', smalltalk.IRJSTranslator, [], 'Compiler');
- smalltalk.IRInliningJSTranslator.comment="I am a specialized JavaScript translator able to write inlined IR instructions to JavaScript stream (`JSStream` instance)."
- smalltalk.addClass('Importer', smalltalk.Object, [], 'Compiler');
- smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler');
- smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler');
- smalltalk.LexicalScope.comment="I represent a lexical scope where variable names are associated with ScopeVars\x0aInstances are used for block scopes. Method scopes are instances of MethodLexicalScope.\x0a\x0aI am attached to a ScopeVar and method/block nodes.\x0aEach context (method/closure) get a fresh scope that inherits from its outer scope."
- smalltalk.addClass('MethodLexicalScope', smalltalk.LexicalScope, ['iVars', 'pseudoVars', 'unknownVariables', 'localReturn', 'nonLocalReturns'], 'Compiler');
- smalltalk.MethodLexicalScope.comment="I represent a method scope."
- smalltalk.addClass('Node', smalltalk.Object, ['position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler');
- smalltalk.Node.comment="I am the abstract root class of the abstract syntax tree.\x0a\x0aposition: holds a point containing lline- and column number of the symbol location in the original source file"
- smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler');
- smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters', 'scope'], 'Compiler');
- smalltalk.addMethod(
- "_inlined",
- smalltalk.method({
- selector: "inlined",
- category: 'accessing',
- fn: function () {
- var self=this;
- return (($receiver = self['@inlined']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
- return self;},
- args: [],
- source: "inlined\x0a\x09^inlined ifNil: [false]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- "_inlined_",
- smalltalk.method({
- selector: "inlined:",
- category: 'accessing',
- fn: function (aBoolean) {
- var self=this;
- (self['@inlined']=aBoolean);
- return self;},
- args: ["aBoolean"],
- source: "inlined: aBoolean\x0a\x09inlined := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.BlockNode);
- smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler');
- smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler');
- smalltalk.addClass('DynamicDictionaryNode', smalltalk.Node, [], 'Compiler');
- smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler');
- smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source', 'scope', 'classReferences', 'messageSends', 'superSends'], 'Compiler');
- smalltalk.addClass('ReturnNode', smalltalk.Node, ['scope'], 'Compiler');
- smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver', 'superSend', 'index'], 'Compiler');
- smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps', 'scope'], 'Compiler');
- smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler');
- smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler');
- smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned', 'binding'], 'Compiler');
- smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler');
- smalltalk.addClass('VerbatimNode', smalltalk.Node, ['value'], 'Compiler');
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: 'visiting',
- fn: function (aVisitor) {
- var self=this;
- smalltalk.send(aVisitor, "_visitVerbatimNode_", [self]);
- return self;},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitVerbatimNode: self",
- messageSends: ["visitVerbatimNode:"],
- referencedClasses: []
- }),
- smalltalk.VerbatimNode);
- smalltalk.addMethod(
- "_value",
- smalltalk.method({
- selector: "value",
- category: 'accessing',
- fn: function () {
- var self=this;
- return self['@value'];
- return self;},
- args: [],
- source: "value\x0a\x09^value",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.VerbatimNode);
- smalltalk.addMethod(
- "_value_",
- smalltalk.method({
- selector: "value:",
- category: 'accessing',
- fn: function (anObject) {
- var self=this;
- (self['@value']=anObject);
- return self;},
- args: ["anObject"],
- source: "value: anObject\x0a\x09value := anObject",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.VerbatimNode);
- smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler');
- smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors."
- smalltalk.addMethod(
- "_visitVerbatimNode_",
- smalltalk.method({
- selector: "visitVerbatimNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self, "_visitNode_", [aNode]);
- return self;},
- args: ["aNode"],
- source: "visitVerbatimNode: aNode\x0a\x09self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['outerContext', 'pc', 'locals', 'receiver', 'selector'], 'Compiler');
- smalltalk.addClass('ASTInterpreter', smalltalk.NodeVisitor, ['currentNode', 'context', 'shouldReturn'], 'Compiler');
- smalltalk.addClass('AbstractCodeGenerator', smalltalk.NodeVisitor, ['currentClass', 'source'], 'Compiler');
- smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API."
- smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler');
- smalltalk.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation."
- smalltalk.addClass('InliningCodeGenerator', smalltalk.CodeGenerator, [], 'Compiler');
- smalltalk.InliningCodeGenerator.comment="I am a specialized code generator that uses inlining to produce more optimized JavaScript output"
- smalltalk.addClass('FunCodeGenerator', smalltalk.AbstractCodeGenerator, ['stream', 'nestedBlocks', 'earlyReturn', 'currentSelector', 'unknownVariables', 'tempVariables', 'messageSends', 'referencedClasses', 'classReferenced', 'argVariables'], 'Compiler');
- smalltalk.addMethod(
- "_argVariables",
- smalltalk.method({
- selector: "argVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return smalltalk.send(self['@argVariables'], "_copy", []);
- return self;},
- args: [],
- source: "argVariables\x0a\x09^argVariables copy",
- messageSends: ["copy"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_checkClass_for_",
- smalltalk.method({
- selector: "checkClass:for:",
- category: 'optimizations',
- fn: function (aClassName, receiver) {
- var self=this;
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((($receiver = ", "__comma", [receiver]), "__comma", [").klass === smalltalk."]), "__comma", [aClassName]), "__comma", [") ? "])]);
- return self;},
- args: ["aClassName", "receiver"],
- source: "checkClass: aClassName for: receiver\x0a stream nextPutAll: '((($receiver = ', receiver, ').klass === smalltalk.', aClassName, ') ? '",
- messageSends: ["nextPutAll:", ","],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_compileNode_",
- smalltalk.method({
- selector: "compileNode:",
- category: 'compiling',
- fn: function (aNode) {
- var self=this;
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- smalltalk.send(self, "_visit_", [aNode]);
- return smalltalk.send(self['@stream'], "_contents", []);
- return self;},
- args: ["aNode"],
- source: "compileNode: aNode\x0a\x09stream := '' writeStream.\x0a\x09self visit: aNode.\x0a\x09^stream contents",
- messageSends: ["writeStream", "visit:", "contents"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- category: 'initialization',
- fn: function () {
- var self=this;
- smalltalk.send(self, "_initialize", [], smalltalk.FunCodeGenerator.superclass || nil);
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- (self['@unknownVariables']=[]);
- (self['@tempVariables']=[]);
- (self['@argVariables']=[]);
- (self['@messageSends']=[]);
- (self['@classReferenced']=[]);
- return self;},
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream. \x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09messageSends := #().\x0a\x09classReferenced := #()",
- messageSends: ["initialize", "writeStream"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_inline_receiver_argumentNodes_",
- smalltalk.method({
- selector: "inline:receiver:argumentNodes:",
- category: 'optimizations',
- fn: function (aSelector, receiver, aCollection) {
- var self=this;
- var inlined=nil;
- (inlined=false);
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil)"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["($receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Boolean", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["(! $receiver ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["())"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver <="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver >="]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver +"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver +"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver -"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver -"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver *"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver *"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver /"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self['@stream'], "_nextPutAll_", ["$receiver /"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));
- return inlined;
- return self;},
- args: ["aSelector", "receiver", "aCollection"],
- source: "inline: aSelector receiver: receiver argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a\x0a\x09\x22-- Booleans --\x22\x0a\x0a\x09(aSelector = 'ifFalse:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : nil)'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifTrue:ifFalse:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '($receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifFalse:ifTrue:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09self checkClass: 'Boolean' for: receiver.\x0a \x09stream nextPutAll: '(! $receiver ? '.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '() : '.\x0a \x09\x09self visit: aCollection second.\x0a \x09\x09stream nextPutAll: '())'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver <='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>') ifTrue: [ \x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver >='.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '+') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver +'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '-') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver -'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '*') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver *'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a (aSelector = '/') ifTrue: [\x0a self checkClass: 'Number' for: receiver.\x0a stream nextPutAll: '$receiver /'.\x0a self visit: aCollection first.\x0a inlined := true].\x0a\x0a ^inlined",
- messageSends: ["ifTrue:", "=", "isBlockNode", "first", "checkClass:for:", "nextPutAll:", "visit:", "and:", "second"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_inlineLiteral_receiverNode_argumentNodes_",
- smalltalk.method({
- selector: "inlineLiteral:receiverNode:argumentNodes:",
- category: 'optimizations',
- fn: function (aSelector, anObject, aCollection) {
- var self=this;
- var inlined=nil;
- (inlined=false);
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {"]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()}})()"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while("]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){while(!"]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()) {}})()"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" + "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" - "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" * "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" / "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" < "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" <= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" > "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [anObject, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [" >= "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : $receiver"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") != nil && $receiver != undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : nil"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["(($receiver = "]);smalltalk.send(self, "_visit_", [anObject]);smalltalk.send(self['@stream'], "_nextPutAll_", [") == nil || $receiver == undefined) ? "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_second", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["() : "]);smalltalk.send(self, "_visit_", [smalltalk.send(aCollection, "_first", [])]);smalltalk.send(self['@stream'], "_nextPutAll_", ["()"]);return (inlined=true);})]));})]));
- return inlined;
- return self;},
- args: ["aSelector", "anObject", "aCollection"],
- source: "inlineLiteral: aSelector receiverNode: anObject argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a \x0a\x09\x22-- BlockClosures --\x22\x0a\x0a\x09(aSelector = 'whileTrue:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {'.\x0a \x09self visit: aCollection first.\x0a \x09\x09stream nextPutAll: '()}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileTrue') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while('.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a \x09stream nextPutAll: '(function(){while(!'.\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: '()) {}})()'.\x0a \x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '+') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' + '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '-') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' - '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '*') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' * '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '/') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' / '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' < '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '<=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' <= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' > '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = '>=') ifTrue: [\x0a \x09(self isNode: anObject ofClass: Number) ifTrue: [\x0a \x09self visit: anObject.\x0a \x09stream nextPutAll: ' >= '.\x0a \x09self visit: aCollection first.\x0a \x09inlined := true]].\x0a \x09 \x0a\x09\x22-- UndefinedObject --\x22\x0a\x0a\x09(aSelector = 'ifNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : $receiver'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') != nil && $receiver != undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : nil'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNil:ifNotNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:ifNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a \x09\x09stream nextPutAll: '(($receiver = '.\x0a \x09\x09self visit: anObject.\x0a \x09\x09stream nextPutAll: ') == nil || $receiver == undefined) ? '.\x0a \x09self visit: aCollection second.\x0a \x09stream nextPutAll: '() : '.\x0a \x09self visit: aCollection first.\x0a \x09stream nextPutAll: '()'.\x0a \x09inlined := true]].\x0a \x0a ^inlined",
- messageSends: ["ifTrue:", "=", "and:", "isBlockNode", "first", "nextPutAll:", "visit:", "isNode:ofClass:", "second"],
- referencedClasses: ["Number"]
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_isNode_ofClass_",
- smalltalk.method({
- selector: "isNode:ofClass:",
- category: 'optimizations',
- fn: function (aNode, aClass) {
- var self=this;
- return smalltalk.send(smalltalk.send(aNode, "_isValueNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "_class", []), "__eq", [aClass]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["self"]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_currentClass", []), "__eq", [aClass]);})]);})]);})]);
- return self;},
- args: ["aNode", "aClass"],
- source: "isNode: aNode ofClass: aClass\x0a\x09^aNode isValueNode and: [\x0a \x09aNode value class = aClass or: [\x0a \x09\x09aNode value = 'self' and: [self currentClass = aClass]]]",
- messageSends: ["and:", "isValueNode", "or:", "=", "class", "value", "currentClass"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_knownVariables",
- smalltalk.method({
- selector: "knownVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_tempVariables", [])]);smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_argVariables", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_pseudoVariables", []));
- return self;},
- args: [],
- source: "knownVariables\x0a\x09^self pseudoVariables \x0a\x09\x09addAll: self tempVariables;\x0a\x09\x09addAll: self argVariables;\x0a\x09\x09yourself",
- messageSends: ["addAll:", "tempVariables", "argVariables", "yourself", "pseudoVariables"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_performOptimizations",
- smalltalk.method({
- selector: "performOptimizations",
- category: 'testing',
- fn: function () {
- var self=this;
- return smalltalk.send(smalltalk.send(self, "_class", []), "_performOptimizations", []);
- return self;},
- args: [],
- source: "performOptimizations\x0a\x09^self class performOptimizations",
- messageSends: ["performOptimizations", "class"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_send_to_arguments_superSend_",
- smalltalk.method({
- selector: "send:to:arguments:superSend:",
- category: 'visiting',
- fn: function (aSelector, aReceiver, aCollection, aBoolean) {
- var self=this;
- return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){var tmp=nil;
- (tmp=self['@stream']);smalltalk.send(str, "_nextPutAll_", ["smalltalk.send("]);smalltalk.send(str, "_nextPutAll_", [aReceiver]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", \x22", "__comma", [smalltalk.send(aSelector, "_asSelector", [])]), "__comma", ["\x22, ["])]);(self['@stream']=str);smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);(self['@stream']=tmp);smalltalk.send(str, "_nextPutAll_", ["]"]);((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(self, "_currentClass", [])])]), "__comma", [".superclass || nil"])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(self, "_currentClass", [])])]), "__comma", [".superclass || nil"])]);})]));return smalltalk.send(str, "_nextPutAll_", [")"]);})]);
- return self;},
- args: ["aSelector", "aReceiver", "aCollection", "aBoolean"],
- source: "send: aSelector to: aReceiver arguments: aCollection superSend: aBoolean\x0a\x09^String streamContents: [:str || tmp |\x0a \x09tmp := stream.\x0a\x09\x09str nextPutAll: 'smalltalk.send('.\x0a\x09\x09str nextPutAll: aReceiver.\x0a\x09\x09str nextPutAll: ', \x22', aSelector asSelector, '\x22, ['.\x0a stream := str.\x0a\x09\x09aCollection\x0a\x09 \x09\x09do: [:each | self visit: each]\x0a\x09 \x09\x09separatedBy: [stream nextPutAll: ', '].\x0a stream := tmp.\x0a str nextPutAll: ']'.\x0a\x09\x09aBoolean ifTrue: [\x0a\x09\x09\x09str nextPutAll: ', smalltalk.', (self classNameFor: self currentClass), '.superclass || nil'].\x0a\x09\x09str nextPutAll: ')']",
- messageSends: ["streamContents:", "nextPutAll:", ",", "asSelector", "do:separatedBy:", "visit:", "ifTrue:", "classNameFor:", "currentClass"],
- referencedClasses: ["String"]
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_tempVariables",
- smalltalk.method({
- selector: "tempVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return smalltalk.send(self['@tempVariables'], "_copy", []);
- return self;},
- args: [],
- source: "tempVariables\x0a\x09^tempVariables copy",
- messageSends: ["copy"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_unknownVariables",
- smalltalk.method({
- selector: "unknownVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return smalltalk.send(self['@unknownVariables'], "_copy", []);
- return self;},
- args: [],
- source: "unknownVariables\x0a\x09^unknownVariables copy",
- messageSends: ["copy"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visit_",
- smalltalk.method({
- selector: "visit:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(aNode, "_accept_", [self]);
- return self;},
- args: ["aNode"],
- source: "visit: aNode\x0a\x09aNode accept: self",
- messageSends: ["accept:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitAssignmentNode_",
- smalltalk.method({
- selector: "visitAssignmentNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self['@stream'], "_nextPutAll_", ["("]);
- smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["="]);
- smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);
- smalltalk.send(self['@stream'], "_nextPutAll_", [")"]);
- return self;},
- args: ["aNode"],
- source: "visitAssignmentNode: aNode\x0a\x09stream nextPutAll: '('.\x0a\x09self visit: aNode left.\x0a\x09stream nextPutAll: '='.\x0a\x09self visit: aNode right.\x0a\x09stream nextPutAll: ')'",
- messageSends: ["nextPutAll:", "visit:", "left", "right"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitBlockNode_",
- smalltalk.method({
- selector: "visitBlockNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
- smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["){"]);
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
- return self;},
- args: ["aNode"],
- source: "visitBlockNode: aNode\x0a\x09stream nextPutAll: '(function('.\x0a\x09aNode parameters \x0a\x09 do: [:each |\x0a\x09\x09tempVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream nextPutAll: '){'.\x0a\x09aNode nodes do: [:each | self visit: each].\x0a\x09stream nextPutAll: '})'",
- messageSends: ["nextPutAll:", "do:separatedBy:", "parameters", "add:", "do:", "nodes", "visit:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitBlockSequenceNode_",
- smalltalk.method({
- selector: "visitBlockSequenceNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- var index=nil;
- (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
- ((($receiver = smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return nil;"]);})() : (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
- (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", ["=nil;"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return nil;"]);}), (function(){smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
- (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", ["=nil;"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);(index=(0));return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);})]));
- (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])));
- return self;},
- args: ["aNode"],
- source: "visitBlockSequenceNode: aNode\x0a\x09| index |\x0a\x09nestedBlocks := nestedBlocks + 1.\x0a\x09aNode nodes isEmpty\x0a\x09 ifTrue: [\x0a\x09\x09stream nextPutAll: 'return nil;']\x0a\x09 ifFalse: [\x0a\x09\x09aNode temps do: [:each | | temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09\x09 tempVariables add: temp.\x0a\x09\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09\x09index := 0.\x0a\x09\x09aNode nodes do: [:each |\x0a\x09\x09 index := index + 1.\x0a\x09\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09\x09stream nextPutAll: 'return '].\x0a\x09\x09 self visit: each.\x0a\x09\x09 stream nextPutAll: ';']].\x0a\x09nestedBlocks := nestedBlocks - 1",
- messageSends: ["+", "ifTrue:ifFalse:", "isEmpty", "nodes", "nextPutAll:", "do:", "temps", "safeVariableNameFor:", "add:", ",", "lf", "ifTrue:", "=", "size", "visit:", "-"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitCascadeNode_",
- smalltalk.method({
- selector: "visitCascadeNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- var index=nil;
- (index=(0));
- ((($receiver = smalltalk.send(self['@tempVariables'], "_includes_", ["$rec"])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@tempVariables'], "_add_", ["$rec"]);})]));
- smalltalk.send(self['@stream'], "_nextPutAll_", ["(function($rec){"]);
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VariableNode || VariableNode), "_new", []), "_value_", ["$rec"])]);smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["})("]);
- smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
- smalltalk.send(self['@stream'], "_nextPutAll_", [")"]);
- return self;},
- args: ["aNode"],
- source: "visitCascadeNode: aNode\x0a\x09| index |\x0a\x09index := 0.\x0a\x09(tempVariables includes: '$rec') ifFalse: [\x0a\x09\x09tempVariables add: '$rec'].\x0a\x09stream nextPutAll: '(function($rec){'.\x0a\x09aNode nodes do: [:each |\x0a\x09 index := index + 1.\x0a\x09 index = aNode nodes size ifTrue: [\x0a\x09\x09stream nextPutAll: 'return '].\x0a\x09 each receiver: (VariableNode new value: '$rec').\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';'].\x0a\x09stream nextPutAll: '})('.\x0a\x09self visit: aNode receiver.\x0a\x09stream nextPutAll: ')'",
- messageSends: ["ifFalse:", "includes:", "add:", "nextPutAll:", "do:", "nodes", "+", "ifTrue:", "=", "size", "receiver:", "value:", "new", "visit:", "receiver"],
- referencedClasses: ["VariableNode"]
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitClassReferenceNode_",
- smalltalk.method({
- selector: "visitClassReferenceNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- ((($receiver = smalltalk.send(self['@referencedClasses'], "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})]));
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(smalltalk.", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [" || "]), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [")"])]);
- return self;},
- args: ["aNode"],
- source: "visitClassReferenceNode: aNode\x0a\x09(referencedClasses includes: aNode value) ifFalse: [\x0a\x09\x09referencedClasses add: aNode value].\x0a\x09stream nextPutAll: '(smalltalk.', aNode value, ' || ', aNode value, ')'",
- messageSends: ["ifFalse:", "includes:", "value", "add:", "nextPutAll:", ","],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitDynamicArrayNode_",
- smalltalk.method({
- selector: "visitDynamicArrayNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self['@stream'], "_nextPutAll_", ["["]);
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
- return self;},
- args: ["aNode"],
- source: "visitDynamicArrayNode: aNode\x0a\x09stream nextPutAll: '['.\x0a\x09aNode nodes \x0a\x09\x09do: [:each | self visit: each]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'",
- messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitDynamicDictionaryNode_",
- smalltalk.method({
- selector: "visitDynamicDictionaryNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.HashedCollection._fromPairs_(["]);
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self, "_visit_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]);
- return self;},
- args: ["aNode"],
- source: "visitDynamicDictionaryNode: aNode\x0a\x09stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09aNode nodes \x0a\x09\x09\x09do: [:each | self visit: each]\x0a\x09\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09\x09stream nextPutAll: '])'",
- messageSends: ["nextPutAll:", "do:separatedBy:", "nodes", "visit:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitFailure_",
- smalltalk.method({
- selector: "visitFailure:",
- category: 'visiting',
- fn: function (aFailure) {
- var self=this;
- smalltalk.send(self, "_error_", [smalltalk.send(aFailure, "_asString", [])]);
- return self;},
- args: ["aFailure"],
- source: "visitFailure: aFailure\x0a\x09self error: aFailure asString",
- messageSends: ["error:", "asString"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitJSStatementNode_",
- smalltalk.method({
- selector: "visitJSStatementNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(aNode, "_source", [])]);
- return self;},
- args: ["aNode"],
- source: "visitJSStatementNode: aNode\x0a\x09stream nextPutAll: aNode source",
- messageSends: ["nextPutAll:", "source"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitMethodNode_",
- smalltalk.method({
- selector: "visitMethodNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- var str=nil;
- var currentSelector=nil;
- (self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []));
- (self['@nestedBlocks']=(0));
- (self['@earlyReturn']=false);
- (self['@messageSends']=[]);
- (self['@referencedClasses']=[]);
- (self['@unknownVariables']=[]);
- (self['@tempVariables']=[]);
- (self['@argVariables']=[]);
- (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aNode, "_selector", [])]), "__comma", ["\x22,"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
- (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(self, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
- smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@argVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
- (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
- (str=self['@stream']);
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
- ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["try{"]);})(str);})]));
- smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
- (self['@stream']=str);
- (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["return self;"]);})(self['@stream']);
- ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["} catch(e) {if(e===$early)return e[0]; throw e}"]);})(self['@stream']);})]));
- smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
- (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@messageSends'], "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(self['@argVariables'], "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
- smalltalk.send(self['@referencedClasses'], "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
- return self;},
- args: ["aNode"],
- source: "visitMethodNode: aNode\x0a\x09| str currentSelector | \x0a\x09currentSelector := aNode selector asSelector.\x0a\x09nestedBlocks := 0.\x0a\x09earlyReturn := false.\x0a\x09messageSends := #().\x0a\x09referencedClasses := #().\x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09stream \x0a\x09 nextPutAll: 'smalltalk.method({'; lf;\x0a\x09 nextPutAll: 'selector: \x22', aNode selector, '\x22,'; lf.\x0a\x09stream nextPutAll: 'source: ', self source asJavascript, ',';lf.\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09aNode arguments \x0a\x09 do: [:each | \x0a\x09\x09argVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream \x0a\x09 nextPutAll: '){'; lf;\x0a\x09 nextPutAll: 'var self=this;'; lf.\x0a\x09str := stream.\x0a\x09stream := '' writeStream.\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09earlyReturn ifTrue: [\x0a\x09 str nextPutAll: 'var $early={};'; lf; nextPutAll: 'try{'].\x0a\x09str nextPutAll: stream contents.\x0a\x09stream := str.\x0a\x09stream \x0a\x09 lf; \x0a\x09 nextPutAll: 'return self;'.\x0a\x09earlyReturn ifTrue: [\x0a\x09 stream lf; nextPutAll: '} catch(e) {if(e===$early)return e[0]; throw e}'].\x0a\x09stream nextPutAll: '}'.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: messageSends asJavascript, ','; lf;\x0a \x09nextPutAll: 'args: ', argVariables asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09referencedClasses \x0a\x09\x09do: [:each | stream nextPutAll: each printString]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'.\x0a\x09stream nextPutAll: '})'",
- messageSends: ["asSelector", "selector", "nextPutAll:", "lf", ",", "asJavascript", "source", "do:separatedBy:", "arguments", "add:", "writeStream", "do:", "nodes", "visit:", "ifTrue:", "contents", "printString"],
- referencedClasses: ["String"]
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitReturnNode_",
- smalltalk.method({
- selector: "visitReturnNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@earlyReturn']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@earlyReturn']=true);})]));
- ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);})]));
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
- ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);})]));
- return self;},
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 earlyReturn := true].\x0a\x09nestedBlocks > 0\x0a\x09 ifTrue: [\x0a\x09\x09stream\x0a\x09\x09 nextPutAll: '(function(){throw $early=[']\x0a\x09 ifFalse: [stream nextPutAll: 'return '].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each].\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 stream nextPutAll: ']})()']",
- messageSends: ["ifTrue:", ">", "ifTrue:ifFalse:", "nextPutAll:", "do:", "nodes", "visit:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitSendNode_",
- smalltalk.method({
- selector: "visitSendNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- var str=nil;
- var receiver=nil;
- var superSend=nil;
- var inlined=nil;
- (str=self['@stream']);
- ((($receiver = smalltalk.send(self['@messageSends'], "_includes_", [smalltalk.send(aNode, "_selector", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})]));
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);
- (superSend=smalltalk.send(smalltalk.send(self['@stream'], "_contents", []), "__eq", ["super"]));
- (receiver=((($receiver = superSend).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "self";})() : (function(){return smalltalk.send(self['@stream'], "_contents", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "self";}), (function(){return smalltalk.send(self['@stream'], "_contents", []);})])));
- (self['@stream']=str);
- ((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return ((($receiver = smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(" : ", "__comma", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), "$receiver", smalltalk.send(aNode, "_arguments", []), superSend])]), "__comma", [")"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));})]));}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), receiver, smalltalk.send(aNode, "_arguments", []), superSend])]);})]));
- return self;},
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a | str receiver superSend inlined |\x0a str := stream.\x0a (messageSends includes: aNode selector) ifFalse: [\x0a messageSends add: aNode selector].\x0a stream := '' writeStream.\x0a self visit: aNode receiver.\x0a superSend := stream contents = 'super'.\x0a receiver := superSend ifTrue: ['self'] ifFalse: [stream contents].\x0a stream := str.\x0a\x09\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09(self inlineLiteral: aNode selector receiverNode: aNode receiver argumentNodes: aNode arguments) ifFalse: [\x0a\x09\x09\x09\x09(self inline: aNode selector receiver: receiver argumentNodes: aNode arguments)\x0a \x09\x09\x09ifTrue: [stream nextPutAll: ' : ', (self send: aNode selector to: '$receiver' arguments: aNode arguments superSend: superSend), ')']\x0a \x09\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]]]\x0a\x09\x09ifFalse: [stream nextPutAll: (self send: aNode selector to: receiver arguments: aNode arguments superSend: superSend)]",
- messageSends: ["ifFalse:", "includes:", "selector", "add:", "writeStream", "visit:", "receiver", "=", "contents", "ifTrue:ifFalse:", "performOptimizations", "inlineLiteral:receiverNode:argumentNodes:", "arguments", "inline:receiver:argumentNodes:", "nextPutAll:", ",", "send:to:arguments:superSend:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitSequenceNode_",
- smalltalk.method({
- selector: "visitSequenceNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [(function(each){var temp=nil;
- (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [temp]), "__comma", ["=nil;"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);})]);
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_separatedBy_", [(function(each){smalltalk.send(self, "_visit_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [";"]);}), (function(){return smalltalk.send(self['@stream'], "_lf", []);})]);
- return self;},
- args: ["aNode"],
- source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [:each || temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09 tempVariables add: temp.\x0a\x09 stream nextPutAll: 'var ', temp, '=nil;'; lf].\x0a\x09aNode nodes do: [:each |\x0a\x09 self visit: each.\x0a\x09 stream nextPutAll: ';']\x0a\x09 separatedBy: [stream lf]",
- messageSends: ["do:", "temps", "safeVariableNameFor:", "add:", "nextPutAll:", ",", "lf", "do:separatedBy:", "nodes", "visit:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitValueNode_",
- smalltalk.method({
- selector: "visitValueNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
- return self;},
- args: ["aNode"],
- source: "visitValueNode: aNode\x0a\x09stream nextPutAll: aNode value asJavascript",
- messageSends: ["nextPutAll:", "asJavascript", "value"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.addMethod(
- "_visitVariableNode_",
- smalltalk.method({
- selector: "visitVariableNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- var varName=nil;
- ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_currentClass", []), "_allInstanceVariableNames", []), "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);})() : (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);}), (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);})() : (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["(smalltalk.getThisContext())"]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [varName]);})]));})]));})]));
- return self;},
- args: ["aNode"],
- source: "visitVariableNode: aNode\x0a\x09| varName |\x0a\x09(self currentClass allInstanceVariableNames includes: aNode value) \x0a\x09\x09ifTrue: [stream nextPutAll: 'self[''@', aNode value, ''']']\x0a\x09\x09ifFalse: [\x0a \x09varName := self safeVariableNameFor: aNode value.\x0a\x09\x09\x09(self knownVariables includes: varName) \x0a \x09\x09ifFalse: [\x0a \x09unknownVariables add: aNode value.\x0a \x09aNode assigned \x0a \x09\x09ifTrue: [stream nextPutAll: varName]\x0a \x09\x09ifFalse: [stream nextPutAll: '(typeof ', varName, ' == ''undefined'' ? nil : ', varName, ')']]\x0a \x09\x09ifTrue: [\x0a \x09aNode value = 'thisContext'\x0a \x09\x09ifTrue: [stream nextPutAll: '(smalltalk.getThisContext())']\x0a \x09\x09\x09\x09ifFalse: [stream nextPutAll: varName]]]",
- messageSends: ["ifTrue:ifFalse:", "includes:", "allInstanceVariableNames", "currentClass", "value", "nextPutAll:", ",", "safeVariableNameFor:", "ifFalse:ifTrue:", "knownVariables", "add:", "assigned", "="],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator);
- smalltalk.FunCodeGenerator.klass.iVarNames = ['performOptimizations'];
- smalltalk.addMethod(
- "_performOptimizations",
- smalltalk.method({
- selector: "performOptimizations",
- category: 'accessing',
- fn: function () {
- var self=this;
- return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
- return self;},
- args: [],
- source: "performOptimizations\x0a\x09^performOptimizations ifNil: [true]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator.klass);
- smalltalk.addMethod(
- "_performOptimizations_",
- smalltalk.method({
- selector: "performOptimizations:",
- category: 'accessing',
- fn: function (aBoolean) {
- var self=this;
- (self['@performOptimizations']=aBoolean);
- return self;},
- args: ["aBoolean"],
- source: "performOptimizations: aBoolean\x0a\x09performOptimizations := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.FunCodeGenerator.klass);
- smalltalk.addClass('ImpCodeGenerator', smalltalk.AbstractCodeGenerator, ['stream', 'nestedBlocks', 'earlyReturn', 'currentSelector', 'unknownVariables', 'tempVariables', 'messageSends', 'referencedClasses', 'classReferenced', 'argVariables', 'mutables', 'target', 'lazyVars', 'realVarNames'], 'Compiler');
- smalltalk.addMethod(
- "_aboutToModifyState",
- smalltalk.method({
- selector: "aboutToModifyState",
- category: 'compilation DSL',
- fn: function (){
- var self=this;
- var list=nil;
- var old=nil;
- (list=self['@mutables']);
- (self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
- (old=smalltalk.send(self, "_switchTarget_", [nil]));
- smalltalk.send(list, "_do_", [(function(each){var value=nil;
- smalltalk.send(self, "_switchTarget_", [each]);return smalltalk.send(self, "_realAssign_", [smalltalk.send(self['@lazyVars'], "_at_", [each])]);})]);
- smalltalk.send(self, "_switchTarget_", [old]);
- return self;},
- args: [],
- source: "aboutToModifyState\x0a| list old |\x0a\x09list := mutables.\x0a\x09mutables := Set new.\x0a\x09old := self switchTarget: nil.\x0a\x09list do: [ :each | | value |\x0a\x09\x09self switchTarget: each.\x0a\x09\x09self realAssign: (lazyVars at: each)\x0a\x09].\x0a\x09self switchTarget: old",
- messageSends: ["new", "switchTarget:", "do:", "realAssign:", "at:"],
- referencedClasses: ["Set"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_argVariables",
- smalltalk.method({
- selector: "argVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return smalltalk.send(self['@argVariables'], "_copy", []);
- return self;},
- args: [],
- source: "argVariables\x0a\x09^argVariables copy",
- messageSends: ["copy"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_assert_",
- smalltalk.method({
- selector: "assert:",
- category: 'testing',
- fn: function (aBoolean) {
- var self=this;
- ((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", ["assertion failed"]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", ["assertion failed"]);})]));
- return self;},
- args: ["aBoolean"],
- source: "assert: aBoolean\x0a\x09aBoolean ifFalse: [ self error: 'assertion failed' ]",
- messageSends: ["ifFalse:", "error:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_checkClass_for_",
- smalltalk.method({
- selector: "checkClass:for:",
- category: 'optimizations',
- fn: function (aClassName, receiver) {
- var self=this;
- smalltalk.send(self, "_prvCheckClass_for_", [aClassName, receiver]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["{"]);
- return self;},
- args: ["aClassName", "receiver"],
- source: "checkClass: aClassName for: receiver\x0a\x09self prvCheckClass: aClassName for: receiver.\x0a\x09stream nextPutAll: '{'",
- messageSends: ["prvCheckClass:for:", "nextPutAll:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_checkClass_for_includeIf_",
- smalltalk.method({
- selector: "checkClass:for:includeIf:",
- category: 'optimizations',
- fn: function (aClassName, receiver, aBoolean){
- var self=this;
- smalltalk.send(self, "_prvCheckClass_for_", [aClassName, receiver]);
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "if((";})() : (function(){return "if(!(";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "if((";}), (function(){return "if(!(";})])), "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [")) {"])]);
- return self;},
- args: ["aClassName", "receiver", "aBoolean"],
- source: "checkClass: aClassName for: receiver includeIf: aBoolean\x0a\x09self prvCheckClass: aClassName for: receiver.\x0a\x09stream nextPutAll: (aBoolean ifTrue: ['if(('] ifFalse: ['if(!(']), (self useValueNamed: receiver), ')) {'",
- messageSends: ["prvCheckClass:for:", "nextPutAll:", ",", "ifTrue:ifFalse:", "useValueNamed:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_compileNode_",
- smalltalk.method({
- selector: "compileNode:",
- category: 'compiling',
- fn: function (aNode) {
- var self=this;
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- smalltalk.send(self, "_visit_", [aNode]);
- return smalltalk.send(self['@stream'], "_contents", []);
- return self;},
- args: ["aNode"],
- source: "compileNode: aNode\x0a\x09stream := '' writeStream.\x0a\x09self visit: aNode.\x0a\x09^stream contents",
- messageSends: ["writeStream", "visit:", "contents"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_ifValueWanted_",
- smalltalk.method({
- selector: "ifValueWanted:",
- category: 'compilation DSL',
- fn: function (aBlock){
- var self=this;
- smalltalk.send(self['@target'], "_ifNotNil_", [aBlock]);
- return self;},
- args: ["aBlock"],
- source: "ifValueWanted: aBlock\x0a\x09target ifNotNil: aBlock",
- messageSends: ["ifNotNil:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- category: 'initialization',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_initialize", [], smalltalk.ImpCodeGenerator.superclass || nil);
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- (self['@unknownVariables']=[]);
- (self['@tempVariables']=[]);
- (self['@argVariables']=[]);
- (self['@messageSends']=[]);
- (self['@classReferenced']=[]);
- (self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
- (self['@realVarNames']=smalltalk.send((smalltalk.Set || Set), "_new", []));
- (self['@lazyVars']=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
- (self['@target']=nil);
- return self;},
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream. \x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09messageSends := #().\x0a\x09classReferenced := #().\x0a\x09mutables := Set new.\x0a\x09realVarNames := Set new.\x0a\x09lazyVars := HashedCollection new.\x0a\x09target := nil\x0a",
- messageSends: ["initialize", "writeStream", "new"],
- referencedClasses: ["Set", "HashedCollection"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_inline_receiver_argumentNodes_",
- smalltalk.method({
- selector: "inline:receiver:argumentNodes:",
- category: 'optimizations',
- fn: function (aSelector, receiver, aCollection){
- var self=this;
- var $early={};
- try{((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]);return (function(){throw $early=[true]})();})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifTrue:ifFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, true]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifFalse:ifTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_checkClass_for_includeIf_", ["Boolean", receiver, false]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (function(){throw $early=[true]})();})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["<"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["<="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["<="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", [">"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", [">="])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [">="]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["+"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["+"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["+"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["-"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["-"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["-"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["*"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["*"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["*"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["/"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["/"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var operand=nil;
- (operand=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(aCollection, "_first", [])]));smalltalk.send(self, "_checkClass_for_", ["Number", receiver]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", ["/"]), "__comma", [operand]), "__comma", [")"])]);})]);return (function(){throw $early=[[smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [operand])]]})();})]));
- return nil;
- return self;
- } catch(e) {if(e===$early)return e[0]; throw e}},
- args: ["aSelector", "receiver", "aCollection"],
- source: "inline: aSelector receiver: receiver argumentNodes: aCollection\x0a\x0a\x09\x22-- Booleans --\x22\x0a\x0a\x09(aSelector = 'ifFalse:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: false.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self nilIfValueWanted ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09(aSelector = 'ifTrue:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: true.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self nilIfValueWanted ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09(aSelector = 'ifTrue:ifFalse:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: true.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09(aSelector = 'ifFalse:ifTrue:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [\x0a\x09\x09\x09self checkClass: 'Boolean' for: receiver includeIf: false.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09^true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(aSelector = '<') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '<', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a\x09(aSelector = '<=') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '<=', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a\x09(aSelector = '>') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '>', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a\x09(aSelector = '>=') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '>=', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '+') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '+', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '-') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '-', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '*') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '*', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a (aSelector = '/') ifTrue: [ | operand |\x0a\x09\x09operand := self isolatedUse: aCollection first.\x0a\x09\x09self checkClass: 'Number' for: receiver.\x0a\x09\x09self prvPutAndElse: [\x0a\x09\x09\x09self lazyAssignExpression: '(', (self useValueNamed: receiver), '/', operand, ')' ].\x0a\x09\x09^{ VerbatimNode new value: operand }].\x0a\x0a ^nil",
- messageSends: ["ifTrue:", "=", "isBlockNode", "first", "checkClass:for:includeIf:", "prvPutAndElse:", "visit:", "nodes", "nilIfValueWanted", "and:", "second", "isolatedUse:", "checkClass:for:", "lazyAssignExpression:", ",", "useValueNamed:", "value:", "new"],
- referencedClasses: ["VerbatimNode"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_inlineLiteral_receiverNode_argumentNodes_",
- smalltalk.method({
- selector: "inlineLiteral:receiverNode:argumentNodes:",
- category: 'optimizations',
- fn: function (aSelector, anObject, aCollection){
- var self=this;
- var inlined=nil;
- (inlined=false);
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if (!(", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(anObject, "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var old=nil;
- smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["for(;;){", "if ((", anObject, ")) {"]);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("break}", "__comma", [smalltalk.send(self, "_mylf", [])])]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", []), nil]);})]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileTrue"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while((", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["whileFalse"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(anObject, "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self, "_prvWhileConditionStatement_pre_condition_post_", ["do{", "}while(!(", anObject, smalltalk.send("));", "__comma", [smalltalk.send(self, "_mylf", [])])]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(["+", "-", "*", "/", "<", "<=", ">=", ">"], "_includes_", [aSelector])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_prvInlineNumberOperator_on_and_", [aSelector, anObject, smalltalk.send(aCollection, "_first", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_prvInlineNumberOperator_on_and_", [aSelector, anObject, smalltalk.send(aCollection, "_first", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [rcv]);})]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNil:ifNotNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["ifNotNil:ifNil:"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_isBlockNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(aCollection, "_second", []), "_isBlockNode", []);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- smalltalk.send(self, "_aboutToModifyState", []);(rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_makeTargetRealVariable", []);smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null) {"])]);smalltalk.send(self, "_prvPutAndElse_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_first", []), "_nodes", []), "_first", [])]);})]);smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(aCollection, "_second", []), "_nodes", []), "_first", [])]);})]);return (inlined=true);})]));})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["isNil"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- (rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null)"])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- (rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") === nil || ("]), "__comma", [rcv]), "__comma", [") == null)"])]);return (inlined=true);})]));
- ((($receiver = smalltalk.send(aSelector, "__eq", ["notNil"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- (rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null)"])]);return (inlined=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- (rcv=smalltalk.send(self, "_isolatedUse_", [anObject]));((($receiver = smalltalk.send(rcv, "__eq", ["super"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (rcv="self");})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (rcv="self");})]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("((", "__comma", [rcv]), "__comma", [") !== nil && ("]), "__comma", [rcv]), "__comma", [") != null)"])]);return (inlined=true);})]));
- return inlined;
- return self;},
- args: ["aSelector", "anObject", "aCollection"],
- source: "inlineLiteral: aSelector receiverNode: anObject argumentNodes: aCollection\x0a | inlined |\x0a inlined := false.\x0a \x0a\x09\x22-- BlockClosures --\x22\x0a\x0a\x09(aSelector = 'whileTrue:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [ | old |\x0a\x09\x09\x09self prvWhileConditionStatement: 'for(;;){' pre: 'if (!(' condition: anObject post: ')) {'.\x0a\x09\x09\x09stream nextPutAll: 'break}', self mylf.\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection first nodes first targetBeing: nil ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse:') ifTrue: [\x0a \x09(anObject isBlockNode and: [aCollection first isBlockNode]) ifTrue: [ | old |\x0a\x09\x09\x09self prvWhileConditionStatement: 'for(;;){' pre: 'if ((' condition: anObject post: ')) {'.\x0a\x09\x09\x09stream nextPutAll: 'break}', self mylf.\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection first nodes first targetBeing: nil ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileTrue') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a\x09\x09\x09self prvWhileConditionStatement: 'do{' pre: '}while((' condition: anObject post: '));', self mylf.\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'whileFalse') ifTrue: [\x0a \x09anObject isBlockNode ifTrue: [\x0a\x09\x09\x09self prvWhileConditionStatement: 'do{' pre: '}while(!(' condition: anObject post: '));', self mylf.\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09\x22-- Numbers --\x22\x0a\x0a\x09(#('+' '-' '*' '/' '<' '<=' '>=' '>') includes: aSelector) ifTrue: [\x0a\x09\x09(self prvInlineNumberOperator: aSelector on: anObject and: aCollection first) ifTrue: [\x0a\x09\x09\x09inlined := true]].\x0a \x09 \x0a\x09\x22-- UndefinedObject --\x22\x0a\x0a\x09(aSelector = 'ifNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') === nil || (', rcv, ') == null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self lazyAssignValue: rcv ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:') ifTrue: [\x0a\x09\x09aCollection first isBlockNode ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') !== nil && (', rcv, ') != null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self lazyAssignValue: rcv ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNil:ifNotNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') === nil || (', rcv, ') == null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'ifNotNil:ifNil:') ifTrue: [\x0a\x09\x09(aCollection first isBlockNode and: [aCollection second isBlockNode]) ifTrue: [ | rcv |\x0a\x09\x09\x09self aboutToModifyState.\x0a\x09\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09\x09self makeTargetRealVariable.\x0a\x09\x09\x09stream nextPutAll: 'if((', rcv, ') !== nil && (', rcv, ') != null) {'.\x0a\x09\x09\x09self prvPutAndElse: [ self visit: aCollection first nodes first ].\x0a\x09\x09\x09self prvPutAndClose: [ self visit: aCollection second nodes first ].\x0a\x09\x09\x09inlined := true]].\x0a\x0a\x09(aSelector = 'isNil') ifTrue: [ | rcv |\x0a\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09self lazyAssignValue: '((', rcv, ') === nil || (', rcv, ') == null)'.\x0a\x09\x09inlined := true].\x0a\x0a\x09(aSelector = 'notNil') ifTrue: [ | rcv |\x0a\x09\x09rcv := self isolatedUse: anObject.\x0a\x09\x09rcv = 'super' ifTrue: [ rcv := 'self' ].\x0a\x09\x09self lazyAssignValue: '((', rcv, ') !== nil && (', rcv, ') != null)'.\x0a\x09\x09inlined := true].\x0a\x0a ^inlined",
- messageSends: ["ifTrue:", "=", "and:", "isBlockNode", "first", "prvWhileConditionStatement:pre:condition:post:", "nextPutAll:", ",", "mylf", "prvPutAndClose:", "visit:targetBeing:", "nodes", "includes:", "prvInlineNumberOperator:on:and:", "aboutToModifyState", "isolatedUse:", "makeTargetRealVariable", "prvPutAndElse:", "visit:", "lazyAssignValue:", "second"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_isNode_ofClass_",
- smalltalk.method({
- selector: "isNode:ofClass:",
- category: 'optimizations',
- fn: function (aNode, aClass) {
- var self=this;
- return smalltalk.send(smalltalk.send(aNode, "_isValueNode", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "_class", []), "__eq", [aClass]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["self"]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_currentClass", []), "__eq", [aClass]);})]);})]);})]);
- return self;},
- args: ["aNode", "aClass"],
- source: "isNode: aNode ofClass: aClass\x0a\x09^aNode isValueNode and: [\x0a \x09aNode value class = aClass or: [\x0a \x09\x09aNode value = 'self' and: [self currentClass = aClass]]]",
- messageSends: ["and:", "isValueNode", "or:", "=", "class", "value", "currentClass"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_isolated_",
- smalltalk.method({
- selector: "isolated:",
- category: 'compilation DSL',
- fn: function (node){
- var self=this;
- return smalltalk.send(self, "_visit_targetBeing_", [node, smalltalk.send(self, "_nextLazyvarName", [])]);
- return self;},
- args: ["node"],
- source: "isolated: node\x0a \x09^ self visit: node targetBeing: self nextLazyvarName",
- messageSends: ["visit:targetBeing:", "nextLazyvarName"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_isolatedUse_",
- smalltalk.method({
- selector: "isolatedUse:",
- category: 'compilation DSL',
- fn: function (node){
- var self=this;
- var old=nil;
- (old=smalltalk.send(self, "_switchTarget_", [smalltalk.send(self, "_nextLazyvarName", [])]));
- smalltalk.send(self, "_visit_", [node]);
- return smalltalk.send(self, "_useValueNamed_", [smalltalk.send(self, "_switchTarget_", [old])]);
- return self;},
- args: ["node"],
- source: "isolatedUse: node\x0a| old |\x0a\x09old := self switchTarget: self nextLazyvarName.\x0a\x09self visit: node.\x0a\x09^self useValueNamed: (self switchTarget: old)",
- messageSends: ["switchTarget:", "nextLazyvarName", "visit:", "useValueNamed:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_knownVariables",
- smalltalk.method({
- selector: "knownVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_tempVariables", [])]);smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_argVariables", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_pseudoVariables", []));
- return self;},
- args: [],
- source: "knownVariables\x0a\x09^self pseudoVariables \x0a\x09\x09addAll: self tempVariables;\x0a\x09\x09addAll: self argVariables;\x0a\x09\x09yourself",
- messageSends: ["addAll:", "tempVariables", "argVariables", "yourself", "pseudoVariables"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_lazyAssign_dependsOnState_",
- smalltalk.method({
- selector: "lazyAssign:dependsOnState:",
- category: 'compilation DSL',
- fn: function (aString, aBoolean){
- var self=this;
- ((($receiver = smalltalk.send(self['@lazyVars'], "_includesKey_", [self['@target']])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@lazyVars'], "_at_put_", [self['@target'], aString]);return ((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})]));})() : (function(){return smalltalk.send(self, "_realAssign_", [aString]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(self['@lazyVars'], "_at_put_", [self['@target'], aString]);return ((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@mutables'], "_add_", [self['@target']]);})]));}), (function(){return smalltalk.send(self, "_realAssign_", [aString]);})]));
- return self;},
- args: ["aString", "aBoolean"],
- source: "lazyAssign: aString dependsOnState: aBoolean\x0a\x09(lazyVars includesKey: target)\x0a\x09\x09ifTrue: [ lazyVars at: target put: aString. aBoolean ifTrue: [ mutables add: target ] ]\x0a\x09\x09ifFalse: [ self realAssign: aString ]",
- messageSends: ["ifTrue:ifFalse:", "includesKey:", "at:put:", "ifTrue:", "add:", "realAssign:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_lazyAssignExpression_",
- smalltalk.method({
- selector: "lazyAssignExpression:",
- category: 'compilation DSL',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_lazyAssign_dependsOnState_", [aString, true]);
- return self;},
- args: ["aString"],
- source: "lazyAssignExpression: aString\x0a\x09self lazyAssign: aString dependsOnState: true",
- messageSends: ["lazyAssign:dependsOnState:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_lazyAssignValue_",
- smalltalk.method({
- selector: "lazyAssignValue:",
- category: 'compilation DSL',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_lazyAssign_dependsOnState_", [aString, false]);
- return self;},
- args: ["aString"],
- source: "lazyAssignValue: aString\x0a\x09self lazyAssign: aString dependsOnState: false",
- messageSends: ["lazyAssign:dependsOnState:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_makeTargetRealVariable",
- smalltalk.method({
- selector: "makeTargetRealVariable",
- category: 'compilation DSL',
- fn: function (){
- var self=this;
- ((($receiver = smalltalk.send(self['@lazyVars'], "_includesKey_", [self['@target']])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@lazyVars'], "_removeKey_", [self['@target']]);smalltalk.send(self['@lazyVars'], "_at_put_", [smalltalk.send("assigned ", "__comma", [self['@target']]), nil]);return smalltalk.send(self['@realVarNames'], "_add_", [self['@target']]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@lazyVars'], "_removeKey_", [self['@target']]);smalltalk.send(self['@lazyVars'], "_at_put_", [smalltalk.send("assigned ", "__comma", [self['@target']]), nil]);return smalltalk.send(self['@realVarNames'], "_add_", [self['@target']]);})]));
- return self;},
- args: [],
- source: "makeTargetRealVariable\x0a\x09(lazyVars includesKey: target) ifTrue: [\x0a\x09\x09lazyVars removeKey: target.\x0a\x09\x09lazyVars at: 'assigned ',target put: nil. \x22<-- only to retain size, it is used in nextLazyvarName\x22\x0a\x09\x09realVarNames add: target ].",
- messageSends: ["ifTrue:", "includesKey:", "removeKey:", "at:put:", ",", "add:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_mylf",
- smalltalk.method({
- selector: "mylf",
- category: 'output',
- fn: function () {
- var self=this;
- return smalltalk.send(smalltalk.send((smalltalk.String || String), "_lf", []), "__comma", [smalltalk.send(smalltalk.send((smalltalk.Array || Array), "_new_", [((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(2) : smalltalk.send($receiver, "__plus", [(2)]))]), "_join_", [smalltalk.send((smalltalk.String || String), "_tab", [])])]);
- return self;},
- args: [],
- source: "mylf\x0a\x09^String lf, ((Array new: nestedBlocks+2) join: String tab)",
- messageSends: [",", "lf", "join:", "new:", "+", "tab"],
- referencedClasses: ["String", "Array"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_nextLazyvarName",
- smalltalk.method({
- selector: "nextLazyvarName",
- category: 'compilation DSL',
- fn: function (){
- var self=this;
- var name=nil;
- (name=smalltalk.send("$", "__comma", [smalltalk.send(smalltalk.send(self['@lazyVars'], "_size", []), "_asString", [])]));
- smalltalk.send(self['@lazyVars'], "_at_put_", [name, name]);
- return name;
- return self;},
- args: [],
- source: "nextLazyvarName\x0a\x09| name |\x0a\x09name := '$', lazyVars size asString.\x0a\x09lazyVars at: name put: name.\x0a\x09^name",
- messageSends: [",", "asString", "size", "at:put:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_nilIfValueWanted",
- smalltalk.method({
- selector: "nilIfValueWanted",
- category: 'compilation DSL',
- fn: function (){
- var self=this;
- (($receiver = self['@target']) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self, "_lazyAssignValue_", ["nil"]);})() : nil;
- return self;},
- args: [],
- source: "nilIfValueWanted\x0a\x09target ifNotNil: [ self lazyAssignValue: 'nil' ]",
- messageSends: ["ifNotNil:", "lazyAssignValue:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_performOptimizations",
- smalltalk.method({
- selector: "performOptimizations",
- category: 'testing',
- fn: function () {
- var self=this;
- return smalltalk.send(smalltalk.send(self, "_class", []), "_performOptimizations", []);
- return self;},
- args: [],
- source: "performOptimizations\x0a\x09^self class performOptimizations",
- messageSends: ["performOptimizations", "class"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_prvCheckClass_for_",
- smalltalk.method({
- selector: "prvCheckClass:for:",
- category: 'optimizations',
- fn: function (aClassName, receiver){
- var self=this;
- smalltalk.send(self, "_makeTargetRealVariable", []);
- smalltalk.send(self, "_aboutToModifyState", []);
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("if((", "__comma", [smalltalk.send(self, "_useValueNamed_", [receiver])]), "__comma", [").klass === smalltalk."]), "__comma", [aClassName]), "__comma", [") "])]);
- return self;},
- args: ["aClassName", "receiver"],
- source: "prvCheckClass: aClassName for: receiver\x0a\x09self makeTargetRealVariable.\x0a\x09self aboutToModifyState.\x0a stream nextPutAll: 'if((', (self useValueNamed: receiver), ').klass === smalltalk.', aClassName, ') '",
- messageSends: ["makeTargetRealVariable", "aboutToModifyState", "nextPutAll:", ",", "useValueNamed:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_prvInlineNumberOperator_on_and_",
- smalltalk.method({
- selector: "prvInlineNumberOperator:on:and:",
- category: 'optimizations',
- fn: function (aSelector, receiverNode, operandNode){
- var self=this;
- var $early={};
- try{((($receiver = smalltalk.send(aSelector, "__eq", [aSelector])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [receiverNode, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- var operand=nil;
- (rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- var operand=nil;
- (rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_isNode_ofClass_", [receiverNode, (smalltalk.Number || Number)])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var rcv=nil;
- var operand=nil;
- (rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var rcv=nil;
- var operand=nil;
- (rcv=smalltalk.send(self, "_isolated_", [receiverNode]));(operand=smalltalk.send(self, "_isolated_", [operandNode]));smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_useValueNamed_", [rcv]), "__comma", [aSelector]), "__comma", [smalltalk.send(self, "_useValueNamed_", [operand])])]);return (function(){throw $early=[true]})();})]));})]));
- return false;
- return self;
- } catch(e) {if(e===$early)return e[0]; throw e}},
- args: ["aSelector", "receiverNode", "operandNode"],
- source: "prvInlineNumberOperator: aSelector on: receiverNode and: operandNode\x0a\x09(aSelector = aSelector) ifTrue: [\x0a\x09\x09(self isNode: receiverNode ofClass: Number) ifTrue: [\x0a\x09\x09\x09| rcv operand |\x0a\x09\x09\x09rcv := self isolated: receiverNode.\x0a\x09\x09\x09operand := self isolated: operandNode.\x0a\x09\x09\x09self lazyAssignValue: ((self useValueNamed: rcv), aSelector, (self useValueNamed: operand)).\x0a\x09\x09\x09^true]].\x0a\x09^false\x0a",
- messageSends: ["ifTrue:", "=", "isNode:ofClass:", "isolated:", "lazyAssignValue:", ",", "useValueNamed:"],
- referencedClasses: ["Number"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_prvPutAndClose_",
- smalltalk.method({
- selector: "prvPutAndClose:",
- category: 'output',
- fn: function (aBlock) {
- var self=this;
- smalltalk.send(aBlock, "_value", []);
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("}", "__comma", [smalltalk.send(self, "_mylf", [])])]);
- return self;},
- args: ["aBlock"],
- source: "prvPutAndClose: aBlock\x0a\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '}', self mylf\x0a",
- messageSends: ["value", "nextPutAll:", ",", "mylf"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_prvPutAndElse_",
- smalltalk.method({
- selector: "prvPutAndElse:",
- category: 'output',
- fn: function (aBlock) {
- var self=this;
- smalltalk.send(aBlock, "_value", []);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["} else {"]);
- return self;},
- args: ["aBlock"],
- source: "prvPutAndElse: aBlock\x0a\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '} else {'\x0a",
- messageSends: ["value", "nextPutAll:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_prvWhileConditionStatement_pre_condition_post_",
- smalltalk.method({
- selector: "prvWhileConditionStatement:pre:condition:post:",
- category: 'optimizations',
- fn: function (stmtString, preString, anObject, postString){
- var self=this;
- var x=nil;
- smalltalk.send(self['@stream'], "_nextPutAll_", [stmtString]);
- (x=smalltalk.send(self, "_isolatedUse_", [smalltalk.send(smalltalk.send(anObject, "_nodes", []), "_first", [])]));
- smalltalk.send(x, "_ifEmpty_", [(function(){return (x="\x22should not reach - receiver includes ^\x22");})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(preString, "__comma", [x]), "__comma", [postString])]);
- smalltalk.send(self, "_nilIfValueWanted", []);
- return self;},
- args: ["stmtString", "preString", "anObject", "postString"],
- source: "prvWhileConditionStatement: stmtString pre: preString condition: anObject post: postString\x0a\x09| x |\x0a\x09stream nextPutAll: stmtString.\x0a\x09x := self isolatedUse: anObject nodes first.\x0a\x09x ifEmpty: [ x := '\x22should not reach - receiver includes ^\x22' ].\x0a\x09stream nextPutAll: preString, x, postString.\x0a\x09self nilIfValueWanted",
- messageSends: ["nextPutAll:", "isolatedUse:", "first", "nodes", "ifEmpty:", ",", "nilIfValueWanted"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_putTemps_",
- smalltalk.method({
- selector: "putTemps:",
- category: 'output',
- fn: function (temps) {
- var self=this;
- smalltalk.send(temps, "_ifNotEmpty_", [(function(){smalltalk.send(self['@stream'], "_nextPutAll_", ["var "]);smalltalk.send(temps, "_do_separatedBy_", [(function(each){var temp=nil;
- (temp=smalltalk.send(self, "_safeVariableNameFor_", [each]));smalltalk.send(self['@tempVariables'], "_add_", [temp]);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(temp, "__comma", ["=nil"])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(";", "__comma", [smalltalk.send(self, "_mylf", [])])]);})]);
- return self;},
- args: ["temps"],
- source: "putTemps: temps\x0a temps ifNotEmpty: [\x0a\x09stream nextPutAll: 'var '.\x0a\x09temps do: [:each | | temp |\x0a temp := self safeVariableNameFor: each.\x0a\x09 tempVariables add: temp.\x0a\x09 stream nextPutAll: temp, '=nil'] separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ';', self mylf\x0a ]",
- messageSends: ["ifNotEmpty:", "nextPutAll:", "do:separatedBy:", "safeVariableNameFor:", "add:", ",", "mylf"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_realAssign_",
- smalltalk.method({
- selector: "realAssign:",
- category: 'compilation DSL',
- fn: function (aString){
- var self=this;
- var closer=nil;
- smalltalk.send(aString, "_ifNotEmpty_", [(function(){smalltalk.send(self, "_aboutToModifyState", []);(closer="");smalltalk.send(self, "_ifValueWanted_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [((($receiver = smalltalk.send(self['@target'], "__eq", ["^"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "return ";})() : (function(){return ((($receiver = smalltalk.send(self['@target'], "__eq", ["!"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){(closer="]");return "throw $early=[";})() : (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){(closer="]");return "throw $early=[";}), (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "return ";}), (function(){return ((($receiver = smalltalk.send(self['@target'], "__eq", ["!"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){(closer="]");return "throw $early=[";})() : (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){(closer="]");return "throw $early=[";}), (function(){return smalltalk.send(self['@target'], "__comma", ["="]);})]));})]))]);})]);smalltalk.send(self, "_makeTargetRealVariable", []);return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(aString, "__comma", [closer]), "__comma", [";"]), "__comma", [smalltalk.send(self, "_mylf", [])])]);})]);
- return self;},
- args: ["aString"],
- source: "realAssign: aString\x0a\x09| closer |\x0a\x09aString ifNotEmpty: [\x0a\x09\x09self aboutToModifyState.\x0a\x09\x09closer := ''.\x0a\x09\x09self ifValueWanted: [ stream nextPutAll:\x0a\x09\x09\x09(target = '^' ifTrue: ['return '] ifFalse: [\x0a\x09\x09\x09\x09target = '!' ifTrue: [ closer := ']'. 'throw $early=['] ifFalse: [\x0a\x09\x09\x09\x09\x09target, '=']]) ].\x0a\x09\x09self makeTargetRealVariable.\x0a\x09\x09stream nextPutAll: aString, closer, ';', self mylf ]",
- messageSends: ["ifNotEmpty:", "aboutToModifyState", "ifValueWanted:", "nextPutAll:", "ifTrue:ifFalse:", "=", ",", "makeTargetRealVariable", "mylf"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_send_to_arguments_superSend_",
- smalltalk.method({
- selector: "send:to:arguments:superSend:",
- category: 'visiting',
- fn: function (aSelector, aReceiver, aCollection, aBoolean){
- var self=this;
- var args=nil;
- (args=smalltalk.send(self, "_isolated_", [(function($rec){smalltalk.send($rec, "_nodes_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.DynamicArrayNode || DynamicArrayNode), "_new", []))]));
- smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){smalltalk.send(str, "_nextPutAll_", ["smalltalk.send("]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self, "_useValueNamed_", [aReceiver])]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(", \x22", "__comma", [smalltalk.send(aSelector, "_asSelector", [])]), "__comma", ["\x22, "])]);smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self, "_useValueNamed_", [args])]);((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(smalltalk.send(self, "_currentClass", []), "_superclass", [])])])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(", smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(smalltalk.send(self, "_currentClass", []), "_superclass", [])])])]);})]));return smalltalk.send(str, "_nextPutAll_", [")"]);})])]);
- return self;},
- args: ["aSelector", "aReceiver", "aCollection", "aBoolean"],
- source: "send: aSelector to: aReceiver arguments: aCollection superSend: aBoolean\x0a\x09| args |\x0a\x09args := self isolated: (DynamicArrayNode new nodes: aCollection; yourself).\x0a\x09self lazyAssignExpression: (String streamContents: [ :str |\x0a\x09\x09str nextPutAll: 'smalltalk.send('.\x0a\x09\x09str nextPutAll: (self useValueNamed: aReceiver).\x0a\x09\x09str nextPutAll: ', \x22', aSelector asSelector, '\x22, '.\x0a\x09\x09str nextPutAll: (self useValueNamed: args).\x0a\x09\x09aBoolean ifTrue: [\x0a\x09\x09\x09str nextPutAll: ', smalltalk.', (self classNameFor: self currentClass superclass)].\x0a\x09\x09str nextPutAll: ')'\x0a\x09])",
- messageSends: ["isolated:", "nodes:", "yourself", "new", "lazyAssignExpression:", "streamContents:", "nextPutAll:", "useValueNamed:", ",", "asSelector", "ifTrue:", "classNameFor:", "superclass", "currentClass"],
- referencedClasses: ["DynamicArrayNode", "String"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_sequenceOfNodes_temps_",
- smalltalk.method({
- selector: "sequenceOfNodes:temps:",
- category: 'visiting',
- fn: function (nodes, temps){
- var self=this;
- ((($receiver = smalltalk.send(nodes, "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){var old=nil;
- var index=nil;
- smalltalk.send(self, "_putTemps_", [temps]);(old=smalltalk.send(self, "_switchTarget_", [nil]));(index=(0));return smalltalk.send(nodes, "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(nodes, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_switchTarget_", [old]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_switchTarget_", [old]);})]));return smalltalk.send(self, "_visit_", [each]);})]);})() : (function(){return smalltalk.send(self, "_nilIfValueWanted", []);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){var old=nil;
- var index=nil;
- smalltalk.send(self, "_putTemps_", [temps]);(old=smalltalk.send(self, "_switchTarget_", [nil]));(index=(0));return smalltalk.send(nodes, "_do_", [(function(each){(index=((($receiver = index).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));((($receiver = smalltalk.send(index, "__eq", [smalltalk.send(nodes, "_size", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_switchTarget_", [old]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_switchTarget_", [old]);})]));return smalltalk.send(self, "_visit_", [each]);})]);}), (function(){return smalltalk.send(self, "_nilIfValueWanted", []);})]));
- return self;},
- args: ["nodes", "temps"],
- source: "sequenceOfNodes: nodes temps: temps\x0a\x09nodes isEmpty\x0a\x09\x09ifFalse: [ | old index |\x0a\x09\x09\x09self putTemps: temps.\x0a\x09\x09\x09old :=self switchTarget: nil.\x0a\x09\x09\x09index := 0.\x0a\x09\x09\x09nodes do: [:each |\x0a\x09\x09\x09\x09index := index + 1.\x0a\x09\x09\x09\x09index = nodes size ifTrue: [ self switchTarget: old ].\x0a\x09\x09\x09self visit: each ]]\x0a\x09\x09ifTrue: [ self nilIfValueWanted ]",
- messageSends: ["ifFalse:ifTrue:", "isEmpty", "putTemps:", "switchTarget:", "do:", "+", "ifTrue:", "=", "size", "visit:", "nilIfValueWanted"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_switchTarget_",
- smalltalk.method({
- selector: "switchTarget:",
- category: 'compilation DSL',
- fn: function (aString){
- var self=this;
- var old=nil;
- (old=self['@target']);
- (self['@target']=aString);
- return old;
- return self;},
- args: ["aString"],
- source: "switchTarget: aString\x0a\x09| old |\x0a\x09old := target.\x0a\x09target := aString.\x0a\x09^old",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_tempVariables",
- smalltalk.method({
- selector: "tempVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return smalltalk.send(self['@tempVariables'], "_copy", []);
- return self;},
- args: [],
- source: "tempVariables\x0a\x09^tempVariables copy",
- messageSends: ["copy"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_unknownVariables",
- smalltalk.method({
- selector: "unknownVariables",
- category: 'accessing',
- fn: function () {
- var self=this;
- return smalltalk.send(self['@unknownVariables'], "_copy", []);
- return self;},
- args: [],
- source: "unknownVariables\x0a\x09^unknownVariables copy",
- messageSends: ["copy"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_useValueNamed_",
- smalltalk.method({
- selector: "useValueNamed:",
- category: 'compilation DSL',
- fn: function (key){
- var self=this;
- var $early={};
- try{var val=nil;
- ((($receiver = smalltalk.send(self['@realVarNames'], "_includes_", [key])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw $early=[key]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=[key]})();})]));
- smalltalk.send(self['@mutables'], "_remove_", [key]);
- return smalltalk.send(self['@lazyVars'], "_at_", [key]);
- return self;
- } catch(e) {if(e===$early)return e[0]; throw e}},
- args: ["key"],
- source: "useValueNamed: key\x0a\x09| val |\x0a\x09(realVarNames includes: key) ifTrue: [ ^key ].\x0a\x09mutables remove: key.\x0a\x09^lazyVars at: key",
- messageSends: ["ifTrue:", "includes:", "remove:", "at:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visit_",
- smalltalk.method({
- selector: "visit:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(aNode, "_accept_", [self]);
- return self;},
- args: ["aNode"],
- source: "visit: aNode\x0a\x09aNode accept: self",
- messageSends: ["accept:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visit_targetBeing_",
- smalltalk.method({
- selector: "visit:targetBeing:",
- category: 'compilation DSL',
- fn: function (aNode, aString){
- var self=this;
- var old=nil;
- (old=smalltalk.send(self, "_switchTarget_", [aString]));
- smalltalk.send(self, "_visit_", [aNode]);
- return smalltalk.send(self, "_switchTarget_", [old]);
- return self;},
- args: ["aNode", "aString"],
- source: "visit: aNode targetBeing: aString\x0a| old |\x0a\x09old := self switchTarget: aString.\x0a\x09self visit: aNode.\x0a\x09^ self switchTarget: old.\x0a",
- messageSends: ["switchTarget:", "visit:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitAssignmentNode_",
- smalltalk.method({
- selector: "visitAssignmentNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var olds=nil;
- var oldt=nil;
- (olds=self['@stream']);
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- (oldt=smalltalk.send(self, "_switchTarget_", [smalltalk.send(self, "_nextLazyvarName", [])]));
- smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);
- smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@lazyVars'], "_at_", [self['@target']]), "_~_eq", [self['@target']])]);
- smalltalk.send(self, "_switchTarget_", [smalltalk.send(self, "_useValueNamed_", [smalltalk.send(self, "_switchTarget_", [nil])])]);
- smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(self['@lazyVars'], "_includesKey_", [self['@target']]), "_not", [])]);
- (self['@stream']=olds);
- smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);
- (olds=smalltalk.send(self, "_switchTarget_", [oldt]));
- smalltalk.send(self, "_ifValueWanted_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [olds]);})]);
- return self;},
- args: ["aNode"],
- source: "visitAssignmentNode: aNode\x0a| olds oldt |\x0a\x09olds := stream.\x0a\x09stream := '' writeStream.\x0a\x09oldt := self switchTarget: self nextLazyvarName.\x0a\x09self visit: aNode left.\x0a\x09self assert: (lazyVars at: target) ~= target.\x0a\x09self switchTarget: (self useValueNamed: (self switchTarget: nil)).\x0a\x09self assert: (lazyVars includesKey: target) not.\x0a\x09stream := olds.\x0a\x09self visit: aNode right.\x0a\x09olds := self switchTarget: oldt.\x0a\x09self ifValueWanted: [ self lazyAssignExpression: olds ]",
- messageSends: ["writeStream", "switchTarget:", "nextLazyvarName", "visit:", "left", "assert:", "~=", "at:", "useValueNamed:", "not", "includesKey:", "right", "ifValueWanted:", "lazyAssignExpression:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitBlockNode_",
- smalltalk.method({
- selector: "visitBlockNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var oldt=nil;
- var olds=nil;
- var oldm=nil;
- smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", []), "__eq", [(1)])]);
- (oldt=smalltalk.send(self, "_switchTarget_", ["^"]));
- (olds=self['@stream']);
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
- smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@tempVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["){"]);
- (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
- (oldm=self['@mutables']);
- (self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
- smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", [])]);
- smalltalk.send(self, "_assert_", [smalltalk.send(self['@mutables'], "_isEmpty", [])]);
- (self['@mutables']=oldm);
- (self['@nestedBlocks']=((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])));
- smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
- smalltalk.send(self, "_switchTarget_", [oldt]);
- (oldt=smalltalk.send(self['@stream'], "_contents", []));
- (self['@stream']=olds);
- smalltalk.send(self, "_lazyAssignExpression_", [oldt]);
- return self;},
- args: ["aNode"],
- source: "visitBlockNode: aNode\x0a| oldt olds oldm |\x0a\x09self assert: aNode nodes size = 1.\x0a\x09oldt := self switchTarget: '^'.\x0a\x09olds := stream.\x0a\x09stream := '' writeStream.\x0a\x09stream nextPutAll: '(function('.\x0a\x09aNode parameters \x0a\x09 do: [:each |\x0a\x09\x09tempVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream nextPutAll: '){'.\x0a\x09nestedBlocks := nestedBlocks + 1.\x0a\x09oldm := mutables.\x0a\x09mutables := Set new.\x0a\x09self visit: aNode nodes first.\x0a\x09self assert: mutables isEmpty.\x0a\x09mutables := oldm.\x0a\x09nestedBlocks := nestedBlocks - 1.\x0a\x09stream nextPutAll: '})'.\x0a\x09self switchTarget: oldt.\x0a\x09oldt := stream contents.\x0a\x09stream := olds.\x0a\x09self lazyAssignExpression: oldt",
- messageSends: ["assert:", "=", "size", "nodes", "switchTarget:", "writeStream", "nextPutAll:", "do:separatedBy:", "parameters", "add:", "+", "new", "visit:", "first", "isEmpty", "-", "contents", "lazyAssignExpression:"],
- referencedClasses: ["Set"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitBlockSequenceNode_",
- smalltalk.method({
- selector: "visitBlockSequenceNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), smalltalk.send(aNode, "_temps", [])]);
- return self;},
- args: ["aNode"],
- source: "visitBlockSequenceNode: aNode\x0a\x09self sequenceOfNodes: aNode nodes temps: aNode temps",
- messageSends: ["sequenceOfNodes:temps:", "nodes", "temps"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitCascadeNode_",
- smalltalk.method({
- selector: "visitCascadeNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var rcv=nil;
- (rcv=smalltalk.send(self, "_isolated_", [smalltalk.send(aNode, "_receiver", [])]));
- smalltalk.send(self, "_aboutToModifyState", []);
- (rcv=smalltalk.send(self, "_useValueNamed_", [rcv]));
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(each, "_receiver_", [smalltalk.send(smalltalk.send((smalltalk.VerbatimNode || VerbatimNode), "_new", []), "_value_", [rcv])]);})]);
- smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), []]);
- return self;},
- args: ["aNode"],
- source: "visitCascadeNode: aNode\x0a\x09| rcv |\x0a\x09rcv := self isolated: aNode receiver.\x0a\x09self aboutToModifyState.\x0a\x09rcv := self useValueNamed: rcv.\x0a\x09aNode nodes do: [:each |\x0a\x09\x09each receiver: (VerbatimNode new value: rcv) ].\x0a\x09self sequenceOfNodes: aNode nodes temps: #()",
- messageSends: ["isolated:", "receiver", "aboutToModifyState", "useValueNamed:", "do:", "nodes", "receiver:", "value:", "new", "sequenceOfNodes:temps:"],
- referencedClasses: ["VerbatimNode"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitClassReferenceNode_",
- smalltalk.method({
- selector: "visitClassReferenceNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- ((($receiver = smalltalk.send(self['@referencedClasses'], "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@referencedClasses'], "_add_", [smalltalk.send(aNode, "_value", [])]);})]));
- smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(smalltalk.", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [" || "]), "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", [")"])]);
- return self;},
- args: ["aNode"],
- source: "visitClassReferenceNode: aNode\x0a\x09(referencedClasses includes: aNode value) ifFalse: [\x0a\x09\x09referencedClasses add: aNode value].\x0a\x09self lazyAssignExpression: '(smalltalk.', aNode value, ' || ', aNode value, ')'",
- messageSends: ["ifFalse:", "includes:", "value", "add:", "lazyAssignExpression:", ","],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitDynamicArrayNode_",
- smalltalk.method({
- selector: "visitDynamicArrayNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var args=nil;
- (args=smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_collect_", [(function(node){return smalltalk.send(self, "_isolated_", [node]);})]));
- smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(str){smalltalk.send(str, "_nextPutAll_", ["["]);smalltalk.send(args, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self, "_useValueNamed_", [each])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [", "]);})]);return smalltalk.send(str, "_nextPutAll_", ["]"]);})])]);
- return self;},
- args: ["aNode"],
- source: "visitDynamicArrayNode: aNode\x0a\x09| args |\x0a\x09args :=aNode nodes collect: [ :node | self isolated: node ].\x0a\x09self lazyAssignValue: (String streamContents: [ :str |\x0a\x09\x09str nextPutAll: '['.\x0a\x09\x09args\x0a\x09 \x09\x09do: [:each | str nextPutAll: (self useValueNamed: each) ]\x0a\x09 \x09\x09separatedBy: [str nextPutAll: ', '].\x0a str nextPutAll: ']'\x0a\x09])",
- messageSends: ["collect:", "nodes", "isolated:", "lazyAssignValue:", "streamContents:", "nextPutAll:", "do:separatedBy:", "useValueNamed:"],
- referencedClasses: ["String"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitDynamicDictionaryNode_",
- smalltalk.method({
- selector: "visitDynamicDictionaryNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var elements=nil;
- (elements=smalltalk.send(self, "_isolated_", [(function($rec){smalltalk.send($rec, "_nodes_", [smalltalk.send(aNode, "_nodes", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.DynamicArrayNode || DynamicArrayNode), "_new", []))]));
- smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send("smalltalk.HashedCollection._fromPairs_(", "__comma", [smalltalk.send(self, "_useValueNamed_", [elements])]), "__comma", [")"])]);
- return self;},
- args: ["aNode"],
- source: "visitDynamicDictionaryNode: aNode\x0a\x09| elements |\x0a\x09elements := self isolated: (DynamicArrayNode new nodes: aNode nodes; yourself).\x0a\x09self lazyAssignValue: 'smalltalk.HashedCollection._fromPairs_(', (self useValueNamed: elements), ')'",
- messageSends: ["isolated:", "nodes:", "nodes", "yourself", "new", "lazyAssignValue:", ",", "useValueNamed:"],
- referencedClasses: ["DynamicArrayNode"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitFailure_",
- smalltalk.method({
- selector: "visitFailure:",
- category: 'visiting',
- fn: function (aFailure) {
- var self=this;
- smalltalk.send(self, "_error_", [smalltalk.send(aFailure, "_asString", [])]);
- return self;},
- args: ["aFailure"],
- source: "visitFailure: aFailure\x0a\x09self error: aFailure asString",
- messageSends: ["error:", "asString"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitJSStatementNode_",
- smalltalk.method({
- selector: "visitJSStatementNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- smalltalk.send(self, "_aboutToModifyState", []);
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(";", "__comma", [smalltalk.send(smalltalk.send(aNode, "_source", []), "_replace_with_", [">>", ">"])]), "__comma", [";"]), "__comma", [smalltalk.send(self, "_mylf", [])])]);
- return self;},
- args: ["aNode"],
- source: "visitJSStatementNode: aNode\x0a\x09self aboutToModifyState.\x0a\x09stream nextPutAll: ';', (aNode source replace: '>>' with: '>'), ';', self mylf",
- messageSends: ["aboutToModifyState", "nextPutAll:", ",", "replace:with:", "source", "mylf"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitMethodNode_",
- smalltalk.method({
- selector: "visitMethodNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var str=nil;
- var currentSelector=nil;
- (self['@currentSelector']=smalltalk.send(smalltalk.send(aNode, "_selector", []), "_asSelector", []));
- (self['@nestedBlocks']=(0));
- (self['@earlyReturn']=false);
- (self['@messageSends']=[]);
- (self['@referencedClasses']=[]);
- (self['@unknownVariables']=[]);
- (self['@tempVariables']=[]);
- (self['@argVariables']=[]);
- (self['@lazyVars']=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
- (self['@mutables']=smalltalk.send((smalltalk.Set || Set), "_new", []));
- (self['@realVarNames']=smalltalk.send((smalltalk.Set || Set), "_new", []));
- (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aNode, "_selector", [])]), "__comma", ["\x22,"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
- (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(self, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
- smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_separatedBy_", [(function(each){smalltalk.send(self['@argVariables'], "_add_", [each]);return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [", "]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send("){var self=this;", "__comma", [smalltalk.send(self, "_mylf", [])])]);
- (str=self['@stream']);
- (self['@stream']=smalltalk.send("", "_writeStream", []));
- smalltalk.send(self, "_switchTarget_", [nil]);
- smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", []), "__eq", [(1)])]);
- smalltalk.send(self, "_visit_", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", [])]);
- smalltalk.send(self['@realVarNames'], "_ifNotEmpty_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send("var ", "__comma", [smalltalk.send(smalltalk.send(self['@realVarNames'], "_asArray", []), "_join_", [","])]), "__comma", [";"]), "__comma", [smalltalk.send(self, "_mylf", [])])]);})]);
- ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send("var $early={}; try{", "__comma", [smalltalk.send(self, "_mylf", [])])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send("var $early={}; try{", "__comma", [smalltalk.send(self, "_mylf", [])])]);})]));
- smalltalk.send(str, "_nextPutAll_", [smalltalk.send(self['@stream'], "_contents", [])]);
- (self['@stream']=str);
- ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", []), "_nodes", []), "_notEmpty", []), "_and_", [(function(){var checker=nil;
- (checker=smalltalk.send((smalltalk.ReturnNodeChecker || ReturnNodeChecker), "_new", []));smalltalk.send(checker, "_visit_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", []), "_nodes", []), "_last", [])]);return smalltalk.send(checker, "_wasReturnNode", []);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self, "_switchTarget_", ["^"]);smalltalk.send(self, "_lazyAssignValue_", ["self"]);return smalltalk.send(self, "_switchTarget_", [nil]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){smalltalk.send(self, "_switchTarget_", ["^"]);smalltalk.send(self, "_lazyAssignValue_", ["self"]);return smalltalk.send(self, "_switchTarget_", [nil]);})]));
- ((($receiver = self['@earlyReturn']).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["} catch(e) {if(e===$early) return e[0]; throw e}"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self['@stream'], "_nextPutAll_", ["} catch(e) {if(e===$early) return e[0]; throw e}"]);})]));
- smalltalk.send(self['@stream'], "_nextPutAll_", ["}"]);
- (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self['@messageSends'], "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(self['@argVariables'], "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
- smalltalk.send(self['@referencedClasses'], "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["]"]);
- smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
- smalltalk.send(self, "_assert_", [smalltalk.send(self['@mutables'], "_isEmpty", [])]);
- return self;},
- args: ["aNode"],
- source: "visitMethodNode: aNode\x0a\x09| str currentSelector | \x0a\x09currentSelector := aNode selector asSelector.\x0a\x09nestedBlocks := 0.\x0a\x09earlyReturn := false.\x0a\x09messageSends := #().\x0a\x09referencedClasses := #().\x0a\x09unknownVariables := #().\x0a\x09tempVariables := #().\x0a\x09argVariables := #().\x0a\x09lazyVars := HashedCollection new.\x0a\x09mutables := Set new.\x0a\x09realVarNames := Set new.\x0a\x09stream \x0a\x09 nextPutAll: 'smalltalk.method({'; lf;\x0a\x09 nextPutAll: 'selector: \x22', aNode selector, '\x22,'; lf.\x0a\x09stream nextPutAll: 'source: ', self source asJavascript, ',';lf.\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09aNode arguments \x0a\x09 do: [:each | \x0a\x09\x09argVariables add: each.\x0a\x09\x09stream nextPutAll: each]\x0a\x09 separatedBy: [stream nextPutAll: ', '].\x0a\x09stream \x0a\x09 nextPutAll: '){var self=this;', self mylf.\x0a\x09str := stream.\x0a\x09stream := '' writeStream.\x0a\x09self switchTarget: nil.\x0a\x09self assert: aNode nodes size = 1.\x0a\x09self visit: aNode nodes first.\x0a\x09realVarNames ifNotEmpty: [ str nextPutAll: 'var ', (realVarNames asArray join: ','), ';', self mylf ].\x0a\x09earlyReturn ifTrue: [\x0a\x09 str nextPutAll: 'var $early={}; try{', self mylf].\x0a\x09str nextPutAll: stream contents.\x0a\x09stream := str.\x0a\x09(aNode nodes first nodes notEmpty and: [ |checker|\x0a\x09 checker := ReturnNodeChecker new.\x0a\x09 checker visit: aNode nodes first nodes last.\x0a\x09 checker wasReturnNode]) ifFalse: [ self switchTarget: '^'. self lazyAssignValue: 'self'. self switchTarget: nil ].\x0a\x09earlyReturn ifTrue: [\x0a\x09 stream nextPutAll: '} catch(e) {if(e===$early) return e[0]; throw e}'].\x0a\x09stream nextPutAll: '}'.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: messageSends asJavascript, ','; lf;\x0a \x09nextPutAll: 'args: ', argVariables asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09referencedClasses \x0a\x09\x09do: [:each | stream nextPutAll: each printString]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream nextPutAll: ']'.\x0a\x09stream nextPutAll: '})'.\x0a\x09self assert: mutables isEmpty",
- messageSends: ["asSelector", "selector", "new", "nextPutAll:", "lf", ",", "asJavascript", "source", "do:separatedBy:", "arguments", "add:", "mylf", "writeStream", "switchTarget:", "assert:", "=", "size", "nodes", "visit:", "first", "ifNotEmpty:", "join:", "asArray", "ifTrue:", "contents", "ifFalse:", "and:", "notEmpty", "last", "wasReturnNode", "lazyAssignValue:", "printString", "isEmpty"],
- referencedClasses: ["HashedCollection", "Set", "ReturnNodeChecker", "String"]
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitReturnNode_",
- smalltalk.method({
- selector: "visitReturnNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- smalltalk.send(self, "_assert_", [smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_size", []), "__eq", [(1)])]);
- ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (self['@earlyReturn']=true);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (self['@earlyReturn']=true);})]));
- smalltalk.send(self, "_visit_targetBeing_", [smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", []), ((($receiver = ((($receiver = self['@nestedBlocks']).klass === smalltalk.Number) ? $receiver >(0) : smalltalk.send($receiver, "__gt", [(0)]))).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "!";})() : (function(){return "^";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "!";}), (function(){return "^";})]))]);
- smalltalk.send(self, "_lazyAssignValue_", [""]);
- return self;},
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09self assert: aNode nodes size = 1.\x0a\x09nestedBlocks > 0 ifTrue: [\x0a\x09 earlyReturn := true].\x0a\x09self\x0a\x09\x09visit: aNode nodes first\x0a\x09\x09targetBeing: (nestedBlocks > 0 ifTrue: ['!'] ifFalse: ['^']).\x0a\x09self lazyAssignValue: ''",
- messageSends: ["assert:", "=", "size", "nodes", "ifTrue:", ">", "visit:targetBeing:", "first", "ifTrue:ifFalse:", "lazyAssignValue:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitSendNode_",
- smalltalk.method({
- selector: "visitSendNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var $early={};
- try{var receiver=nil;
- var superSend=nil;
- var rcv=nil;
- ((($receiver = smalltalk.send(self['@messageSends'], "_includes_", [smalltalk.send(aNode, "_selector", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self['@messageSends'], "_add_", [smalltalk.send(aNode, "_selector", [])]);})]));
- ((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw $early=[self]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=[self]})();})]));})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return ((($receiver = smalltalk.send(self, "_inlineLiteral_receiverNode_argumentNodes_", [smalltalk.send(aNode, "_selector", []), smalltalk.send(aNode, "_receiver", []), smalltalk.send(aNode, "_arguments", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw $early=[self]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=[self]})();})]));})]));
- (rcv=smalltalk.send(self, "_isolated_", [smalltalk.send(aNode, "_receiver", [])]));
- (superSend=smalltalk.send(smalltalk.send(self['@lazyVars'], "_at_ifAbsent_", [rcv, (function(){return nil;})]), "__eq", ["super"]));
- ((($receiver = superSend).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(self['@mutables'], "_remove_", [rcv]);return smalltalk.send(self['@lazyVars'], "_at_put_", [rcv, "self"]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(self['@mutables'], "_remove_", [rcv]);return smalltalk.send(self['@lazyVars'], "_at_put_", [rcv, "self"]);})]));
- ((($receiver = smalltalk.send(self, "_performOptimizations", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var inline=nil;
- (inline=smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), rcv, smalltalk.send(aNode, "_arguments", [])]));return (($receiver = inline) != nil && $receiver != undefined) ? (function(){var args=nil;
- (args=((($receiver = smalltalk.send(inline, "__eq", [true])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aNode, "_arguments", []);})() : (function(){return inline;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aNode, "_arguments", []);}), (function(){return inline;})])));smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), rcv, args, superSend]);})]);return (function(){throw $early=[self]})();})() : nil;})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var inline=nil;
- (inline=smalltalk.send(self, "_inline_receiver_argumentNodes_", [smalltalk.send(aNode, "_selector", []), rcv, smalltalk.send(aNode, "_arguments", [])]));return (($receiver = inline) != nil && $receiver != undefined) ? (function(){var args=nil;
- (args=((($receiver = smalltalk.send(inline, "__eq", [true])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aNode, "_arguments", []);})() : (function(){return inline;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aNode, "_arguments", []);}), (function(){return inline;})])));smalltalk.send(self, "_prvPutAndClose_", [(function(){return smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), rcv, args, superSend]);})]);return (function(){throw $early=[self]})();})() : nil;})]));
- smalltalk.send(self, "_send_to_arguments_superSend_", [smalltalk.send(aNode, "_selector", []), rcv, smalltalk.send(aNode, "_arguments", []), superSend]);
- return self;
- } catch(e) {if(e===$early)return e[0]; throw e}},
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a | receiver superSend rcv |\x0a (messageSends includes: aNode selector) ifFalse: [\x0a messageSends add: aNode selector].\x0a\x09\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09(self inlineLiteral: aNode selector receiverNode: aNode receiver argumentNodes: aNode arguments) ifTrue: [ ^self ].\x0a\x09\x09].\x0a\x0a\x09rcv := self isolated: aNode receiver.\x0a superSend := (lazyVars at: rcv ifAbsent: []) = 'super'.\x0a superSend ifTrue: [ mutables remove: rcv. lazyVars at: rcv put: 'self' ].\x0a\x0a\x09self performOptimizations \x0a\x09\x09ifTrue: [ | inline |\x0a\x09\x09\x09inline := self inline: aNode selector receiver: rcv argumentNodes: aNode arguments.\x0a\x09\x09\x09inline ifNotNil: [ | args |\x0a\x09\x09\x09\x09args := inline = true ifTrue: [ aNode arguments ] ifFalse: [ inline ].\x0a\x09\x09\x09\x09self prvPutAndClose: [ self send: aNode selector to: rcv arguments: args superSend: superSend ].\x0a\x09\x09\x09\x09^self ]].\x0a\x09self send: aNode selector to: rcv arguments: aNode arguments superSend: superSend",
- messageSends: ["ifFalse:", "includes:", "selector", "add:", "ifTrue:", "performOptimizations", "inlineLiteral:receiverNode:argumentNodes:", "receiver", "arguments", "isolated:", "=", "at:ifAbsent:", "remove:", "at:put:", "inline:receiver:argumentNodes:", "ifNotNil:", "ifTrue:ifFalse:", "prvPutAndClose:", "send:to:arguments:superSend:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitSequenceNode_",
- smalltalk.method({
- selector: "visitSequenceNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- ((($receiver = smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), smalltalk.send(aNode, "_temps", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_sequenceOfNodes_temps_", [smalltalk.send(aNode, "_nodes", []), smalltalk.send(aNode, "_temps", [])]);})]));
- return self;},
- args: ["aNode"],
- source: "visitSequenceNode: aNode\x0a\x09aNode nodes isEmpty ifFalse: [\x0a\x09\x09self sequenceOfNodes: aNode nodes temps: aNode temps ]\x0a",
- messageSends: ["ifFalse:", "isEmpty", "nodes", "sequenceOfNodes:temps:", "temps"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitValueNode_",
- smalltalk.method({
- selector: "visitValueNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(smalltalk.send(aNode, "_value", []), "_asJavascript", [])]);
- return self;},
- args: ["aNode"],
- source: "visitValueNode: aNode\x0a\x09self lazyAssignValue: aNode value asJavascript",
- messageSends: ["lazyAssignValue:", "asJavascript", "value"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitVariableNode_",
- smalltalk.method({
- selector: "visitVariableNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- var varName=nil;
- ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_currentClass", []), "_allInstanceVariableNames", []), "_includes_", [smalltalk.send(aNode, "_value", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);})() : (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send("self['@", "__comma", [smalltalk.send(aNode, "_value", [])]), "__comma", ["']"])]);}), (function(){(varName=smalltalk.send(self, "_safeVariableNameFor_", [smalltalk.send(aNode, "_value", [])]));return ((($receiver = smalltalk.send(smalltalk.send(self, "_knownVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})]));})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){smalltalk.send(self['@unknownVariables'], "_add_", [smalltalk.send(aNode, "_value", [])]);return ((($receiver = smalltalk.send(aNode, "_assigned", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(typeof ", "__comma", [varName]), "__comma", [" == 'undefined' ? nil : "]), "__comma", [varName]), "__comma", [")"])]);})]));}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(aNode, "_value", []), "__eq", ["thisContext"])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignExpression_", ["(smalltalk.getThisContext())"]);}), (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_pseudoVariables", []), "_includes_", [varName])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);})() : (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_lazyAssignValue_", [varName]);}), (function(){return smalltalk.send(self, "_lazyAssignExpression_", [varName]);})]));})]));})]));})]));
- return self;},
- args: ["aNode"],
- source: "visitVariableNode: aNode\x0a\x09| varName |\x0a\x09(self currentClass allInstanceVariableNames includes: aNode value) \x0a\x09\x09ifTrue: [self lazyAssignExpression: 'self[''@', aNode value, ''']']\x0a\x09\x09ifFalse: [\x0a \x09varName := self safeVariableNameFor: aNode value.\x0a\x09\x09\x09(self knownVariables includes: varName) \x0a \x09\x09ifFalse: [\x0a \x09unknownVariables add: aNode value.\x0a \x09aNode assigned \x0a \x09\x09ifTrue: [self lazyAssignExpression: varName]\x0a \x09\x09ifFalse: [self lazyAssignExpression: '(typeof ', varName, ' == ''undefined'' ? nil : ', varName, ')']]\x0a \x09\x09ifTrue: [\x0a \x09aNode value = 'thisContext'\x0a \x09\x09ifTrue: [self lazyAssignExpression: '(smalltalk.getThisContext())']\x0a \x09\x09\x09\x09ifFalse: [(self pseudoVariables includes: varName)\x0a\x09\x09\x09\x09\x09\x09\x09ifTrue: [ self lazyAssignValue: varName ]\x0a\x09\x09\x09\x09\x09\x09\x09ifFalse: [ self lazyAssignExpression: varName]]]]",
- messageSends: ["ifTrue:ifFalse:", "includes:", "allInstanceVariableNames", "currentClass", "value", "lazyAssignExpression:", ",", "safeVariableNameFor:", "ifFalse:ifTrue:", "knownVariables", "add:", "assigned", "=", "pseudoVariables", "lazyAssignValue:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.addMethod(
- "_visitVerbatimNode_",
- smalltalk.method({
- selector: "visitVerbatimNode:",
- category: 'visiting',
- fn: function (aNode){
- var self=this;
- smalltalk.send(self, "_lazyAssignValue_", [smalltalk.send(aNode, "_value", [])]);
- return self;},
- args: ["aNode"],
- source: "visitVerbatimNode: aNode\x0a\x09self lazyAssignValue: aNode value",
- messageSends: ["lazyAssignValue:", "value"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator);
- smalltalk.ImpCodeGenerator.klass.iVarNames = ['performOptimizations'];
- smalltalk.addMethod(
- "_performOptimizations",
- smalltalk.method({
- selector: "performOptimizations",
- category: 'accessing',
- fn: function () {
- var self=this;
- return (($receiver = self['@performOptimizations']) == nil || $receiver == undefined) ? (function(){return true;})() : $receiver;
- return self;},
- args: [],
- source: "performOptimizations\x0a\x09^performOptimizations ifNil: [true]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator.klass);
- smalltalk.addMethod(
- "_performOptimizations_",
- smalltalk.method({
- selector: "performOptimizations:",
- category: 'accessing',
- fn: function (aBoolean) {
- var self=this;
- (self['@performOptimizations']=aBoolean);
- return self;},
- args: ["aBoolean"],
- source: "performOptimizations: aBoolean\x0a\x09performOptimizations := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ImpCodeGenerator.klass);
- smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler');
- smalltalk.IRASTTranslator.comment="I am the AST (abstract syntax tree) visitor responsible for building the intermediate representation graph.\x0aI rely on a builder object, instance of IRBuilder."
- smalltalk.addClass('ReturnNodeChecker', smalltalk.NodeVisitor, ['wasReturnNode'], 'Compiler');
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- category: 'initializing',
- fn: function () {
- var self=this;
- (self['@wasReturnNode']=false);
- return self;},
- args: [],
- source: "initialize\x0a\x09wasReturnNode := false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ReturnNodeChecker);
- smalltalk.addMethod(
- "_visitReturnNode_",
- smalltalk.method({
- selector: "visitReturnNode:",
- category: 'visiting',
- fn: function (aNode) {
- var self=this;
- (self['@wasReturnNode']=true);
- return self;},
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09wasReturnNode := true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ReturnNodeChecker);
- smalltalk.addMethod(
- "_wasReturnNode",
- smalltalk.method({
- selector: "wasReturnNode",
- category: 'accessing',
- fn: function () {
- var self=this;
- return self['@wasReturnNode'];
- return self;},
- args: [],
- source: "wasReturnNode\x0a\x09^wasReturnNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ReturnNodeChecker);
- smalltalk.addClass('SemanticAnalyzer', smalltalk.NodeVisitor, ['currentScope', 'theClass', 'classReferences', 'messageSends', 'superSends'], 'Compiler');
- smalltalk.SemanticAnalyzer.comment="I semantically analyze the abstract syntax tree and annotate it with informations such as non local returns and variable scopes."
- smalltalk.addClass('PackageLoader', smalltalk.Object, [], 'Compiler');
- smalltalk.addClass('ScopeVar', smalltalk.Object, ['scope', 'name'], 'Compiler');
- smalltalk.ScopeVar.comment="I am an entry in a LexicalScope that gets associated with variable nodes of the same name. \x0aThere are 4 different subclasses of vars: temp vars, local vars, args, and unknown/global vars."
- smalltalk.addClass('AliasVar', smalltalk.ScopeVar, ['node'], 'Compiler');
- smalltalk.AliasVar.comment="I am an internally defined variable by the compiler"
- smalltalk.addClass('ArgVar', smalltalk.ScopeVar, [], 'Compiler');
- smalltalk.ArgVar.comment="I am an argument of a method or block."
- smalltalk.addClass('ClassRefVar', smalltalk.ScopeVar, [], 'Compiler');
- smalltalk.ClassRefVar.comment="I am an class reference variable"
- smalltalk.addClass('InstanceVar', smalltalk.ScopeVar, [], 'Compiler');
- smalltalk.InstanceVar.comment="I am an instance variable of a method or block."
- smalltalk.addClass('PseudoVar', smalltalk.ScopeVar, [], 'Compiler');
- smalltalk.PseudoVar.comment="I am an pseudo variable.\x0a\x0aThe five Smalltalk pseudo variables are: 'self', 'super', 'nil', 'true' and 'false'"
- smalltalk.addClass('TempVar', smalltalk.ScopeVar, [], 'Compiler');
- smalltalk.TempVar.comment="I am an temporary variable of a method or block."
- smalltalk.addClass('UnknownVar', smalltalk.ScopeVar, [], 'Compiler');
- smalltalk.UnknownVar.comment="I am an unknown variable. Amber uses unknown variables as JavaScript globals"
- smalltalk.addMethod(
- "_appendToInstruction_",
- smalltalk.method({
- selector: "appendToInstruction:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(anIRInstruction)._appendBlock_(self);
- return self}, self, "appendToInstruction:", [anIRInstruction], smalltalk.BlockClosure)},
- args: ["anIRInstruction"],
- source: "appendToInstruction: anIRInstruction\x0a anIRInstruction appendBlock: self",
- messageSends: ["appendBlock:"],
- referencedClasses: []
- }),
- smalltalk.BlockClosure);
- smalltalk.addMethod(
- "_nextChunk",
- smalltalk.method({
- selector: "nextChunk",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$5,$6,$4,$2;
- var $early={};
- try {
- $ctx1.locals.char=nil;
- $ctx1.locals.result=nil;
- $ctx1.locals.chunk=nil;
- $ctx1.locals.result=_st("")._writeStream();
- $1=(function(){
- return smalltalk.withContext(function($ctx2) {
$ctx1.locals.char=_st(self["@stream"])._next();
- $ctx1.locals.char;
- return _st($ctx1.locals.char)._notNil();
- })});
- $2=(function(){
- return smalltalk.withContext(function($ctx2) {
$3=_st($ctx1.locals.char).__eq("!");
- $4=(function(){
- return smalltalk.withContext(function($ctx3) {
$5=_st(_st(self["@stream"])._peek()).__eq("!");
- if(smalltalk.assert($5)){
- return _st(self["@stream"])._next();
- } else {
- $6=_st(_st($ctx1.locals.result)._contents())._trimBoth();
- throw $early=[$6];
- };
- })});
- _st($3)._ifTrue_($4);
- return _st($ctx1.locals.result)._nextPut_($ctx1.locals.char);
- })});
- _st($1)._whileTrue_($2);
- return nil;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- }, self, "nextChunk", [], smalltalk.ChunkParser)},
- args: [],
- source: "nextChunk\x0a\x09\x22The chunk format (Smalltalk Interchange Format or Fileout format)\x0a\x09is a trivial format but can be a bit tricky to understand:\x0a\x09\x09- Uses the exclamation mark as delimiter of chunks.\x0a\x09\x09- Inside a chunk a normal exclamation mark must be doubled.\x0a\x09\x09- A non empty chunk must be a valid Smalltalk expression.\x0a\x09\x09- A chunk on top level with a preceding empty chunk is an instruction chunk:\x0a\x09\x09\x09- The object created by the expression then takes over reading chunks.\x0a\x0a\x09This metod returns next chunk as a String (trimmed), empty String (all whitespace) or nil.\x22\x0a\x0a\x09| char result chunk |\x0a\x09result := '' writeStream.\x0a [char := stream next.\x0a char notNil] whileTrue: [\x0a char = '!' ifTrue: [\x0a stream peek = '!'\x0a ifTrue: [stream next \x22skipping the escape double\x22]\x0a ifFalse: [^result contents trimBoth \x22chunk end marker found\x22]].\x0a result nextPut: char].\x0a\x09^nil \x22a chunk needs to end with !\x22",
- messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next", "trimBoth", "contents", "=", "peek", "nextPut:", "notNil"],
- referencedClasses: []
- }),
- smalltalk.ChunkParser);
- smalltalk.addMethod(
- "_stream_",
- smalltalk.method({
- selector: "stream:",
- category: '*Compiler',
- fn: function (aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@stream"]=aStream;
- return self}, self, "stream:", [aStream], smalltalk.ChunkParser)},
- args: ["aStream"],
- source: "stream: aStream\x0a\x09stream := aStream",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ChunkParser);
- smalltalk.addMethod(
- "_on_",
- smalltalk.method({
- selector: "on:",
- category: '*Compiler',
- fn: function (aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._new())._stream_(aStream);
- return $1;
- }, self, "on:", [aStream], smalltalk.ChunkParser.klass)},
- args: ["aStream"],
- source: "on: aStream\x0a\x09^self new stream: aStream",
- messageSends: ["stream:", "new"],
- referencedClasses: []
- }),
- smalltalk.ChunkParser.klass);
- smalltalk.addMethod(
- "_asVariableName",
- smalltalk.method({
- selector: "asVariableName",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
- if(smalltalk.assert($2)){
- $1=_st(self).__comma("_");
- } else {
- $1=self;
- };
- return $1;
- }, self, "asVariableName", [], smalltalk.String)},
- args: [],
- source: "asVariableName\x0a\x09^ (Smalltalk current reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
- messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
- referencedClasses: ["Smalltalk"]
- }),
- smalltalk.String);
- smalltalk.addMethod(
- "_codeGeneratorClass",
- smalltalk.method({
- selector: "codeGeneratorClass",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@codeGeneratorClass"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=(smalltalk.InliningCodeGenerator || InliningCodeGenerator);
- } else {
- $1=$2;
- };
- return $1;
- }, self, "codeGeneratorClass", [], smalltalk.Compiler)},
- args: [],
- source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [InliningCodeGenerator]",
- messageSends: ["ifNil:"],
- referencedClasses: ["InliningCodeGenerator"]
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_codeGeneratorClass_",
- smalltalk.method({
- selector: "codeGeneratorClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@codeGeneratorClass"]=aClass;
- return self}, self, "codeGeneratorClass:", [aClass], smalltalk.Compiler)},
- args: ["aClass"],
- source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_compile_",
- smalltalk.method({
- selector: "compile:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._compileNode_(_st(self)._parse_(aString));
- return $1;
- }, self, "compile:", [aString], smalltalk.Compiler)},
- args: ["aString"],
- source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
- messageSends: ["compileNode:", "parse:"],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_compile_forClass_",
- smalltalk.method({
- selector: "compile:forClass:",
- category: '*Compiler',
- fn: function (aString,aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(self)._currentClass_(aClass);
- _st(self)._source_(aString);
- $1=_st(self)._compile_(aString);
- return $1;
- }, self, "compile:forClass:", [aString,aClass], smalltalk.Compiler)},
- args: ["aString", "aClass"],
- source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
- messageSends: ["currentClass:", "source:", "compile:"],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_compileExpression_",
- smalltalk.method({
- selector: "compileExpression:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(self)._currentClass_((smalltalk.DoIt || DoIt));
- _st(self)._source_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
- $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
- return $1;
- }, self, "compileExpression:", [aString], smalltalk.Compiler)},
- args: ["aString"],
- source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
- messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
- referencedClasses: ["DoIt"]
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_compileNode_",
- smalltalk.method({
- selector: "compileNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3;
- $ctx1.locals.generator=nil;
- $ctx1.locals.result=nil;
- $ctx1.locals.generator=_st(_st(self)._codeGeneratorClass())._new();
- $1=$ctx1.locals.generator;
- _st($1)._source_(_st(self)._source());
- $2=_st($1)._currentClass_(_st(self)._currentClass());
- $ctx1.locals.result=_st($ctx1.locals.generator)._compileNode_(aNode);
- _st(self)._unknownVariables_([]);
- $3=$ctx1.locals.result;
- return $3;
- }, self, "compileNode:", [aNode], smalltalk.Compiler)},
- args: ["aNode"],
- source: "compileNode: aNode\x0a\x09| generator result |\x0a\x09generator := self codeGeneratorClass new.\x0a\x09generator\x0a\x09\x09source: self source;\x0a\x09\x09currentClass: self currentClass.\x0a\x09result := generator compileNode: aNode.\x0a\x09self unknownVariables: #().\x0a\x09^result",
- messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_currentClass",
- smalltalk.method({
- selector: "currentClass",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@currentClass"];
- return $1;
- }, self, "currentClass", [], smalltalk.Compiler)},
- args: [],
- source: "currentClass\x0a\x09^currentClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_currentClass_",
- smalltalk.method({
- selector: "currentClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@currentClass"]=aClass;
- return self}, self, "currentClass:", [aClass], smalltalk.Compiler)},
- args: ["aClass"],
- source: "currentClass: aClass\x0a\x09currentClass := aClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_eval_",
- smalltalk.method({
- selector: "eval:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return eval(aString);
- return self}, self, "eval:", [aString], smalltalk.Compiler)},
- args: ["aString"],
- source: "eval: aString\x0a\x09<return eval(aString)>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_evaluateExpression_",
- smalltalk.method({
- selector: "evaluateExpression:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.result=nil;
- _st((smalltalk.DoIt || DoIt))._addCompiledMethod_(_st(self)._eval_(_st(self)._compileExpression_(aString)));
- $ctx1.locals.result=_st(_st((smalltalk.DoIt || DoIt))._new())._doIt();
- _st((smalltalk.DoIt || DoIt))._removeCompiledMethod_(_st(_st((smalltalk.DoIt || DoIt))._methodDictionary())._at_("doIt"));
- $1=$ctx1.locals.result;
- return $1;
- }, self, "evaluateExpression:", [aString], smalltalk.Compiler)},
- args: ["aString"],
- source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09| result |\x0a\x09DoIt addCompiledMethod: (self eval: (self compileExpression: aString)).\x0a\x09result := DoIt new doIt.\x0a\x09DoIt removeCompiledMethod: (DoIt methodDictionary at: 'doIt').\x0a\x09^result",
- messageSends: ["addCompiledMethod:", "eval:", "compileExpression:", "doIt", "new", "removeCompiledMethod:", "at:", "methodDictionary"],
- referencedClasses: ["DoIt"]
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_install_forClass_category_",
- smalltalk.method({
- selector: "install:forClass:category:",
- category: '*Compiler',
- fn: function (aString,aBehavior,anotherString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.compiled=nil;
- $ctx1.locals.compiled=_st(self)._eval_(_st(self)._compile_forClass_(aString,aBehavior));
- _st($ctx1.locals.compiled)._category_(anotherString);
- _st(aBehavior)._addCompiledMethod_($ctx1.locals.compiled);
- _st(self)._setupClass_(aBehavior);
- $1=$ctx1.locals.compiled;
- return $1;
- }, self, "install:forClass:category:", [aString,aBehavior,anotherString], smalltalk.Compiler)},
- args: ["aString", "aBehavior", "anotherString"],
- source: "install: aString forClass: aBehavior category: anotherString\x0a\x09| compiled |\x0a\x09compiled := self eval: (self compile: aString forClass: aBehavior).\x0a\x09compiled category: anotherString.\x0a\x09aBehavior addCompiledMethod: compiled.\x0a self setupClass: aBehavior.\x0a\x09^compiled",
- messageSends: ["eval:", "compile:forClass:", "category:", "addCompiledMethod:", "setupClass:"],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_parse_",
- smalltalk.method({
- selector: "parse:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._parse_(aString);
- return $1;
- }, self, "parse:", [aString], smalltalk.Compiler)},
- args: ["aString"],
- source: "parse: aString\x0a ^Smalltalk current parse: aString",
- messageSends: ["parse:", "current"],
- referencedClasses: ["Smalltalk"]
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_parseExpression_",
- smalltalk.method({
- selector: "parseExpression:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._parse_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
- return $1;
- }, self, "parseExpression:", [aString], smalltalk.Compiler)},
- args: ["aString"],
- source: "parseExpression: aString\x0a ^self parse: 'doIt ^[', aString, '] value'",
- messageSends: ["parse:", ","],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_recompile_",
- smalltalk.method({
- selector: "recompile:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(_st(aClass)._methodDictionary())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
_st(console)._log_(_st(_st(_st(aClass)._name()).__comma(" >> ")).__comma(_st(each)._selector()));
- return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
- })}));
- _st(self)._setupClass_(aClass);
- $1=_st(aClass)._isMetaclass();
- if(! smalltalk.assert($1)){
- _st(self)._recompile_(_st(aClass)._class());
- };
- return self}, self, "recompile:", [aClass], smalltalk.Compiler)},
- args: ["aClass"],
- source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each |\x0a\x09\x09console log: aClass name, ' >> ', each selector.\x0a\x09\x09self install: each source forClass: aClass category: each category].\x0a\x09self setupClass: aClass.\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
- messageSends: ["do:", "log:", ",", "selector", "name", "install:forClass:category:", "source", "category", "methodDictionary", "setupClass:", "ifFalse:", "recompile:", "class", "isMetaclass"],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_recompileAll",
- smalltalk.method({
- selector: "recompileAll",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
$1=(smalltalk.Transcript || Transcript);
- _st($1)._show_(each);
- $2=_st($1)._cr();
- $2;
- return _st((function(){
- return smalltalk.withContext(function($ctx3) {
return _st(self)._recompile_(each);
- })}))._valueWithTimeout_((100));
- })}));
- return self}, self, "recompileAll", [], smalltalk.Compiler)},
- args: [],
- source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
- messageSends: ["do:", "show:", "cr", "valueWithTimeout:", "recompile:", "classes", "current"],
- referencedClasses: ["Transcript", "Smalltalk"]
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_setupClass_",
- smalltalk.method({
- selector: "setupClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
smalltalk.init(aClass);
- return self}, self, "setupClass:", [aClass], smalltalk.Compiler)},
- args: ["aClass"],
- source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass)>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_source",
- smalltalk.method({
- selector: "source",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@source"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1="";
- } else {
- $1=$2;
- };
- return $1;
- }, self, "source", [], smalltalk.Compiler)},
- args: [],
- source: "source\x0a\x09^source ifNil: ['']",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_source_",
- smalltalk.method({
- selector: "source:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@source"]=aString;
- return self}, self, "source:", [aString], smalltalk.Compiler)},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_unknownVariables",
- smalltalk.method({
- selector: "unknownVariables",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@unknownVariables"];
- return $1;
- }, self, "unknownVariables", [], smalltalk.Compiler)},
- args: [],
- source: "unknownVariables\x0a\x09^unknownVariables",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_unknownVariables_",
- smalltalk.method({
- selector: "unknownVariables:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@unknownVariables"]=aCollection;
- return self}, self, "unknownVariables:", [aCollection], smalltalk.Compiler)},
- args: ["aCollection"],
- source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Compiler);
- smalltalk.addMethod(
- "_recompile_",
- smalltalk.method({
- selector: "recompile:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._new())._recompile_(aClass);
- return self}, self, "recompile:", [aClass], smalltalk.Compiler.klass)},
- args: ["aClass"],
- source: "recompile: aClass\x0a\x09self new recompile: aClass",
- messageSends: ["recompile:", "new"],
- referencedClasses: []
- }),
- smalltalk.Compiler.klass);
- smalltalk.addMethod(
- "_recompileAll",
- smalltalk.method({
- selector: "recompileAll",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._recompile_(each);
- })}));
- return self}, self, "recompileAll", [], smalltalk.Compiler.klass)},
- args: [],
- source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
- messageSends: ["do:", "recompile:", "classes", "current"],
- referencedClasses: ["Smalltalk"]
- }),
- smalltalk.Compiler.klass);
- smalltalk.addMethod(
- "_messageText",
- smalltalk.method({
- selector: "messageText",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(" Invalid assignment to variable: ").__comma(_st(self)._variableName());
- return $1;
- }, self, "messageText", [], smalltalk.InvalidAssignmentError)},
- args: [],
- source: "messageText\x0a\x09^ ' Invalid assignment to variable: ', self variableName",
- messageSends: [",", "variableName"],
- referencedClasses: []
- }),
- smalltalk.InvalidAssignmentError);
- smalltalk.addMethod(
- "_variableName",
- smalltalk.method({
- selector: "variableName",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@variableName"];
- return $1;
- }, self, "variableName", [], smalltalk.InvalidAssignmentError)},
- args: [],
- source: "variableName\x0a\x09^ variableName",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.InvalidAssignmentError);
- smalltalk.addMethod(
- "_variableName_",
- smalltalk.method({
- selector: "variableName:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@variableName"]=aString;
- return self}, self, "variableName:", [aString], smalltalk.InvalidAssignmentError)},
- args: ["aString"],
- source: "variableName: aString\x0a\x09variableName := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.InvalidAssignmentError);
- smalltalk.addMethod(
- "_messageText",
- smalltalk.method({
- selector: "messageText",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st("Variable shadowing error: ").__comma(_st(self)._variableName())).__comma(" is already defined");
- return $1;
- }, self, "messageText", [], smalltalk.ShadowingVariableError)},
- args: [],
- source: "messageText\x0a\x09^ 'Variable shadowing error: ', self variableName, ' is already defined'",
- messageSends: [",", "variableName"],
- referencedClasses: []
- }),
- smalltalk.ShadowingVariableError);
- smalltalk.addMethod(
- "_variableName",
- smalltalk.method({
- selector: "variableName",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@variableName"];
- return $1;
- }, self, "variableName", [], smalltalk.ShadowingVariableError)},
- args: [],
- source: "variableName\x0a\x09^ variableName",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ShadowingVariableError);
- smalltalk.addMethod(
- "_variableName_",
- smalltalk.method({
- selector: "variableName:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@variableName"]=aString;
- return self}, self, "variableName:", [aString], smalltalk.ShadowingVariableError)},
- args: ["aString"],
- source: "variableName: aString\x0a\x09variableName := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ShadowingVariableError);
- smalltalk.addMethod(
- "_variableName",
- smalltalk.method({
- selector: "variableName",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@variableName"];
- return $1;
- }, self, "variableName", [], smalltalk.UnknownVariableError)},
- args: [],
- source: "variableName\x0a\x09^ variableName",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.UnknownVariableError);
- smalltalk.addMethod(
- "_variableName_",
- smalltalk.method({
- selector: "variableName:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@variableName"]=aString;
- return self}, self, "variableName:", [aString], smalltalk.UnknownVariableError)},
- args: ["aString"],
- source: "variableName: aString\x0a\x09variableName := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.UnknownVariableError);
- smalltalk.addMethod(
- "_classNameFor_",
- smalltalk.method({
- selector: "classNameFor:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$5,$4,$1;
- $2=_st(aClass)._isMetaclass();
- $3=(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
- })});
- $4=(function(){
- return smalltalk.withContext(function($ctx2) {
$5=_st(aClass)._isNil();
- if(smalltalk.assert($5)){
- return "nil";
- } else {
- return _st(aClass)._name();
- };
- })});
- $1=_st($2)._ifTrue_ifFalse_($3,$4);
- return $1;
- }, self, "classNameFor:", [aClass], smalltalk.Exporter)},
- args: ["aClass"],
- source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
- messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
- referencedClasses: []
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportAll",
- smalltalk.method({
- selector: "exportAll",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.String || String))._streamContents_((function(stream){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages())._do_((function(pkg){
- return smalltalk.withContext(function($ctx3) {
return _st(stream)._nextPutAll_(_st(self)._exportPackage_(_st(pkg)._name()));
- })}));
- })}));
- return $1;
- }, self, "exportAll", [], smalltalk.Exporter)},
- args: [],
- source: "exportAll\x0a \x22Export all packages in the system.\x22\x0a\x0a ^String streamContents: [:stream |\x0a \x09Smalltalk current packages do: [:pkg |\x0a\x09\x09stream nextPutAll: (self exportPackage: pkg name)]]",
- messageSends: ["streamContents:", "do:", "nextPutAll:", "exportPackage:", "name", "packages", "current"],
- referencedClasses: ["Smalltalk", "String"]
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportClass_",
- smalltalk.method({
- selector: "exportClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.String || String))._streamContents_((function(stream){
- return smalltalk.withContext(function($ctx2) {
_st(self)._exportDefinitionOf_on_(aClass,stream);
- _st(self)._exportMethodsOf_on_(aClass,stream);
- _st(self)._exportMetaDefinitionOf_on_(aClass,stream);
- return _st(self)._exportMethodsOf_on_(_st(aClass)._class(),stream);
- })}));
- return $1;
- }, self, "exportClass:", [aClass], smalltalk.Exporter)},
- args: ["aClass"],
- source: "exportClass: aClass\x0a\x09\x22Export a single class. Subclasses override these methods.\x22\x0a\x0a\x09^String streamContents: [:stream |\x0a\x09\x09self exportDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass on: stream.\x0a\x09\x09self exportMetaDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass class on: stream]",
- messageSends: ["streamContents:", "exportDefinitionOf:on:", "exportMethodsOf:on:", "exportMetaDefinitionOf:on:", "class"],
- referencedClasses: ["String"]
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportDefinitionOf_on_",
- smalltalk.method({
- selector: "exportDefinitionOf:on:",
- category: '*Compiler',
- fn: function (aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5,$6,$7;
- $1=aStream;
- _st($1)._nextPutAll_("smalltalk.addClass(");
- _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
- _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
- $2=_st($1)._nextPutAll_(", [");
- _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(", ");
- })}));
- $3=aStream;
- _st($3)._nextPutAll_("], '");
- _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
- $4=_st($3)._nextPutAll_(");");
- $5=_st(_st(aClass)._comment())._notEmpty();
- if(smalltalk.assert($5)){
- $6=aStream;
- _st($6)._lf();
- _st($6)._nextPutAll_("smalltalk.");
- _st($6)._nextPutAll_(_st(self)._classNameFor_(aClass));
- _st($6)._nextPutAll_(".comment=");
- $7=_st($6)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
- $7;
- };
- _st(aStream)._lf();
- return self}, self, "exportDefinitionOf:on:", [aClass,aStream], smalltalk.Exporter)},
- args: ["aClass", "aStream"],
- source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09 aStream \x0a\x09 \x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.';\x0a\x09\x09nextPutAll: (self classNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript].\x0a\x09aStream lf",
- messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "lf", "asJavascript", "comment", "notEmpty"],
- referencedClasses: []
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportMetaDefinitionOf_on_",
- smalltalk.method({
- selector: "exportMetaDefinitionOf:on:",
- category: '*Compiler',
- fn: function (aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3;
- $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
- if(! smalltalk.assert($1)){
- $2=aStream;
- _st($2)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._class())));
- $3=_st($2)._nextPutAll_(".iVarNames = [");
- $3;
- _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(",");
- })}));
- _st(aStream)._nextPutAll_(_st("];").__comma(_st((smalltalk.String || String))._lf()));
- };
- return self}, self, "exportMetaDefinitionOf:on:", [aClass,aStream], smalltalk.Exporter)},
- args: ["aClass", "aStream"],
- source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09 aStream \x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09 aClass class instanceVariableNames\x0a\x09\x09do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09\x09separatedBy: [aStream nextPutAll: ','].\x0a\x09 aStream nextPutAll: '];', String lf]",
- messageSends: ["ifFalse:", "nextPutAll:", ",", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"],
- referencedClasses: ["String"]
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportMethod_of_on_",
- smalltalk.method({
- selector: "exportMethod:of:on:",
- category: '*Compiler',
- fn: function (aMethod,aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $1=aStream;
- _st($1)._nextPutAll_("smalltalk.addMethod(");
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
- _st($1)._lf();
- _st($1)._nextPutAll_("smalltalk.method({");
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("category: '").__comma(_st(aMethod)._category())).__comma("',"));
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("fn: ").__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(aMethod)._arguments())._asJavascript())).__comma(","));
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("messageSends: ").__comma(_st(_st(aMethod)._messageSends())._asJavascript())).__comma(","));
- _st($1)._lf();
- $2=_st($1)._nextPutAll_(_st("referencedClasses: ").__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
- $3=aStream;
- _st($3)._lf();
- _st($3)._nextPutAll_("}),");
- _st($3)._lf();
- _st($3)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass)));
- _st($3)._nextPutAll_(");");
- _st($3)._lf();
- $4=_st($3)._lf();
- return self}, self, "exportMethod:of:on:", [aMethod,aClass,aStream], smalltalk.Exporter)},
- args: ["aMethod", "aClass", "aStream"],
- source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'category: ''', aMethod category, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
- messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"],
- referencedClasses: []
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportMethodsOf_on_",
- smalltalk.method({
- selector: "exportMethodsOf:on:",
- category: '*Compiler',
- fn: function (aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$2;
- $1=_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
- })}));
- $2=(function(each){
- return smalltalk.withContext(function($ctx2) {
$3=_st(_st(each)._category())._match_("^\x5c*");
- if(! smalltalk.assert($3)){
- return _st(self)._exportMethod_of_on_(each,aClass,aStream);
- };
- })});
- _st($1)._do_($2);
- _st(aStream)._lf();
- return self}, self, "exportMethodsOf:on:", [aClass,aStream], smalltalk.Exporter)},
- args: ["aClass", "aStream"],
- source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09(each category match: '^\x5c*') ifFalse: [\x0a\x09\x09\x09self exportMethod: each of: aClass on: aStream]].\x0a\x09aStream lf",
- messageSends: ["do:", "ifFalse:", "exportMethod:of:on:", "match:", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "lf"],
- referencedClasses: []
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportPackage_",
- smalltalk.method({
- selector: "exportPackage:",
- category: '*Compiler',
- fn: function (packageName){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.package=nil;
- $1=_st((smalltalk.String || String))._streamContents_((function(stream){
- return smalltalk.withContext(function($ctx2) {
$ctx1.locals.package_=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_(packageName);
- $ctx1.locals.package_;
- _st(self)._exportPackageDefinitionOf_on_($ctx1.locals.package_,stream);
- _st(_st(_st($ctx1.locals.package_)._sortedClasses())._asSet())._do_((function(each){
- return smalltalk.withContext(function($ctx3) {
return _st(stream)._nextPutAll_(_st(self)._exportClass_(each));
- })}));
- return _st(self)._exportPackageExtensionsOf_on_($ctx1.locals.package_,stream);
- })}));
- return $1;
- }, self, "exportPackage:", [packageName], smalltalk.Exporter)},
- args: ["packageName"],
- source: "exportPackage: packageName\x0a\x09\x22Export a given package by name.\x22\x0a\x0a\x09| package |\x0a\x09^String streamContents: [:stream |\x0a package := Smalltalk current packageAt: packageName.\x0a self exportPackageDefinitionOf: package on: stream.\x0a\x0a\x09\x09\x22Export classes in dependency order.\x0a\x09\x09Update (issue #171): Remove duplicates for export\x22\x0a\x09 \x09package sortedClasses asSet do: [:each |\x0a stream nextPutAll: (self exportClass: each)].\x0a\x09\x09self exportPackageExtensionsOf: package on: stream]",
- messageSends: ["streamContents:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "nextPutAll:", "exportClass:", "asSet", "sortedClasses", "exportPackageExtensionsOf:on:"],
- referencedClasses: ["Smalltalk", "String"]
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportPackageDefinitionOf_on_",
- smalltalk.method({
- selector: "exportPackageDefinitionOf:on:",
- category: '*Compiler',
- fn: function (package_,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=aStream;
- _st($1)._nextPutAll_("smalltalk.addPackage(");
- $2=_st($1)._nextPutAll_(_st(_st(_st(_st("'").__comma(_st(package_)._name())).__comma("', ")).__comma(_st(package_)._propertiesAsJSON())).__comma(");"));
- _st(aStream)._lf();
- return self}, self, "exportPackageDefinitionOf:on:", [package_,aStream], smalltalk.Exporter)},
- args: ["package", "aStream"],
- source: "exportPackageDefinitionOf: package on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addPackage(';\x0a\x09 nextPutAll: '''', package name, ''', ', package propertiesAsJSON , ');'.\x0a\x09aStream lf",
- messageSends: ["nextPutAll:", ",", "propertiesAsJSON", "name", "lf"],
- referencedClasses: []
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_exportPackageExtensionsOf_on_",
- smalltalk.method({
- selector: "exportPackageExtensionsOf:on:",
- category: '*Compiler',
- fn: function (package_,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$5,$7,$6,$4,$2;
- $ctx1.locals.name=nil;
- $ctx1.locals.name=_st(package_)._name();
- $1=_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes());
- $2=(function(each){
- return smalltalk.withContext(function($ctx2) {
$3=[each,_st(each)._class()];
- $4=(function(aClass){
- return smalltalk.withContext(function($ctx3) {
$5=_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
- return smalltalk.withContext(function($ctx4) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
- })}));
- $6=(function(method){
- return smalltalk.withContext(function($ctx4) {
$7=_st(_st(method)._category())._match_(_st("^\x5c*").__comma($ctx1.locals.name));
- if(smalltalk.assert($7)){
- return _st(self)._exportMethod_of_on_(method,aClass,aStream);
- };
- })});
- return _st($5)._do_($6);
- })});
- return _st($3)._do_($4);
- })});
- _st($1)._do_($2);
- return self}, self, "exportPackageExtensionsOf:on:", [package_,aStream], smalltalk.Exporter)},
- args: ["package", "aStream"],
- source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22Issue #143: sort classes and methods alphabetically\x22\x0a\x0a\x09| name |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass | \x0a\x09\x09\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |\x0a\x09\x09\x09\x09(method category match: '^\x5c*', name) ifTrue: [\x0a\x09\x09\x09\x09\x09self exportMethod: method of: aClass on: aStream ]]]]",
- messageSends: ["name", "do:", "ifTrue:", "exportMethod:of:on:", "match:", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"],
- referencedClasses: ["Smalltalk", "Package"]
- }),
- smalltalk.Exporter);
- smalltalk.addMethod(
- "_chunkEscape_",
- smalltalk.method({
- selector: "chunkEscape:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
- return $1;
- }, self, "chunkEscape:", [aString], smalltalk.ChunkExporter)},
- args: ["aString"],
- source: "chunkEscape: aString\x0a\x09\x22Replace all occurrences of ! with !! and trim at both ends.\x22\x0a\x0a\x09^(aString replace: '!' with: '!!') trimBoth",
- messageSends: ["trimBoth", "replace:with:"],
- referencedClasses: []
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_classNameFor_",
- smalltalk.method({
- selector: "classNameFor:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$5,$4,$1;
- $2=_st(aClass)._isMetaclass();
- $3=(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
- })});
- $4=(function(){
- return smalltalk.withContext(function($ctx2) {
$5=_st(aClass)._isNil();
- if(smalltalk.assert($5)){
- return "nil";
- } else {
- return _st(aClass)._name();
- };
- })});
- $1=_st($2)._ifTrue_ifFalse_($3,$4);
- return $1;
- }, self, "classNameFor:", [aClass], smalltalk.ChunkExporter)},
- args: ["aClass"],
- source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, ' class']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
- messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
- referencedClasses: []
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportDefinitionOf_on_",
- smalltalk.method({
- selector: "exportDefinitionOf:on:",
- category: '*Compiler',
- fn: function (aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5,$6,$7;
- $1=aStream;
- _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
- _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
- _st($1)._lf();
- $2=_st($1)._nextPutAll_("\x09instanceVariableNames: '");
- _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(" ");
- })}));
- $3=aStream;
- _st($3)._nextPutAll_("'");
- _st($3)._lf();
- _st($3)._nextPutAll_(_st(_st("\x09package: '").__comma(_st(aClass)._category())).__comma("'!"));
- $4=_st($3)._lf();
- $5=_st(_st(aClass)._comment())._notEmpty();
- if(smalltalk.assert($5)){
- $6=aStream;
- _st($6)._nextPutAll_(_st(_st("!").__comma(_st(self)._classNameFor_(aClass))).__comma(" commentStamp!"));
- _st($6)._lf();
- _st($6)._nextPutAll_(_st(_st(self)._chunkEscape_(_st(aClass)._comment())).__comma("!"));
- $7=_st($6)._lf();
- $7;
- };
- _st(aStream)._lf();
- return self}, self, "exportDefinitionOf:on:", [aClass,aStream], smalltalk.ChunkExporter)},
- args: ["aClass", "aStream"],
- source: "exportDefinitionOf: aClass on: aStream\x0a \x22Chunk format.\x22\x0a\x0a aStream \x0a nextPutAll: (self classNameFor: aClass superclass);\x0a nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;\x0a nextPutAll: '\x09instanceVariableNames: '''.\x0a aClass instanceVariableNames \x0a do: [:each | aStream nextPutAll: each]\x0a separatedBy: [aStream nextPutAll: ' '].\x0a aStream \x0a nextPutAll: ''''; lf;\x0a nextPutAll: '\x09package: ''', aClass category, '''!'; lf.\x0a aClass comment notEmpty ifTrue: [\x0a aStream \x0a nextPutAll: '!', (self classNameFor: aClass), ' commentStamp!';lf;\x0a nextPutAll: (self chunkEscape: aClass comment), '!';lf].\x0a aStream lf",
- messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"],
- referencedClasses: []
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportMetaDefinitionOf_on_",
- smalltalk.method({
- selector: "exportMetaDefinitionOf:on:",
- category: '*Compiler',
- fn: function (aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5;
- $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
- if(! smalltalk.assert($1)){
- $2=aStream;
- _st($2)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._class()));
- $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
- $3;
- _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(" ");
- })}));
- $4=aStream;
- _st($4)._nextPutAll_("'!");
- _st($4)._lf();
- $5=_st($4)._lf();
- $5;
- };
- return self}, self, "exportMetaDefinitionOf:on:", [aClass,aStream], smalltalk.ChunkExporter)},
- args: ["aClass", "aStream"],
- source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream \x0a\x09\x09 nextPutAll: (self classNameFor: aClass class);\x0a\x09\x09 nextPutAll: ' instanceVariableNames: '''.\x0a\x09\x09aClass class instanceVariableNames \x0a\x09\x09 do: [:each | aStream nextPutAll: each]\x0a\x09\x09 separatedBy: [aStream nextPutAll: ' '].\x0a\x09\x09aStream\x09\x0a\x09\x09 nextPutAll: '''!'; lf; lf]",
- messageSends: ["ifFalse:", "nextPutAll:", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"],
- referencedClasses: []
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportMethod_of_on_",
- smalltalk.method({
- selector: "exportMethod:of:on:",
- category: '*Compiler',
- fn: function (aMethod,aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=aStream;
- _st($1)._lf();
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(self)._chunkEscape_(_st(aMethod)._source()));
- _st($1)._lf();
- $2=_st($1)._nextPutAll_("!");
- return self}, self, "exportMethod:of:on:", [aMethod,aClass,aStream], smalltalk.ChunkExporter)},
- args: ["aMethod", "aClass", "aStream"],
- source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;\x0a\x09\x09nextPutAll: '!'",
- messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"],
- referencedClasses: []
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportMethods_category_of_on_",
- smalltalk.method({
- selector: "exportMethods:category:of:on:",
- category: '*Compiler',
- fn: function (methods,category,aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $1=aStream;
- _st($1)._nextPutAll_(_st("!").__comma(_st(self)._classNameFor_(aClass)));
- $2=_st($1)._nextPutAll_(_st(_st(" methodsFor: '").__comma(category)).__comma("'!"));
- _st(_st(methods)._sorted_((function(a,b){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
- })})))._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._exportMethod_of_on_(each,aClass,aStream);
- })}));
- $3=aStream;
- _st($3)._nextPutAll_(" !");
- _st($3)._lf();
- $4=_st($3)._lf();
- return self}, self, "exportMethods:category:of:on:", [methods,category,aClass,aStream], smalltalk.ChunkExporter)},
- args: ["methods", "category", "aClass", "aStream"],
- source: "exportMethods: methods category: category of: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ' methodsFor: ''', category, '''!'.\x0a\x09\x09(methods sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09\x09\x09self exportMethod: each of: aClass on: aStream].\x0a\x09aStream nextPutAll: ' !'; lf; lf",
- messageSends: ["nextPutAll:", ",", "classNameFor:", "do:", "exportMethod:of:on:", "sorted:", "<=", "selector", "lf"],
- referencedClasses: []
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportMethodsOf_on_",
- smalltalk.method({
- selector: "exportMethodsOf:on:",
- category: '*Compiler',
- fn: function (aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$2;
- $ctx1.locals.map=nil;
- $ctx1.locals.map=_st((smalltalk.Dictionary || Dictionary))._new();
- $1=aClass;
- $2=(function(category,methods){
- return smalltalk.withContext(function($ctx2) {
$3=_st(category)._match_("^\x5c*");
- if(! smalltalk.assert($3)){
- return _st($ctx1.locals.map)._at_put_(category,methods);
- };
- })});
- _st($1)._protocolsDo_($2);
- _st(_st(_st($ctx1.locals.map)._keys())._sorted_((function(a,b){
- return smalltalk.withContext(function($ctx2) {
return _st(a).__lt_eq(b);
- })})))._do_((function(category){
- return smalltalk.withContext(function($ctx2) {
$ctx2.locals.methods=nil;
- $ctx2.locals.methods=_st($ctx1.locals.map)._at_(category);
- $ctx2.locals.methods;
- return _st(self)._exportMethods_category_of_on_($ctx2.locals.methods,category,aClass,aStream);
- })}));
- return self}, self, "exportMethodsOf:on:", [aClass,aStream], smalltalk.ChunkExporter)},
- args: ["aClass", "aStream"],
- source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| map |\x0a\x09map := Dictionary new.\x0a\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09(category match: '^\x5c*') ifFalse: [ map at: category put: methods ]].\x0a\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09methods := map at: category.\x0a\x09\x09self\x0a\x09\x09\x09exportMethods: methods\x0a\x09\x09\x09category: category\x0a\x09\x09\x09of: aClass\x0a\x09\x09\x09on: aStream ]",
- messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "do:", "at:", "exportMethods:category:of:on:", "sorted:", "<=", "keys"],
- referencedClasses: ["Dictionary"]
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportPackageDefinitionOf_on_",
- smalltalk.method({
- selector: "exportPackageDefinitionOf:on:",
- category: '*Compiler',
- fn: function (package_,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=aStream;
- _st($1)._nextPutAll_(_st(_st(_st(_st("Smalltalk current createPackage: '").__comma(_st(package_)._name())).__comma("' properties: ")).__comma(_st(_st(package_)._properties())._storeString())).__comma("!"));
- $2=_st($1)._lf();
- return self}, self, "exportPackageDefinitionOf:on:", [package_,aStream], smalltalk.ChunkExporter)},
- args: ["package", "aStream"],
- source: "exportPackageDefinitionOf: package on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream \x0a\x09 nextPutAll: 'Smalltalk current createPackage: ''', package name,\x0a\x09\x09''' properties: ', package properties storeString, '!'; lf.",
- messageSends: ["nextPutAll:", ",", "storeString", "properties", "name", "lf"],
- referencedClasses: []
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportPackageExtensionsOf_on_",
- smalltalk.method({
- selector: "exportPackageExtensionsOf:on:",
- category: '*Compiler',
- fn: function (package_,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$5,$7,$6,$4,$2;
- $ctx1.locals.name=nil;
- $ctx1.locals.map=nil;
- $ctx1.locals.name=_st(package_)._name();
- $1=_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes());
- $2=(function(each){
- return smalltalk.withContext(function($ctx2) {
$3=[each,_st(each)._class()];
- $4=(function(aClass){
- return smalltalk.withContext(function($ctx3) {
$ctx1.locals.map=_st((smalltalk.Dictionary || Dictionary))._new();
- $ctx1.locals.map;
- $5=aClass;
- $6=(function(category,methods){
- return smalltalk.withContext(function($ctx4) {
$7=_st(category)._match_(_st("^\x5c*").__comma($ctx1.locals.name));
- if(smalltalk.assert($7)){
- return _st($ctx1.locals.map)._at_put_(category,methods);
- };
- })});
- _st($5)._protocolsDo_($6);
- return _st(_st(_st($ctx1.locals.map)._keys())._sorted_((function(a,b){
- return smalltalk.withContext(function($ctx4) {
return _st(a).__lt_eq(b);
- })})))._do_((function(category){
- return smalltalk.withContext(function($ctx4) {
$ctx4.locals.methods=nil;
- $ctx4.locals.methods=_st($ctx1.locals.map)._at_(category);
- $ctx4.locals.methods;
- return _st(self)._exportMethods_category_of_on_($ctx4.locals.methods,category,aClass,aStream);
- })}));
- })});
- return _st($3)._do_($4);
- })});
- _st($1)._do_($2);
- return self}, self, "exportPackageExtensionsOf:on:", [package_,aStream], smalltalk.ChunkExporter)},
- args: ["package", "aStream"],
- source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22We need to override this one too since we need to group\x0a\x09all methods in a given protocol under a leading methodsFor: chunk\x0a\x09for that class.\x22\x0a\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| name map |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass |\x0a\x09\x09\x09map := Dictionary new.\x0a\x09\x09\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09\x09\x09(category match: '^\x5c*', name) ifTrue: [ map at: category put: methods ]].\x0a\x09\x09\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09\x09\x09methods := map at: category.\x09\x0a\x09\x09\x09\x09self exportMethods: methods category: category of: aClass on: aStream ]]]",
- messageSends: ["name", "do:", "new", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "at:", "exportMethods:category:of:on:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"],
- referencedClasses: ["Dictionary", "Smalltalk", "Package"]
- }),
- smalltalk.ChunkExporter);
- smalltalk.addMethod(
- "_exportDefinitionOf_on_",
- smalltalk.method({
- selector: "exportDefinitionOf:on:",
- category: '*Compiler',
- fn: function (aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $1=aStream;
- _st($1)._nextPutAll_("smalltalk.addClass(");
- _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
- _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
- $2=_st($1)._nextPutAll_(", [");
- _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(", ");
- })}));
- $3=aStream;
- _st($3)._nextPutAll_("], '");
- _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
- $4=_st($3)._nextPutAll_(");");
- _st(aStream)._lf();
- return self}, self, "exportDefinitionOf:on:", [aClass,aStream], smalltalk.StrippedExporter)},
- args: ["aClass", "aStream"],
- source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aStream lf",
- messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "lf"],
- referencedClasses: []
- }),
- smalltalk.StrippedExporter);
- smalltalk.addMethod(
- "_exportMethod_of_on_",
- smalltalk.method({
- selector: "exportMethod:of:on:",
- category: '*Compiler',
- fn: function (aMethod,aClass,aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=aStream;
- _st($1)._nextPutAll_("smalltalk.addMethod(");
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
- _st($1)._lf();
- _st($1)._nextPutAll_("smalltalk.method({");
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
- _st($1)._lf();
- _st($1)._nextPutAll_(_st("fn: ").__comma(_st(_st(aMethod)._fn())._compiledSource()));
- _st($1)._lf();
- _st($1)._nextPutAll_("}),");
- _st($1)._lf();
- _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass)));
- _st($1)._nextPutAll_(");");
- _st($1)._lf();
- $2=_st($1)._lf();
- return self}, self, "exportMethod:of:on:", [aMethod,aClass,aStream], smalltalk.StrippedExporter)},
- args: ["aMethod", "aClass", "aStream"],
- source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource;lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
- messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "compiledSource", "fn", "classNameFor:"],
- referencedClasses: []
- }),
- smalltalk.StrippedExporter);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRInstruction_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRInstruction)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInstruction: self",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_add_",
- smalltalk.method({
- selector: "add:",
- category: '*Compiler',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(anObject)._parent_(self);
- $1=_st(_st(self)._instructions())._add_(anObject);
- return $1;
- }, self, "add:", [anObject], smalltalk.IRInstruction)},
- args: ["anObject"],
- source: "add: anObject\x0a\x09anObject parent: self.\x0a\x09^ self instructions add: anObject",
- messageSends: ["parent:", "add:", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_canBeAssigned",
- smalltalk.method({
- selector: "canBeAssigned",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "canBeAssigned", [], smalltalk.IRInstruction)},
- args: [],
- source: "canBeAssigned\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_instructions",
- smalltalk.method({
- selector: "instructions",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@instructions"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@instructions"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
- $1=self["@instructions"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "instructions", [], smalltalk.IRInstruction)},
- args: [],
- source: "instructions\x0a\x09^ instructions ifNil: [ instructions := OrderedCollection new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["OrderedCollection"]
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isClosure",
- smalltalk.method({
- selector: "isClosure",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isClosure", [], smalltalk.IRInstruction)},
- args: [],
- source: "isClosure\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isInlined", [], smalltalk.IRInstruction)},
- args: [],
- source: "isInlined\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isLocalReturn",
- smalltalk.method({
- selector: "isLocalReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isLocalReturn", [], smalltalk.IRInstruction)},
- args: [],
- source: "isLocalReturn\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isReturn",
- smalltalk.method({
- selector: "isReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isReturn", [], smalltalk.IRInstruction)},
- args: [],
- source: "isReturn\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isSend",
- smalltalk.method({
- selector: "isSend",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isSend", [], smalltalk.IRInstruction)},
- args: [],
- source: "isSend\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isSequence",
- smalltalk.method({
- selector: "isSequence",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isSequence", [], smalltalk.IRInstruction)},
- args: [],
- source: "isSequence\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isTempDeclaration",
- smalltalk.method({
- selector: "isTempDeclaration",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isTempDeclaration", [], smalltalk.IRInstruction)},
- args: [],
- source: "isTempDeclaration\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_isVariable",
- smalltalk.method({
- selector: "isVariable",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isVariable", [], smalltalk.IRInstruction)},
- args: [],
- source: "isVariable\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_parent",
- smalltalk.method({
- selector: "parent",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@parent"];
- return $1;
- }, self, "parent", [], smalltalk.IRInstruction)},
- args: [],
- source: "parent\x0a\x09^ parent",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_parent_",
- smalltalk.method({
- selector: "parent:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@parent"]=anIRInstruction;
- return self}, self, "parent:", [anIRInstruction], smalltalk.IRInstruction)},
- args: ["anIRInstruction"],
- source: "parent: anIRInstruction\x0a\x09parent := anIRInstruction",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_remove",
- smalltalk.method({
- selector: "remove",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._parent())._remove_(self);
- return self}, self, "remove", [], smalltalk.IRInstruction)},
- args: [],
- source: "remove\x0a\x09self parent remove: self",
- messageSends: ["remove:", "parent"],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_remove_",
- smalltalk.method({
- selector: "remove:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._instructions())._remove_(anIRInstruction);
- return self}, self, "remove:", [anIRInstruction], smalltalk.IRInstruction)},
- args: ["anIRInstruction"],
- source: "remove: anIRInstruction\x0a\x09self instructions remove: anIRInstruction",
- messageSends: ["remove:", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_replace_with_",
- smalltalk.method({
- selector: "replace:with:",
- category: '*Compiler',
- fn: function (anIRInstruction,anotherIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(anotherIRInstruction)._parent_(self);
- _st(_st(self)._instructions())._at_put_(_st(_st(self)._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
- return self}, self, "replace:with:", [anIRInstruction,anotherIRInstruction], smalltalk.IRInstruction)},
- args: ["anIRInstruction", "anotherIRInstruction"],
- source: "replace: anIRInstruction with: anotherIRInstruction\x0a\x09anotherIRInstruction parent: self.\x0a\x09self instructions \x0a\x09\x09at: (self instructions indexOf: anIRInstruction)\x0a\x09\x09put: anotherIRInstruction",
- messageSends: ["parent:", "at:put:", "indexOf:", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_replaceWith_",
- smalltalk.method({
- selector: "replaceWith:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._parent())._replace_with_(self,anIRInstruction);
- return self}, self, "replaceWith:", [anIRInstruction], smalltalk.IRInstruction)},
- args: ["anIRInstruction"],
- source: "replaceWith: anIRInstruction\x0a\x09self parent replace: self with: anIRInstruction",
- messageSends: ["replace:with:", "parent"],
- referencedClasses: []
- }),
- smalltalk.IRInstruction);
- smalltalk.addMethod(
- "_on_",
- smalltalk.method({
- selector: "on:",
- category: '*Compiler',
- fn: function (aBuilder){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._builder_(aBuilder);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "on:", [aBuilder], smalltalk.IRInstruction.klass)},
- args: ["aBuilder"],
- source: "on: aBuilder\x0a\x09^ self new\x0a\x09\x09builder: aBuilder;\x0a\x09\x09yourself",
- messageSends: ["builder:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.IRInstruction.klass);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRAssignment_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRAssignment)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRAssignment: self",
- messageSends: ["visitIRAssignment:"],
- referencedClasses: []
- }),
- smalltalk.IRAssignment);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRInlinedAssignment_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRInlinedAssignment)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
- messageSends: ["visitIRInlinedAssignment:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedAssignment);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isInlined", [], smalltalk.IRInlinedAssignment)},
- args: [],
- source: "isInlined\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInlinedAssignment);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRDynamicArray_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRDynamicArray)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicArray: self",
- messageSends: ["visitIRDynamicArray:"],
- referencedClasses: []
- }),
- smalltalk.IRDynamicArray);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRDynamicDictionary)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicDictionary: self",
- messageSends: ["visitIRDynamicDictionary:"],
- referencedClasses: []
- }),
- smalltalk.IRDynamicDictionary);
- smalltalk.addMethod(
- "_scope",
- smalltalk.method({
- selector: "scope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@scope"];
- return $1;
- }, self, "scope", [], smalltalk.IRScopedInstruction)},
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRScopedInstruction);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@scope"]=aScope;
- return self}, self, "scope:", [aScope], smalltalk.IRScopedInstruction)},
- args: ["aScope"],
- source: "scope: aScope\x0a\x09scope := aScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRScopedInstruction);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRClosure_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRClosure)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
- messageSends: ["visitIRClosure:"],
- referencedClasses: []
- }),
- smalltalk.IRClosure);
- smalltalk.addMethod(
- "_arguments",
- smalltalk.method({
- selector: "arguments",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@arguments"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=[];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "arguments", [], smalltalk.IRClosure)},
- args: [],
- source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.IRClosure);
- smalltalk.addMethod(
- "_arguments_",
- smalltalk.method({
- selector: "arguments:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@arguments"]=aCollection;
- return self}, self, "arguments:", [aCollection], smalltalk.IRClosure)},
- args: ["aCollection"],
- source: "arguments: aCollection\x0a\x09arguments := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRClosure);
- smalltalk.addMethod(
- "_isClosure",
- smalltalk.method({
- selector: "isClosure",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isClosure", [], smalltalk.IRClosure)},
- args: [],
- source: "isClosure\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRClosure);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
- _st(aScope)._instruction_(self);
- return self}, self, "scope:", [aScope], smalltalk.IRClosure)},
- args: ["aScope"],
- source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
- messageSends: ["scope:", "instruction:"],
- referencedClasses: []
- }),
- smalltalk.IRClosure);
- smalltalk.addMethod(
- "_sequence",
- smalltalk.method({
- selector: "sequence",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._instructions())._last();
- return $1;
- }, self, "sequence", [], smalltalk.IRClosure)},
- args: [],
- source: "sequence\x0a\x09^ self instructions last",
- messageSends: ["last", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRClosure);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aVisitor)._visitIRInlinedClosure_(self);
- return self}, self, "accept:", [aVisitor], smalltalk.IRInlinedClosure)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
- messageSends: ["visitIRInlinedClosure:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedClosure);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isInlined", [], smalltalk.IRInlinedClosure)},
- args: [],
- source: "isInlined\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInlinedClosure);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRMethod_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRMethod)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
- messageSends: ["visitIRMethod:"],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_arguments",
- smalltalk.method({
- selector: "arguments",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@arguments"];
- return $1;
- }, self, "arguments", [], smalltalk.IRMethod)},
- args: [],
- source: "arguments\x0a\x09^ arguments",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_arguments_",
- smalltalk.method({
- selector: "arguments:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@arguments"]=aCollection;
- return self}, self, "arguments:", [aCollection], smalltalk.IRMethod)},
- args: ["aCollection"],
- source: "arguments: aCollection\x0a\x09arguments := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_classReferences",
- smalltalk.method({
- selector: "classReferences",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@classReferences"];
- return $1;
- }, self, "classReferences", [], smalltalk.IRMethod)},
- args: [],
- source: "classReferences\x0a\x09^ classReferences",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_classReferences_",
- smalltalk.method({
- selector: "classReferences:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@classReferences"]=aCollection;
- return self}, self, "classReferences:", [aCollection], smalltalk.IRMethod)},
- args: ["aCollection"],
- source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_internalVariables",
- smalltalk.method({
- selector: "internalVariables",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@internalVariables"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
- $1=self["@internalVariables"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "internalVariables", [], smalltalk.IRMethod)},
- args: [],
- source: "internalVariables\x0a\x09^ internalVariables ifNil: [ internalVariables := Set new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Set"]
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_messageSends",
- smalltalk.method({
- selector: "messageSends",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@messageSends"];
- return $1;
- }, self, "messageSends", [], smalltalk.IRMethod)},
- args: [],
- source: "messageSends\x0a\x09^ messageSends",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_messageSends_",
- smalltalk.method({
- selector: "messageSends:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@messageSends"]=aCollection;
- return self}, self, "messageSends:", [aCollection], smalltalk.IRMethod)},
- args: ["aCollection"],
- source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
- _st(aScope)._instruction_(self);
- return self}, self, "scope:", [aScope], smalltalk.IRMethod)},
- args: ["aScope"],
- source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
- messageSends: ["scope:", "instruction:"],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_selector",
- smalltalk.method({
- selector: "selector",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@selector"];
- return $1;
- }, self, "selector", [], smalltalk.IRMethod)},
- args: [],
- source: "selector\x0a\x09^ selector",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_selector_",
- smalltalk.method({
- selector: "selector:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@selector"]=aString;
- return self}, self, "selector:", [aString], smalltalk.IRMethod)},
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_source",
- smalltalk.method({
- selector: "source",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@source"];
- return $1;
- }, self, "source", [], smalltalk.IRMethod)},
- args: [],
- source: "source\x0a\x09^ source",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_source_",
- smalltalk.method({
- selector: "source:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@source"]=aString;
- return self}, self, "source:", [aString], smalltalk.IRMethod)},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_superSends",
- smalltalk.method({
- selector: "superSends",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@superSends"];
- return $1;
- }, self, "superSends", [], smalltalk.IRMethod)},
- args: [],
- source: "superSends\x0a\x09^ superSends",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_superSends_",
- smalltalk.method({
- selector: "superSends:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@superSends"]=aCollection;
- return self}, self, "superSends:", [aCollection], smalltalk.IRMethod)},
- args: ["aCollection"],
- source: "superSends: aCollection\x0a\x09superSends := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_theClass",
- smalltalk.method({
- selector: "theClass",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@theClass"];
- return $1;
- }, self, "theClass", [], smalltalk.IRMethod)},
- args: [],
- source: "theClass\x0a\x09^ theClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_theClass_",
- smalltalk.method({
- selector: "theClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@theClass"]=aClass;
- return self}, self, "theClass:", [aClass], smalltalk.IRMethod)},
- args: ["aClass"],
- source: "theClass: aClass\x0a\x09theClass := aClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRMethod);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRReturn_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRReturn)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRReturn: self",
- messageSends: ["visitIRReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRReturn);
- smalltalk.addMethod(
- "_canBeAssigned",
- smalltalk.method({
- selector: "canBeAssigned",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "canBeAssigned", [], smalltalk.IRReturn)},
- args: [],
- source: "canBeAssigned\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRReturn);
- smalltalk.addMethod(
- "_isBlockReturn",
- smalltalk.method({
- selector: "isBlockReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isBlockReturn", [], smalltalk.IRReturn)},
- args: [],
- source: "isBlockReturn\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRReturn);
- smalltalk.addMethod(
- "_isLocalReturn",
- smalltalk.method({
- selector: "isLocalReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isLocalReturn", [], smalltalk.IRReturn)},
- args: [],
- source: "isLocalReturn\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRReturn);
- smalltalk.addMethod(
- "_isNonLocalReturn",
- smalltalk.method({
- selector: "isNonLocalReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._isLocalReturn())._not();
- return $1;
- }, self, "isNonLocalReturn", [], smalltalk.IRReturn)},
- args: [],
- source: "isNonLocalReturn\x0a\x09^ self isLocalReturn not",
- messageSends: ["not", "isLocalReturn"],
- referencedClasses: []
- }),
- smalltalk.IRReturn);
- smalltalk.addMethod(
- "_isReturn",
- smalltalk.method({
- selector: "isReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isReturn", [], smalltalk.IRReturn)},
- args: [],
- source: "isReturn\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRReturn);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRBlockReturn_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRBlockReturn)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockReturn: self",
- messageSends: ["visitIRBlockReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRBlockReturn);
- smalltalk.addMethod(
- "_isBlockReturn",
- smalltalk.method({
- selector: "isBlockReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isBlockReturn", [], smalltalk.IRBlockReturn)},
- args: [],
- source: "isBlockReturn\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRBlockReturn);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRInlinedReturn_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRInlinedReturn)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
- messageSends: ["visitIRInlinedReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedReturn);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isInlined", [], smalltalk.IRInlinedReturn)},
- args: [],
- source: "isInlined\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInlinedReturn);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRInlinedNonLocalReturn_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRInlinedNonLocalReturn)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedNonLocalReturn: self",
- messageSends: ["visitIRInlinedNonLocalReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedNonLocalReturn);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isInlined", [], smalltalk.IRInlinedNonLocalReturn)},
- args: [],
- source: "isInlined\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInlinedNonLocalReturn);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRNonLocalReturn)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRNonLocalReturn: self",
- messageSends: ["visitIRNonLocalReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRNonLocalReturn);
- smalltalk.addMethod(
- "_isLocalReturn",
- smalltalk.method({
- selector: "isLocalReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isLocalReturn", [], smalltalk.IRNonLocalReturn)},
- args: [],
- source: "isLocalReturn\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRNonLocalReturn);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRTempDeclaration_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRTempDeclaration)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRTempDeclaration: self",
- messageSends: ["visitIRTempDeclaration:"],
- referencedClasses: []
- }),
- smalltalk.IRTempDeclaration);
- smalltalk.addMethod(
- "_name",
- smalltalk.method({
- selector: "name",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@name"];
- return $1;
- }, self, "name", [], smalltalk.IRTempDeclaration)},
- args: [],
- source: "name\x0a\x09^ name",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRTempDeclaration);
- smalltalk.addMethod(
- "_name_",
- smalltalk.method({
- selector: "name:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@name"]=aString;
- return self}, self, "name:", [aString], smalltalk.IRTempDeclaration)},
- args: ["aString"],
- source: "name: aString\x0a\x09name := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRTempDeclaration);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRSend_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRSend)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSend: self",
- messageSends: ["visitIRSend:"],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_classSend",
- smalltalk.method({
- selector: "classSend",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@classSend"];
- return $1;
- }, self, "classSend", [], smalltalk.IRSend)},
- args: [],
- source: "classSend\x0a\x09^ classSend",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_classSend_",
- smalltalk.method({
- selector: "classSend:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@classSend"]=aClass;
- return self}, self, "classSend:", [aClass], smalltalk.IRSend)},
- args: ["aClass"],
- source: "classSend: aClass\x0a\x09classSend := aClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_index",
- smalltalk.method({
- selector: "index",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@index"];
- return $1;
- }, self, "index", [], smalltalk.IRSend)},
- args: [],
- source: "index\x0a\x09^ index",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_index_",
- smalltalk.method({
- selector: "index:",
- category: '*Compiler',
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@index"]=anInteger;
- return self}, self, "index:", [anInteger], smalltalk.IRSend)},
- args: ["anInteger"],
- source: "index: anInteger\x0a\x09index := anInteger",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_isSend",
- smalltalk.method({
- selector: "isSend",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isSend", [], smalltalk.IRSend)},
- args: [],
- source: "isSend\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_javascriptSelector",
- smalltalk.method({
- selector: "javascriptSelector",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(self)._classSend();
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=_st(_st(self)._selector())._asSelector();
- } else {
- $1=_st(_st(self)._selector())._asSuperSelector();
- };
- return $1;
- }, self, "javascriptSelector", [], smalltalk.IRSend)},
- args: [],
- source: "javascriptSelector\x0a\x09^ self classSend \x0a \x09ifNil: [ self selector asSelector ]\x0a \x09ifNotNil: [ self selector asSuperSelector ]",
- messageSends: ["ifNil:ifNotNil:", "asSelector", "selector", "asSuperSelector", "classSend"],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_selector",
- smalltalk.method({
- selector: "selector",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@selector"];
- return $1;
- }, self, "selector", [], smalltalk.IRSend)},
- args: [],
- source: "selector\x0a\x09^ selector",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_selector_",
- smalltalk.method({
- selector: "selector:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@selector"]=aString;
- return self}, self, "selector:", [aString], smalltalk.IRSend)},
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSend);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aVisitor)._visitInlinedSend_(self);
- return self}, self, "accept:", [aVisitor], smalltalk.IRInlinedSend)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
- messageSends: ["visitInlinedSend:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedSend);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isInlined", [], smalltalk.IRInlinedSend)},
- args: [],
- source: "isInlined\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInlinedSend);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aVisitor)._visitIRInlinedIfFalse_(self);
- return self}, self, "accept:", [aVisitor], smalltalk.IRInlinedIfFalse)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
- messageSends: ["visitIRInlinedIfFalse:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedIfFalse);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aVisitor)._visitIRInlinedIfNilIfNotNil_(self);
- return self}, self, "accept:", [aVisitor], smalltalk.IRInlinedIfNilIfNotNil)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
- messageSends: ["visitIRInlinedIfNilIfNotNil:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedIfNilIfNotNil);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aVisitor)._visitIRInlinedIfTrue_(self);
- return self}, self, "accept:", [aVisitor], smalltalk.IRInlinedIfTrue)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
- messageSends: ["visitIRInlinedIfTrue:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedIfTrue);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aVisitor)._visitIRInlinedIfTrueIfFalse_(self);
- return self}, self, "accept:", [aVisitor], smalltalk.IRInlinedIfTrueIfFalse)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
- messageSends: ["visitIRInlinedIfTrueIfFalse:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedIfTrueIfFalse);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRSequence_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRSequence)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSequence: self",
- messageSends: ["visitIRSequence:"],
- referencedClasses: []
- }),
- smalltalk.IRSequence);
- smalltalk.addMethod(
- "_isSequence",
- smalltalk.method({
- selector: "isSequence",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isSequence", [], smalltalk.IRSequence)},
- args: [],
- source: "isSequence\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSequence);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRBlockSequence_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRBlockSequence)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockSequence: self",
- messageSends: ["visitIRBlockSequence:"],
- referencedClasses: []
- }),
- smalltalk.IRBlockSequence);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aVisitor)._visitIRInlinedSequence_(self);
- return self}, self, "accept:", [aVisitor], smalltalk.IRInlinedSequence)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
- messageSends: ["visitIRInlinedSequence:"],
- referencedClasses: []
- }),
- smalltalk.IRInlinedSequence);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isInlined", [], smalltalk.IRInlinedSequence)},
- args: [],
- source: "isInlined\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRInlinedSequence);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRValue_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRValue)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRValue: self",
- messageSends: ["visitIRValue:"],
- referencedClasses: []
- }),
- smalltalk.IRValue);
- smalltalk.addMethod(
- "_value",
- smalltalk.method({
- selector: "value",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@value"];
- return $1;
- }, self, "value", [], smalltalk.IRValue)},
- args: [],
- source: "value\x0a\x09^value",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRValue);
- smalltalk.addMethod(
- "_value_",
- smalltalk.method({
- selector: "value:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@value"]=aString;
- return self}, self, "value:", [aString], smalltalk.IRValue)},
- args: ["aString"],
- source: "value: aString\x0a\x09value := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRValue);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRVariable_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRVariable)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVariable: self",
- messageSends: ["visitIRVariable:"],
- referencedClasses: []
- }),
- smalltalk.IRVariable);
- smalltalk.addMethod(
- "_isVariable",
- smalltalk.method({
- selector: "isVariable",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isVariable", [], smalltalk.IRVariable)},
- args: [],
- source: "isVariable\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRVariable);
- smalltalk.addMethod(
- "_variable",
- smalltalk.method({
- selector: "variable",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@variable"];
- return $1;
- }, self, "variable", [], smalltalk.IRVariable)},
- args: [],
- source: "variable\x0a\x09^ variable",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRVariable);
- smalltalk.addMethod(
- "_variable_",
- smalltalk.method({
- selector: "variable:",
- category: '*Compiler',
- fn: function (aScopeVariable){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@variable"]=aScopeVariable;
- return self}, self, "variable:", [aScopeVariable], smalltalk.IRVariable)},
- args: ["aScopeVariable"],
- source: "variable: aScopeVariable\x0a\x09variable := aScopeVariable",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRVariable);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitIRVerbatim_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.IRVerbatim)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVerbatim: self",
- messageSends: ["visitIRVerbatim:"],
- referencedClasses: []
- }),
- smalltalk.IRVerbatim);
- smalltalk.addMethod(
- "_source",
- smalltalk.method({
- selector: "source",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@source"];
- return $1;
- }, self, "source", [], smalltalk.IRVerbatim)},
- args: [],
- source: "source\x0a\x09^ source",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRVerbatim);
- smalltalk.addMethod(
- "_source_",
- smalltalk.method({
- selector: "source:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@source"]=aString;
- return self}, self, "source:", [aString], smalltalk.IRVerbatim)},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRVerbatim);
- smalltalk.addMethod(
- "_ifFalse_",
- smalltalk.method({
- selector: "ifFalse:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._inlinedSend_with_(_st((smalltalk.IRInlinedIfFalse || IRInlinedIfFalse))._new(),anIRInstruction);
- return $1;
- }, self, "ifFalse:", [anIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction"],
- source: "ifFalse: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfFalse new with: anIRInstruction",
- messageSends: ["inlinedSend:with:", "new"],
- referencedClasses: ["IRInlinedIfFalse"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_ifFalse_ifTrue_",
- smalltalk.method({
- selector: "ifFalse:ifTrue:",
- category: '*Compiler',
- fn: function (anIRInstruction,anotherIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._perform_withArguments_(smalltalk.symbolFor("ifTrue:ifFalse:"),[anotherIRInstruction,anIRInstruction]);
- return $1;
- }, self, "ifFalse:ifTrue:", [anIRInstruction,anotherIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction", "anotherIRInstruction"],
- source: "ifFalse: anIRInstruction ifTrue: anotherIRInstruction\x0a\x09^ self perform: #ifTrue:ifFalse: withArguments: { anotherIRInstruction. anIRInstruction }",
- messageSends: ["perform:withArguments:"],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_ifNil_",
- smalltalk.method({
- selector: "ifNil:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$4,$5,$1;
- $2=_st((smalltalk.IRClosure || IRClosure))._new();
- _st($2)._scope_(_st(_st(anIRInstruction)._scope())._copy());
- $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
- _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
- $4=_st($3)._yourself();
- _st($2)._add_($4);
- $5=_st($2)._yourself();
- $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anIRInstruction,$5);
- return $1;
- }, self, "ifNil:", [anIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction"],
- source: "ifNil: anIRInstruction\x0a\x09^ self \x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new \x0a\x09\x09with: anIRInstruction\x0a\x09\x09with: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send instructions first;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)",
- messageSends: ["inlinedSend:with:with:", "new", "scope:", "copy", "scope", "add:", "first", "instructions", "send", "yourself"],
- referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_ifNil_ifNotNil_",
- smalltalk.method({
- selector: "ifNil:ifNotNil:",
- category: '*Compiler',
- fn: function (anIRInstruction,anotherIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anIRInstruction,anotherIRInstruction);
- return $1;
- }, self, "ifNil:ifNotNil:", [anIRInstruction,anotherIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction", "anotherIRInstruction"],
- source: "ifNil: anIRInstruction ifNotNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new with: anIRInstruction with: anotherIRInstruction",
- messageSends: ["inlinedSend:with:with:", "new"],
- referencedClasses: ["IRInlinedIfNilIfNotNil"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_ifNotNil_",
- smalltalk.method({
- selector: "ifNotNil:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$4,$5,$1;
- $2=_st((smalltalk.IRClosure || IRClosure))._new();
- _st($2)._scope_(_st(_st(anIRInstruction)._scope())._copy());
- $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
- _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
- $4=_st($3)._yourself();
- _st($2)._add_($4);
- $5=_st($2)._yourself();
- $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),$5,anIRInstruction);
- return $1;
- }, self, "ifNotNil:", [anIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction"],
- source: "ifNotNil: anIRInstruction\x0a\x09^ self \x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new\x0a\x09\x09with: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send instructions first;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)\x0a\x09\x09with: anIRInstruction",
- messageSends: ["inlinedSend:with:with:", "new", "scope:", "copy", "scope", "add:", "first", "instructions", "send", "yourself"],
- referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_ifNotNil_ifNil_",
- smalltalk.method({
- selector: "ifNotNil:ifNil:",
- category: '*Compiler',
- fn: function (anIRInstruction,anotherIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anotherIRInstruction,anIRInstruction);
- return $1;
- }, self, "ifNotNil:ifNil:", [anIRInstruction,anotherIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction", "anotherIRInstruction"],
- source: "ifNotNil: anIRInstruction ifNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new with: anotherIRInstruction with: anIRInstruction",
- messageSends: ["inlinedSend:with:with:", "new"],
- referencedClasses: ["IRInlinedIfNilIfNotNil"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_ifTrue_",
- smalltalk.method({
- selector: "ifTrue:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._inlinedSend_with_(_st((smalltalk.IRInlinedIfTrue || IRInlinedIfTrue))._new(),anIRInstruction);
- return $1;
- }, self, "ifTrue:", [anIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction"],
- source: "ifTrue: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrue new with: anIRInstruction",
- messageSends: ["inlinedSend:with:", "new"],
- referencedClasses: ["IRInlinedIfTrue"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_ifTrue_ifFalse_",
- smalltalk.method({
- selector: "ifTrue:ifFalse:",
- category: '*Compiler',
- fn: function (anIRInstruction,anotherIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfTrueIfFalse || IRInlinedIfTrueIfFalse))._new(),anIRInstruction,anotherIRInstruction);
- return $1;
- }, self, "ifTrue:ifFalse:", [anIRInstruction,anotherIRInstruction], smalltalk.IRSendInliner)},
- args: ["anIRInstruction", "anotherIRInstruction"],
- source: "ifTrue: anIRInstruction ifFalse: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrueIfFalse new with: anIRInstruction with: anotherIRInstruction",
- messageSends: ["inlinedSend:with:with:", "new"],
- referencedClasses: ["IRInlinedIfTrueIfFalse"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inlineClosure_",
- smalltalk.method({
- selector: "inlineClosure:",
- category: '*Compiler',
- fn: function (anIRClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$2,$4,$6,$5,$7;
- $ctx1.locals.inlinedClosure=nil;
- $ctx1.locals.sequence=nil;
- $ctx1.locals.statements=nil;
- $ctx1.locals.inlinedClosure=_st(self)._inlinedClosure();
- _st($ctx1.locals.inlinedClosure)._scope_(_st(anIRClosure)._scope());
- $1=_st(anIRClosure)._instructions();
- $2=(function(each){
- return smalltalk.withContext(function($ctx2) {
$3=_st(each)._isSequence();
- if(! smalltalk.assert($3)){
- return _st($ctx1.locals.inlinedClosure)._add_(each);
- };
- })});
- _st($1)._do_($2);
- $ctx1.locals.sequence=_st(self)._inlinedSequence();
- _st($ctx1.locals.inlinedClosure)._add_($ctx1.locals.sequence);
- $ctx1.locals.statements=_st(_st(_st(anIRClosure)._instructions())._last())._instructions();
- $4=$ctx1.locals.statements;
- $5=(function(){
- return smalltalk.withContext(function($ctx2) {
_st(_st($ctx1.locals.statements)._allButLast())._do_((function(each){
- return smalltalk.withContext(function($ctx3) {
return _st($ctx1.locals.sequence)._add_(each);
- })}));
- $6=_st(_st(_st($ctx1.locals.statements)._last())._isReturn())._and_((function(){
- return smalltalk.withContext(function($ctx3) {
return _st(_st($ctx1.locals.statements)._last())._isBlockReturn();
- })}));
- if(smalltalk.assert($6)){
- return _st($ctx1.locals.sequence)._add_(_st(_st(_st($ctx1.locals.statements)._last())._instructions())._first());
- } else {
- return _st($ctx1.locals.sequence)._add_(_st($ctx1.locals.statements)._last());
- };
- })});
- _st($4)._ifNotEmpty_($5);
- $7=$ctx1.locals.inlinedClosure;
- return $7;
- }, self, "inlineClosure:", [anIRClosure], smalltalk.IRSendInliner)},
- args: ["anIRClosure"],
- source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure sequence statements |\x0a\x0a\x09inlinedClosure := self inlinedClosure.\x0a\x09inlinedClosure scope: anIRClosure scope.\x0a\x0a\x09\x22Add the possible temp declarations\x22\x0a\x09anIRClosure instructions do: [ :each | \x0a\x09\x09each isSequence ifFalse: [\x0a\x09\x09\x09inlinedClosure add: each ]].\x0a\x0a\x09\x22Add a block sequence\x22\x0a\x09sequence := self inlinedSequence.\x0a\x09inlinedClosure add: sequence.\x0a\x0a\x09\x22Get all the statements\x22\x0a\x09statements := anIRClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements allButLast do: [ :each | sequence add: each ].\x0a\x0a\x09\x09\x22Inlined closures don't have implicit local returns\x22\x0a\x09\x09(statements last isReturn and: [ statements last isBlockReturn ])\x0a\x09\x09\x09ifTrue: [ sequence add: statements last instructions first ]\x0a\x09\x09\x09ifFalse: [ sequence add: statements last ] ].\x0a\x0a\x09^ inlinedClosure",
- messageSends: ["inlinedClosure", "scope:", "scope", "do:", "ifFalse:", "add:", "isSequence", "instructions", "inlinedSequence", "last", "ifNotEmpty:", "allButLast", "ifTrue:ifFalse:", "first", "and:", "isBlockReturn", "isReturn"],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inlineSend_",
- smalltalk.method({
- selector: "inlineSend:",
- category: '*Compiler',
- fn: function (anIRSend){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(self)._send_(anIRSend);
- $1=_st(self)._perform_withArguments_(_st(_st(self)._send())._selector(),_st(_st(_st(self)._send())._instructions())._allButFirst());
- return $1;
- }, self, "inlineSend:", [anIRSend], smalltalk.IRSendInliner)},
- args: ["anIRSend"],
- source: "inlineSend: anIRSend\x0a\x09self send: anIRSend.\x0a\x09^ self \x0a\x09\x09perform: self send selector \x0a\x09\x09withArguments: self send instructions allButFirst",
- messageSends: ["send:", "perform:withArguments:", "selector", "send", "allButFirst", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inlinedClosure",
- smalltalk.method({
- selector: "inlinedClosure",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.IRInlinedClosure || IRInlinedClosure))._new();
- return $1;
- }, self, "inlinedClosure", [], smalltalk.IRSendInliner)},
- args: [],
- source: "inlinedClosure\x0a\x09^ IRInlinedClosure new",
- messageSends: ["new"],
- referencedClasses: ["IRInlinedClosure"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inlinedSend_with_",
- smalltalk.method({
- selector: "inlinedSend:with:",
- category: '*Compiler',
- fn: function (inlinedSend,anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5;
- $ctx1.locals.inlinedClosure=nil;
- $1=_st(anIRInstruction)._isClosure();
- if(! smalltalk.assert($1)){
- _st(self)._inliningError_("Message argument should be a block");
- };
- $2=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
- if(! smalltalk.assert($2)){
- _st(self)._inliningError_("Inlined block should have zero argument");
- };
- $ctx1.locals.inlinedClosure=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anIRInstruction));
- $3=inlinedSend;
- _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
- $4=_st($3)._add_($ctx1.locals.inlinedClosure);
- _st(_st(self)._send())._replaceWith_(inlinedSend);
- $5=inlinedSend;
- return $5;
- }, self, "inlinedSend:with:", [inlinedSend,anIRInstruction], smalltalk.IRSendInliner)},
- args: ["inlinedSend", "anIRInstruction"],
- source: "inlinedSend: inlinedSend with: anIRInstruction\x0a\x09| inlinedClosure |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09inlinedClosure := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send instructions first;\x0a\x09\x09add: inlinedClosure.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x0a\x09^ inlinedSend",
- messageSends: ["ifFalse:", "inliningError:", "isClosure", "=", "size", "arguments", "visit:", "inlineClosure:", "translator", "add:", "first", "instructions", "send", "replaceWith:"],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inlinedSend_with_with_",
- smalltalk.method({
- selector: "inlinedSend:with:with:",
- category: '*Compiler',
- fn: function (inlinedSend,anIRInstruction,anotherIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5,$6,$7;
- $ctx1.locals.inlinedClosure1=nil;
- $ctx1.locals.inlinedClosure2=nil;
- $1=_st(anIRInstruction)._isClosure();
- if(! smalltalk.assert($1)){
- _st(self)._inliningError_("Message argument should be a block");
- };
- $2=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
- if(! smalltalk.assert($2)){
- _st(self)._inliningError_("Inlined block should have zero argument");
- };
- $3=_st(anotherIRInstruction)._isClosure();
- if(! smalltalk.assert($3)){
- _st(self)._inliningError_("Message argument should be a block");
- };
- $4=_st(_st(_st(anotherIRInstruction)._arguments())._size()).__eq((0));
- if(! smalltalk.assert($4)){
- _st(self)._inliningError_("Inlined block should have zero argument");
- };
- $ctx1.locals.inlinedClosure1=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anIRInstruction));
- $ctx1.locals.inlinedClosure2=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anotherIRInstruction));
- $5=inlinedSend;
- _st($5)._add_(_st(_st(_st(self)._send())._instructions())._first());
- _st($5)._add_($ctx1.locals.inlinedClosure1);
- $6=_st($5)._add_($ctx1.locals.inlinedClosure2);
- _st(_st(self)._send())._replaceWith_(inlinedSend);
- $7=inlinedSend;
- return $7;
- }, self, "inlinedSend:with:with:", [inlinedSend,anIRInstruction,anotherIRInstruction], smalltalk.IRSendInliner)},
- args: ["inlinedSend", "anIRInstruction", "anotherIRInstruction"],
- source: "inlinedSend: inlinedSend with: anIRInstruction with: anotherIRInstruction\x0a\x09| inlinedClosure1 inlinedClosure2 |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09anotherIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anotherIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09inlinedClosure1 := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x09inlinedClosure2 := self translator visit: (self inlineClosure: anotherIRInstruction).\x0a\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send instructions first;\x0a\x09\x09add: inlinedClosure1;\x0a\x09\x09add: inlinedClosure2.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x09^ inlinedSend",
- messageSends: ["ifFalse:", "inliningError:", "isClosure", "=", "size", "arguments", "visit:", "inlineClosure:", "translator", "add:", "first", "instructions", "send", "replaceWith:"],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inlinedSequence",
- smalltalk.method({
- selector: "inlinedSequence",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.IRInlinedSequence || IRInlinedSequence))._new();
- return $1;
- }, self, "inlinedSequence", [], smalltalk.IRSendInliner)},
- args: [],
- source: "inlinedSequence\x0a\x09^ IRInlinedSequence new",
- messageSends: ["new"],
- referencedClasses: ["IRInlinedSequence"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inliningError_",
- smalltalk.method({
- selector: "inliningError:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st((smalltalk.InliningError || InliningError))._signal_(aString);
- return self}, self, "inliningError:", [aString], smalltalk.IRSendInliner)},
- args: ["aString"],
- source: "inliningError: aString\x0a\x09InliningError signal: aString",
- messageSends: ["signal:"],
- referencedClasses: ["InliningError"]
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_send",
- smalltalk.method({
- selector: "send",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@send"];
- return $1;
- }, self, "send", [], smalltalk.IRSendInliner)},
- args: [],
- source: "send\x0a\x09^ send",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_send_",
- smalltalk.method({
- selector: "send:",
- category: '*Compiler',
- fn: function (anIRSend){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@send"]=anIRSend;
- return self}, self, "send:", [anIRSend], smalltalk.IRSendInliner)},
- args: ["anIRSend"],
- source: "send: anIRSend\x0a\x09send := anIRSend",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_translator",
- smalltalk.method({
- selector: "translator",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@translator"];
- return $1;
- }, self, "translator", [], smalltalk.IRSendInliner)},
- args: [],
- source: "translator\x0a\x09^ translator",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_translator_",
- smalltalk.method({
- selector: "translator:",
- category: '*Compiler',
- fn: function (anASTTranslator){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@translator"]=anASTTranslator;
- return self}, self, "translator:", [anASTTranslator], smalltalk.IRSendInliner)},
- args: ["anASTTranslator"],
- source: "translator: anASTTranslator\x0a\x09translator := anASTTranslator",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner);
- smalltalk.addMethod(
- "_inlinedSelectors",
- smalltalk.method({
- selector: "inlinedSelectors",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return ["ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:", "ifNil:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil"];
- }, self, "inlinedSelectors", [], smalltalk.IRSendInliner.klass)},
- args: [],
- source: "inlinedSelectors\x0a\x09^ #('ifTrue:' 'ifFalse:' 'ifTrue:ifFalse:' 'ifFalse:ifTrue:' 'ifNil:' 'ifNotNil:' 'ifNil:ifNotNil:' 'ifNotNil:ifNil')",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner.klass);
- smalltalk.addMethod(
- "_shouldInline_",
- smalltalk.method({
- selector: "shouldInline:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$4,$3;
- var $early={};
- try {
- $1=_st(_st(self)._inlinedSelectors())._includes_(_st(anIRInstruction)._selector());
- if(! smalltalk.assert($1)){
- return false;
- };
- $2=_st(_st(anIRInstruction)._instructions())._allButFirst();
- $3=(function(each){
- return smalltalk.withContext(function($ctx2) {
$4=_st(each)._isClosure();
- if(! smalltalk.assert($4)){
- throw $early=[false];
- };
- })});
- _st($2)._do_($3);
- return true;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- }, self, "shouldInline:", [anIRInstruction], smalltalk.IRSendInliner.klass)},
- args: ["anIRInstruction"],
- source: "shouldInline: anIRInstruction\x0a\x09(self inlinedSelectors includes: anIRInstruction selector) ifFalse: [ ^ false ].\x0a\x09anIRInstruction instructions allButFirst do: [ :each |\x0a\x09\x09each isClosure ifFalse: [ ^ false ]].\x0a\x09^ true",
- messageSends: ["ifFalse:", "includes:", "selector", "inlinedSelectors", "do:", "isClosure", "allButFirst", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRSendInliner.klass);
- smalltalk.addMethod(
- "_assignment",
- smalltalk.method({
- selector: "assignment",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@assignment"];
- return $1;
- }, self, "assignment", [], smalltalk.IRAssignmentInliner)},
- args: [],
- source: "assignment\x0a\x09^ assignment",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRAssignmentInliner);
- smalltalk.addMethod(
- "_assignment_",
- smalltalk.method({
- selector: "assignment:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@assignment"]=aNode;
- return self}, self, "assignment:", [aNode], smalltalk.IRAssignmentInliner)},
- args: ["aNode"],
- source: "assignment: aNode\x0a\x09assignment := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRAssignmentInliner);
- smalltalk.addMethod(
- "_inlineAssignment_",
- smalltalk.method({
- selector: "inlineAssignment:",
- category: '*Compiler',
- fn: function (anIRAssignment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.inlinedAssignment=nil;
- _st(self)._assignment_(anIRAssignment);
- $ctx1.locals.inlinedAssignment=_st((smalltalk.IRInlinedAssignment || IRInlinedAssignment))._new();
- _st(_st(anIRAssignment)._instructions())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.inlinedAssignment)._add_(each);
- })}));
- _st(anIRAssignment)._replaceWith_($ctx1.locals.inlinedAssignment);
- _st(self)._inlineSend_(_st(_st($ctx1.locals.inlinedAssignment)._instructions())._last());
- $1=$ctx1.locals.inlinedAssignment;
- return $1;
- }, self, "inlineAssignment:", [anIRAssignment], smalltalk.IRAssignmentInliner)},
- args: ["anIRAssignment"],
- source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment instructions do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment instructions last.\x0a\x09^ inlinedAssignment",
- messageSends: ["assignment:", "new", "do:", "add:", "instructions", "replaceWith:", "inlineSend:", "last"],
- referencedClasses: ["IRInlinedAssignment"]
- }),
- smalltalk.IRAssignmentInliner);
- smalltalk.addMethod(
- "_inlineClosure_",
- smalltalk.method({
- selector: "inlineClosure:",
- category: '*Compiler',
- fn: function (anIRClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$4,$5,$2,$6;
- $ctx1.locals.inlinedClosure=nil;
- $ctx1.locals.statements=nil;
- $ctx1.locals.inlinedClosure=smalltalk.IRSendInliner.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
- $ctx1.locals.statements=_st(_st(_st($ctx1.locals.inlinedClosure)._instructions())._last())._instructions();
- $1=$ctx1.locals.statements;
- $2=(function(){
- return smalltalk.withContext(function($ctx2) {
$3=_st(_st($ctx1.locals.statements)._last())._canBeAssigned();
- if(smalltalk.assert($3)){
- $4=_st((smalltalk.IRAssignment || IRAssignment))._new();
- _st($4)._add_(_st(_st(_st(self)._assignment())._instructions())._first());
- _st($4)._add_(_st(_st($ctx1.locals.statements)._last())._copy());
- $5=_st($4)._yourself();
- return _st(_st($ctx1.locals.statements)._last())._replaceWith_($5);
- };
- })});
- _st($1)._ifNotEmpty_($2);
- $6=$ctx1.locals.inlinedClosure;
- return $6;
- }, self, "inlineClosure:", [anIRClosure], smalltalk.IRAssignmentInliner)},
- args: ["anIRClosure"],
- source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last canBeAssigned ifTrue: [\x0a\x09\x09\x09statements last replaceWith: (IRAssignment new\x0a\x09\x09\x09\x09add: self assignment instructions first;\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself) ] ].\x0a\x0a\x09^ inlinedClosure",
- messageSends: ["inlineClosure:", "instructions", "last", "ifNotEmpty:", "ifTrue:", "replaceWith:", "add:", "first", "assignment", "new", "copy", "yourself", "canBeAssigned"],
- referencedClasses: ["IRAssignment"]
- }),
- smalltalk.IRAssignmentInliner);
- smalltalk.addMethod(
- "_inlineClosure_",
- smalltalk.method({
- selector: "inlineClosure:",
- category: '*Compiler',
- fn: function (anIRClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=smalltalk.IRSendInliner.fn.prototype._inlineCLosure_.apply(_st(self), [anIRClosure]);
- return $1;
- }, self, "inlineClosure:", [anIRClosure], smalltalk.IRNonLocalReturnInliner)},
- args: ["anIRClosure"],
- source: "inlineClosure: anIRClosure\x0a\x09\x22| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last replaceWith: (IRNonLocalReturn new\x0a\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09^ inlinedClosure\x22\x0a\x0a\x09^ super inlineCLosure: anIRClosure",
- messageSends: ["inlineCLosure:"],
- referencedClasses: []
- }),
- smalltalk.IRNonLocalReturnInliner);
- smalltalk.addMethod(
- "_inlinedReturn",
- smalltalk.method({
- selector: "inlinedReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.IRInlinedNonLocalReturn || IRInlinedNonLocalReturn))._new();
- return $1;
- }, self, "inlinedReturn", [], smalltalk.IRNonLocalReturnInliner)},
- args: [],
- source: "inlinedReturn\x0a\x09^ IRInlinedNonLocalReturn new",
- messageSends: ["new"],
- referencedClasses: ["IRInlinedNonLocalReturn"]
- }),
- smalltalk.IRNonLocalReturnInliner);
- smalltalk.addMethod(
- "_inlineClosure_",
- smalltalk.method({
- selector: "inlineClosure:",
- category: '*Compiler',
- fn: function (anIRClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$4,$5,$2,$6;
- $ctx1.locals.closure=nil;
- $ctx1.locals.statements=nil;
- $ctx1.locals.closure=smalltalk.IRSendInliner.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
- $ctx1.locals.statements=_st(_st(_st($ctx1.locals.closure)._instructions())._last())._instructions();
- $1=$ctx1.locals.statements;
- $2=(function(){
- return smalltalk.withContext(function($ctx2) {
$3=_st(_st($ctx1.locals.statements)._last())._isReturn();
- if(! smalltalk.assert($3)){
- $4=_st((smalltalk.IRReturn || IRReturn))._new();
- _st($4)._add_(_st(_st($ctx1.locals.statements)._last())._copy());
- $5=_st($4)._yourself();
- return _st(_st($ctx1.locals.statements)._last())._replaceWith_($5);
- };
- })});
- _st($1)._ifNotEmpty_($2);
- $6=$ctx1.locals.closure;
- return $6;
- }, self, "inlineClosure:", [anIRClosure], smalltalk.IRReturnInliner)},
- args: ["anIRClosure"],
- source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last isReturn\x0a\x09\x09\x09ifFalse: [ statements last replaceWith: (IRReturn new\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself)] ].\x0a\x0a\x09^ closure",
- messageSends: ["inlineClosure:", "instructions", "last", "ifNotEmpty:", "ifFalse:", "replaceWith:", "add:", "copy", "new", "yourself", "isReturn"],
- referencedClasses: ["IRReturn"]
- }),
- smalltalk.IRReturnInliner);
- smalltalk.addMethod(
- "_inlineReturn_",
- smalltalk.method({
- selector: "inlineReturn:",
- category: '*Compiler',
- fn: function (anIRReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.return=nil;
- $ctx1.locals.return_=_st(self)._inlinedReturn();
- _st(_st(anIRReturn)._instructions())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.return_)._add_(each);
- })}));
- _st(anIRReturn)._replaceWith_($ctx1.locals.return_);
- _st(self)._inlineSend_(_st(_st($ctx1.locals.return_)._instructions())._last());
- $1=$ctx1.locals.return_;
- return $1;
- }, self, "inlineReturn:", [anIRReturn], smalltalk.IRReturnInliner)},
- args: ["anIRReturn"],
- source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn instructions do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return instructions last.\x0a\x09^ return",
- messageSends: ["inlinedReturn", "do:", "add:", "instructions", "replaceWith:", "inlineSend:", "last"],
- referencedClasses: []
- }),
- smalltalk.IRReturnInliner);
- smalltalk.addMethod(
- "_inlinedReturn",
- smalltalk.method({
- selector: "inlinedReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.IRInlinedReturn || IRInlinedReturn))._new();
- return $1;
- }, self, "inlinedReturn", [], smalltalk.IRReturnInliner)},
- args: [],
- source: "inlinedReturn\x0a\x09^ IRInlinedReturn new",
- messageSends: ["new"],
- referencedClasses: ["IRInlinedReturn"]
- }),
- smalltalk.IRReturnInliner);
- smalltalk.addMethod(
- "_visit_",
- smalltalk.method({
- selector: "visit:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(anIRInstruction)._accept_(self);
- return $1;
- }, self, "visit:", [anIRInstruction], smalltalk.IRVisitor)},
- args: ["anIRInstruction"],
- source: "visit: anIRInstruction\x0a\x09^ anIRInstruction accept: self",
- messageSends: ["accept:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRAssignment_",
- smalltalk.method({
- selector: "visitIRAssignment:",
- category: '*Compiler',
- fn: function (anIRAssignment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRAssignment);
- return $1;
- }, self, "visitIRAssignment:", [anIRAssignment], smalltalk.IRVisitor)},
- args: ["anIRAssignment"],
- source: "visitIRAssignment: anIRAssignment\x0a\x09^ self visitIRInstruction: anIRAssignment",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRBlockReturn_",
- smalltalk.method({
- selector: "visitIRBlockReturn:",
- category: '*Compiler',
- fn: function (anIRBlockReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRReturn_(anIRBlockReturn);
- return $1;
- }, self, "visitIRBlockReturn:", [anIRBlockReturn], smalltalk.IRVisitor)},
- args: ["anIRBlockReturn"],
- source: "visitIRBlockReturn: anIRBlockReturn\x0a\x09^ self visitIRReturn: anIRBlockReturn",
- messageSends: ["visitIRReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRBlockSequence_",
- smalltalk.method({
- selector: "visitIRBlockSequence:",
- category: '*Compiler',
- fn: function (anIRBlockSequence){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRSequence_(anIRBlockSequence);
- return $1;
- }, self, "visitIRBlockSequence:", [anIRBlockSequence], smalltalk.IRVisitor)},
- args: ["anIRBlockSequence"],
- source: "visitIRBlockSequence: anIRBlockSequence\x0a\x09^ self visitIRSequence: anIRBlockSequence",
- messageSends: ["visitIRSequence:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRClosure_",
- smalltalk.method({
- selector: "visitIRClosure:",
- category: '*Compiler',
- fn: function (anIRClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRClosure);
- return $1;
- }, self, "visitIRClosure:", [anIRClosure], smalltalk.IRVisitor)},
- args: ["anIRClosure"],
- source: "visitIRClosure: anIRClosure\x0a\x09^ self visitIRInstruction: anIRClosure",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRDynamicArray_",
- smalltalk.method({
- selector: "visitIRDynamicArray:",
- category: '*Compiler',
- fn: function (anIRDynamicArray){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
- return $1;
- }, self, "visitIRDynamicArray:", [anIRDynamicArray], smalltalk.IRVisitor)},
- args: ["anIRDynamicArray"],
- source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09^ self visitIRInstruction: anIRDynamicArray",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRDynamicDictionary_",
- smalltalk.method({
- selector: "visitIRDynamicDictionary:",
- category: '*Compiler',
- fn: function (anIRDynamicDictionary){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
- return $1;
- }, self, "visitIRDynamicDictionary:", [anIRDynamicDictionary], smalltalk.IRVisitor)},
- args: ["anIRDynamicDictionary"],
- source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09^ self visitIRInstruction: anIRDynamicDictionary",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRInlinedClosure_",
- smalltalk.method({
- selector: "visitIRInlinedClosure:",
- category: '*Compiler',
- fn: function (anIRInlinedClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
- return $1;
- }, self, "visitIRInlinedClosure:", [anIRInlinedClosure], smalltalk.IRVisitor)},
- args: ["anIRInlinedClosure"],
- source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09^ self visitIRClosure: anIRInlinedClosure",
- messageSends: ["visitIRClosure:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRInlinedSequence_",
- smalltalk.method({
- selector: "visitIRInlinedSequence:",
- category: '*Compiler',
- fn: function (anIRInlinedSequence){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
- return $1;
- }, self, "visitIRInlinedSequence:", [anIRInlinedSequence], smalltalk.IRVisitor)},
- args: ["anIRInlinedSequence"],
- source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09^ self visitIRSequence: anIRInlinedSequence",
- messageSends: ["visitIRSequence:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRInstruction_",
- smalltalk.method({
- selector: "visitIRInstruction:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(_st(anIRInstruction)._instructions())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(each);
- })}));
- $1=anIRInstruction;
- return $1;
- }, self, "visitIRInstruction:", [anIRInstruction], smalltalk.IRVisitor)},
- args: ["anIRInstruction"],
- source: "visitIRInstruction: anIRInstruction\x0a\x09anIRInstruction instructions do: [ :each | self visit: each ].\x0a\x09^ anIRInstruction",
- messageSends: ["do:", "visit:", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRMethod_",
- smalltalk.method({
- selector: "visitIRMethod:",
- category: '*Compiler',
- fn: function (anIRMethod){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRMethod);
- return $1;
- }, self, "visitIRMethod:", [anIRMethod], smalltalk.IRVisitor)},
- args: ["anIRMethod"],
- source: "visitIRMethod: anIRMethod\x0a\x09^ self visitIRInstruction: anIRMethod",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRNonLocalReturn_",
- smalltalk.method({
- selector: "visitIRNonLocalReturn:",
- category: '*Compiler',
- fn: function (anIRNonLocalReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
- return $1;
- }, self, "visitIRNonLocalReturn:", [anIRNonLocalReturn], smalltalk.IRVisitor)},
- args: ["anIRNonLocalReturn"],
- source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self visitIRInstruction: anIRNonLocalReturn",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRNonLocalReturnHandling_",
- smalltalk.method({
- selector: "visitIRNonLocalReturnHandling:",
- category: '*Compiler',
- fn: function (anIRNonLocalReturnHandling){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
- return $1;
- }, self, "visitIRNonLocalReturnHandling:", [anIRNonLocalReturnHandling], smalltalk.IRVisitor)},
- args: ["anIRNonLocalReturnHandling"],
- source: "visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling\x0a\x09^ self visitIRInstruction: anIRNonLocalReturnHandling",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRReturn_",
- smalltalk.method({
- selector: "visitIRReturn:",
- category: '*Compiler',
- fn: function (anIRReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRReturn);
- return $1;
- }, self, "visitIRReturn:", [anIRReturn], smalltalk.IRVisitor)},
- args: ["anIRReturn"],
- source: "visitIRReturn: anIRReturn\x0a\x09^ self visitIRInstruction: anIRReturn",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRSend_",
- smalltalk.method({
- selector: "visitIRSend:",
- category: '*Compiler',
- fn: function (anIRSend){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRSend);
- return $1;
- }, self, "visitIRSend:", [anIRSend], smalltalk.IRVisitor)},
- args: ["anIRSend"],
- source: "visitIRSend: anIRSend\x0a\x09^ self visitIRInstruction: anIRSend",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRSequence_",
- smalltalk.method({
- selector: "visitIRSequence:",
- category: '*Compiler',
- fn: function (anIRSequence){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRSequence);
- return $1;
- }, self, "visitIRSequence:", [anIRSequence], smalltalk.IRVisitor)},
- args: ["anIRSequence"],
- source: "visitIRSequence: anIRSequence\x0a\x09^ self visitIRInstruction: anIRSequence",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRTempDeclaration_",
- smalltalk.method({
- selector: "visitIRTempDeclaration:",
- category: '*Compiler',
- fn: function (anIRTempDeclaration){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
- return $1;
- }, self, "visitIRTempDeclaration:", [anIRTempDeclaration], smalltalk.IRVisitor)},
- args: ["anIRTempDeclaration"],
- source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09^ self visitIRInstruction: anIRTempDeclaration",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRValue_",
- smalltalk.method({
- selector: "visitIRValue:",
- category: '*Compiler',
- fn: function (anIRValue){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRValue);
- return $1;
- }, self, "visitIRValue:", [anIRValue], smalltalk.IRVisitor)},
- args: ["anIRValue"],
- source: "visitIRValue: anIRValue\x0a\x09^ self visitIRInstruction: anIRValue",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRVariable_",
- smalltalk.method({
- selector: "visitIRVariable:",
- category: '*Compiler',
- fn: function (anIRVariable){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRVariable);
- return $1;
- }, self, "visitIRVariable:", [anIRVariable], smalltalk.IRVisitor)},
- args: ["anIRVariable"],
- source: "visitIRVariable: anIRVariable\x0a\x09^ self visitIRInstruction: anIRVariable",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_visitIRVerbatim_",
- smalltalk.method({
- selector: "visitIRVerbatim:",
- category: '*Compiler',
- fn: function (anIRVerbatim){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitIRInstruction_(anIRVerbatim);
- return $1;
- }, self, "visitIRVerbatim:", [anIRVerbatim], smalltalk.IRVisitor)},
- args: ["anIRVerbatim"],
- source: "visitIRVerbatim: anIRVerbatim\x0a\x09^ self visitIRInstruction: anIRVerbatim",
- messageSends: ["visitIRInstruction:"],
- referencedClasses: []
- }),
- smalltalk.IRVisitor);
- smalltalk.addMethod(
- "_assignmentInliner",
- smalltalk.method({
- selector: "assignmentInliner",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRAssignmentInliner || IRAssignmentInliner))._new();
- _st($2)._translator_(self);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "assignmentInliner", [], smalltalk.IRInliner)},
- args: [],
- source: "assignmentInliner\x0a\x09^ IRAssignmentInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
- messageSends: ["translator:", "new", "yourself"],
- referencedClasses: ["IRAssignmentInliner"]
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_nonLocalReturnInliner",
- smalltalk.method({
- selector: "nonLocalReturnInliner",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRNonLocalReturnInliner || IRNonLocalReturnInliner))._new();
- _st($2)._translator_(self);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "nonLocalReturnInliner", [], smalltalk.IRInliner)},
- args: [],
- source: "nonLocalReturnInliner\x0a\x09^ IRNonLocalReturnInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
- messageSends: ["translator:", "new", "yourself"],
- referencedClasses: ["IRNonLocalReturnInliner"]
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_returnInliner",
- smalltalk.method({
- selector: "returnInliner",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRReturnInliner || IRReturnInliner))._new();
- _st($2)._translator_(self);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "returnInliner", [], smalltalk.IRInliner)},
- args: [],
- source: "returnInliner\x0a\x09^ IRReturnInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
- messageSends: ["translator:", "new", "yourself"],
- referencedClasses: ["IRReturnInliner"]
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_sendInliner",
- smalltalk.method({
- selector: "sendInliner",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRSendInliner || IRSendInliner))._new();
- _st($2)._translator_(self);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "sendInliner", [], smalltalk.IRInliner)},
- args: [],
- source: "sendInliner\x0a\x09^ IRSendInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
- messageSends: ["translator:", "new", "yourself"],
- referencedClasses: ["IRSendInliner"]
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_shouldInlineAssignment_",
- smalltalk.method({
- selector: "shouldInlineAssignment:",
- category: '*Compiler',
- fn: function (anIRAssignment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(anIRAssignment)._isInlined())._not())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(_st(anIRAssignment)._instructions())._last())._isSend())._and_((function(){
- return smalltalk.withContext(function($ctx3) {
return _st(self)._shouldInlineSend_(_st(_st(anIRAssignment)._instructions())._last());
- })}));
- })}));
- return $1;
- }, self, "shouldInlineAssignment:", [anIRAssignment], smalltalk.IRInliner)},
- args: ["anIRAssignment"],
- source: "shouldInlineAssignment: anIRAssignment\x0a\x09^ anIRAssignment isInlined not and: [ \x0a\x09\x09anIRAssignment instructions last isSend and: [\x09\x0a\x09\x09\x09self shouldInlineSend: (anIRAssignment instructions last) ]]",
- messageSends: ["and:", "shouldInlineSend:", "last", "instructions", "isSend", "not", "isInlined"],
- referencedClasses: []
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_shouldInlineReturn_",
- smalltalk.method({
- selector: "shouldInlineReturn:",
- category: '*Compiler',
- fn: function (anIRReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(anIRReturn)._isInlined())._not())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(_st(anIRReturn)._instructions())._first())._isSend())._and_((function(){
- return smalltalk.withContext(function($ctx3) {
return _st(self)._shouldInlineSend_(_st(_st(anIRReturn)._instructions())._first());
- })}));
- })}));
- return $1;
- }, self, "shouldInlineReturn:", [anIRReturn], smalltalk.IRInliner)},
- args: ["anIRReturn"],
- source: "shouldInlineReturn: anIRReturn\x0a\x09^ anIRReturn isInlined not and: [ \x0a\x09\x09anIRReturn instructions first isSend and: [\x09\x0a\x09\x09\x09self shouldInlineSend: (anIRReturn instructions first) ]]",
- messageSends: ["and:", "shouldInlineSend:", "first", "instructions", "isSend", "not", "isInlined"],
- referencedClasses: []
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_shouldInlineSend_",
- smalltalk.method({
- selector: "shouldInlineSend:",
- category: '*Compiler',
- fn: function (anIRSend){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(anIRSend)._isInlined())._not())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st((smalltalk.IRSendInliner || IRSendInliner))._shouldInline_(anIRSend);
- })}));
- return $1;
- }, self, "shouldInlineSend:", [anIRSend], smalltalk.IRInliner)},
- args: ["anIRSend"],
- source: "shouldInlineSend: anIRSend\x0a\x09^ anIRSend isInlined not and: [\x0a\x09\x09IRSendInliner shouldInline: anIRSend ]",
- messageSends: ["and:", "shouldInline:", "not", "isInlined"],
- referencedClasses: ["IRSendInliner"]
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_transformNonLocalReturn_",
- smalltalk.method({
- selector: "transformNonLocalReturn:",
- category: '*Compiler',
- fn: function (anIRNonLocalReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5;
- $ctx1.locals.localReturn=nil;
- $1=_st(_st(anIRNonLocalReturn)._scope())._canInlineNonLocalReturns();
- if(smalltalk.assert($1)){
- _st(_st(_st(anIRNonLocalReturn)._scope())._methodScope())._removeNonLocalReturn_(_st(anIRNonLocalReturn)._scope());
- $2=_st((smalltalk.IRReturn || IRReturn))._new();
- _st($2)._scope_(_st(anIRNonLocalReturn)._scope());
- $3=_st($2)._yourself();
- $ctx1.locals.localReturn=$3;
- $ctx1.locals.localReturn;
- _st(_st(anIRNonLocalReturn)._instructions())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.localReturn)._add_(each);
- })}));
- _st(anIRNonLocalReturn)._replaceWith_($ctx1.locals.localReturn);
- $4=$ctx1.locals.localReturn;
- return $4;
- };
- $5=smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
- return $5;
- }, self, "transformNonLocalReturn:", [anIRNonLocalReturn], smalltalk.IRInliner)},
- args: ["anIRNonLocalReturn"],
- source: "transformNonLocalReturn: anIRNonLocalReturn\x0a\x09\x22Replace a non local return into a local return\x22\x0a\x0a\x09| localReturn |\x0a\x09anIRNonLocalReturn scope canInlineNonLocalReturns ifTrue: [\x0a\x09\x09anIRNonLocalReturn scope methodScope removeNonLocalReturn: anIRNonLocalReturn scope.\x0a\x09\x09localReturn := IRReturn new\x0a\x09\x09\x09scope: anIRNonLocalReturn scope;\x0a\x09\x09\x09yourself.\x0a\x09\x09anIRNonLocalReturn instructions do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: anIRNonLocalReturn",
- messageSends: ["ifTrue:", "removeNonLocalReturn:", "scope", "methodScope", "scope:", "new", "yourself", "do:", "add:", "instructions", "replaceWith:", "canInlineNonLocalReturns", "visitIRNonLocalReturn:"],
- referencedClasses: ["IRReturn"]
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_visitIRAssignment_",
- smalltalk.method({
- selector: "visitIRAssignment:",
- category: '*Compiler',
- fn: function (anIRAssignment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(self)._shouldInlineAssignment_(anIRAssignment);
- if(smalltalk.assert($2)){
- $1=_st(_st(self)._assignmentInliner())._inlineAssignment_(anIRAssignment);
- } else {
- $1=smalltalk.IRVisitor.fn.prototype._visitIRAssignment_.apply(_st(self), [anIRAssignment]);
- };
- return $1;
- }, self, "visitIRAssignment:", [anIRAssignment], smalltalk.IRInliner)},
- args: ["anIRAssignment"],
- source: "visitIRAssignment: anIRAssignment\x0a\x09^ (self shouldInlineAssignment: anIRAssignment) \x0a\x09\x09ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]\x0a\x09\x09ifFalse: [ super visitIRAssignment: anIRAssignment ]",
- messageSends: ["ifTrue:ifFalse:", "inlineAssignment:", "assignmentInliner", "visitIRAssignment:", "shouldInlineAssignment:"],
- referencedClasses: []
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_visitIRNonLocalReturn_",
- smalltalk.method({
- selector: "visitIRNonLocalReturn:",
- category: '*Compiler',
- fn: function (anIRNonLocalReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(self)._shouldInlineReturn_(anIRNonLocalReturn);
- if(smalltalk.assert($2)){
- $1=_st(_st(self)._nonLocalReturnInliner())._inlineReturn_(anIRNonLocalReturn);
- } else {
- $1=_st(self)._transformNonLocalReturn_(anIRNonLocalReturn);
- };
- return $1;
- }, self, "visitIRNonLocalReturn:", [anIRNonLocalReturn], smalltalk.IRInliner)},
- args: ["anIRNonLocalReturn"],
- source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ (self shouldInlineReturn: anIRNonLocalReturn) \x0a\x09\x09ifTrue: [ self nonLocalReturnInliner inlineReturn: anIRNonLocalReturn ]\x0a\x09\x09ifFalse: [ self transformNonLocalReturn: anIRNonLocalReturn ]",
- messageSends: ["ifTrue:ifFalse:", "inlineReturn:", "nonLocalReturnInliner", "transformNonLocalReturn:", "shouldInlineReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_visitIRReturn_",
- smalltalk.method({
- selector: "visitIRReturn:",
- category: '*Compiler',
- fn: function (anIRReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(self)._shouldInlineReturn_(anIRReturn);
- if(smalltalk.assert($2)){
- $1=_st(_st(self)._returnInliner())._inlineReturn_(anIRReturn);
- } else {
- $1=smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
- };
- return $1;
- }, self, "visitIRReturn:", [anIRReturn], smalltalk.IRInliner)},
- args: ["anIRReturn"],
- source: "visitIRReturn: anIRReturn\x0a\x09^ (self shouldInlineReturn: anIRReturn) \x0a\x09\x09ifTrue: [ self returnInliner inlineReturn: anIRReturn ]\x0a\x09\x09ifFalse: [ super visitIRReturn: anIRReturn ]",
- messageSends: ["ifTrue:ifFalse:", "inlineReturn:", "returnInliner", "visitIRReturn:", "shouldInlineReturn:"],
- referencedClasses: []
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_visitIRSend_",
- smalltalk.method({
- selector: "visitIRSend:",
- category: '*Compiler',
- fn: function (anIRSend){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(self)._shouldInlineSend_(anIRSend);
- if(smalltalk.assert($2)){
- $1=_st(_st(self)._sendInliner())._inlineSend_(anIRSend);
- } else {
- $1=smalltalk.IRVisitor.fn.prototype._visitIRSend_.apply(_st(self), [anIRSend]);
- };
- return $1;
- }, self, "visitIRSend:", [anIRSend], smalltalk.IRInliner)},
- args: ["anIRSend"],
- source: "visitIRSend: anIRSend\x0a\x09^ (self shouldInlineSend: anIRSend)\x0a\x09\x09ifTrue: [ self sendInliner inlineSend: anIRSend ]\x0a\x09\x09ifFalse: [ super visitIRSend: anIRSend ]",
- messageSends: ["ifTrue:ifFalse:", "inlineSend:", "sendInliner", "visitIRSend:", "shouldInlineSend:"],
- referencedClasses: []
- }),
- smalltalk.IRInliner);
- smalltalk.addMethod(
- "_contents",
- smalltalk.method({
- selector: "contents",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._stream())._contents();
- return $1;
- }, self, "contents", [], smalltalk.IRJSTranslator)},
- args: [],
- source: "contents\x0a\x09^ self stream contents",
- messageSends: ["contents", "stream"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
- self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
- return self}, self, "initialize", [], smalltalk.IRJSTranslator)},
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09stream := JSStream new.",
- messageSends: ["initialize", "new"],
- referencedClasses: ["JSStream"]
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_stream",
- smalltalk.method({
- selector: "stream",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@stream"];
- return $1;
- }, self, "stream", [], smalltalk.IRJSTranslator)},
- args: [],
- source: "stream\x0a\x09^ stream",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_stream_",
- smalltalk.method({
- selector: "stream:",
- category: '*Compiler',
- fn: function (aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@stream"]=aStream;
- return self}, self, "stream:", [aStream], smalltalk.IRJSTranslator)},
- args: ["aStream"],
- source: "stream: aStream\x0a\x09stream := aStream",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRAssignment_",
- smalltalk.method({
- selector: "visitIRAssignment:",
- category: '*Compiler',
- fn: function (anIRAssignment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
- _st(_st(self)._stream())._nextPutAssignment();
- _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
- return self}, self, "visitIRAssignment:", [anIRAssignment], smalltalk.IRJSTranslator)},
- args: ["anIRAssignment"],
- source: "visitIRAssignment: anIRAssignment\x0a\x09self visit: anIRAssignment instructions first.\x0a\x09self stream nextPutAssignment.\x0a\x09self visit: anIRAssignment instructions last.",
- messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRClosure_",
- smalltalk.method({
- selector: "visitIRClosure:",
- category: '*Compiler',
- fn: function (anIRClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
- return smalltalk.withContext(function($ctx3) {
return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
- })}));
- })}),_st(anIRClosure)._arguments());
- return self}, self, "visitIRClosure:", [anIRClosure], smalltalk.IRJSTranslator)},
- args: ["anIRClosure"],
- source: "visitIRClosure: anIRClosure\x0a\x09self stream \x0a\x09\x09nextPutClosureWith: [ \x0a \x09self stream \x0a \x09nextPutBlockContextFor: anIRClosure\x0a during: [ super visitIRClosure: anIRClosure ] ]\x0a\x09\x09arguments: anIRClosure arguments",
- messageSends: ["nextPutClosureWith:arguments:", "nextPutBlockContextFor:during:", "visitIRClosure:", "stream", "arguments"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRDynamicArray_",
- smalltalk.method({
- selector: "visitIRDynamicArray:",
- category: '*Compiler',
- fn: function (anIRDynamicArray){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutAll_("[");
- _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(each);
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._stream())._nextPutAll_(",");
- })}));
- _st(self["@stream"])._nextPutAll_("]");
- return self}, self, "visitIRDynamicArray:", [anIRDynamicArray], smalltalk.IRJSTranslator)},
- args: ["anIRDynamicArray"],
- source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09self stream nextPutAll: '['.\x0a\x09anIRDynamicArray instructions\x0a\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ']'",
- messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRDynamicDictionary_",
- smalltalk.method({
- selector: "visitIRDynamicDictionary:",
- category: '*Compiler',
- fn: function (anIRDynamicDictionary){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
- _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(each);
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._stream())._nextPutAll_(",");
- })}));
- _st(_st(self)._stream())._nextPutAll_("])");
- return self}, self, "visitIRDynamicDictionary:", [anIRDynamicDictionary], smalltalk.IRJSTranslator)},
- args: ["anIRDynamicDictionary"],
- source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09self stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09anIRDynamicDictionary instructions \x0a\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09separatedBy: [self stream nextPutAll: ',' ].\x0a\x09self stream nextPutAll: '])'",
- messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRMethod_",
- smalltalk.method({
- selector: "visitIRMethod:",
- category: '*Compiler',
- fn: function (anIRMethod){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$4,$6,$7,$9,$10,$8,$5,$3;
- $1=_st(self)._stream();
- $2=anIRMethod;
- $3=(function(){
- return smalltalk.withContext(function($ctx2) {
$4=_st(self)._stream();
- $5=(function(){
- return smalltalk.withContext(function($ctx3) {
$6=_st(self)._stream();
- $7=anIRMethod;
- $8=(function(){
- return smalltalk.withContext(function($ctx4) {
$9=_st(_st(anIRMethod)._internalVariables())._notEmpty();
- if(smalltalk.assert($9)){
- _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
- return smalltalk.withContext(function($ctx5) {
return _st(_st(each)._variable())._alias();
- })})));
- };
- $10=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
- if(smalltalk.assert($10)){
- return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
- return smalltalk.withContext(function($ctx5) {
return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
- })}));
- } else {
- return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
- };
- })});
- return _st($6)._nextPutContextFor_during_($7,$8);
- })});
- return _st($4)._nextPutFunctionWith_arguments_($5,_st(anIRMethod)._arguments());
- })});
- _st($1)._nextPutMethodDeclaration_with_($2,$3);
- return self}, self, "visitIRMethod:", [anIRMethod], smalltalk.IRJSTranslator)},
- args: ["anIRMethod"],
- source: "visitIRMethod: anIRMethod\x0a\x09self stream\x0a\x09\x09nextPutMethodDeclaration: anIRMethod \x0a\x09\x09with: [ self stream \x0a\x09\x09\x09nextPutFunctionWith: [ \x0a \x09self stream nextPutContextFor: anIRMethod during: [\x0a\x09\x09\x09\x09anIRMethod internalVariables notEmpty ifTrue: [\x0a\x09\x09\x09\x09\x09self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |\x0a\x09\x09\x09\x09\x09\x09each variable alias ]) ].\x0a\x09\x09\x09\x09anIRMethod scope hasNonLocalReturn \x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09self stream nextPutNonLocalReturnHandlingWith: [\x0a\x09\x09\x09\x09\x09\x09\x09super visitIRMethod: anIRMethod ]]\x0a\x09\x09\x09\x09\x09ifFalse: [ super visitIRMethod: anIRMethod ]]]\x0a\x09\x09\x09arguments: anIRMethod arguments ]",
- messageSends: ["nextPutMethodDeclaration:with:", "nextPutFunctionWith:arguments:", "nextPutContextFor:during:", "ifTrue:", "nextPutVars:", "collect:", "alias", "variable", "asArray", "internalVariables", "stream", "notEmpty", "ifTrue:ifFalse:", "nextPutNonLocalReturnHandlingWith:", "visitIRMethod:", "hasNonLocalReturn", "scope", "arguments"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRNonLocalReturn_",
- smalltalk.method({
- selector: "visitIRNonLocalReturn:",
- category: '*Compiler',
- fn: function (anIRNonLocalReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
- return smalltalk.withContext(function($ctx2) {
return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
- })}));
- return self}, self, "visitIRNonLocalReturn:", [anIRNonLocalReturn], smalltalk.IRJSTranslator)},
- args: ["anIRNonLocalReturn"],
- source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09self stream nextPutNonLocalReturnWith: [\x0a\x09\x09super visitIRNonLocalReturn: anIRNonLocalReturn ]",
- messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRReturn_",
- smalltalk.method({
- selector: "visitIRReturn:",
- category: '*Compiler',
- fn: function (anIRReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutReturnWith_((function(){
- return smalltalk.withContext(function($ctx2) {
return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
- })}));
- return self}, self, "visitIRReturn:", [anIRReturn], smalltalk.IRJSTranslator)},
- args: ["anIRReturn"],
- source: "visitIRReturn: anIRReturn\x0a\x09self stream nextPutReturnWith: [\x0a\x09\x09super visitIRReturn: anIRReturn ]",
- messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRSend_",
- smalltalk.method({
- selector: "visitIRSend:",
- category: '*Compiler',
- fn: function (anIRSend){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3;
- $1=_st(anIRSend)._classSend();
- if(($receiver = $1) == nil || $receiver == undefined){
- _st(_st(self)._stream())._nextPutAll_("_st(");
- _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
- _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
- _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(each);
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._stream())._nextPutAll_(",");
- })}));
- _st(_st(self)._stream())._nextPutAll_(")");
- } else {
- $2=_st(self)._stream();
- _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
- _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
- $3=_st($2)._nextPutAll_("_st(");
- $3;
- _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
- _st(_st(self)._stream())._nextPutAll_("), [");
- _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(each);
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._stream())._nextPutAll_(",");
- })}));
- _st(_st(self)._stream())._nextPutAll_("])");
- };
- return self}, self, "visitIRSend:", [anIRSend], smalltalk.IRJSTranslator)},
- args: ["anIRSend"],
- source: "visitIRSend: anIRSend\x0a\x09anIRSend classSend \x0a \x09ifNil: [\x0a\x09\x09\x09self stream nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a \x09\x09 \x09self stream nextPutAll: ').', anIRSend selector asSelector, '('.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09ifNotNil: [ \x0a\x09\x09\x09self stream \x0a \x09nextPutAll: anIRSend classSend asJavascript, '.fn.prototype.';\x0a\x09\x09\x09\x09nextPutAll: anIRSend selector asSelector, '.apply(';\x0a\x09\x09\x09\x09nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a\x09\x09\x09self stream nextPutAll: '), ['.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: '])' ]",
- messageSends: ["ifNil:ifNotNil:", "nextPutAll:", "stream", "visit:", "first", "instructions", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "asJavascript", "classSend"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRSequence_",
- smalltalk.method({
- selector: "visitIRSequence:",
- category: '*Compiler',
- fn: function (anIRSequence){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutSequenceWith_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(anIRSequence)._instructions())._do_((function(each){
- return smalltalk.withContext(function($ctx3) {
return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
- })}));
- })}));
- return self}, self, "visitIRSequence:", [anIRSequence], smalltalk.IRJSTranslator)},
- args: ["anIRSequence"],
- source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence instructions do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ]]",
- messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRTempDeclaration_",
- smalltalk.method({
- selector: "visitIRTempDeclaration:",
- category: '*Compiler',
- fn: function (anIRTempDeclaration){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=_st(self)._stream();
- _st($1)._nextPutAll_(_st(_st(_st(_st(_st(anIRTempDeclaration)._scope())._alias()).__comma(".locals.")).__comma(_st(anIRTempDeclaration)._name())).__comma("=nil;"));
- $2=_st($1)._lf();
- return self}, self, "visitIRTempDeclaration:", [anIRTempDeclaration], smalltalk.IRJSTranslator)},
- args: ["anIRTempDeclaration"],
- source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09self stream \x0a \x09nextPutAll: anIRTempDeclaration scope alias, '.locals.', anIRTempDeclaration name, '=nil;'; \x0a lf",
- messageSends: ["nextPutAll:", ",", "name", "alias", "scope", "stream", "lf"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRValue_",
- smalltalk.method({
- selector: "visitIRValue:",
- category: '*Compiler',
- fn: function (anIRValue){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
- return self}, self, "visitIRValue:", [anIRValue], smalltalk.IRJSTranslator)},
- args: ["anIRValue"],
- source: "visitIRValue: anIRValue\x0a\x09self stream nextPutAll: anIRValue value asJavascript",
- messageSends: ["nextPutAll:", "asJavascript", "value", "stream"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRVariable_",
- smalltalk.method({
- selector: "visitIRVariable:",
- category: '*Compiler',
- fn: function (anIRVariable){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
- if(smalltalk.assert($1)){
- _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
- } else {
- _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
- };
- return self}, self, "visitIRVariable:", [anIRVariable], smalltalk.IRJSTranslator)},
- args: ["anIRVariable"],
- source: "visitIRVariable: anIRVariable\x0a\x09anIRVariable variable name = 'thisContext'\x0a \x09ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]\x0a \x09ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]",
- messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRVerbatim_",
- smalltalk.method({
- selector: "visitIRVerbatim:",
- category: '*Compiler',
- fn: function (anIRVerbatim){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutStatementWith_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
- })}));
- return self}, self, "visitIRVerbatim:", [anIRVerbatim], smalltalk.IRJSTranslator)},
- args: ["anIRVerbatim"],
- source: "visitIRVerbatim: anIRVerbatim\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self stream nextPutAll: anIRVerbatim source ]",
- messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"],
- referencedClasses: []
- }),
- smalltalk.IRJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedAssignment_",
- smalltalk.method({
- selector: "visitIRInlinedAssignment:",
- category: '*Compiler',
- fn: function (anIRInlinedAssignment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self)._visit_(_st(_st(anIRInlinedAssignment)._instructions())._last());
- return self}, self, "visitIRInlinedAssignment:", [anIRInlinedAssignment], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedAssignment"],
- source: "visitIRInlinedAssignment: anIRInlinedAssignment\x0a\x09self visit: anIRInlinedAssignment instructions last",
- messageSends: ["visit:", "last", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedClosure_",
- smalltalk.method({
- selector: "visitIRInlinedClosure:",
- category: '*Compiler',
- fn: function (anIRInlinedClosure){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(anIRInlinedClosure)._instructions())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(each);
- })}));
- return self}, self, "visitIRInlinedClosure:", [anIRInlinedClosure], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedClosure"],
- source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09anIRInlinedClosure instructions do: [ :each |\x0a\x09\x09self visit: each ]",
- messageSends: ["do:", "visit:", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedIfFalse_",
- smalltalk.method({
- selector: "visitIRInlinedIfFalse:",
- category: '*Compiler',
- fn: function (anIRInlinedIfFalse){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutIf_with_((function(){
- return smalltalk.withContext(function($ctx2) {
_st(_st(self)._stream())._nextPutAll_("! smalltalk.assert(");
- _st(self)._visit_(_st(_st(anIRInlinedIfFalse)._instructions())._first());
- return _st(_st(self)._stream())._nextPutAll_(")");
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedIfFalse)._instructions())._last());
- })}));
- return self}, self, "visitIRInlinedIfFalse:", [anIRInlinedIfFalse], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedIfFalse"],
- source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: '! smalltalk.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfFalse instructions last ]",
- messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedIfNil_",
- smalltalk.method({
- selector: "visitIRInlinedIfNil:",
- category: '*Compiler',
- fn: function (anIRInlinedIfNil){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutIf_with_((function(){
- return smalltalk.withContext(function($ctx2) {
_st(_st(self)._stream())._nextPutAll_("($receiver = ");
- _st(self)._visit_(_st(_st(anIRInlinedIfNil)._instructions())._first());
- return _st(_st(self)._stream())._nextPutAll_(") == nil || $receiver == undefined");
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedIfNil)._instructions())._last());
- })}));
- return self}, self, "visitIRInlinedIfNil:", [anIRInlinedIfNil], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedIfNil"],
- source: "visitIRInlinedIfNil: anIRInlinedIfNil\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: '($receiver = '. \x0a\x09\x09self visit: anIRInlinedIfNil instructions first.\x0a\x09\x09self stream nextPutAll: ') == nil || $receiver == undefined' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNil instructions last ]",
- messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedIfNilIfNotNil_",
- smalltalk.method({
- selector: "visitIRInlinedIfNilIfNotNil:",
- category: '*Compiler',
- fn: function (anIRInlinedIfNilIfNotNil){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutIfElse_with_with_((function(){
- return smalltalk.withContext(function($ctx2) {
_st(_st(self)._stream())._nextPutAll_("($receiver = ");
- _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._first());
- return _st(_st(self)._stream())._nextPutAll_(") == nil || $receiver == undefined");
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._second());
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._third());
- })}));
- return self}, self, "visitIRInlinedIfNilIfNotNil:", [anIRInlinedIfNilIfNotNil], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedIfNilIfNotNil"],
- source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream \x0a\x09\x09nextPutIfElse: [ \x0a\x09\x09\x09self stream nextPutAll: '($receiver = '. \x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == nil || $receiver == undefined' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
- messageSends: ["nextPutIfElse:with:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "second", "third"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedIfTrue_",
- smalltalk.method({
- selector: "visitIRInlinedIfTrue:",
- category: '*Compiler',
- fn: function (anIRInlinedIfTrue){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutIf_with_((function(){
- return smalltalk.withContext(function($ctx2) {
_st(_st(self)._stream())._nextPutAll_("smalltalk.assert(");
- _st(self)._visit_(_st(_st(anIRInlinedIfTrue)._instructions())._first());
- return _st(_st(self)._stream())._nextPutAll_(")");
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedIfTrue)._instructions())._last());
- })}));
- return self}, self, "visitIRInlinedIfTrue:", [anIRInlinedIfTrue], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedIfTrue"],
- source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: 'smalltalk.assert('. \x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrue instructions last ]",
- messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedIfTrueIfFalse_",
- smalltalk.method({
- selector: "visitIRInlinedIfTrueIfFalse:",
- category: '*Compiler',
- fn: function (anIRInlinedIfTrueIfFalse){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutIfElse_with_with_((function(){
- return smalltalk.withContext(function($ctx2) {
_st(_st(self)._stream())._nextPutAll_("smalltalk.assert(");
- _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._first());
- return _st(_st(self)._stream())._nextPutAll_(")");
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._second());
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._third());
- })}));
- return self}, self, "visitIRInlinedIfTrueIfFalse:", [anIRInlinedIfTrueIfFalse], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedIfTrueIfFalse"],
- source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream \x0a\x09\x09nextPutIfElse: [ \x0a\x09\x09\x09self stream nextPutAll: 'smalltalk.assert('. \x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
- messageSends: ["nextPutIfElse:with:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "second", "third"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedNonLocalReturn_",
- smalltalk.method({
- selector: "visitIRInlinedNonLocalReturn:",
- category: '*Compiler',
- fn: function (anIRInlinedReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._stream())._nextPutStatementWith_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
- })}));
- _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
- return smalltalk.withContext(function($ctx2) {
})}));
- return self}, self, "visitIRInlinedNonLocalReturn:", [anIRInlinedReturn], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedReturn"],
- source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn instructions last ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",
- messageSends: ["nextPutStatementWith:", "visit:", "last", "instructions", "stream", "nextPutNonLocalReturnWith:"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedReturn_",
- smalltalk.method({
- selector: "visitIRInlinedReturn:",
- category: '*Compiler',
- fn: function (anIRInlinedReturn){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self)._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
- return self}, self, "visitIRInlinedReturn:", [anIRInlinedReturn], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedReturn"],
- source: "visitIRInlinedReturn: anIRInlinedReturn\x0a\x09self visit: anIRInlinedReturn instructions last",
- messageSends: ["visit:", "last", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_visitIRInlinedSequence_",
- smalltalk.method({
- selector: "visitIRInlinedSequence:",
- category: '*Compiler',
- fn: function (anIRInlinedSequence){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(anIRInlinedSequence)._instructions())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._stream())._nextPutStatementWith_((function(){
- return smalltalk.withContext(function($ctx3) {
return _st(self)._visit_(each);
- })}));
- })}));
- return self}, self, "visitIRInlinedSequence:", [anIRInlinedSequence], smalltalk.IRInliningJSTranslator)},
- args: ["anIRInlinedSequence"],
- source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence instructions do: [ :each | \x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
- messageSends: ["do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
- referencedClasses: []
- }),
- smalltalk.IRInliningJSTranslator);
- smalltalk.addMethod(
- "_import_",
- smalltalk.method({
- selector: "import:",
- category: '*Compiler',
- fn: function (aStream){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$4,$6,$5,$2;
- $ctx1.locals.chunk=nil;
- $ctx1.locals.result=nil;
- $ctx1.locals.parser=nil;
- $ctx1.locals.lastEmpty=nil;
- $ctx1.locals.parser=_st((smalltalk.ChunkParser || ChunkParser))._on_(aStream);
- $ctx1.locals.lastEmpty=false;
- $1=(function(){
- return smalltalk.withContext(function($ctx2) {
$ctx1.locals.chunk=_st($ctx1.locals.parser)._nextChunk();
- $ctx1.locals.chunk;
- return _st($ctx1.locals.chunk)._isNil();
- })});
- $2=(function(){
- return smalltalk.withContext(function($ctx2) {
$3=_st($ctx1.locals.chunk)._isEmpty();
- $4=(function(){
- return smalltalk.withContext(function($ctx3) {
$ctx1.locals.lastEmpty=true;
- return $ctx1.locals.lastEmpty;
- })});
- $5=(function(){
- return smalltalk.withContext(function($ctx3) {
$ctx1.locals.result=_st(_st((smalltalk.Compiler || Compiler))._new())._evaluateExpression_($ctx1.locals.chunk);
- $ctx1.locals.result;
- $6=$ctx1.locals.lastEmpty;
- if(smalltalk.assert($6)){
- $ctx1.locals.lastEmpty=false;
- $ctx1.locals.lastEmpty;
- return _st($ctx1.locals.result)._scanFrom_($ctx1.locals.parser);
- };
- })});
- return _st($3)._ifTrue_ifFalse_($4,$5);
- })});
- _st($1)._whileFalse_($2);
- return self}, self, "import:", [aStream], smalltalk.Importer)},
- args: ["aStream"],
- source: "import: aStream\x0a | chunk result parser lastEmpty |\x0a parser := ChunkParser on: aStream.\x0a lastEmpty := false.\x0a [chunk := parser nextChunk.\x0a chunk isNil] whileFalse: [\x0a chunk isEmpty\x0a \x09\x09ifTrue: [lastEmpty := true]\x0a \x09\x09ifFalse: [\x0a \x09\x09result := Compiler new evaluateExpression: chunk.\x0a \x09\x09lastEmpty \x0a \x09\x09\x09ifTrue: [\x0a \x09lastEmpty := false.\x0a \x09result scanFrom: parser]]]",
- messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"],
- referencedClasses: ["ChunkParser", "Compiler"]
- }),
- smalltalk.Importer);
- smalltalk.addMethod(
- "_contents",
- smalltalk.method({
- selector: "contents",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self["@stream"])._contents();
- return $1;
- }, self, "contents", [], smalltalk.JSStream)},
- args: [],
- source: "contents\x0a\x09^ stream contents",
- messageSends: ["contents"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
- self["@stream"]=_st("")._writeStream();
- return self}, self, "initialize", [], smalltalk.JSStream)},
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.",
- messageSends: ["initialize", "writeStream"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_lf",
- smalltalk.method({
- selector: "lf",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self["@stream"])._lf();
- return self}, self, "lf", [], smalltalk.JSStream)},
- args: [],
- source: "lf\x0a\x09stream lf",
- messageSends: ["lf"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPut_",
- smalltalk.method({
- selector: "nextPut:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self["@stream"])._nextPut_(aString);
- return self}, self, "nextPut:", [aString], smalltalk.JSStream)},
- args: ["aString"],
- source: "nextPut: aString\x0a\x09stream nextPut: aString",
- messageSends: ["nextPut:"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutAll_",
- smalltalk.method({
- selector: "nextPutAll:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self["@stream"])._nextPutAll_(aString);
- return self}, self, "nextPutAll:", [aString], smalltalk.JSStream)},
- args: ["aString"],
- source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString",
- messageSends: ["nextPutAll:"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutAssignment",
- smalltalk.method({
- selector: "nextPutAssignment",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self["@stream"])._nextPutAll_("=");
- return self}, self, "nextPutAssignment", [], smalltalk.JSStream)},
- args: [],
- source: "nextPutAssignment\x0a\x09stream nextPutAll: '='",
- messageSends: ["nextPutAll:"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutBlockContextFor_during_",
- smalltalk.method({
- selector: "nextPutBlockContextFor:during:",
- category: '*Compiler',
- fn: function (anIRClosure,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=self;
- _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") { "));
- $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
- _st(aBlock)._value();
- _st(self)._nextPutAll_("})");
- return self}, self, "nextPutBlockContextFor:during:", [anIRClosure,aBlock], smalltalk.JSStream)},
- args: ["anIRClosure", "aBlock"],
- source: "nextPutBlockContextFor: anIRClosure during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') { '; \x0a nextPutAll: String cr.\x0a aBlock value.\x0a self nextPutAll: '})'",
- messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value"],
- referencedClasses: ["String"]
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutClosureWith_arguments_",
- smalltalk.method({
- selector: "nextPutClosureWith:arguments:",
- category: '*Compiler',
- fn: function (aBlock,anArray){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- _st(self["@stream"])._nextPutAll_("(function(");
- _st(anArray)._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPut_(",");
- })}));
- $1=self["@stream"];
- _st($1)._nextPutAll_("){");
- $2=_st($1)._lf();
- _st(aBlock)._value();
- _st(self["@stream"])._nextPutAll_("})");
- return self}, self, "nextPutClosureWith:arguments:", [aBlock,anArray], smalltalk.JSStream)},
- args: ["aBlock", "anArray"],
- source: "nextPutClosureWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: '(function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '})'",
- messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutContextFor_during_",
- smalltalk.method({
- selector: "nextPutContextFor:during:",
- category: '*Compiler',
- fn: function (aMethod,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5,$6;
- $1=self;
- _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
- $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
- _st(aBlock)._value();
- $3=self;
- _st($3)._nextPutAll_("}, self, ");
- $4=_st($3)._nextPutAll_(_st(_st(_st(aMethod)._selector())._asJavascript()).__comma(", ["));
- _st(_st(aMethod)._arguments())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._nextPutAll_(_st(each)._asVariableName());
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._nextPutAll_(",");
- })}));
- $5=self;
- _st($5)._nextPutAll_("], ");
- _st($5)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
- $6=_st($5)._nextPutAll_(")");
- return self}, self, "nextPutContextFor:during:", [aMethod,aBlock], smalltalk.JSStream)},
- args: ["aMethod", "aBlock"],
- source: "nextPutContextFor: aMethod during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; \x0a nextPutAll: String cr.\x0a aBlock value.\x0a self \x0a \x09nextPutAll: '}, self, ';\x0a nextPutAll: aMethod selector asJavascript, ', ['.\x0a aMethod arguments \x0a \x09do: [ :each | self nextPutAll: each asVariableName ]\x0a \x09separatedBy: [ self nextPutAll: ',' ].\x0a self nextPutAll: '], ';\x0a nextPutAll: aMethod theClass asJavascript;\x0a nextPutAll: ')'",
- messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "arguments", "theClass"],
- referencedClasses: ["String"]
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutFunctionWith_arguments_",
- smalltalk.method({
- selector: "nextPutFunctionWith:arguments:",
- category: '*Compiler',
- fn: function (aBlock,anArray){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- _st(self["@stream"])._nextPutAll_("fn: function(");
- _st(anArray)._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPut_(",");
- })}));
- $1=self["@stream"];
- _st($1)._nextPutAll_("){");
- $2=_st($1)._lf();
- $3=self["@stream"];
- _st($3)._nextPutAll_("var self=this;");
- $4=_st($3)._lf();
- _st(aBlock)._value();
- _st(self["@stream"])._nextPutAll_("}");
- return self}, self, "nextPutFunctionWith:arguments:", [aBlock,anArray], smalltalk.JSStream)},
- args: ["aBlock", "anArray"],
- source: "nextPutFunctionWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09stream nextPutAll: 'var self=this;'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '}'",
- messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutIf_with_",
- smalltalk.method({
- selector: "nextPutIf:with:",
- category: '*Compiler',
- fn: function (aBlock,anotherBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- _st(self["@stream"])._nextPutAll_("if(");
- _st(aBlock)._value();
- $1=self["@stream"];
- _st($1)._nextPutAll_("){");
- $2=_st($1)._lf();
- _st(anotherBlock)._value();
- _st(self["@stream"])._nextPutAll_("}");
- return self}, self, "nextPutIf:with:", [aBlock,anotherBlock], smalltalk.JSStream)},
- args: ["aBlock", "anotherBlock"],
- source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
- messageSends: ["nextPutAll:", "value", "lf"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutIfElse_with_with_",
- smalltalk.method({
- selector: "nextPutIfElse:with:with:",
- category: '*Compiler',
- fn: function (aBlock,ifBlock,elseBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- _st(self["@stream"])._nextPutAll_("if(");
- _st(aBlock)._value();
- $1=self["@stream"];
- _st($1)._nextPutAll_("){");
- $2=_st($1)._lf();
- _st(ifBlock)._value();
- $3=self["@stream"];
- _st($3)._nextPutAll_("} else {");
- $4=_st($3)._lf();
- _st(elseBlock)._value();
- _st(self["@stream"])._nextPutAll_("}");
- return self}, self, "nextPutIfElse:with:with:", [aBlock,ifBlock,elseBlock], smalltalk.JSStream)},
- args: ["aBlock", "ifBlock", "elseBlock"],
- source: "nextPutIfElse: aBlock with: ifBlock with: elseBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09ifBlock value.\x0a\x09stream nextPutAll: '} else {'; lf.\x0a\x09elseBlock value.\x0a\x09stream nextPutAll: '}'",
- messageSends: ["nextPutAll:", "value", "lf"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutMethodDeclaration_with_",
- smalltalk.method({
- selector: "nextPutMethodDeclaration:with:",
- category: '*Compiler',
- fn: function (aMethod,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5,$6;
- $1=self["@stream"];
- _st($1)._nextPutAll_("smalltalk.method({");
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
- _st($1)._lf();
- _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
- $2=_st($1)._lf();
- _st(aBlock)._value();
- $3=self["@stream"];
- _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
- _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
- _st($3)._lf();
- _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(each)._value();
- })})))._asArray())._asJavascript())).__comma(","));
- _st($3)._lf();
- $4=_st($3)._nextPutAll_("referencedClasses: [");
- _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPutAll_(",");
- })}));
- $5=self["@stream"];
- _st($5)._nextPutAll_("]");
- $6=_st($5)._nextPutAll_("})");
- return self}, self, "nextPutMethodDeclaration:with:", [aMethod,aBlock], smalltalk.JSStream)},
- args: ["aMethod", "aBlock"],
- source: "nextPutMethodDeclaration: aMethod with: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'smalltalk.method({'; lf;\x0a\x09\x09nextPutAll: 'selector: \x22', aMethod selector, '\x22,'; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf. \x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: aMethod messageSends asArray asJavascript, ','; lf;\x0a nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09aMethod classReferences \x0a\x09\x09do: [:each | stream nextPutAll: each asJavascript]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream \x0a\x09\x09nextPutAll: ']';\x0a\x09\x09nextPutAll: '})'",
- messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"],
- referencedClasses: ["String"]
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutNonLocalReturnHandlingWith_",
- smalltalk.method({
- selector: "nextPutNonLocalReturnHandlingWith:",
- category: '*Compiler',
- fn: function (aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $1=self["@stream"];
- _st($1)._nextPutAll_("var $early={};");
- _st($1)._lf();
- _st($1)._nextPutAll_("try {");
- $2=_st($1)._lf();
- _st(aBlock)._value();
- $3=self["@stream"];
- _st($3)._nextPutAll_("}");
- _st($3)._lf();
- _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
- $4=_st($3)._lf();
- return self}, self, "nextPutNonLocalReturnHandlingWith:", [aBlock], smalltalk.JSStream)},
- args: ["aBlock"],
- 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",
- messageSends: ["nextPutAll:", "lf", "value"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutNonLocalReturnWith_",
- smalltalk.method({
- selector: "nextPutNonLocalReturnWith:",
- category: '*Compiler',
- fn: function (aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self["@stream"])._nextPutAll_("throw $early=[");
- _st(aBlock)._value();
- _st(self["@stream"])._nextPutAll_("]");
- return self}, self, "nextPutNonLocalReturnWith:", [aBlock], smalltalk.JSStream)},
- args: ["aBlock"],
- source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: 'throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']'",
- messageSends: ["nextPutAll:", "value"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutReturn",
- smalltalk.method({
- selector: "nextPutReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self["@stream"])._nextPutAll_("return ");
- return self}, self, "nextPutReturn", [], smalltalk.JSStream)},
- args: [],
- source: "nextPutReturn\x0a\x09stream nextPutAll: 'return '",
- messageSends: ["nextPutAll:"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutReturnWith_",
- smalltalk.method({
- selector: "nextPutReturnWith:",
- category: '*Compiler',
- fn: function (aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self)._nextPutReturn();
- _st(aBlock)._value();
- return self}, self, "nextPutReturnWith:", [aBlock], smalltalk.JSStream)},
- args: ["aBlock"],
- source: "nextPutReturnWith: aBlock\x0a\x09self nextPutReturn.\x0a\x09aBlock value",
- messageSends: ["nextPutReturn", "value"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutSequenceWith_",
- smalltalk.method({
- selector: "nextPutSequenceWith:",
- category: '*Compiler',
- fn: function (aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aBlock)._value();
- return self}, self, "nextPutSequenceWith:", [aBlock], smalltalk.JSStream)},
- args: ["aBlock"],
- source: "nextPutSequenceWith: aBlock\x0a\x09\x22stream \x0a\x09\x09nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf.\x22\x0a\x09aBlock value.\x0a\x09\x22stream \x0a\x09\x09nextPutAll: '};'; lf\x22",
- messageSends: ["value"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutStatement_with_",
- smalltalk.method({
- selector: "nextPutStatement:with:",
- category: '*Compiler',
- fn: function (anInteger,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $1=self["@stream"];
- _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
- $2=_st($1)._lf();
- _st(self)._nextPutStatementWith_(aBlock);
- $3=self["@stream"];
- _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
- $4=_st($3)._lf();
- return self}, self, "nextPutStatement:with:", [anInteger,aBlock], smalltalk.JSStream)},
- args: ["anInteger", "aBlock"],
- source: "nextPutStatement: anInteger with: aBlock\x0a\x09stream nextPutAll: 'case ', anInteger asString, ':'; lf.\x0a\x09self nextPutStatementWith: aBlock.\x0a\x09stream nextPutAll: 'smalltalk.thisContext.pc=', (anInteger + 1) asString, ';'; lf",
- messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutStatementWith_",
- smalltalk.method({
- selector: "nextPutStatementWith:",
- category: '*Compiler',
- fn: function (aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- _st(aBlock)._value();
- $1=self["@stream"];
- _st($1)._nextPutAll_(";");
- $2=_st($1)._lf();
- return self}, self, "nextPutStatementWith:", [aBlock], smalltalk.JSStream)},
- args: ["aBlock"],
- source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
- messageSends: ["value", "nextPutAll:", "lf"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutVar_",
- smalltalk.method({
- selector: "nextPutVar:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=self["@stream"];
- _st($1)._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
- $2=_st($1)._lf();
- return self}, self, "nextPutVar:", [aString], smalltalk.JSStream)},
- args: ["aString"],
- source: "nextPutVar: aString\x0a\x09stream nextPutAll: 'var ', aString, ';'; lf",
- messageSends: ["nextPutAll:", ",", "lf"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_nextPutVars_",
- smalltalk.method({
- selector: "nextPutVars:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- _st(self["@stream"])._nextPutAll_("var ");
- _st(aCollection)._do_separatedBy_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPutAll_(each);
- })}),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@stream"])._nextPutAll_(",");
- })}));
- $1=self["@stream"];
- _st($1)._nextPutAll_(";");
- $2=_st($1)._lf();
- return self}, self, "nextPutVars:", [aCollection], smalltalk.JSStream)},
- args: ["aCollection"],
- source: "nextPutVars: aCollection\x0a\x09stream nextPutAll: 'var '.\x0a\x09aCollection \x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ';'; lf",
- messageSends: ["nextPutAll:", "do:separatedBy:", "lf"],
- referencedClasses: []
- }),
- smalltalk.JSStream);
- smalltalk.addMethod(
- "_addArg_",
- smalltalk.method({
- selector: "addArg:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._args())._at_put_(aString,_st((smalltalk.ArgVar || ArgVar))._on_(aString));
- _st(_st(_st(self)._args())._at_(aString))._scope_(self);
- return self}, self, "addArg:", [aString], smalltalk.LexicalScope)},
- args: ["aString"],
- source: "addArg: aString\x0a\x09self args at: aString put: (ArgVar on: aString).\x0a\x09(self args at: aString) scope: self",
- messageSends: ["at:put:", "on:", "args", "scope:", "at:"],
- referencedClasses: ["ArgVar"]
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_addTemp_",
- smalltalk.method({
- selector: "addTemp:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._temps())._at_put_(aString,_st((smalltalk.TempVar || TempVar))._on_(aString));
- _st(_st(_st(self)._temps())._at_(aString))._scope_(self);
- return self}, self, "addTemp:", [aString], smalltalk.LexicalScope)},
- args: ["aString"],
- source: "addTemp: aString\x0a\x09self temps at: aString put: (TempVar on: aString).\x0a\x09(self temps at: aString) scope: self",
- messageSends: ["at:put:", "on:", "temps", "scope:", "at:"],
- referencedClasses: ["TempVar"]
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_alias",
- smalltalk.method({
- selector: "alias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st("$ctx").__comma(_st(_st(self)._scopeLevel())._asString());
- return $1;
- }, self, "alias", [], smalltalk.LexicalScope)},
- args: [],
- source: "alias\x0a\x09^ '$ctx', self scopeLevel asString",
- messageSends: [",", "asString", "scopeLevel"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_allVariableNames",
- smalltalk.method({
- selector: "allVariableNames",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(self)._args())._keys()).__comma(_st(_st(self)._temps())._keys());
- return $1;
- }, self, "allVariableNames", [], smalltalk.LexicalScope)},
- args: [],
- source: "allVariableNames\x0a\x09^ self args keys, self temps keys",
- messageSends: [",", "keys", "temps", "args"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_args",
- smalltalk.method({
- selector: "args",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@args"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@args"]=_st((smalltalk.Dictionary || Dictionary))._new();
- $1=self["@args"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "args", [], smalltalk.LexicalScope)},
- args: [],
- source: "args\x0a\x09^ args ifNil: [ args := Dictionary new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Dictionary"]
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_bindingFor_",
- smalltalk.method({
- selector: "bindingFor:",
- category: '*Compiler',
- fn: function (aStringOrNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._pseudoVars())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._args())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
- return smalltalk.withContext(function($ctx3) {
return _st(_st(self)._temps())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
- return smalltalk.withContext(function($ctx4) {
return nil;
- })}));
- })}));
- })}));
- return $1;
- }, self, "bindingFor:", [aStringOrNode], smalltalk.LexicalScope)},
- args: ["aStringOrNode"],
- source: "bindingFor: aStringOrNode\x0a\x09^ self pseudoVars at: aStringOrNode value ifAbsent: [ \x0a\x09\x09self args at: aStringOrNode value ifAbsent: [\x0a\x09\x09\x09self temps at: aStringOrNode value ifAbsent: [ nil ]]]",
- messageSends: ["at:ifAbsent:", "value", "temps", "args", "pseudoVars"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_canInlineNonLocalReturns",
- smalltalk.method({
- selector: "canInlineNonLocalReturns",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._isInlined())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._outerScope())._canInlineNonLocalReturns();
- })}));
- return $1;
- }, self, "canInlineNonLocalReturns", [], smalltalk.LexicalScope)},
- args: [],
- source: "canInlineNonLocalReturns\x0a\x09^ self isInlined and: [ self outerScope canInlineNonLocalReturns ]",
- messageSends: ["and:", "canInlineNonLocalReturns", "outerScope", "isInlined"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_instruction",
- smalltalk.method({
- selector: "instruction",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@instruction"];
- return $1;
- }, self, "instruction", [], smalltalk.LexicalScope)},
- args: [],
- source: "instruction\x0a\x09^ instruction",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_instruction_",
- smalltalk.method({
- selector: "instruction:",
- category: '*Compiler',
- fn: function (anIRInstruction){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@instruction"]=anIRInstruction;
- return self}, self, "instruction:", [anIRInstruction], smalltalk.LexicalScope)},
- args: ["anIRInstruction"],
- source: "instruction: anIRInstruction\x0a\x09instruction := anIRInstruction",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_isBlockScope",
- smalltalk.method({
- selector: "isBlockScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._isMethodScope())._not();
- return $1;
- }, self, "isBlockScope", [], smalltalk.LexicalScope)},
- args: [],
- source: "isBlockScope\x0a\x09^ self isMethodScope not",
- messageSends: ["not", "isMethodScope"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_isInlined",
- smalltalk.method({
- selector: "isInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(self)._instruction())._notNil())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._instruction())._isInlined();
- })}));
- return $1;
- }, self, "isInlined", [], smalltalk.LexicalScope)},
- args: [],
- source: "isInlined\x0a\x09^ self instruction notNil and: [\x0a \x09self instruction isInlined ]",
- messageSends: ["and:", "isInlined", "instruction", "notNil"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_isMethodScope",
- smalltalk.method({
- selector: "isMethodScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isMethodScope", [], smalltalk.LexicalScope)},
- args: [],
- source: "isMethodScope\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_lookupVariable_",
- smalltalk.method({
- selector: "lookupVariable:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$2,$4;
- $ctx1.locals.lookup=nil;
- $ctx1.locals.lookup=_st(self)._bindingFor_(aNode);
- $1=$ctx1.locals.lookup;
- $2=(function(){
- return smalltalk.withContext(function($ctx2) {
$3=_st(self)._outerScope();
- if(($receiver = $3) == nil || $receiver == undefined){
- $ctx1.locals.lookup=$3;
- } else {
- $ctx1.locals.lookup=_st(_st(self)._outerScope())._lookupVariable_(aNode);
- };
- return $ctx1.locals.lookup;
- })});
- _st($1)._ifNil_($2);
- $4=$ctx1.locals.lookup;
- return $4;
- }, self, "lookupVariable:", [aNode], smalltalk.LexicalScope)},
- args: ["aNode"],
- source: "lookupVariable: aNode\x0a\x09| lookup |\x0a\x09lookup := (self bindingFor: aNode).\x0a\x09lookup ifNil: [\x0a\x09\x09lookup := self outerScope ifNotNil: [ \x0a\x09\x09\x09(self outerScope lookupVariable: aNode) ]].\x0a\x09^ lookup",
- messageSends: ["bindingFor:", "ifNil:", "ifNotNil:", "lookupVariable:", "outerScope"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_methodScope",
- smalltalk.method({
- selector: "methodScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(self)._outerScope();
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=$2;
- } else {
- $1=_st(_st(self)._outerScope())._methodScope();
- };
- return $1;
- }, self, "methodScope", [], smalltalk.LexicalScope)},
- args: [],
- source: "methodScope\x0a\x09^ self outerScope ifNotNil: [\x0a\x09\x09self outerScope methodScope ]",
- messageSends: ["ifNotNil:", "methodScope", "outerScope"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_node",
- smalltalk.method({
- selector: "node",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@node"];
- return $1;
- }, self, "node", [], smalltalk.LexicalScope)},
- args: [],
- source: "node\x0a\x09\x22Answer the node in which I am defined\x22\x0a\x09\x0a\x09^ node",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_node_",
- smalltalk.method({
- selector: "node:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@node"]=aNode;
- return self}, self, "node:", [aNode], smalltalk.LexicalScope)},
- args: ["aNode"],
- source: "node: aNode\x0a\x09node := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_outerScope",
- smalltalk.method({
- selector: "outerScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@outerScope"];
- return $1;
- }, self, "outerScope", [], smalltalk.LexicalScope)},
- args: [],
- source: "outerScope\x0a\x09^ outerScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_outerScope_",
- smalltalk.method({
- selector: "outerScope:",
- category: '*Compiler',
- fn: function (aLexicalScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@outerScope"]=aLexicalScope;
- return self}, self, "outerScope:", [aLexicalScope], smalltalk.LexicalScope)},
- args: ["aLexicalScope"],
- source: "outerScope: aLexicalScope\x0a\x09outerScope := aLexicalScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_pseudoVars",
- smalltalk.method({
- selector: "pseudoVars",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._methodScope())._pseudoVars();
- return $1;
- }, self, "pseudoVars", [], smalltalk.LexicalScope)},
- args: [],
- source: "pseudoVars\x0a\x09^ self methodScope pseudoVars",
- messageSends: ["pseudoVars", "methodScope"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_scopeLevel",
- smalltalk.method({
- selector: "scopeLevel",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $1=_st(self)._outerScope();
- if(($receiver = $1) == nil || $receiver == undefined){
- return (1);
- } else {
- $1;
- };
- $2=_st(self)._isInlined();
- if(smalltalk.assert($2)){
- $3=_st(_st(self)._outerScope())._scopeLevel();
- return $3;
- };
- $4=_st(_st(_st(self)._outerScope())._scopeLevel()).__plus((1));
- return $4;
- }, self, "scopeLevel", [], smalltalk.LexicalScope)},
- args: [],
- source: "scopeLevel\x0a\x09self outerScope ifNil: [ ^ 1 ].\x0a\x09self isInlined ifTrue: [ ^ self outerScope scopeLevel ].\x0a \x0a\x09^ self outerScope scopeLevel + 1",
- messageSends: ["ifNil:", "outerScope", "ifTrue:", "scopeLevel", "isInlined", "+"],
- referencedClasses: []
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_temps",
- smalltalk.method({
- selector: "temps",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@temps"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@temps"]=_st((smalltalk.Dictionary || Dictionary))._new();
- $1=self["@temps"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "temps", [], smalltalk.LexicalScope)},
- args: [],
- source: "temps\x0a\x09^ temps ifNil: [ temps := Dictionary new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Dictionary"]
- }),
- smalltalk.LexicalScope);
- smalltalk.addMethod(
- "_addIVar_",
- smalltalk.method({
- selector: "addIVar:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._iVars())._at_put_(aString,_st((smalltalk.InstanceVar || InstanceVar))._on_(aString));
- _st(_st(_st(self)._iVars())._at_(aString))._scope_(self);
- return self}, self, "addIVar:", [aString], smalltalk.MethodLexicalScope)},
- args: ["aString"],
- source: "addIVar: aString\x0a\x09self iVars at: aString put: (InstanceVar on: aString).\x0a\x09(self iVars at: aString) scope: self",
- messageSends: ["at:put:", "on:", "iVars", "scope:", "at:"],
- referencedClasses: ["InstanceVar"]
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_addNonLocalReturn_",
- smalltalk.method({
- selector: "addNonLocalReturn:",
- category: '*Compiler',
- fn: function (aScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._nonLocalReturns())._add_(aScope);
- return self}, self, "addNonLocalReturn:", [aScope], smalltalk.MethodLexicalScope)},
- args: ["aScope"],
- source: "addNonLocalReturn: aScope\x0a\x09self nonLocalReturns add: aScope",
- messageSends: ["add:", "nonLocalReturns"],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_allVariableNames",
- smalltalk.method({
- selector: "allVariableNames",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(smalltalk.LexicalScope.fn.prototype._allVariableNames.apply(_st(self), [])).__comma(_st(_st(self)._iVars())._keys());
- return $1;
- }, self, "allVariableNames", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "allVariableNames\x0a\x09^ super allVariableNames, self iVars keys",
- messageSends: [",", "keys", "iVars", "allVariableNames"],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_bindingFor_",
- smalltalk.method({
- selector: "bindingFor:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=smalltalk.LexicalScope.fn.prototype._bindingFor_.apply(_st(self), [aNode]);
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=_st(_st(self)._iVars())._at_ifAbsent_(_st(aNode)._value(),(function(){
- return smalltalk.withContext(function($ctx2) {
return nil;
- })}));
- } else {
- $1=$2;
- };
- return $1;
- }, self, "bindingFor:", [aNode], smalltalk.MethodLexicalScope)},
- args: ["aNode"],
- source: "bindingFor: aNode\x0a\x09^ (super bindingFor: aNode) ifNil: [\x0a\x09\x09self iVars at: aNode value ifAbsent: [ nil ]]",
- messageSends: ["ifNil:", "at:ifAbsent:", "value", "iVars", "bindingFor:"],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_canInlineNonLocalReturns",
- smalltalk.method({
- selector: "canInlineNonLocalReturns",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "canInlineNonLocalReturns", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "canInlineNonLocalReturns\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_hasLocalReturn",
- smalltalk.method({
- selector: "hasLocalReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._localReturn();
- return $1;
- }, self, "hasLocalReturn", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "hasLocalReturn\x0a\x09^ self localReturn",
- messageSends: ["localReturn"],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_hasNonLocalReturn",
- smalltalk.method({
- selector: "hasNonLocalReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._nonLocalReturns())._notEmpty();
- return $1;
- }, self, "hasNonLocalReturn", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "hasNonLocalReturn\x0a\x09^ self nonLocalReturns notEmpty",
- messageSends: ["notEmpty", "nonLocalReturns"],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_iVars",
- smalltalk.method({
- selector: "iVars",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@iVars"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@iVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
- $1=self["@iVars"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "iVars", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "iVars\x0a\x09^ iVars ifNil: [ iVars := Dictionary new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Dictionary"]
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_isMethodScope",
- smalltalk.method({
- selector: "isMethodScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isMethodScope", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "isMethodScope\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_localReturn",
- smalltalk.method({
- selector: "localReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@localReturn"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, self, "localReturn", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "localReturn\x0a\x09^ localReturn ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_localReturn_",
- smalltalk.method({
- selector: "localReturn:",
- category: '*Compiler',
- fn: function (aBoolean){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@localReturn"]=aBoolean;
- return self}, self, "localReturn:", [aBoolean], smalltalk.MethodLexicalScope)},
- args: ["aBoolean"],
- source: "localReturn: aBoolean\x0a\x09localReturn := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_methodScope",
- smalltalk.method({
- selector: "methodScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self;
- return $1;
- }, self, "methodScope", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "methodScope\x0a\x09^ self",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_nonLocalReturns",
- smalltalk.method({
- selector: "nonLocalReturns",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@nonLocalReturns"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@nonLocalReturns"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
- $1=self["@nonLocalReturns"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "nonLocalReturns", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "nonLocalReturns\x0a\x09^ nonLocalReturns ifNil: [ nonLocalReturns := OrderedCollection new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["OrderedCollection"]
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_pseudoVars",
- smalltalk.method({
- selector: "pseudoVars",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $1=self["@pseudoVars"];
- if(($receiver = $1) == nil || $receiver == undefined){
- self["@pseudoVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
- self["@pseudoVars"];
- _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._pseudoVariableNames())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
$2=_st((smalltalk.PseudoVar || PseudoVar))._on_(each);
- _st($2)._scope_(_st(self)._methodScope());
- $3=_st($2)._yourself();
- return _st(self["@pseudoVars"])._at_put_(each,$3);
- })}));
- } else {
- $1;
- };
- $4=self["@pseudoVars"];
- return $4;
- }, self, "pseudoVars", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "pseudoVars\x0a\x09pseudoVars ifNil: [\x0a\x09\x09pseudoVars := Dictionary new.\x0a\x09\x09Smalltalk current pseudoVariableNames do: [ :each |\x0a\x09\x09\x09pseudoVars at: each put: ((PseudoVar on: each)\x0a\x09\x09\x09\x09scope: self methodScope;\x0a\x09\x09\x09\x09yourself) ]].\x0a\x09^ pseudoVars",
- messageSends: ["ifNil:", "new", "do:", "at:put:", "scope:", "methodScope", "on:", "yourself", "pseudoVariableNames", "current"],
- referencedClasses: ["Dictionary", "PseudoVar", "Smalltalk"]
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_removeNonLocalReturn_",
- smalltalk.method({
- selector: "removeNonLocalReturn:",
- category: '*Compiler',
- fn: function (aScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._nonLocalReturns())._remove_ifAbsent_(aScope,(function(){
- return smalltalk.withContext(function($ctx2) {
})}));
- return self}, self, "removeNonLocalReturn:", [aScope], smalltalk.MethodLexicalScope)},
- args: ["aScope"],
- source: "removeNonLocalReturn: aScope\x0a\x09self nonLocalReturns remove: aScope ifAbsent: []",
- messageSends: ["remove:ifAbsent:", "nonLocalReturns"],
- referencedClasses: []
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_unknownVariables",
- smalltalk.method({
- selector: "unknownVariables",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@unknownVariables"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@unknownVariables"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
- $1=self["@unknownVariables"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "unknownVariables", [], smalltalk.MethodLexicalScope)},
- args: [],
- source: "unknownVariables\x0a\x09^ unknownVariables ifNil: [ unknownVariables := OrderedCollection new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["OrderedCollection"]
- }),
- smalltalk.MethodLexicalScope);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.Node)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitNode: self",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_addNode_",
- smalltalk.method({
- selector: "addNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._nodes())._add_(aNode);
- return self}, self, "addNode:", [aNode], smalltalk.Node)},
- args: ["aNode"],
- source: "addNode: aNode\x0a\x09self nodes add: aNode",
- messageSends: ["add:", "nodes"],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_isAssignmentNode",
- smalltalk.method({
- selector: "isAssignmentNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isAssignmentNode", [], smalltalk.Node)},
- args: [],
- source: "isAssignmentNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_isBlockNode",
- smalltalk.method({
- selector: "isBlockNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isBlockNode", [], smalltalk.Node)},
- args: [],
- source: "isBlockNode\x0a\x09^false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_isBlockSequenceNode",
- smalltalk.method({
- selector: "isBlockSequenceNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isBlockSequenceNode", [], smalltalk.Node)},
- args: [],
- source: "isBlockSequenceNode\x0a\x09^false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_isImmutable",
- smalltalk.method({
- selector: "isImmutable",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isImmutable", [], smalltalk.Node)},
- args: [],
- source: "isImmutable\x0a\x09^false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_isReturnNode",
- smalltalk.method({
- selector: "isReturnNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isReturnNode", [], smalltalk.Node)},
- args: [],
- source: "isReturnNode\x0a\x09^false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_isSendNode",
- smalltalk.method({
- selector: "isSendNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isSendNode", [], smalltalk.Node)},
- args: [],
- source: "isSendNode\x0a\x09^false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_isValueNode",
- smalltalk.method({
- selector: "isValueNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isValueNode", [], smalltalk.Node)},
- args: [],
- source: "isValueNode\x0a\x09^false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_nodes",
- smalltalk.method({
- selector: "nodes",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@nodes"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@nodes"]=_st((smalltalk.Array || Array))._new();
- $1=self["@nodes"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "nodes", [], smalltalk.Node)},
- args: [],
- source: "nodes\x0a\x09^nodes ifNil: [nodes := Array new]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Array"]
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_nodes_",
- smalltalk.method({
- selector: "nodes:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@nodes"]=aCollection;
- return self}, self, "nodes:", [aCollection], smalltalk.Node)},
- args: ["aCollection"],
- source: "nodes: aCollection\x0a\x09nodes := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_position",
- smalltalk.method({
- selector: "position",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@position"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@position"]=_st((0)).__at((0));
- $1=self["@position"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "position", [], smalltalk.Node)},
- args: [],
- source: "position\x0a\x09^position ifNil: [position := 0@0]",
- messageSends: ["ifNil:", "@"],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_position_",
- smalltalk.method({
- selector: "position:",
- category: '*Compiler',
- fn: function (aPosition){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@position"]=aPosition;
- return self}, self, "position:", [aPosition], smalltalk.Node)},
- args: ["aPosition"],
- source: "position: aPosition\x0a\x09position := aPosition",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_shouldBeAliased",
- smalltalk.method({
- selector: "shouldBeAliased",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@shouldBeAliased"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, self, "shouldBeAliased", [], smalltalk.Node)},
- args: [],
- source: "shouldBeAliased\x0a\x09^ shouldBeAliased ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_shouldBeAliased_",
- smalltalk.method({
- selector: "shouldBeAliased:",
- category: '*Compiler',
- fn: function (aBoolean){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@shouldBeAliased"]=aBoolean;
- return self}, self, "shouldBeAliased:", [aBoolean], smalltalk.Node)},
- args: ["aBoolean"],
- source: "shouldBeAliased: aBoolean\x0a\x09shouldBeAliased := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_shouldBeInlined",
- smalltalk.method({
- selector: "shouldBeInlined",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@shouldBeInlined"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, self, "shouldBeInlined", [], smalltalk.Node)},
- args: [],
- source: "shouldBeInlined\x0a\x09^ shouldBeInlined ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_shouldBeInlined_",
- smalltalk.method({
- selector: "shouldBeInlined:",
- category: '*Compiler',
- fn: function (aBoolean){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@shouldBeInlined"]=aBoolean;
- return self}, self, "shouldBeInlined:", [aBoolean], smalltalk.Node)},
- args: ["aBoolean"],
- source: "shouldBeInlined: aBoolean\x0a\x09shouldBeInlined := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_subtreeNeedsAliasing",
- smalltalk.method({
- selector: "subtreeNeedsAliasing",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(self)._shouldBeAliased())._or_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._shouldBeInlined();
- })})))._or_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(self)._nodes())._detect_ifNone_((function(each){
- return smalltalk.withContext(function($ctx3) {
return _st(each)._subtreeNeedsAliasing();
- })}),(function(){
- return smalltalk.withContext(function($ctx3) {
return false;
- })}))).__tild_eq(false);
- })}));
- return $1;
- }, self, "subtreeNeedsAliasing", [], smalltalk.Node)},
- args: [],
- source: "subtreeNeedsAliasing\x0a ^(self shouldBeAliased or: [ self shouldBeInlined ]) or: [\x0a (self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]",
- messageSends: ["or:", "~=", "detect:ifNone:", "subtreeNeedsAliasing", "nodes", "shouldBeInlined", "shouldBeAliased"],
- referencedClasses: []
- }),
- smalltalk.Node);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitAssignmentNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.AssignmentNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitAssignmentNode: self",
- messageSends: ["visitAssignmentNode:"],
- referencedClasses: []
- }),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- "_isAssignmentNode",
- smalltalk.method({
- selector: "isAssignmentNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isAssignmentNode", [], smalltalk.AssignmentNode)},
- args: [],
- source: "isAssignmentNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- "_left",
- smalltalk.method({
- selector: "left",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@left"];
- return $1;
- }, self, "left", [], smalltalk.AssignmentNode)},
- args: [],
- source: "left\x0a\x09^left",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- "_left_",
- smalltalk.method({
- selector: "left:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@left"]=aNode;
- return self}, self, "left:", [aNode], smalltalk.AssignmentNode)},
- args: ["aNode"],
- source: "left: aNode\x0a\x09left := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- "_nodes",
- smalltalk.method({
- selector: "nodes",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.Array || Array))._with_with_(_st(self)._left(),_st(self)._right());
- return $1;
- }, self, "nodes", [], smalltalk.AssignmentNode)},
- args: [],
- source: "nodes\x0a\x09^ Array with: self left with: self right",
- messageSends: ["with:with:", "left", "right"],
- referencedClasses: ["Array"]
- }),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- "_right",
- smalltalk.method({
- selector: "right",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@right"];
- return $1;
- }, self, "right", [], smalltalk.AssignmentNode)},
- args: [],
- source: "right\x0a\x09^right",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- "_right_",
- smalltalk.method({
- selector: "right:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@right"]=aNode;
- return self}, self, "right:", [aNode], smalltalk.AssignmentNode)},
- args: ["aNode"],
- source: "right: aNode\x0a\x09right := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AssignmentNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitBlockNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.BlockNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockNode: self",
- messageSends: ["visitBlockNode:"],
- referencedClasses: []
- }),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- "_isBlockNode",
- smalltalk.method({
- selector: "isBlockNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isBlockNode", [], smalltalk.BlockNode)},
- args: [],
- source: "isBlockNode\x0a\x09^true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- "_parameters",
- smalltalk.method({
- selector: "parameters",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@parameters"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@parameters"]=_st((smalltalk.Array || Array))._new();
- $1=self["@parameters"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "parameters", [], smalltalk.BlockNode)},
- args: [],
- source: "parameters\x0a\x09^parameters ifNil: [parameters := Array new]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Array"]
- }),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- "_parameters_",
- smalltalk.method({
- selector: "parameters:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@parameters"]=aCollection;
- return self}, self, "parameters:", [aCollection], smalltalk.BlockNode)},
- args: ["aCollection"],
- source: "parameters: aCollection\x0a\x09parameters := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- "_scope",
- smalltalk.method({
- selector: "scope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@scope"];
- return $1;
- }, self, "scope", [], smalltalk.BlockNode)},
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aLexicalScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@scope"]=aLexicalScope;
- return self}, self, "scope:", [aLexicalScope], smalltalk.BlockNode)},
- args: ["aLexicalScope"],
- source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.BlockNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitCascadeNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.CascadeNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitCascadeNode: self",
- messageSends: ["visitCascadeNode:"],
- referencedClasses: []
- }),
- smalltalk.CascadeNode);
- smalltalk.addMethod(
- "_receiver",
- smalltalk.method({
- selector: "receiver",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@receiver"];
- return $1;
- }, self, "receiver", [], smalltalk.CascadeNode)},
- args: [],
- source: "receiver\x0a\x09^receiver",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.CascadeNode);
- smalltalk.addMethod(
- "_receiver_",
- smalltalk.method({
- selector: "receiver:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@receiver"]=aNode;
- return self}, self, "receiver:", [aNode], smalltalk.CascadeNode)},
- args: ["aNode"],
- source: "receiver: aNode\x0a\x09receiver := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.CascadeNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitDynamicArrayNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.DynamicArrayNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicArrayNode: self",
- messageSends: ["visitDynamicArrayNode:"],
- referencedClasses: []
- }),
- smalltalk.DynamicArrayNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitDynamicDictionaryNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.DynamicDictionaryNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicDictionaryNode: self",
- messageSends: ["visitDynamicDictionaryNode:"],
- referencedClasses: []
- }),
- smalltalk.DynamicDictionaryNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitJSStatementNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.JSStatementNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitJSStatementNode: self",
- messageSends: ["visitJSStatementNode:"],
- referencedClasses: []
- }),
- smalltalk.JSStatementNode);
- smalltalk.addMethod(
- "_source",
- smalltalk.method({
- selector: "source",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@source"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1="";
- } else {
- $1=$2;
- };
- return $1;
- }, self, "source", [], smalltalk.JSStatementNode)},
- args: [],
- source: "source\x0a\x09^source ifNil: ['']",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.JSStatementNode);
- smalltalk.addMethod(
- "_source_",
- smalltalk.method({
- selector: "source:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@source"]=aString;
- return self}, self, "source:", [aString], smalltalk.JSStatementNode)},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.JSStatementNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitMethodNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.MethodNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitMethodNode: self",
- messageSends: ["visitMethodNode:"],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_arguments",
- smalltalk.method({
- selector: "arguments",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@arguments"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=[];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "arguments", [], smalltalk.MethodNode)},
- args: [],
- source: "arguments\x0a\x09^arguments ifNil: [#()]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_arguments_",
- smalltalk.method({
- selector: "arguments:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@arguments"]=aCollection;
- return self}, self, "arguments:", [aCollection], smalltalk.MethodNode)},
- args: ["aCollection"],
- source: "arguments: aCollection\x0a\x09arguments := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_classReferences",
- smalltalk.method({
- selector: "classReferences",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@classReferences"];
- return $1;
- }, self, "classReferences", [], smalltalk.MethodNode)},
- args: [],
- source: "classReferences\x0a\x09^ classReferences",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_classReferences_",
- smalltalk.method({
- selector: "classReferences:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@classReferences"]=aCollection;
- return self}, self, "classReferences:", [aCollection], smalltalk.MethodNode)},
- args: ["aCollection"],
- source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_messageSends",
- smalltalk.method({
- selector: "messageSends",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@messageSends"];
- return $1;
- }, self, "messageSends", [], smalltalk.MethodNode)},
- args: [],
- source: "messageSends\x0a\x09^ messageSends",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_messageSends_",
- smalltalk.method({
- selector: "messageSends:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@messageSends"]=aCollection;
- return self}, self, "messageSends:", [aCollection], smalltalk.MethodNode)},
- args: ["aCollection"],
- source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_scope",
- smalltalk.method({
- selector: "scope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@scope"];
- return $1;
- }, self, "scope", [], smalltalk.MethodNode)},
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aMethodScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@scope"]=aMethodScope;
- return self}, self, "scope:", [aMethodScope], smalltalk.MethodNode)},
- args: ["aMethodScope"],
- source: "scope: aMethodScope\x0a\x09scope := aMethodScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_selector",
- smalltalk.method({
- selector: "selector",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@selector"];
- return $1;
- }, self, "selector", [], smalltalk.MethodNode)},
- args: [],
- source: "selector\x0a\x09^selector",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_selector_",
- smalltalk.method({
- selector: "selector:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@selector"]=aString;
- return self}, self, "selector:", [aString], smalltalk.MethodNode)},
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_source",
- smalltalk.method({
- selector: "source",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@source"];
- return $1;
- }, self, "source", [], smalltalk.MethodNode)},
- args: [],
- source: "source\x0a\x09^source",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_source_",
- smalltalk.method({
- selector: "source:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@source"]=aString;
- return self}, self, "source:", [aString], smalltalk.MethodNode)},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_superSends",
- smalltalk.method({
- selector: "superSends",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@superSends"];
- return $1;
- }, self, "superSends", [], smalltalk.MethodNode)},
- args: [],
- source: "superSends\x0a\x09^ superSends",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_superSends_",
- smalltalk.method({
- selector: "superSends:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@superSends"]=aCollection;
- return self}, self, "superSends:", [aCollection], smalltalk.MethodNode)},
- args: ["aCollection"],
- source: "superSends: aCollection\x0a\x09superSends := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MethodNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitReturnNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.ReturnNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitReturnNode: self",
- messageSends: ["visitReturnNode:"],
- referencedClasses: []
- }),
- smalltalk.ReturnNode);
- smalltalk.addMethod(
- "_isReturnNode",
- smalltalk.method({
- selector: "isReturnNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isReturnNode", [], smalltalk.ReturnNode)},
- args: [],
- source: "isReturnNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ReturnNode);
- smalltalk.addMethod(
- "_nonLocalReturn",
- smalltalk.method({
- selector: "nonLocalReturn",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(self)._scope())._isMethodScope())._not();
- return $1;
- }, self, "nonLocalReturn", [], smalltalk.ReturnNode)},
- args: [],
- source: "nonLocalReturn\x0a\x09^ self scope isMethodScope not",
- messageSends: ["not", "isMethodScope", "scope"],
- referencedClasses: []
- }),
- smalltalk.ReturnNode);
- smalltalk.addMethod(
- "_scope",
- smalltalk.method({
- selector: "scope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@scope"];
- return $1;
- }, self, "scope", [], smalltalk.ReturnNode)},
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ReturnNode);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aLexicalScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@scope"]=aLexicalScope;
- return self}, self, "scope:", [aLexicalScope], smalltalk.ReturnNode)},
- args: ["aLexicalScope"],
- source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ReturnNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitSendNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.SendNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitSendNode: self",
- messageSends: ["visitSendNode:"],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_arguments",
- smalltalk.method({
- selector: "arguments",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@arguments"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@arguments"]=[];
- $1=self["@arguments"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "arguments", [], smalltalk.SendNode)},
- args: [],
- source: "arguments\x0a\x09^arguments ifNil: [arguments := #()]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_arguments_",
- smalltalk.method({
- selector: "arguments:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@arguments"]=aCollection;
- return self}, self, "arguments:", [aCollection], smalltalk.SendNode)},
- args: ["aCollection"],
- source: "arguments: aCollection\x0a\x09arguments := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_cascadeNodeWithMessages_",
- smalltalk.method({
- selector: "cascadeNodeWithMessages:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$4,$5,$3;
- $ctx1.locals.first=nil;
- $1=_st((smalltalk.SendNode || SendNode))._new();
- _st($1)._selector_(_st(self)._selector());
- _st($1)._arguments_(_st(self)._arguments());
- $2=_st($1)._yourself();
- $ctx1.locals.first=$2;
- $4=_st((smalltalk.CascadeNode || CascadeNode))._new();
- _st($4)._receiver_(_st(self)._receiver());
- _st($4)._nodes_(_st(_st((smalltalk.Array || Array))._with_($ctx1.locals.first)).__comma(aCollection));
- $5=_st($4)._yourself();
- $3=$5;
- return $3;
- }, self, "cascadeNodeWithMessages:", [aCollection], smalltalk.SendNode)},
- args: ["aCollection"],
- source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself.\x0a\x09^CascadeNode new\x0a\x09 receiver: self receiver;\x0a\x09 nodes: (Array with: first), aCollection;\x0a\x09 yourself",
- messageSends: ["selector:", "selector", "new", "arguments:", "arguments", "yourself", "receiver:", "receiver", "nodes:", ",", "with:"],
- referencedClasses: ["SendNode", "CascadeNode", "Array"]
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_index",
- smalltalk.method({
- selector: "index",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@index"];
- return $1;
- }, self, "index", [], smalltalk.SendNode)},
- args: [],
- source: "index\x0a\x09^ index",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_index_",
- smalltalk.method({
- selector: "index:",
- category: '*Compiler',
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@index"]=anInteger;
- return self}, self, "index:", [anInteger], smalltalk.SendNode)},
- args: ["anInteger"],
- source: "index: anInteger\x0a\x09index := anInteger",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_isSendNode",
- smalltalk.method({
- selector: "isSendNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isSendNode", [], smalltalk.SendNode)},
- args: [],
- source: "isSendNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_nodes",
- smalltalk.method({
- selector: "nodes",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.Array || Array))._withAll_(_st(self)._arguments());
- _st($2)._add_(_st(self)._receiver());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "nodes", [], smalltalk.SendNode)},
- args: [],
- source: "nodes\x0a\x09^ (Array withAll: self arguments)\x0a\x09\x09add: self receiver;\x0a\x09\x09yourself",
- messageSends: ["add:", "receiver", "withAll:", "arguments", "yourself"],
- referencedClasses: ["Array"]
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_receiver",
- smalltalk.method({
- selector: "receiver",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@receiver"];
- return $1;
- }, self, "receiver", [], smalltalk.SendNode)},
- args: [],
- source: "receiver\x0a\x09^receiver",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_receiver_",
- smalltalk.method({
- selector: "receiver:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@receiver"]=aNode;
- return self}, self, "receiver:", [aNode], smalltalk.SendNode)},
- args: ["aNode"],
- source: "receiver: aNode\x0a\x09receiver := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_selector",
- smalltalk.method({
- selector: "selector",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@selector"];
- return $1;
- }, self, "selector", [], smalltalk.SendNode)},
- args: [],
- source: "selector\x0a\x09^selector",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_selector_",
- smalltalk.method({
- selector: "selector:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@selector"]=aString;
- return self}, self, "selector:", [aString], smalltalk.SendNode)},
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_superSend",
- smalltalk.method({
- selector: "superSend",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@superSend"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, self, "superSend", [], smalltalk.SendNode)},
- args: [],
- source: "superSend\x0a\x09^ superSend ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_superSend_",
- smalltalk.method({
- selector: "superSend:",
- category: '*Compiler',
- fn: function (aBoolean){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@superSend"]=aBoolean;
- return self}, self, "superSend:", [aBoolean], smalltalk.SendNode)},
- args: ["aBoolean"],
- source: "superSend: aBoolean\x0a\x09superSend := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_valueForReceiver_",
- smalltalk.method({
- selector: "valueForReceiver:",
- category: '*Compiler',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$5,$4,$6,$1;
- $2=_st((smalltalk.SendNode || SendNode))._new();
- $3=$2;
- $5=_st(self)._receiver();
- if(($receiver = $5) == nil || $receiver == undefined){
- $4=anObject;
- } else {
- $4=_st(_st(self)._receiver())._valueForReceiver_(anObject);
- };
- _st($3)._receiver_($4);
- _st($2)._selector_(_st(self)._selector());
- _st($2)._arguments_(_st(self)._arguments());
- $6=_st($2)._yourself();
- $1=$6;
- return $1;
- }, self, "valueForReceiver:", [anObject], smalltalk.SendNode)},
- args: ["anObject"],
- source: "valueForReceiver: anObject\x0a\x09^SendNode new\x0a\x09 receiver: (self receiver \x0a\x09\x09ifNil: [anObject]\x0a\x09\x09ifNotNil: [self receiver valueForReceiver: anObject]);\x0a\x09 selector: self selector;\x0a\x09 arguments: self arguments;\x0a\x09 yourself",
- messageSends: ["receiver:", "ifNil:ifNotNil:", "valueForReceiver:", "receiver", "new", "selector:", "selector", "arguments:", "arguments", "yourself"],
- referencedClasses: ["SendNode"]
- }),
- smalltalk.SendNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitSequenceNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.SequenceNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitSequenceNode: self",
- messageSends: ["visitSequenceNode:"],
- referencedClasses: []
- }),
- smalltalk.SequenceNode);
- smalltalk.addMethod(
- "_asBlockSequenceNode",
- smalltalk.method({
- selector: "asBlockSequenceNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.BlockSequenceNode || BlockSequenceNode))._new();
- _st($2)._nodes_(_st(self)._nodes());
- _st($2)._temps_(_st(self)._temps());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "asBlockSequenceNode", [], smalltalk.SequenceNode)},
- args: [],
- source: "asBlockSequenceNode\x0a\x09^BlockSequenceNode new\x0a\x09 nodes: self nodes;\x0a\x09 temps: self temps;\x0a\x09 yourself",
- messageSends: ["nodes:", "nodes", "new", "temps:", "temps", "yourself"],
- referencedClasses: ["BlockSequenceNode"]
- }),
- smalltalk.SequenceNode);
- smalltalk.addMethod(
- "_scope",
- smalltalk.method({
- selector: "scope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@scope"];
- return $1;
- }, self, "scope", [], smalltalk.SequenceNode)},
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SequenceNode);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aLexicalScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@scope"]=aLexicalScope;
- return self}, self, "scope:", [aLexicalScope], smalltalk.SequenceNode)},
- args: ["aLexicalScope"],
- source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SequenceNode);
- smalltalk.addMethod(
- "_temps",
- smalltalk.method({
- selector: "temps",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@temps"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=[];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "temps", [], smalltalk.SequenceNode)},
- args: [],
- source: "temps\x0a\x09^temps ifNil: [#()]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.SequenceNode);
- smalltalk.addMethod(
- "_temps_",
- smalltalk.method({
- selector: "temps:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@temps"]=aCollection;
- return self}, self, "temps:", [aCollection], smalltalk.SequenceNode)},
- args: ["aCollection"],
- source: "temps: aCollection\x0a\x09temps := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SequenceNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitBlockSequenceNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.BlockSequenceNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockSequenceNode: self",
- messageSends: ["visitBlockSequenceNode:"],
- referencedClasses: []
- }),
- smalltalk.BlockSequenceNode);
- smalltalk.addMethod(
- "_isBlockSequenceNode",
- smalltalk.method({
- selector: "isBlockSequenceNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isBlockSequenceNode", [], smalltalk.BlockSequenceNode)},
- args: [],
- source: "isBlockSequenceNode\x0a\x09^true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.BlockSequenceNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitValueNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.ValueNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitValueNode: self",
- messageSends: ["visitValueNode:"],
- referencedClasses: []
- }),
- smalltalk.ValueNode);
- smalltalk.addMethod(
- "_isImmutable",
- smalltalk.method({
- selector: "isImmutable",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isImmutable", [], smalltalk.ValueNode)},
- args: [],
- source: "isImmutable\x0a\x09^true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ValueNode);
- smalltalk.addMethod(
- "_isValueNode",
- smalltalk.method({
- selector: "isValueNode",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isValueNode", [], smalltalk.ValueNode)},
- args: [],
- source: "isValueNode\x0a\x09^true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ValueNode);
- smalltalk.addMethod(
- "_value",
- smalltalk.method({
- selector: "value",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@value"];
- return $1;
- }, self, "value", [], smalltalk.ValueNode)},
- args: [],
- source: "value\x0a\x09^value",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ValueNode);
- smalltalk.addMethod(
- "_value_",
- smalltalk.method({
- selector: "value:",
- category: '*Compiler',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@value"]=anObject;
- return self}, self, "value:", [anObject], smalltalk.ValueNode)},
- args: ["anObject"],
- source: "value: anObject\x0a\x09value := anObject",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ValueNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitVariableNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.VariableNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitVariableNode: self",
- messageSends: ["visitVariableNode:"],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_alias",
- smalltalk.method({
- selector: "alias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._binding())._alias();
- return $1;
- }, self, "alias", [], smalltalk.VariableNode)},
- args: [],
- source: "alias\x0a\x09^ self binding alias",
- messageSends: ["alias", "binding"],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_assigned",
- smalltalk.method({
- selector: "assigned",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@assigned"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, self, "assigned", [], smalltalk.VariableNode)},
- args: [],
- source: "assigned\x0a\x09^assigned ifNil: [false]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_assigned_",
- smalltalk.method({
- selector: "assigned:",
- category: '*Compiler',
- fn: function (aBoolean){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@assigned"]=aBoolean;
- return self}, self, "assigned:", [aBoolean], smalltalk.VariableNode)},
- args: ["aBoolean"],
- source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_beAssigned",
- smalltalk.method({
- selector: "beAssigned",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(self)._binding())._validateAssignment();
- self["@assigned"]=true;
- return self}, self, "beAssigned", [], smalltalk.VariableNode)},
- args: [],
- source: "beAssigned\x0a\x09self binding validateAssignment.\x0a\x09assigned := true",
- messageSends: ["validateAssignment", "binding"],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_binding",
- smalltalk.method({
- selector: "binding",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@binding"];
- return $1;
- }, self, "binding", [], smalltalk.VariableNode)},
- args: [],
- source: "binding\x0a\x09^ binding",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_binding_",
- smalltalk.method({
- selector: "binding:",
- category: '*Compiler',
- fn: function (aScopeVar){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@binding"]=aScopeVar;
- return self}, self, "binding:", [aScopeVar], smalltalk.VariableNode)},
- args: ["aScopeVar"],
- source: "binding: aScopeVar\x0a\x09binding := aScopeVar",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_isImmutable",
- smalltalk.method({
- selector: "isImmutable",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isImmutable", [], smalltalk.VariableNode)},
- args: [],
- source: "isImmutable\x0a\x09^false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.VariableNode);
- smalltalk.addMethod(
- "_accept_",
- smalltalk.method({
- selector: "accept:",
- category: '*Compiler',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aVisitor)._visitClassReferenceNode_(self);
- return $1;
- }, self, "accept:", [aVisitor], smalltalk.ClassReferenceNode)},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitClassReferenceNode: self",
- messageSends: ["visitClassReferenceNode:"],
- referencedClasses: []
- }),
- smalltalk.ClassReferenceNode);
- smalltalk.addMethod(
- "_visit_",
- smalltalk.method({
- selector: "visit:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aNode)._accept_(self);
- return $1;
- }, self, "visit:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visit: aNode\x0a\x09^ aNode accept: self",
- messageSends: ["accept:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitAll_",
- smalltalk.method({
- selector: "visitAll:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aCollection)._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._visit_(each);
- })}));
- return $1;
- }, self, "visitAll:", [aCollection], smalltalk.NodeVisitor)},
- args: ["aCollection"],
- source: "visitAll: aCollection\x0a\x09^ aCollection do: [ :each | self visit: each ]",
- messageSends: ["do:", "visit:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitAssignmentNode_",
- smalltalk.method({
- selector: "visitAssignmentNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitAssignmentNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitBlockNode_",
- smalltalk.method({
- selector: "visitBlockNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitBlockNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitBlockSequenceNode_",
- smalltalk.method({
- selector: "visitBlockSequenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitSequenceNode_(aNode);
- return $1;
- }, self, "visitBlockSequenceNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
- messageSends: ["visitSequenceNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitCascadeNode_",
- smalltalk.method({
- selector: "visitCascadeNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitCascadeNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitClassReferenceNode_",
- smalltalk.method({
- selector: "visitClassReferenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitVariableNode_(aNode);
- return $1;
- }, self, "visitClassReferenceNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitClassReferenceNode: aNode\x0a\x09^ self visitVariableNode: aNode",
- messageSends: ["visitVariableNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitDynamicArrayNode_",
- smalltalk.method({
- selector: "visitDynamicArrayNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitDynamicArrayNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitDynamicDictionaryNode_",
- smalltalk.method({
- selector: "visitDynamicDictionaryNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitDynamicDictionaryNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitJSStatementNode_",
- smalltalk.method({
- selector: "visitJSStatementNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitJSStatementNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitMethodNode_",
- smalltalk.method({
- selector: "visitMethodNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitMethodNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitNode_",
- smalltalk.method({
- selector: "visitNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitAll_(_st(aNode)._nodes());
- return $1;
- }, self, "visitNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
- messageSends: ["visitAll:", "nodes"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitReturnNode_",
- smalltalk.method({
- selector: "visitReturnNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitReturnNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitSendNode_",
- smalltalk.method({
- selector: "visitSendNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitSendNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitSequenceNode_",
- smalltalk.method({
- selector: "visitSequenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitSequenceNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitValueNode_",
- smalltalk.method({
- selector: "visitValueNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitValueNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_visitVariableNode_",
- smalltalk.method({
- selector: "visitVariableNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._visitNode_(aNode);
- return $1;
- }, self, "visitVariableNode:", [aNode], smalltalk.NodeVisitor)},
- args: ["aNode"],
- source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- smalltalk.NodeVisitor);
- smalltalk.addMethod(
- "_initializeFromMethodContext_",
- smalltalk.method({
- selector: "initializeFromMethodContext:",
- category: '*Compiler',
- fn: function (aMethodContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(self)._pc_(_st(aMethodContext)._pc());
- _st(self)._receiver_(_st(aMethodContext)._receiver());
- _st(self)._selector_(_st(aMethodContext)._selector());
- $1=_st(aMethodContext)._outerContext();
- if(($receiver = $1) == nil || $receiver == undefined){
- $1;
- } else {
- _st(self)._outerContext_(_st(_st(self)._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
- };
- _st(_st(aMethodContext)._locals())._keysAndValuesDo_((function(key,value){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._locals())._at_put_(key,value);
- })}));
- return self}, self, "initializeFromMethodContext:", [aMethodContext], smalltalk.AIContext)},
- args: ["aMethodContext"],
- source: "initializeFromMethodContext: aMethodContext\x0a\x09self pc: aMethodContext pc.\x0a self receiver: aMethodContext receiver.\x0a self selector: aMethodContext selector.\x0a aMethodContext outerContext ifNotNil: [\x0a\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a aMethodContext locals keysAndValuesDo: [ :key :value |\x0a \x09self locals at: key put: value ]",
- messageSends: ["pc:", "pc", "receiver:", "receiver", "selector:", "selector", "ifNotNil:", "outerContext:", "fromMethodContext:", "outerContext", "class", "keysAndValuesDo:", "at:put:", "locals"],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_locals",
- smalltalk.method({
- selector: "locals",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@locals"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@locals"]=_st((smalltalk.Dictionary || Dictionary))._new();
- $1=self["@locals"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "locals", [], smalltalk.AIContext)},
- args: [],
- source: "locals\x0a\x09^ locals ifNil: [ locals := Dictionary new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Dictionary"]
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_outerContext",
- smalltalk.method({
- selector: "outerContext",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@outerContext"];
- return $1;
- }, self, "outerContext", [], smalltalk.AIContext)},
- args: [],
- source: "outerContext\x0a\x09^ outerContext",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_outerContext_",
- smalltalk.method({
- selector: "outerContext:",
- category: '*Compiler',
- fn: function (anAIContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@outerContext"]=anAIContext;
- return self}, self, "outerContext:", [anAIContext], smalltalk.AIContext)},
- args: ["anAIContext"],
- source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_pc",
- smalltalk.method({
- selector: "pc",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@pc"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@pc"]=(0);
- $1=self["@pc"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "pc", [], smalltalk.AIContext)},
- args: [],
- source: "pc\x0a\x09^ pc ifNil: [ pc := 0 ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_pc_",
- smalltalk.method({
- selector: "pc:",
- category: '*Compiler',
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@pc"]=anInteger;
- return self}, self, "pc:", [anInteger], smalltalk.AIContext)},
- args: ["anInteger"],
- source: "pc: anInteger\x0a\x09pc := anInteger",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_receiver",
- smalltalk.method({
- selector: "receiver",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@receiver"];
- return $1;
- }, self, "receiver", [], smalltalk.AIContext)},
- args: [],
- source: "receiver\x0a\x09^ receiver",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_receiver_",
- smalltalk.method({
- selector: "receiver:",
- category: '*Compiler',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@receiver"]=anObject;
- return self}, self, "receiver:", [anObject], smalltalk.AIContext)},
- args: ["anObject"],
- source: "receiver: anObject\x0a\x09receiver := anObject",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_selector",
- smalltalk.method({
- selector: "selector",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@selector"];
- return $1;
- }, self, "selector", [], smalltalk.AIContext)},
- args: [],
- source: "selector\x0a\x09^ selector",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_selector_",
- smalltalk.method({
- selector: "selector:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@selector"]=aString;
- return self}, self, "selector:", [aString], smalltalk.AIContext)},
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AIContext);
- smalltalk.addMethod(
- "_fromMethodContext_",
- smalltalk.method({
- selector: "fromMethodContext:",
- category: '*Compiler',
- fn: function (aMethodContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._initializeFromMethodContext_(aMethodContext);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "fromMethodContext:", [aMethodContext], smalltalk.AIContext.klass)},
- args: ["aMethodContext"],
- source: "fromMethodContext: aMethodContext\x0a\x09^ self new \x0a \x09initializeFromMethodContext: aMethodContext;\x0a yourself",
- messageSends: ["initializeFromMethodContext:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.AIContext.klass);
- smalltalk.addMethod(
- "_context",
- smalltalk.method({
- selector: "context",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@context"];
- return $1;
- }, self, "context", [], smalltalk.ASTInterpreter)},
- args: [],
- source: "context\x0a\x09^ context",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_context_",
- smalltalk.method({
- selector: "context:",
- category: '*Compiler',
- fn: function (anAIContext){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@context"]=anAIContext;
- return self}, self, "context:", [anAIContext], smalltalk.ASTInterpreter)},
- args: ["anAIContext"],
- source: "context: anAIContext\x0a\x09context := anAIContext",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_initialize",
- smalltalk.method({
- selector: "initialize",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
smalltalk.NodeVisitor.fn.prototype._initialize.apply(_st(self), []);
- self["@shouldReturn"]=false;
- return self}, self, "initialize", [], smalltalk.ASTInterpreter)},
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a shouldReturn := false",
- messageSends: ["initialize"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_interpret_",
- smalltalk.method({
- selector: "interpret:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- self["@shouldReturn"]=false;
- $1=_st(self)._interpretNode_(aNode);
- return $1;
- }, self, "interpret:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "interpret: aNode\x0a\x09shouldReturn := false.\x0a ^ self interpretNode: aNode",
- messageSends: ["interpretNode:"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_interpretNode_",
- smalltalk.method({
- selector: "interpretNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- self["@currentNode"]=aNode;
- $1=_st(self)._visit_(aNode);
- return $1;
- }, self, "interpretNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "interpretNode: aNode\x0a\x09currentNode := aNode.\x0a ^ self visit: aNode",
- messageSends: ["visit:"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_messageFromSendNode_",
- smalltalk.method({
- selector: "messageFromSendNode:",
- category: '*Compiler',
- fn: function (aSendNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.Message || Message))._new();
- _st($2)._selector_(_st(aSendNode)._selector());
- _st($2)._arguments_(_st(_st(aSendNode)._arguments())._collect_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._interpretNode_(each);
- })})));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "messageFromSendNode:", [aSendNode], smalltalk.ASTInterpreter)},
- args: ["aSendNode"],
- source: "messageFromSendNode: aSendNode\x0a\x09^ Message new\x0a \x09selector: aSendNode selector;\x0a arguments: (aSendNode arguments collect: [ :each |\x0a \x09self interpretNode: each ]);\x0a yourself",
- messageSends: ["selector:", "selector", "new", "arguments:", "collect:", "interpretNode:", "arguments", "yourself"],
- referencedClasses: ["Message"]
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitBlockNode_",
- smalltalk.method({
- selector: "visitBlockNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._interpretNode_(_st(_st(aNode)._nodes())._first());
- })});
- return $1;
- }, self, "visitBlockNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitBlockNode: aNode\x0a ^ [ self interpretNode: aNode nodes first ]",
- messageSends: ["interpretNode:", "first", "nodes"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitCascadeNode_",
- smalltalk.method({
- selector: "visitCascadeNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.receiver=nil;
- $ctx1.locals.receiver=_st(self)._interpretNode_(_st(aNode)._receiver());
- _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._messageFromSendNode_(each))._sendTo_($ctx1.locals.receiver);
- })}));
- $1=_st(_st(self)._messageFromSendNode_(_st(_st(aNode)._nodes())._last()))._sendTo_($ctx1.locals.receiver);
- return $1;
- }, self, "visitCascadeNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitCascadeNode: aNode\x0a\x09\x22TODO: Handle super sends\x22\x0a\x09| receiver |\x0a \x0a receiver := self interpretNode: aNode receiver.\x0a\x0a aNode nodes allButLast\x0a \x09do: [ :each | \x0a \x09(self messageFromSendNode: each)\x0a \x09sendTo: receiver ].\x0a\x0a ^ (self messageFromSendNode: aNode nodes last)\x0a \x09sendTo: receiver",
- messageSends: ["interpretNode:", "receiver", "do:", "sendTo:", "messageFromSendNode:", "allButLast", "nodes", "last"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitClassReferenceNode_",
- smalltalk.method({
- selector: "visitClassReferenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aNode)._value());
- return $1;
- }, self, "visitClassReferenceNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitClassReferenceNode: aNode\x0a\x09^ Smalltalk current at: aNode value",
- messageSends: ["at:", "value", "current"],
- referencedClasses: ["Smalltalk"]
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitJSStatementNode_",
- smalltalk.method({
- selector: "visitJSStatementNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self)._halt();
- return self}, self, "visitJSStatementNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitJSStatementNode: aNode\x0a\x09self halt",
- messageSends: ["halt"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitReturnNode_",
- smalltalk.method({
- selector: "visitReturnNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- self["@shouldReturn"]=true;
- $1=_st(self)._interpretNode_(_st(_st(aNode)._nodes())._first());
- return $1;
- }, self, "visitReturnNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09shouldReturn := true.\x0a ^ self interpretNode: aNode nodes first",
- messageSends: ["interpretNode:", "first", "nodes"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitSendNode_",
- smalltalk.method({
- selector: "visitSendNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._messageFromSendNode_(aNode))._sendTo_(_st(self)._interpretNode_(_st(aNode)._receiver()));
- return $1;
- }, self, "visitSendNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a\x09\x22TODO: Handle super sends\x22\x0a \x0a ^ (self messageFromSendNode: aNode)\x0a \x09sendTo: (self interpretNode: aNode receiver)",
- messageSends: ["sendTo:", "interpretNode:", "receiver", "messageFromSendNode:"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitSequenceNode_",
- smalltalk.method({
- selector: "visitSequenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$4,$2,$5;
- var $early={};
- try {
- $1=_st(_st(aNode)._nodes())._allButLast();
- $2=(function(each){
- return smalltalk.withContext(function($ctx2) {
$ctx2.locals.value=nil;
- $ctx2.locals.value=_st(self)._interpretNode_(each);
- $ctx2.locals.value;
- $3=self["@shouldReturn"];
- if(smalltalk.assert($3)){
- $4=$ctx2.locals.value;
- throw $early=[$4];
- };
- })});
- _st($1)._do_($2);
- $5=_st(self)._interpretNode_(_st(_st(aNode)._nodes())._last());
- return $5;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- }, self, "visitSequenceNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitSequenceNode: aNode\x0a\x09aNode nodes allButLast do: [ :each | | value |\x0a value := self interpretNode: each.\x0a\x09\x09shouldReturn ifTrue: [ ^ value ] ].\x0a ^ self interpretNode: aNode nodes last",
- messageSends: ["do:", "interpretNode:", "ifTrue:", "allButLast", "nodes", "last"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_visitValueNode_",
- smalltalk.method({
- selector: "visitValueNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(aNode)._value();
- return $1;
- }, self, "visitValueNode:", [aNode], smalltalk.ASTInterpreter)},
- args: ["aNode"],
- source: "visitValueNode: aNode\x0a\x09^ aNode value",
- messageSends: ["value"],
- referencedClasses: []
- }),
- smalltalk.ASTInterpreter);
- smalltalk.addMethod(
- "_classNameFor_",
- smalltalk.method({
- selector: "classNameFor:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$5,$4,$1;
- $2=_st(aClass)._isMetaclass();
- $3=(function(){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
- })});
- $4=(function(){
- return smalltalk.withContext(function($ctx2) {
$5=_st(aClass)._isNil();
- if(smalltalk.assert($5)){
- return "nil";
- } else {
- return _st(aClass)._name();
- };
- })});
- $1=_st($2)._ifTrue_ifFalse_($3,$4);
- return $1;
- }, self, "classNameFor:", [aClass], smalltalk.AbstractCodeGenerator)},
- args: ["aClass"],
- source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
- messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
- referencedClasses: []
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_compileNode_",
- smalltalk.method({
- selector: "compileNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self)._subclassResponsibility();
- return self}, self, "compileNode:", [aNode], smalltalk.AbstractCodeGenerator)},
- args: ["aNode"],
- source: "compileNode: aNode\x0a\x09self subclassResponsibility",
- messageSends: ["subclassResponsibility"],
- referencedClasses: []
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_currentClass",
- smalltalk.method({
- selector: "currentClass",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@currentClass"];
- return $1;
- }, self, "currentClass", [], smalltalk.AbstractCodeGenerator)},
- args: [],
- source: "currentClass\x0a\x09^currentClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_currentClass_",
- smalltalk.method({
- selector: "currentClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@currentClass"]=aClass;
- return self}, self, "currentClass:", [aClass], smalltalk.AbstractCodeGenerator)},
- args: ["aClass"],
- source: "currentClass: aClass\x0a\x09currentClass := aClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_pseudoVariables",
- smalltalk.method({
- selector: "pseudoVariables",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return ["self", "super", "true", "false", "nil", "thisContext"];
- }, self, "pseudoVariables", [], smalltalk.AbstractCodeGenerator)},
- args: [],
- source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_safeVariableNameFor_",
- smalltalk.method({
- selector: "safeVariableNameFor:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(aString);
- if(smalltalk.assert($2)){
- $1=_st(aString).__comma("_");
- } else {
- $1=aString;
- };
- return $1;
- }, self, "safeVariableNameFor:", [aString], smalltalk.AbstractCodeGenerator)},
- args: ["aString"],
- source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
- messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
- referencedClasses: ["Smalltalk"]
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_source",
- smalltalk.method({
- selector: "source",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@source"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1="";
- } else {
- $1=$2;
- };
- return $1;
- }, self, "source", [], smalltalk.AbstractCodeGenerator)},
- args: [],
- source: "source\x0a\x09^source ifNil: ['']",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_source_",
- smalltalk.method({
- selector: "source:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@source"]=aString;
- return self}, self, "source:", [aString], smalltalk.AbstractCodeGenerator)},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AbstractCodeGenerator);
- smalltalk.addMethod(
- "_compileNode_",
- smalltalk.method({
- selector: "compileNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $ctx1.locals.ir=nil;
- $ctx1.locals.stream=nil;
- _st(_st(self)._semanticAnalyzer())._visit_(aNode);
- $ctx1.locals.ir=_st(_st(self)._translator())._visit_(aNode);
- $2=_st(self)._irTranslator();
- _st($2)._visit_($ctx1.locals.ir);
- $3=_st($2)._contents();
- $1=$3;
- return $1;
- }, self, "compileNode:", [aNode], smalltalk.CodeGenerator)},
- args: ["aNode"],
- source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09^ self irTranslator\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
- messageSends: ["visit:", "semanticAnalyzer", "translator", "irTranslator", "contents"],
- referencedClasses: []
- }),
- smalltalk.CodeGenerator);
- smalltalk.addMethod(
- "_irTranslator",
- smalltalk.method({
- selector: "irTranslator",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.IRJSTranslator || IRJSTranslator))._new();
- return $1;
- }, self, "irTranslator", [], smalltalk.CodeGenerator)},
- args: [],
- source: "irTranslator\x0a\x09^ IRJSTranslator new",
- messageSends: ["new"],
- referencedClasses: ["IRJSTranslator"]
- }),
- smalltalk.CodeGenerator);
- smalltalk.addMethod(
- "_semanticAnalyzer",
- smalltalk.method({
- selector: "semanticAnalyzer",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.SemanticAnalyzer || SemanticAnalyzer))._on_(_st(self)._currentClass());
- return $1;
- }, self, "semanticAnalyzer", [], smalltalk.CodeGenerator)},
- args: [],
- source: "semanticAnalyzer\x0a\x09^ SemanticAnalyzer on: self currentClass",
- messageSends: ["on:", "currentClass"],
- referencedClasses: ["SemanticAnalyzer"]
- }),
- smalltalk.CodeGenerator);
- smalltalk.addMethod(
- "_translator",
- smalltalk.method({
- selector: "translator",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRASTTranslator || IRASTTranslator))._new();
- _st($2)._source_(_st(self)._source());
- _st($2)._theClass_(_st(self)._currentClass());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "translator", [], smalltalk.CodeGenerator)},
- args: [],
- source: "translator\x0a\x09^ IRASTTranslator new\x0a\x09\x09source: self source;\x0a\x09\x09theClass: self currentClass;\x0a\x09\x09yourself",
- messageSends: ["source:", "source", "new", "theClass:", "currentClass", "yourself"],
- referencedClasses: ["IRASTTranslator"]
- }),
- smalltalk.CodeGenerator);
- smalltalk.addMethod(
- "_compileNode_",
- smalltalk.method({
- selector: "compileNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $ctx1.locals.ir=nil;
- $ctx1.locals.stream=nil;
- _st(_st(self)._semanticAnalyzer())._visit_(aNode);
- $ctx1.locals.ir=_st(_st(self)._translator())._visit_(aNode);
- _st(_st(self)._inliner())._visit_($ctx1.locals.ir);
- $2=_st(self)._irTranslator();
- _st($2)._visit_($ctx1.locals.ir);
- $3=_st($2)._contents();
- $1=$3;
- return $1;
- }, self, "compileNode:", [aNode], smalltalk.InliningCodeGenerator)},
- args: ["aNode"],
- source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09self inliner visit: ir.\x0a\x0a\x09^ self irTranslator\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
- messageSends: ["visit:", "semanticAnalyzer", "translator", "inliner", "irTranslator", "contents"],
- referencedClasses: []
- }),
- smalltalk.InliningCodeGenerator);
- smalltalk.addMethod(
- "_inliner",
- smalltalk.method({
- selector: "inliner",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.IRInliner || IRInliner))._new();
- return $1;
- }, self, "inliner", [], smalltalk.InliningCodeGenerator)},
- args: [],
- source: "inliner\x0a\x09^ IRInliner new",
- messageSends: ["new"],
- referencedClasses: ["IRInliner"]
- }),
- smalltalk.InliningCodeGenerator);
- smalltalk.addMethod(
- "_irTranslator",
- smalltalk.method({
- selector: "irTranslator",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st((smalltalk.IRInliningJSTranslator || IRInliningJSTranslator))._new();
- return $1;
- }, self, "irTranslator", [], smalltalk.InliningCodeGenerator)},
- args: [],
- source: "irTranslator\x0a\x09^ IRInliningJSTranslator new",
- messageSends: ["new"],
- referencedClasses: ["IRInliningJSTranslator"]
- }),
- smalltalk.InliningCodeGenerator);
- smalltalk.addMethod(
- "_alias_",
- smalltalk.method({
- selector: "alias:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5,$6,$7;
- $ctx1.locals.variable=nil;
- $1=_st(aNode)._isImmutable();
- if(smalltalk.assert($1)){
- $2=_st(self)._visit_(aNode);
- return $2;
- };
- $3=_st((smalltalk.IRVariable || IRVariable))._new();
- _st($3)._variable_(_st(_st((smalltalk.AliasVar || AliasVar))._new())._name_(_st("$").__comma(_st(self)._nextAlias())));
- $4=_st($3)._yourself();
- $ctx1.locals.variable=$4;
- $5=_st((smalltalk.IRAssignment || IRAssignment))._new();
- _st($5)._add_($ctx1.locals.variable);
- _st($5)._add_(_st(self)._visit_(aNode));
- $6=_st($5)._yourself();
- _st(_st(self)._sequence())._add_($6);
- _st(_st(_st(self)._method())._internalVariables())._add_($ctx1.locals.variable);
- $7=$ctx1.locals.variable;
- return $7;
- }, self, "alias:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "alias: aNode\x0a\x09| variable |\x0a\x0a\x09aNode isImmutable ifTrue: [ ^ self visit: aNode ].\x0a\x0a\x09variable := IRVariable new \x0a\x09\x09variable: (AliasVar new name: '$', self nextAlias); \x0a\x09\x09yourself.\x0a\x0a\x09self sequence add: (IRAssignment new\x0a\x09\x09add: variable;\x0a\x09\x09add: (self visit: aNode);\x0a\x09\x09yourself).\x0a\x0a\x09self method internalVariables add: variable.\x0a\x0a\x09^ variable",
- messageSends: ["ifTrue:", "visit:", "isImmutable", "variable:", "name:", ",", "nextAlias", "new", "yourself", "add:", "sequence", "internalVariables", "method"],
- referencedClasses: ["AliasVar", "IRVariable", "IRAssignment"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_aliasTemporally_",
- smalltalk.method({
- selector: "aliasTemporally:",
- category: '*Compiler',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$2,$4,$6,$8,$7,$5,$9;
- $ctx1.locals.threshold=nil;
- $ctx1.locals.result=nil;
- $ctx1.locals.threshold=(0);
- $1=aCollection;
- $2=(function(each,i){
- return smalltalk.withContext(function($ctx2) {
$3=_st(each)._subtreeNeedsAliasing();
- if(smalltalk.assert($3)){
- $ctx1.locals.threshold=i;
- return $ctx1.locals.threshold;
- };
- })});
- _st($1)._withIndexDo_($2);
- $ctx1.locals.result=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
- $4=aCollection;
- $5=(function(each,i){
- return smalltalk.withContext(function($ctx2) {
$6=$ctx1.locals.result;
- $8=_st(i).__lt_eq($ctx1.locals.threshold);
- if(smalltalk.assert($8)){
- $7=_st(self)._alias_(each);
- } else {
- $7=_st(self)._visit_(each);
- };
- return _st($6)._add_($7);
- })});
- _st($4)._withIndexDo_($5);
- $9=$ctx1.locals.result;
- return $9;
- }, self, "aliasTemporally:", [aCollection], smalltalk.IRASTTranslator)},
- args: ["aCollection"],
- source: "aliasTemporally: aCollection\x0a\x09\x22https://github.com/NicolasPetton/amber/issues/296\x0a \x0a If a node is aliased, all preceding ones are aliased as well.\x0a The tree is iterated twice. First we get the aliasing dependency, \x0a then the aliasing itself is done\x22\x0a\x0a\x09| threshold result |\x0a threshold := 0.\x0a \x0a aCollection withIndexDo: [ :each :i |\x0a each subtreeNeedsAliasing\x0a\x09\x09 ifTrue: [ threshold := i ]].\x0a\x0a\x09result := OrderedCollection new.\x0a\x09aCollection withIndexDo: [ :each :i | \x0a\x09\x09result add: (i <= threshold\x0a\x09\x09\x09ifTrue: [ self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ])].\x0a\x0a ^result",
- messageSends: ["withIndexDo:", "ifTrue:", "subtreeNeedsAliasing", "new", "add:", "ifTrue:ifFalse:", "alias:", "visit:", "<="],
- referencedClasses: ["OrderedCollection"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_method",
- smalltalk.method({
- selector: "method",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@method"];
- return $1;
- }, self, "method", [], smalltalk.IRASTTranslator)},
- args: [],
- source: "method\x0a\x09^ method",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_method_",
- smalltalk.method({
- selector: "method:",
- category: '*Compiler',
- fn: function (anIRMethod){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@method"]=anIRMethod;
- return self}, self, "method:", [anIRMethod], smalltalk.IRASTTranslator)},
- args: ["anIRMethod"],
- source: "method: anIRMethod\x0a\x09method := anIRMethod",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_nextAlias",
- smalltalk.method({
- selector: "nextAlias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=self["@nextAlias"];
- if(($receiver = $1) == nil || $receiver == undefined){
- self["@nextAlias"]=(0);
- self["@nextAlias"];
- } else {
- $1;
- };
- self["@nextAlias"]=_st(self["@nextAlias"]).__plus((1));
- $2=_st(self["@nextAlias"])._asString();
- return $2;
- }, self, "nextAlias", [], smalltalk.IRASTTranslator)},
- args: [],
- source: "nextAlias\x0a\x09nextAlias ifNil: [ nextAlias := 0 ].\x0a\x09nextAlias := nextAlias + 1.\x0a\x09^ nextAlias asString",
- messageSends: ["ifNil:", "+", "asString"],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_sequence",
- smalltalk.method({
- selector: "sequence",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@sequence"];
- return $1;
- }, self, "sequence", [], smalltalk.IRASTTranslator)},
- args: [],
- source: "sequence\x0a\x09^ sequence",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_sequence_",
- smalltalk.method({
- selector: "sequence:",
- category: '*Compiler',
- fn: function (anIRSequence){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@sequence"]=anIRSequence;
- return self}, self, "sequence:", [anIRSequence], smalltalk.IRASTTranslator)},
- args: ["anIRSequence"],
- source: "sequence: anIRSequence\x0a\x09sequence := anIRSequence",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_source",
- smalltalk.method({
- selector: "source",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@source"];
- return $1;
- }, self, "source", [], smalltalk.IRASTTranslator)},
- args: [],
- source: "source\x0a\x09^ source",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_source_",
- smalltalk.method({
- selector: "source:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@source"]=aString;
- return self}, self, "source:", [aString], smalltalk.IRASTTranslator)},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_theClass",
- smalltalk.method({
- selector: "theClass",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@theClass"];
- return $1;
- }, self, "theClass", [], smalltalk.IRASTTranslator)},
- args: [],
- source: "theClass\x0a\x09^ theClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_theClass_",
- smalltalk.method({
- selector: "theClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@theClass"]=aClass;
- return self}, self, "theClass:", [aClass], smalltalk.IRASTTranslator)},
- args: ["aClass"],
- source: "theClass: aClass\x0a\x09theClass := aClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitAssignmentNode_",
- smalltalk.method({
- selector: "visitAssignmentNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3;
- $ctx1.locals.left=nil;
- $ctx1.locals.right=nil;
- $ctx1.locals.assignment=nil;
- $ctx1.locals.right=_st(self)._visit_(_st(aNode)._right());
- $ctx1.locals.left=_st(self)._visit_(_st(aNode)._left());
- $1=_st((smalltalk.IRAssignment || IRAssignment))._new();
- _st($1)._add_($ctx1.locals.left);
- _st($1)._add_($ctx1.locals.right);
- $2=_st($1)._yourself();
- _st(_st(self)._sequence())._add_($2);
- $3=$ctx1.locals.left;
- return $3;
- }, self, "visitAssignmentNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitAssignmentNode: aNode\x0a\x09| left right assignment |\x0a\x09right := self visit: aNode right.\x0a\x09left := self visit: aNode left.\x0a\x09self sequence add: (IRAssignment new \x0a\x09\x09add: left;\x0a\x09\x09add: right;\x0a\x09\x09yourself).\x0a\x09^ left",
- messageSends: ["visit:", "right", "left", "add:", "new", "yourself", "sequence"],
- referencedClasses: ["IRAssignment"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitBlockNode_",
- smalltalk.method({
- selector: "visitBlockNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5;
- $ctx1.locals.closure=nil;
- $1=_st((smalltalk.IRClosure || IRClosure))._new();
- _st($1)._arguments_(_st(aNode)._parameters());
- _st($1)._scope_(_st(aNode)._scope());
- $2=_st($1)._yourself();
- $ctx1.locals.closure=$2;
- _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
$3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
- _st($3)._name_(_st(each)._name());
- _st($3)._scope_(_st(aNode)._scope());
- $4=_st($3)._yourself();
- return _st($ctx1.locals.closure)._add_($4);
- })}));
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.closure)._add_(_st(self)._visit_(each));
- })}));
- $5=$ctx1.locals.closure;
- return $5;
- }, self, "visitBlockNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitBlockNode: aNode\x0a\x09| closure |\x0a\x09closure := IRClosure new\x0a\x09\x09arguments: aNode parameters;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself.\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09closure add: (IRTempDeclaration new \x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x09aNode nodes do: [ :each | closure add: (self visit: each) ].\x0a\x09^ closure",
- messageSends: ["arguments:", "parameters", "new", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "temps", "visit:", "nodes"],
- referencedClasses: ["IRClosure", "IRTempDeclaration"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitBlockSequenceNode_",
- smalltalk.method({
- selector: "visitBlockSequenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$5,$7,$8,$9,$6,$4,$1;
- $2=self;
- $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
- $4=(function(){
- return smalltalk.withContext(function($ctx2) {
$5=_st(aNode)._nodes();
- $6=(function(){
- return smalltalk.withContext(function($ctx3) {
_st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
- return smalltalk.withContext(function($ctx4) {
return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
- })}));
- $7=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
- if(smalltalk.assert($7)){
- return _st(_st(self)._sequence())._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
- } else {
- $8=_st((smalltalk.IRBlockReturn || IRBlockReturn))._new();
- _st($8)._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
- $9=_st($8)._yourself();
- return _st(_st(self)._sequence())._add_($9);
- };
- })});
- return _st($5)._ifNotEmpty_($6);
- })});
- $1=_st($2)._withSequence_do_($3,$4);
- return $1;
- }, self, "visitBlockSequenceNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitBlockSequenceNode: aNode\x0a\x09^ self\x0a\x09\x09withSequence: IRBlockSequence new\x0a\x09\x09do: [ \x0a\x09\x09\x09aNode nodes ifNotEmpty: [\x0a\x09\x09\x09\x09aNode nodes allButLast do: [ :each | \x0a\x09\x09\x09\x09\x09self sequence add: (self visit: each) ].\x0a\x09\x09\x09\x09aNode nodes last isReturnNode \x0a\x09\x09\x09\x09\x09ifFalse: [ self sequence add: (IRBlockReturn new add: (self visit: aNode nodes last); yourself) ]\x0a\x09\x09\x09\x09\x09ifTrue: [ self sequence add: (self visit: aNode nodes last) ]]]",
- messageSends: ["withSequence:do:", "new", "ifNotEmpty:", "do:", "add:", "visit:", "sequence", "allButLast", "nodes", "ifFalse:ifTrue:", "last", "yourself", "isReturnNode"],
- referencedClasses: ["IRBlockSequence", "IRBlockReturn"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitCascadeNode_",
- smalltalk.method({
- selector: "visitCascadeNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $ctx1.locals.alias=nil;
- $1=_st(_st(aNode)._receiver())._isImmutable();
- if(! smalltalk.assert($1)){
- $ctx1.locals.alias=_st(self)._alias_(_st(aNode)._receiver());
- $ctx1.locals.alias;
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(each)._receiver_(_st(_st((smalltalk.VariableNode || VariableNode))._new())._binding_(_st($ctx1.locals.alias)._variable()));
- })}));
- };
- _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
- })}));
- $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
- return $2;
- }, self, "visitCascadeNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitCascadeNode: aNode\x0a\x09| alias |\x0a\x0a\x09aNode receiver isImmutable ifFalse: [ \x0a\x09\x09alias := self alias: aNode receiver.\x0a\x09\x09aNode nodes do: [ :each |\x0a\x09\x09\x09each receiver: (VariableNode new binding: alias variable) ]].\x0a\x0a\x09aNode nodes allButLast do: [ :each |\x0a\x09\x09self sequence add: (self visit: each) ].\x0a\x0a\x09^ self alias: aNode nodes last",
- messageSends: ["ifFalse:", "alias:", "receiver", "do:", "receiver:", "binding:", "variable", "new", "nodes", "isImmutable", "add:", "visit:", "sequence", "allButLast", "last"],
- referencedClasses: ["VariableNode"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitDynamicArrayNode_",
- smalltalk.method({
- selector: "visitDynamicArrayNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.array=nil;
- $ctx1.locals.array=_st((smalltalk.IRDynamicArray || IRDynamicArray))._new();
- _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.array)._add_(each);
- })}));
- $1=$ctx1.locals.array;
- return $1;
- }, self, "visitDynamicArrayNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09array := IRDynamicArray new.\x0a\x09(self aliasTemporally: aNode nodes) do: [:each | array add: each].\x0a\x09^ array",
- messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
- referencedClasses: ["IRDynamicArray"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitDynamicDictionaryNode_",
- smalltalk.method({
- selector: "visitDynamicDictionaryNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.dictionary=nil;
- $ctx1.locals.dictionary=_st((smalltalk.IRDynamicDictionary || IRDynamicDictionary))._new();
- _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.dictionary)._add_(each);
- })}));
- $1=$ctx1.locals.dictionary;
- return $1;
- }, self, "visitDynamicDictionaryNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitDynamicDictionaryNode: aNode\x0a\x09| dictionary |\x0a\x09dictionary := IRDynamicDictionary new.\x0a (self aliasTemporally: aNode nodes) do: [:each | dictionary add: each].\x0a\x09^ dictionary",
- messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
- referencedClasses: ["IRDynamicDictionary"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitJSStatementNode_",
- smalltalk.method({
- selector: "visitJSStatementNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRVerbatim || IRVerbatim))._new();
- _st($2)._source_(_st(aNode)._source());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "visitJSStatementNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitJSStatementNode: aNode\x0a\x09^ IRVerbatim new\x0a\x09\x09source: aNode source;\x0a\x09\x09yourself",
- messageSends: ["source:", "source", "new", "yourself"],
- referencedClasses: ["IRVerbatim"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitMethodNode_",
- smalltalk.method({
- selector: "visitMethodNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4,$5,$6,$7,$8;
- $1=_st((smalltalk.IRMethod || IRMethod))._new();
- _st($1)._source_(_st(self)._source());
- _st($1)._theClass_(_st(self)._theClass());
- _st($1)._arguments_(_st(aNode)._arguments());
- _st($1)._selector_(_st(aNode)._selector());
- _st($1)._messageSends_(_st(aNode)._messageSends());
- _st($1)._superSends_(_st(aNode)._superSends());
- _st($1)._classReferences_(_st(aNode)._classReferences());
- _st($1)._scope_(_st(aNode)._scope());
- $2=_st($1)._yourself();
- _st(self)._method_($2);
- _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
$3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
- _st($3)._name_(_st(each)._name());
- _st($3)._scope_(_st(aNode)._scope());
- $4=_st($3)._yourself();
- return _st(_st(self)._method())._add_($4);
- })}));
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._method())._add_(_st(self)._visit_(each));
- })}));
- $5=_st(_st(aNode)._scope())._hasLocalReturn();
- if(! smalltalk.assert($5)){
- $6=_st((smalltalk.IRVariable || IRVariable))._new();
- _st($6)._variable_(_st(_st(_st(aNode)._scope())._pseudoVars())._at_("self"));
- $7=_st($6)._yourself();
- _st(_st(_st(self)._method())._add_(_st((smalltalk.IRReturn || IRReturn))._new()))._add_($7);
- };
- $8=_st(self)._method();
- return $8;
- }, self, "visitMethodNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitMethodNode: aNode\x0a\x0a\x09self method: (IRMethod new\x0a\x09\x09source: self source;\x0a theClass: self theClass;\x0a\x09\x09arguments: aNode arguments;\x0a\x09\x09selector: aNode selector;\x0a\x09\x09messageSends: aNode messageSends;\x0a superSends: aNode superSends;\x0a\x09\x09classReferences: aNode classReferences;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself).\x0a\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09self method add: (IRTempDeclaration new\x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09aNode nodes do: [ :each | self method add: (self visit: each) ].\x0a\x0a\x09aNode scope hasLocalReturn ifFalse: [\x0a\x09\x09(self method add: IRReturn new) add: (IRVariable new\x0a\x09\x09\x09variable: (aNode scope pseudoVars at: 'self');\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09^ self method",
- messageSends: ["method:", "source:", "source", "new", "theClass:", "theClass", "arguments:", "arguments", "selector:", "selector", "messageSends:", "messageSends", "superSends:", "superSends", "classReferences:", "classReferences", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "method", "temps", "visit:", "nodes", "ifFalse:", "variable:", "at:", "pseudoVars", "hasLocalReturn"],
- referencedClasses: ["IRMethod", "IRTempDeclaration", "IRVariable", "IRReturn"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitReturnNode_",
- smalltalk.method({
- selector: "visitReturnNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $ctx1.locals.return=nil;
- $1=_st(aNode)._nonLocalReturn();
- if(smalltalk.assert($1)){
- $ctx1.locals.return_=_st((smalltalk.IRNonLocalReturn || IRNonLocalReturn))._new();
- } else {
- $ctx1.locals.return_=_st((smalltalk.IRReturn || IRReturn))._new();
- };
- _st($ctx1.locals.return_)._scope_(_st(aNode)._scope());
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.return_)._add_(_st(self)._alias_(each));
- })}));
- $2=$ctx1.locals.return_;
- return $2;
- }, self, "visitReturnNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09| return |\x0a\x09return := aNode nonLocalReturn \x0a\x09\x09ifTrue: [ IRNonLocalReturn new ]\x0a\x09\x09ifFalse: [ IRReturn new ].\x0a\x09return scope: aNode scope.\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09return add: (self alias: each) ].\x0a\x09^ return",
- messageSends: ["ifTrue:ifFalse:", "new", "nonLocalReturn", "scope:", "scope", "do:", "add:", "alias:", "nodes"],
- referencedClasses: ["IRNonLocalReturn", "IRReturn"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitSendNode_",
- smalltalk.method({
- selector: "visitSendNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3,$4;
- $ctx1.locals.send=nil;
- $ctx1.locals.all=nil;
- $ctx1.locals.receiver=nil;
- $ctx1.locals.arguments=nil;
- $ctx1.locals.send=_st((smalltalk.IRSend || IRSend))._new();
- $1=$ctx1.locals.send;
- _st($1)._selector_(_st(aNode)._selector());
- $2=_st($1)._index_(_st(aNode)._index());
- $3=_st(aNode)._superSend();
- if(smalltalk.assert($3)){
- _st($ctx1.locals.send)._classSend_(_st(_st(self)._theClass())._superclass());
- };
- $ctx1.locals.all=_st(self)._aliasTemporally_(_st([_st(aNode)._receiver()]).__comma(_st(aNode)._arguments()));
- $ctx1.locals.receiver=_st($ctx1.locals.all)._first();
- $ctx1.locals.arguments=_st($ctx1.locals.all)._allButFirst();
- _st($ctx1.locals.send)._add_($ctx1.locals.receiver);
- _st($ctx1.locals.arguments)._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st($ctx1.locals.send)._add_(each);
- })}));
- $4=$ctx1.locals.send;
- return $4;
- }, self, "visitSendNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a\x09| send all receiver arguments |\x0a\x09send := IRSend new.\x0a\x09send \x0a\x09\x09selector: aNode selector;\x0a\x09\x09index: aNode index.\x0a\x09aNode superSend ifTrue: [ send classSend: self theClass superclass ].\x0a \x0a all := self aliasTemporally: { aNode receiver }, aNode arguments.\x0a\x09receiver := all first.\x0a\x09arguments := all allButFirst.\x0a\x0a\x09send add: receiver.\x0a\x09arguments do: [ :each | send add: each ].\x0a\x0a\x09^ send",
- messageSends: ["new", "selector:", "selector", "index:", "index", "ifTrue:", "classSend:", "superclass", "theClass", "superSend", "aliasTemporally:", ",", "arguments", "receiver", "first", "allButFirst", "add:", "do:"],
- referencedClasses: ["IRSend"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitSequenceNode_",
- smalltalk.method({
- selector: "visitSequenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$5,$7,$6,$4,$1;
- $2=self;
- $3=_st((smalltalk.IRSequence || IRSequence))._new();
- $4=(function(){
- return smalltalk.withContext(function($ctx2) {
$5=_st(aNode)._nodes();
- $6=(function(each){
- return smalltalk.withContext(function($ctx3) {
$ctx3.locals.instruction=nil;
- $ctx3.locals.instruction=_st(self)._visit_(each);
- $ctx3.locals.instruction;
- $7=_st($ctx3.locals.instruction)._isVariable();
- if(! smalltalk.assert($7)){
- return _st(_st(self)._sequence())._add_($ctx3.locals.instruction);
- };
- })});
- return _st($5)._do_($6);
- })});
- $1=_st($2)._withSequence_do_($3,$4);
- return $1;
- }, self, "visitSequenceNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitSequenceNode: aNode\x0a\x09^ self \x0a\x09\x09withSequence: IRSequence new \x09\x0a\x09\x09do: [\x0a\x09\x09\x09aNode nodes do: [ :each | | instruction |\x0a\x09\x09\x09\x09instruction := self visit: each.\x0a\x09\x09\x09\x09instruction isVariable ifFalse: [\x0a\x09\x09\x09\x09\x09self sequence add: instruction ]]]",
- messageSends: ["withSequence:do:", "new", "do:", "visit:", "ifFalse:", "add:", "sequence", "isVariable", "nodes"],
- referencedClasses: ["IRSequence"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitValueNode_",
- smalltalk.method({
- selector: "visitValueNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRValue || IRValue))._new();
- _st($2)._value_(_st(aNode)._value());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "visitValueNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitValueNode: aNode\x0a\x09^ IRValue new \x0a\x09\x09value: aNode value; \x0a\x09\x09yourself",
- messageSends: ["value:", "value", "new", "yourself"],
- referencedClasses: ["IRValue"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_visitVariableNode_",
- smalltalk.method({
- selector: "visitVariableNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st((smalltalk.IRVariable || IRVariable))._new();
- _st($2)._variable_(_st(aNode)._binding());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "visitVariableNode:", [aNode], smalltalk.IRASTTranslator)},
- args: ["aNode"],
- source: "visitVariableNode: aNode\x0a\x09^ IRVariable new \x0a\x09\x09variable: aNode binding; \x0a\x09\x09yourself",
- messageSends: ["variable:", "binding", "new", "yourself"],
- referencedClasses: ["IRVariable"]
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_withSequence_do_",
- smalltalk.method({
- selector: "withSequence:do:",
- category: '*Compiler',
- fn: function (aSequence,aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $ctx1.locals.outerSequence=nil;
- $ctx1.locals.outerSequence=_st(self)._sequence();
- _st(self)._sequence_(aSequence);
- _st(aBlock)._value();
- _st(self)._sequence_($ctx1.locals.outerSequence);
- $1=aSequence;
- return $1;
- }, self, "withSequence:do:", [aSequence,aBlock], smalltalk.IRASTTranslator)},
- args: ["aSequence", "aBlock"],
- 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",
- messageSends: ["sequence", "sequence:", "value"],
- referencedClasses: []
- }),
- smalltalk.IRASTTranslator);
- smalltalk.addMethod(
- "_classReferences",
- smalltalk.method({
- selector: "classReferences",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@classReferences"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@classReferences"]=_st((smalltalk.Set || Set))._new();
- $1=self["@classReferences"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "classReferences", [], smalltalk.SemanticAnalyzer)},
- args: [],
- source: "classReferences\x0a\x09^ classReferences ifNil: [ classReferences := Set new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Set"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_errorShadowingVariable_",
- smalltalk.method({
- selector: "errorShadowingVariable:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=_st((smalltalk.ShadowingVariableError || ShadowingVariableError))._new();
- _st($1)._variableName_(aString);
- $2=_st($1)._signal();
- return self}, self, "errorShadowingVariable:", [aString], smalltalk.SemanticAnalyzer)},
- args: ["aString"],
- source: "errorShadowingVariable: aString\x0a\x09ShadowingVariableError new\x0a\x09\x09variableName: aString;\x0a\x09\x09signal",
- messageSends: ["variableName:", "new", "signal"],
- referencedClasses: ["ShadowingVariableError"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_errorUnknownVariable_",
- smalltalk.method({
- selector: "errorUnknownVariable:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3;
- $ctx1.locals.identifier=nil;
- $ctx1.locals.identifier=_st(aNode)._value();
- $1=_st(_st(_st(["jQuery", "window", "process", "global"])._includes_($ctx1.locals.identifier))._not())._and_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._isVariableGloballyUndefined_($ctx1.locals.identifier);
- })}));
- if(smalltalk.assert($1)){
- $2=_st((smalltalk.UnknownVariableError || UnknownVariableError))._new();
- _st($2)._variableName_(_st(aNode)._value());
- $3=_st($2)._signal();
- $3;
- } else {
- _st(_st(_st(self["@currentScope"])._methodScope())._unknownVariables())._add_(_st(aNode)._value());
- };
- return self}, self, "errorUnknownVariable:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "errorUnknownVariable: aNode\x0a\x09\x22Throw an error if the variable is undeclared in the global JS scope (i.e. window)\x22\x0a\x0a\x09| identifier |\x0a identifier := aNode value.\x0a\x09((#('jQuery' 'window' 'process' 'global') includes: identifier) not and: [ self isVariableGloballyUndefined: identifier ]) ifTrue: [\x0a\x09\x09\x09UnknownVariableError new\x0a\x09\x09\x09\x09variableName: aNode value;\x0a\x09\x09\x09\x09signal ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09currentScope methodScope unknownVariables add: aNode value. ]",
- messageSends: ["value", "ifTrue:ifFalse:", "variableName:", "new", "signal", "add:", "unknownVariables", "methodScope", "and:", "isVariableGloballyUndefined:", "not", "includes:"],
- referencedClasses: ["UnknownVariableError"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_isVariableGloballyUndefined_",
- smalltalk.method({
- selector: "isVariableGloballyUndefined:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return eval('typeof ' + aString + ' == "undefined"');
- return self}, self, "isVariableGloballyUndefined:", [aString], smalltalk.SemanticAnalyzer)},
- args: ["aString"],
- source: "isVariableGloballyUndefined: aString\x0a\x09<return eval('typeof ' + aString + ' == \x22undefined\x22')>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_messageSends",
- smalltalk.method({
- selector: "messageSends",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@messageSends"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@messageSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
- $1=self["@messageSends"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "messageSends", [], smalltalk.SemanticAnalyzer)},
- args: [],
- source: "messageSends\x0a\x09^ messageSends ifNil: [ messageSends := Dictionary new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Dictionary"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_newBlockScope",
- smalltalk.method({
- selector: "newBlockScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._newScopeOfClass_((smalltalk.LexicalScope || LexicalScope));
- return $1;
- }, self, "newBlockScope", [], smalltalk.SemanticAnalyzer)},
- args: [],
- source: "newBlockScope\x0a\x09^ self newScopeOfClass: LexicalScope",
- messageSends: ["newScopeOfClass:"],
- referencedClasses: ["LexicalScope"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_newMethodScope",
- smalltalk.method({
- selector: "newMethodScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._newScopeOfClass_((smalltalk.MethodLexicalScope || MethodLexicalScope));
- return $1;
- }, self, "newMethodScope", [], smalltalk.SemanticAnalyzer)},
- args: [],
- source: "newMethodScope\x0a\x09^ self newScopeOfClass: MethodLexicalScope",
- messageSends: ["newScopeOfClass:"],
- referencedClasses: ["MethodLexicalScope"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_newScopeOfClass_",
- smalltalk.method({
- selector: "newScopeOfClass:",
- category: '*Compiler',
- fn: function (aLexicalScopeClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st(aLexicalScopeClass)._new();
- _st($2)._outerScope_(self["@currentScope"]);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "newScopeOfClass:", [aLexicalScopeClass], smalltalk.SemanticAnalyzer)},
- args: ["aLexicalScopeClass"],
- source: "newScopeOfClass: aLexicalScopeClass\x0a\x09^ aLexicalScopeClass new \x0a\x09\x09outerScope: currentScope;\x0a\x09\x09yourself",
- messageSends: ["outerScope:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_popScope",
- smalltalk.method({
- selector: "popScope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@currentScope"];
- if(($receiver = $1) == nil || $receiver == undefined){
- $1;
- } else {
- self["@currentScope"]=_st(self["@currentScope"])._outerScope();
- self["@currentScope"];
- };
- return self}, self, "popScope", [], smalltalk.SemanticAnalyzer)},
- args: [],
- source: "popScope\x0a\x09currentScope ifNotNil: [\x0a\x09\x09currentScope := currentScope outerScope ]",
- messageSends: ["ifNotNil:", "outerScope"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_pushScope_",
- smalltalk.method({
- selector: "pushScope:",
- category: '*Compiler',
- fn: function (aScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aScope)._outerScope_(self["@currentScope"]);
- self["@currentScope"]=aScope;
- return self}, self, "pushScope:", [aScope], smalltalk.SemanticAnalyzer)},
- args: ["aScope"],
- source: "pushScope: aScope\x0a\x09aScope outerScope: currentScope.\x0a\x09currentScope := aScope",
- messageSends: ["outerScope:"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_superSends",
- smalltalk.method({
- selector: "superSends",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$1;
- $2=self["@superSends"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@superSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
- $1=self["@superSends"];
- } else {
- $1=$2;
- };
- return $1;
- }, self, "superSends", [], smalltalk.SemanticAnalyzer)},
- args: [],
- source: "superSends\x0a\x09^ superSends ifNil: [ superSends := Dictionary new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Dictionary"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_theClass",
- smalltalk.method({
- selector: "theClass",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@theClass"];
- return $1;
- }, self, "theClass", [], smalltalk.SemanticAnalyzer)},
- args: [],
- source: "theClass\x0a\x09^ theClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_theClass_",
- smalltalk.method({
- selector: "theClass:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@theClass"]=aClass;
- return self}, self, "theClass:", [aClass], smalltalk.SemanticAnalyzer)},
- args: ["aClass"],
- source: "theClass: aClass\x0a\x09theClass := aClass",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_validateVariableScope_",
- smalltalk.method({
- selector: "validateVariableScope:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self["@currentScope"])._lookupVariable_(aString);
- if(($receiver = $1) == nil || $receiver == undefined){
- $1;
- } else {
- _st(self)._errorShadowingVariable_(aString);
- };
- return self}, self, "validateVariableScope:", [aString], smalltalk.SemanticAnalyzer)},
- args: ["aString"],
- source: "validateVariableScope: aString\x0a\x09\x22Validate the variable scope in by doing a recursive lookup, up to the method scope\x22\x0a\x0a\x09(currentScope lookupVariable: aString) ifNotNil: [\x0a\x09\x09self errorShadowingVariable: aString ]",
- messageSends: ["ifNotNil:", "errorShadowingVariable:", "lookupVariable:"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitAssignmentNode_",
- smalltalk.method({
- selector: "visitAssignmentNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
smalltalk.NodeVisitor.fn.prototype._visitAssignmentNode_.apply(_st(self), [aNode]);
- _st(_st(aNode)._left())._beAssigned();
- return self}, self, "visitAssignmentNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitAssignmentNode: aNode\x0a\x09super visitAssignmentNode: aNode.\x0a\x09aNode left beAssigned",
- messageSends: ["visitAssignmentNode:", "beAssigned", "left"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitBlockNode_",
- smalltalk.method({
- selector: "visitBlockNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(self)._pushScope_(_st(self)._newBlockScope());
- _st(aNode)._scope_(self["@currentScope"]);
- _st(self["@currentScope"])._node_(aNode);
- _st(_st(aNode)._parameters())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
_st(self)._validateVariableScope_(each);
- return _st(self["@currentScope"])._addArg_(each);
- })}));
- smalltalk.NodeVisitor.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
- _st(self)._popScope();
- return self}, self, "visitBlockNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitBlockNode: aNode\x0a\x09self pushScope: self newBlockScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x09\x0a\x09aNode parameters do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitBlockNode: aNode.\x0a\x09self popScope",
- messageSends: ["pushScope:", "newBlockScope", "scope:", "node:", "do:", "validateVariableScope:", "addArg:", "parameters", "visitBlockNode:", "popScope"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitCascadeNode_",
- smalltalk.method({
- selector: "visitCascadeNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(each)._receiver_(_st(aNode)._receiver());
- })}));
- smalltalk.NodeVisitor.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
- $1=_st(_st(_st(aNode)._nodes())._first())._superSend();
- if(smalltalk.assert($1)){
- _st(_st(aNode)._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(each)._superSend_(true);
- })}));
- };
- return self}, self, "visitCascadeNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitCascadeNode: aNode\x0a\x09\x22Populate the receiver into all children\x22\x0a\x09aNode nodes do: [ :each | \x0a\x09\x09each receiver: aNode receiver ].\x0a\x09super visitCascadeNode: aNode.\x0a\x09aNode nodes first superSend ifTrue: [\x0a\x09\x09aNode nodes do: [ :each | each superSend: true ]]",
- messageSends: ["do:", "receiver:", "receiver", "nodes", "visitCascadeNode:", "ifTrue:", "superSend:", "superSend", "first"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitClassReferenceNode_",
- smalltalk.method({
- selector: "visitClassReferenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- _st(_st(self)._classReferences())._add_(_st(aNode)._value());
- $1=_st((smalltalk.ClassRefVar || ClassRefVar))._new();
- _st($1)._name_(_st(aNode)._value());
- $2=_st($1)._yourself();
- _st(aNode)._binding_($2);
- return self}, self, "visitClassReferenceNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitClassReferenceNode: aNode\x0a\x09self classReferences add: aNode value.\x0a\x09aNode binding: (ClassRefVar new name: aNode value; yourself)",
- messageSends: ["add:", "value", "classReferences", "binding:", "name:", "new", "yourself"],
- referencedClasses: ["ClassRefVar"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitMethodNode_",
- smalltalk.method({
- selector: "visitMethodNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- _st(self)._pushScope_(_st(self)._newMethodScope());
- _st(aNode)._scope_(self["@currentScope"]);
- _st(self["@currentScope"])._node_(aNode);
- _st(_st(_st(self)._theClass())._allInstanceVariableNames())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self["@currentScope"])._addIVar_(each);
- })}));
- _st(_st(aNode)._arguments())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
_st(self)._validateVariableScope_(each);
- return _st(self["@currentScope"])._addArg_(each);
- })}));
- smalltalk.NodeVisitor.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
- $1=aNode;
- _st($1)._classReferences_(_st(self)._classReferences());
- _st($1)._messageSends_(_st(_st(self)._messageSends())._keys());
- $2=_st($1)._superSends_(_st(_st(self)._superSends())._keys());
- _st(self)._popScope();
- return self}, self, "visitMethodNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allInstanceVariableNames do: [:each | \x0a\x09\x09currentScope addIVar: each ].\x0a\x09aNode arguments do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode \x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09messageSends: self messageSends keys;\x0a superSends: self superSends keys.\x0a\x09self popScope",
- messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "addIVar:", "allInstanceVariableNames", "theClass", "validateVariableScope:", "addArg:", "arguments", "visitMethodNode:", "classReferences:", "classReferences", "messageSends:", "keys", "messageSends", "superSends:", "superSends", "popScope"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitReturnNode_",
- smalltalk.method({
- selector: "visitReturnNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- _st(aNode)._scope_(self["@currentScope"]);
- $1=_st(self["@currentScope"])._isMethodScope();
- if(smalltalk.assert($1)){
- _st(self["@currentScope"])._localReturn_(true);
- } else {
- _st(_st(self["@currentScope"])._methodScope())._addNonLocalReturn_(self["@currentScope"]);
- };
- smalltalk.NodeVisitor.fn.prototype._visitReturnNode_.apply(_st(self), [aNode]);
- return self}, self, "visitReturnNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitReturnNode: aNode\x0a\x09aNode scope: currentScope.\x0a\x09currentScope isMethodScope\x0a\x09\x09ifTrue: [ currentScope localReturn: true ]\x0a\x09\x09ifFalse: [ currentScope methodScope addNonLocalReturn: currentScope ].\x0a\x09super visitReturnNode: aNode",
- messageSends: ["scope:", "ifTrue:ifFalse:", "localReturn:", "addNonLocalReturn:", "methodScope", "isMethodScope", "visitReturnNode:"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitSendNode_",
- smalltalk.method({
- selector: "visitSendNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$4,$3;
- $1=_st(_st(_st(aNode)._receiver())._value()).__eq("super");
- $2=(function(){
- return smalltalk.withContext(function($ctx2) {
_st(aNode)._superSend_(true);
- _st(_st(aNode)._receiver())._value_("self");
- _st(_st(self)._superSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
- return smalltalk.withContext(function($ctx3) {
return _st((smalltalk.Set || Set))._new();
- })}));
- return _st(_st(_st(self)._superSends())._at_(_st(aNode)._selector()))._add_(aNode);
- })});
- $3=(function(){
- return smalltalk.withContext(function($ctx2) {
$4=_st(_st((smalltalk.IRSendInliner || IRSendInliner))._inlinedSelectors())._includes_(_st(aNode)._selector());
- if(smalltalk.assert($4)){
- _st(aNode)._shouldBeInlined_(true);
- return _st(_st(aNode)._receiver())._shouldBeAliased_(true);
- };
- })});
- _st($1)._ifTrue_ifFalse_($2,$3);
- _st(_st(self)._messageSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
- return smalltalk.withContext(function($ctx2) {
return _st((smalltalk.Set || Set))._new();
- })}));
- _st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._add_(aNode);
- _st(aNode)._index_(_st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._size());
- smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
- return self}, self, "visitSendNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitSendNode: aNode\x0a\x0a\x09aNode receiver value = 'super' \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09aNode superSend: true.\x0a\x09\x09\x09aNode receiver value: 'self'.\x0a\x09\x09\x09self superSends at: aNode selector ifAbsentPut: [ Set new ].\x0a\x09\x09\x09(self superSends at: aNode selector) add: aNode ]\x0a \x0a\x09\x09ifFalse: [ (IRSendInliner inlinedSelectors includes: aNode selector) ifTrue: [\x0a\x09\x09\x09aNode shouldBeInlined: true.\x0a\x09\x09\x09aNode receiver shouldBeAliased: true ] ].\x0a\x0a\x09self messageSends at: aNode selector ifAbsentPut: [ Set new ].\x0a\x09(self messageSends at: aNode selector) add: aNode.\x0a\x0a\x09aNode index: (self messageSends at: aNode selector) size.\x0a\x0a\x09super visitSendNode: aNode",
- messageSends: ["ifTrue:ifFalse:", "superSend:", "value:", "receiver", "at:ifAbsentPut:", "selector", "new", "superSends", "add:", "at:", "ifTrue:", "shouldBeInlined:", "shouldBeAliased:", "includes:", "inlinedSelectors", "=", "value", "messageSends", "index:", "size", "visitSendNode:"],
- referencedClasses: ["Set", "IRSendInliner"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitSequenceNode_",
- smalltalk.method({
- selector: "visitSequenceNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(_st(aNode)._temps())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
_st(self)._validateVariableScope_(each);
- return _st(self["@currentScope"])._addTemp_(each);
- })}));
- smalltalk.NodeVisitor.fn.prototype._visitSequenceNode_.apply(_st(self), [aNode]);
- return self}, self, "visitSequenceNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addTemp: each ].\x0a\x0a\x09super visitSequenceNode: aNode",
- messageSends: ["do:", "validateVariableScope:", "addTemp:", "temps", "visitSequenceNode:"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_visitVariableNode_",
- smalltalk.method({
- selector: "visitVariableNode:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$3,$4,$5,$2;
- $1=aNode;
- $3=_st(self["@currentScope"])._lookupVariable_(aNode);
- if(($receiver = $3) == nil || $receiver == undefined){
- _st(self)._errorUnknownVariable_(aNode);
- $4=_st((smalltalk.UnknownVar || UnknownVar))._new();
- _st($4)._name_(_st(aNode)._value());
- $5=_st($4)._yourself();
- $2=$5;
- } else {
- $2=$3;
- };
- _st($1)._binding_($2);
- return self}, self, "visitVariableNode:", [aNode], smalltalk.SemanticAnalyzer)},
- args: ["aNode"],
- source: "visitVariableNode: aNode\x0a\x09\x22Bind a ScopeVar to aNode by doing a lookup in the current scope.\x0a\x09If no ScopeVar is found, bind a UnknowVar and throw an error\x22\x0a\x0a\x09aNode binding: ((currentScope lookupVariable: aNode) ifNil: [ \x0a\x09\x09self errorUnknownVariable: aNode.\x0a\x09\x09UnknownVar new name: aNode value; yourself ])",
- messageSends: ["binding:", "ifNil:", "errorUnknownVariable:", "name:", "value", "new", "yourself", "lookupVariable:"],
- referencedClasses: ["UnknownVar"]
- }),
- smalltalk.SemanticAnalyzer);
- smalltalk.addMethod(
- "_on_",
- smalltalk.method({
- selector: "on:",
- category: '*Compiler',
- fn: function (aClass){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._theClass_(aClass);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "on:", [aClass], smalltalk.SemanticAnalyzer.klass)},
- args: ["aClass"],
- source: "on: aClass\x0a\x09^ self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09yourself",
- messageSends: ["theClass:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.SemanticAnalyzer.klass);
- smalltalk.addMethod(
- "_initializePackageNamed_prefix_",
- smalltalk.method({
- selector: "initializePackageNamed:prefix:",
- category: '*Compiler',
- fn: function (packageName,aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2;
- $1=_st((smalltalk.Package || Package))._named_(packageName);
- _st($1)._setupClasses();
- _st($1)._commitPathJs_(_st(_st("/").__comma(aString)).__comma("/js"));
- $2=_st($1)._commitPathSt_(_st(_st("/").__comma(aString)).__comma("/st"));
- return self}, self, "initializePackageNamed:prefix:", [packageName,aString], smalltalk.PackageLoader)},
- args: ["packageName", "aString"],
- source: "initializePackageNamed: packageName prefix: aString\x0a\x0a\x09(Package named: packageName) \x0a \x09setupClasses;\x0a commitPathJs: '/', aString, '/js';\x0a commitPathSt: '/', aString, '/st'",
- messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"],
- referencedClasses: ["Package"]
- }),
- smalltalk.PackageLoader);
- smalltalk.addMethod(
- "_loadPackage_prefix_",
- smalltalk.method({
- selector: "loadPackage:prefix:",
- category: '*Compiler',
- fn: function (packageName,aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$4,$5,$8,$7,$6,$3;
- $ctx1.locals.url=nil;
- $ctx1.locals.url=_st(_st(_st(_st("/").__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
- $1=jQuery;
- $2=$ctx1.locals.url;
- $4=_st("type").__minus_gt("GET");
- $5=_st("dataType").__minus_gt("script");
- $7=(function(jqXHR,textStatus){
- return smalltalk.withContext(function($ctx2) {
$8=_st(_st(jqXHR)._readyState()).__eq((4));
- if(smalltalk.assert($8)){
- return _st(self)._initializePackageNamed_prefix_(packageName,aString);
- };
- })});
- $6=_st("complete").__minus_gt($7);
- $3=smalltalk.HashedCollection._fromPairs_([$4,$5,$6,_st("error").__minus_gt((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(window)._alert_(_st("Could not load package at: ").__comma($ctx1.locals.url));
- })}))]);
- _st($1)._ajax_options_($2,$3);
- return self}, self, "loadPackage:prefix:", [packageName,aString], smalltalk.PackageLoader)},
- args: ["packageName", "aString"],
- source: "loadPackage: packageName prefix: aString\x09\x0a\x09| url |\x0a url := '/', aString, '/js/', packageName, '.js'.\x0a\x09jQuery \x0a\x09\x09ajax: url\x0a options: #{\x0a\x09\x09\x09'type' -> 'GET'.\x0a\x09\x09\x09'dataType' -> 'script'.\x0a \x09\x09'complete' -> [ :jqXHR :textStatus | \x0a\x09\x09\x09\x09jqXHR readyState = 4 \x0a \x09ifTrue: [ self initializePackageNamed: packageName prefix: aString ] ].\x0a\x09\x09\x09'error' -> [ window alert: 'Could not load package at: ', url ]\x0a\x09\x09}",
- messageSends: [",", "ajax:options:", "->", "ifTrue:", "initializePackageNamed:prefix:", "=", "readyState", "alert:"],
- referencedClasses: []
- }),
- smalltalk.PackageLoader);
- smalltalk.addMethod(
- "_loadPackages_prefix_",
- smalltalk.method({
- selector: "loadPackages:prefix:",
- category: '*Compiler',
- fn: function (aCollection,aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
_st(aCollection)._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._loadPackage_prefix_(each,aString);
- })}));
- return self}, self, "loadPackages:prefix:", [aCollection,aString], smalltalk.PackageLoader)},
- args: ["aCollection", "aString"],
- source: "loadPackages: aCollection prefix: aString\x0a\x09aCollection do: [ :each |\x0a \x09self loadPackage: each prefix: aString ]",
- messageSends: ["do:", "loadPackage:prefix:"],
- referencedClasses: []
- }),
- smalltalk.PackageLoader);
- smalltalk.addMethod(
- "_loadPackages_prefix_",
- smalltalk.method({
- selector: "loadPackages:prefix:",
- category: '*Compiler',
- fn: function (aCollection,aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._new())._loadPackages_prefix_(aCollection,aString);
- return $1;
- }, self, "loadPackages:prefix:", [aCollection,aString], smalltalk.PackageLoader.klass)},
- args: ["aCollection", "aString"],
- source: "loadPackages: aCollection prefix: aString\x0a\x09^ self new loadPackages: aCollection prefix: aString",
- messageSends: ["loadPackages:prefix:", "new"],
- referencedClasses: []
- }),
- smalltalk.PackageLoader.klass);
- smalltalk.addMethod(
- "_alias",
- smalltalk.method({
- selector: "alias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(self)._name())._asVariableName();
- return $1;
- }, self, "alias", [], smalltalk.ScopeVar)},
- args: [],
- source: "alias\x0a\x09^ self name asVariableName",
- messageSends: ["asVariableName", "name"],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_isArgVar",
- smalltalk.method({
- selector: "isArgVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isArgVar", [], smalltalk.ScopeVar)},
- args: [],
- source: "isArgVar\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_isClassRefVar",
- smalltalk.method({
- selector: "isClassRefVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isClassRefVar", [], smalltalk.ScopeVar)},
- args: [],
- source: "isClassRefVar\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_isInstanceVar",
- smalltalk.method({
- selector: "isInstanceVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isInstanceVar", [], smalltalk.ScopeVar)},
- args: [],
- source: "isInstanceVar\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_isPseudoVar",
- smalltalk.method({
- selector: "isPseudoVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isPseudoVar", [], smalltalk.ScopeVar)},
- args: [],
- source: "isPseudoVar\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_isTempVar",
- smalltalk.method({
- selector: "isTempVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isTempVar", [], smalltalk.ScopeVar)},
- args: [],
- source: "isTempVar\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_isUnknownVar",
- smalltalk.method({
- selector: "isUnknownVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return false;
- }, self, "isUnknownVar", [], smalltalk.ScopeVar)},
- args: [],
- source: "isUnknownVar\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_name",
- smalltalk.method({
- selector: "name",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@name"];
- return $1;
- }, self, "name", [], smalltalk.ScopeVar)},
- args: [],
- source: "name\x0a\x09^ name",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_name_",
- smalltalk.method({
- selector: "name:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@name"]=aString;
- return self}, self, "name:", [aString], smalltalk.ScopeVar)},
- args: ["aString"],
- source: "name: aString\x0a\x09name := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_scope",
- smalltalk.method({
- selector: "scope",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@scope"];
- return $1;
- }, self, "scope", [], smalltalk.ScopeVar)},
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_scope_",
- smalltalk.method({
- selector: "scope:",
- category: '*Compiler',
- fn: function (aScope){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@scope"]=aScope;
- return self}, self, "scope:", [aScope], smalltalk.ScopeVar)},
- args: ["aScope"],
- source: "scope: aScope\x0a\x09scope := aScope",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_validateAssignment",
- smalltalk.method({
- selector: "validateAssignment",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1,$2,$3;
- $1=_st(_st(self)._isArgVar())._or_((function(){
- return smalltalk.withContext(function($ctx2) {
return _st(self)._isPseudoVar();
- })}));
- if(smalltalk.assert($1)){
- $2=_st((smalltalk.InvalidAssignmentError || InvalidAssignmentError))._new();
- _st($2)._variableName_(_st(self)._name());
- $3=_st($2)._signal();
- $3;
- };
- return self}, self, "validateAssignment", [], smalltalk.ScopeVar)},
- args: [],
- source: "validateAssignment\x0a\x09(self isArgVar or: [ self isPseudoVar ]) ifTrue: [\x0a\x09\x09InvalidAssignmentError new\x0a\x09\x09\x09variableName: self name;\x0a\x09\x09\x09signal]",
- messageSends: ["ifTrue:", "variableName:", "name", "new", "signal", "or:", "isPseudoVar", "isArgVar"],
- referencedClasses: ["InvalidAssignmentError"]
- }),
- smalltalk.ScopeVar);
- smalltalk.addMethod(
- "_on_",
- smalltalk.method({
- selector: "on:",
- category: '*Compiler',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._name_(aString);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, self, "on:", [aString], smalltalk.ScopeVar.klass)},
- args: ["aString"],
- source: "on: aString\x0a\x09^ self new \x0a\x09\x09name: aString;\x0a\x09\x09yourself",
- messageSends: ["name:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.ScopeVar.klass);
- smalltalk.addMethod(
- "_node",
- smalltalk.method({
- selector: "node",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=self["@node"];
- return $1;
- }, self, "node", [], smalltalk.AliasVar)},
- args: [],
- source: "node\x0a\x09^ node",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AliasVar);
- smalltalk.addMethod(
- "_node_",
- smalltalk.method({
- selector: "node:",
- category: '*Compiler',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
self["@node"]=aNode;
- return self}, self, "node:", [aNode], smalltalk.AliasVar)},
- args: ["aNode"],
- source: "node: aNode\x0a\x09node := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.AliasVar);
- smalltalk.addMethod(
- "_isArgVar",
- smalltalk.method({
- selector: "isArgVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isArgVar", [], smalltalk.ArgVar)},
- args: [],
- source: "isArgVar\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ArgVar);
- smalltalk.addMethod(
- "_alias",
- smalltalk.method({
- selector: "alias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(_st("(smalltalk.").__comma(_st(self)._name())).__comma(" || ")).__comma(_st(self)._name())).__comma(")");
- return $1;
- }, self, "alias", [], smalltalk.ClassRefVar)},
- args: [],
- source: "alias\x0a\x09^ '(smalltalk.', self name, ' || ', self name, ')'",
- messageSends: [",", "name"],
- referencedClasses: []
- }),
- smalltalk.ClassRefVar);
- smalltalk.addMethod(
- "_isClassRefVar",
- smalltalk.method({
- selector: "isClassRefVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isClassRefVar", [], smalltalk.ClassRefVar)},
- args: [],
- source: "isClassRefVar\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.ClassRefVar);
- smalltalk.addMethod(
- "_alias",
- smalltalk.method({
- selector: "alias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st("self[\x22@").__comma(_st(self)._name())).__comma("\x22]");
- return $1;
- }, self, "alias", [], smalltalk.InstanceVar)},
- args: [],
- source: "alias\x0a\x09^ 'self[\x22@', self name, '\x22]'",
- messageSends: [",", "name"],
- referencedClasses: []
- }),
- smalltalk.InstanceVar);
- smalltalk.addMethod(
- "_isInstanceVar",
- smalltalk.method({
- selector: "isInstanceVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isInstanceVar", [], smalltalk.InstanceVar)},
- args: [],
- source: "isInstanceVar\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.InstanceVar);
- smalltalk.addMethod(
- "_alias",
- smalltalk.method({
- selector: "alias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(self)._name();
- return $1;
- }, self, "alias", [], smalltalk.PseudoVar)},
- args: [],
- source: "alias\x0a\x09^ self name",
- messageSends: ["name"],
- referencedClasses: []
- }),
- smalltalk.PseudoVar);
- smalltalk.addMethod(
- "_isPseudoVar",
- smalltalk.method({
- selector: "isPseudoVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isPseudoVar", [], smalltalk.PseudoVar)},
- args: [],
- source: "isPseudoVar\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.PseudoVar);
- smalltalk.addMethod(
- "_alias",
- smalltalk.method({
- selector: "alias",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
var $1;
- $1=_st(_st(_st(_st(self)._scope())._alias()).__comma(".locals.")).__comma(smalltalk.ScopeVar.fn.prototype._alias.apply(_st(self), []));
- return $1;
- }, self, "alias", [], smalltalk.TempVar)},
- args: [],
- source: "alias\x0a\x09^ self scope alias, '.locals.', super alias",
- messageSends: [",", "alias", "scope"],
- referencedClasses: []
- }),
- smalltalk.TempVar);
- smalltalk.addMethod(
- "_isTempVar",
- smalltalk.method({
- selector: "isTempVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isTempVar", [], smalltalk.TempVar)},
- args: [],
- source: "isTempVar\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.TempVar);
- smalltalk.addMethod(
- "_isUnknownVar",
- smalltalk.method({
- selector: "isUnknownVar",
- category: '*Compiler',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
return true;
- }, self, "isUnknownVar", [], smalltalk.UnknownVar)},
- args: [],
- source: "isUnknownVar\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.UnknownVar);
|