2
0

Compiler-IR.js 139 KB

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