Compiler-IR.js 128 KB

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