Compiler-IR.js 131 KB

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