1
0

Compiler-IR.js 132 KB

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