Compiler-IR.js 131 KB

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