Compiler-IR.js 128 KB

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