Compiler-IR.js 127 KB

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