Compiler-IR.js 128 KB

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