Compiler-IR.js 126 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492
  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: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:each,i:i},$ctx1)})});
  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:each,i:i},$ctx1)})});
  68. _st($4)._withIndexDo_($5);
  69. $9=result;
  70. return $9;
  71. }, function($ctx1) {$ctx1.fill(self,"aliasTemporally:",{aCollection: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: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: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: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: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: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:each},$ctx1)})}));
  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:each},$ctx1)})}));
  280. $5=closure;
  281. return $5;
  282. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode: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:each},$ctx1)})}));
  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({},$ctx1)})});
  315. return _st($5)._ifNotEmpty_($6);
  316. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  317. $1=_st($2)._withSequence_do_($3,$4);
  318. return $1;
  319. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode: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:each},$ctx1)})}));
  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:each},$ctx1)})}));
  346. $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
  347. return $2;
  348. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode: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:each},$ctx1)})}));
  368. $1=array;
  369. return $1;
  370. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode: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:each},$ctx1)})}));
  390. $1=dictionary;
  391. return $1;
  392. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode: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: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:each},$ctx1)})}));
  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:each},$ctx1)})}));
  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: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:each},$ctx1)})}));
  483. $2=return_;
  484. return $2;
  485. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode: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:each},$ctx1)})}));
  516. $4=send;
  517. return $4;
  518. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode: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:each,instruction:instruction},$ctx1)})});
  546. return _st($5)._do_($6);
  547. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  548. $1=_st($2)._withSequence_do_($3,$4);
  549. return $1;
  550. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode: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: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: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:aSequence,aBlock: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: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: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: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: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:anIRInstruction,anotherIRInstruction: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: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: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: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: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: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:aScope}, smalltalk.IRScopedInstruction)})},
  1040. args: ["aScope"],
  1041. source: "scope: aScope\x0a\x09scope := aScope",
  1042. messageSends: [],
  1043. referencedClasses: []
  1044. }),
  1045. smalltalk.IRScopedInstruction);
  1046. smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  1047. smalltalk.addMethod(
  1048. "_arguments",
  1049. smalltalk.method({
  1050. selector: "arguments",
  1051. category: 'accessing',
  1052. fn: function (){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1055. $2=self["@arguments"];
  1056. if(($receiver = $2) == nil || $receiver == undefined){
  1057. $1=[];
  1058. } else {
  1059. $1=$2;
  1060. };
  1061. return $1;
  1062. }, function($ctx1) {$ctx1.fill(self,"arguments",{}, smalltalk.IRClosureInstruction)})},
  1063. args: [],
  1064. source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
  1065. messageSends: ["ifNil:"],
  1066. referencedClasses: []
  1067. }),
  1068. smalltalk.IRClosureInstruction);
  1069. smalltalk.addMethod(
  1070. "_arguments_",
  1071. smalltalk.method({
  1072. selector: "arguments:",
  1073. category: 'accessing',
  1074. fn: function (aCollection){
  1075. var self=this;
  1076. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  1077. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection}, smalltalk.IRClosureInstruction)})},
  1078. args: ["aCollection"],
  1079. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1080. messageSends: [],
  1081. referencedClasses: []
  1082. }),
  1083. smalltalk.IRClosureInstruction);
  1084. smalltalk.addMethod(
  1085. "_locals",
  1086. smalltalk.method({
  1087. selector: "locals",
  1088. category: 'accessing',
  1089. fn: function (){
  1090. var self=this;
  1091. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1092. $2=_st(_st(self)._arguments())._copy();
  1093. _st($2)._addAll_(_st(_st(self)._tempDeclarations())._collect_((function(each){
  1094. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  1095. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1096. $3=_st($2)._yourself();
  1097. $1=$3;
  1098. return $1;
  1099. }, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.IRClosureInstruction)})},
  1100. args: [],
  1101. source: "locals\x0a\x09^ self arguments copy\x0a \x09addAll: (self tempDeclarations collect: [ :each | each name ]); \x0a yourself",
  1102. messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"],
  1103. referencedClasses: []
  1104. }),
  1105. smalltalk.IRClosureInstruction);
  1106. smalltalk.addMethod(
  1107. "_scope_",
  1108. smalltalk.method({
  1109. selector: "scope:",
  1110. category: 'accessing',
  1111. fn: function (aScope){
  1112. var self=this;
  1113. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  1114. _st(aScope)._instruction_(self);
  1115. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.IRClosureInstruction)})},
  1116. args: ["aScope"],
  1117. source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
  1118. messageSends: ["scope:", "instruction:"],
  1119. referencedClasses: []
  1120. }),
  1121. smalltalk.IRClosureInstruction);
  1122. smalltalk.addMethod(
  1123. "_tempDeclarations",
  1124. smalltalk.method({
  1125. selector: "tempDeclarations",
  1126. category: 'accessing',
  1127. fn: function (){
  1128. var self=this;
  1129. return smalltalk.withContext(function($ctx1) { var $1;
  1130. $1=_st(_st(self)._instructions())._select_((function(each){
  1131. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  1132. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1133. return $1;
  1134. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{}, smalltalk.IRClosureInstruction)})},
  1135. args: [],
  1136. source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a \x09each isTempDeclaration ]",
  1137. messageSends: ["select:", "isTempDeclaration", "instructions"],
  1138. referencedClasses: []
  1139. }),
  1140. smalltalk.IRClosureInstruction);
  1141. smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
  1142. smalltalk.addMethod(
  1143. "_accept_",
  1144. smalltalk.method({
  1145. selector: "accept:",
  1146. category: 'visiting',
  1147. fn: function (aVisitor){
  1148. var self=this;
  1149. return smalltalk.withContext(function($ctx1) { var $1;
  1150. $1=_st(aVisitor)._visitIRClosure_(self);
  1151. return $1;
  1152. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRClosure)})},
  1153. args: ["aVisitor"],
  1154. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
  1155. messageSends: ["visitIRClosure:"],
  1156. referencedClasses: []
  1157. }),
  1158. smalltalk.IRClosure);
  1159. smalltalk.addMethod(
  1160. "_isClosure",
  1161. smalltalk.method({
  1162. selector: "isClosure",
  1163. category: 'testing',
  1164. fn: function (){
  1165. var self=this;
  1166. return smalltalk.withContext(function($ctx1) { return true;
  1167. }, function($ctx1) {$ctx1.fill(self,"isClosure",{}, smalltalk.IRClosure)})},
  1168. args: [],
  1169. source: "isClosure\x0a\x09^ true",
  1170. messageSends: [],
  1171. referencedClasses: []
  1172. }),
  1173. smalltalk.IRClosure);
  1174. smalltalk.addMethod(
  1175. "_sequence",
  1176. smalltalk.method({
  1177. selector: "sequence",
  1178. category: 'accessing',
  1179. fn: function (){
  1180. var self=this;
  1181. return smalltalk.withContext(function($ctx1) { var $1;
  1182. $1=_st(_st(self)._instructions())._last();
  1183. return $1;
  1184. }, function($ctx1) {$ctx1.fill(self,"sequence",{}, smalltalk.IRClosure)})},
  1185. args: [],
  1186. source: "sequence\x0a\x09^ self instructions last",
  1187. messageSends: ["last", "instructions"],
  1188. referencedClasses: []
  1189. }),
  1190. smalltalk.IRClosure);
  1191. smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
  1192. smalltalk.IRMethod.comment="I am a method instruction"
  1193. smalltalk.addMethod(
  1194. "_accept_",
  1195. smalltalk.method({
  1196. selector: "accept:",
  1197. category: 'visiting',
  1198. fn: function (aVisitor){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) { var $1;
  1201. $1=_st(aVisitor)._visitIRMethod_(self);
  1202. return $1;
  1203. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRMethod)})},
  1204. args: ["aVisitor"],
  1205. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
  1206. messageSends: ["visitIRMethod:"],
  1207. referencedClasses: []
  1208. }),
  1209. smalltalk.IRMethod);
  1210. smalltalk.addMethod(
  1211. "_classReferences",
  1212. smalltalk.method({
  1213. selector: "classReferences",
  1214. category: 'accessing',
  1215. fn: function (){
  1216. var self=this;
  1217. return smalltalk.withContext(function($ctx1) { var $1;
  1218. $1=self["@classReferences"];
  1219. return $1;
  1220. }, function($ctx1) {$ctx1.fill(self,"classReferences",{}, smalltalk.IRMethod)})},
  1221. args: [],
  1222. source: "classReferences\x0a\x09^ classReferences",
  1223. messageSends: [],
  1224. referencedClasses: []
  1225. }),
  1226. smalltalk.IRMethod);
  1227. smalltalk.addMethod(
  1228. "_classReferences_",
  1229. smalltalk.method({
  1230. selector: "classReferences:",
  1231. category: 'accessing',
  1232. fn: function (aCollection){
  1233. var self=this;
  1234. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  1235. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  1236. args: ["aCollection"],
  1237. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  1238. messageSends: [],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.IRMethod);
  1242. smalltalk.addMethod(
  1243. "_internalVariables",
  1244. smalltalk.method({
  1245. selector: "internalVariables",
  1246. category: 'accessing',
  1247. fn: function (){
  1248. var self=this;
  1249. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1250. $2=self["@internalVariables"];
  1251. if(($receiver = $2) == nil || $receiver == undefined){
  1252. self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
  1253. $1=self["@internalVariables"];
  1254. } else {
  1255. $1=$2;
  1256. };
  1257. return $1;
  1258. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{}, smalltalk.IRMethod)})},
  1259. args: [],
  1260. source: "internalVariables\x0a\x09^ internalVariables ifNil: [ internalVariables := Set new ]",
  1261. messageSends: ["ifNil:", "new"],
  1262. referencedClasses: ["Set"]
  1263. }),
  1264. smalltalk.IRMethod);
  1265. smalltalk.addMethod(
  1266. "_isMethod",
  1267. smalltalk.method({
  1268. selector: "isMethod",
  1269. category: 'accessing',
  1270. fn: function (){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) { return true;
  1273. }, function($ctx1) {$ctx1.fill(self,"isMethod",{}, smalltalk.IRMethod)})},
  1274. args: [],
  1275. source: "isMethod\x0a\x09^ true",
  1276. messageSends: [],
  1277. referencedClasses: []
  1278. }),
  1279. smalltalk.IRMethod);
  1280. smalltalk.addMethod(
  1281. "_messageSends",
  1282. smalltalk.method({
  1283. selector: "messageSends",
  1284. category: 'accessing',
  1285. fn: function (){
  1286. var self=this;
  1287. return smalltalk.withContext(function($ctx1) { var $1;
  1288. $1=self["@messageSends"];
  1289. return $1;
  1290. }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.IRMethod)})},
  1291. args: [],
  1292. source: "messageSends\x0a\x09^ messageSends",
  1293. messageSends: [],
  1294. referencedClasses: []
  1295. }),
  1296. smalltalk.IRMethod);
  1297. smalltalk.addMethod(
  1298. "_messageSends_",
  1299. smalltalk.method({
  1300. selector: "messageSends:",
  1301. category: 'accessing',
  1302. fn: function (aCollection){
  1303. var self=this;
  1304. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  1305. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  1306. args: ["aCollection"],
  1307. source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
  1308. messageSends: [],
  1309. referencedClasses: []
  1310. }),
  1311. smalltalk.IRMethod);
  1312. smalltalk.addMethod(
  1313. "_method",
  1314. smalltalk.method({
  1315. selector: "method",
  1316. category: 'accessing',
  1317. fn: function (){
  1318. var self=this;
  1319. return smalltalk.withContext(function($ctx1) { var $1;
  1320. $1=self;
  1321. return $1;
  1322. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.IRMethod)})},
  1323. args: [],
  1324. source: "method\x0a\x09^ self",
  1325. messageSends: [],
  1326. referencedClasses: []
  1327. }),
  1328. smalltalk.IRMethod);
  1329. smalltalk.addMethod(
  1330. "_selector",
  1331. smalltalk.method({
  1332. selector: "selector",
  1333. category: 'accessing',
  1334. fn: function (){
  1335. var self=this;
  1336. return smalltalk.withContext(function($ctx1) { var $1;
  1337. $1=self["@selector"];
  1338. return $1;
  1339. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.IRMethod)})},
  1340. args: [],
  1341. source: "selector\x0a\x09^ selector",
  1342. messageSends: [],
  1343. referencedClasses: []
  1344. }),
  1345. smalltalk.IRMethod);
  1346. smalltalk.addMethod(
  1347. "_selector_",
  1348. smalltalk.method({
  1349. selector: "selector:",
  1350. category: 'accessing',
  1351. fn: function (aString){
  1352. var self=this;
  1353. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1354. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.IRMethod)})},
  1355. args: ["aString"],
  1356. source: "selector: aString\x0a\x09selector := aString",
  1357. messageSends: [],
  1358. referencedClasses: []
  1359. }),
  1360. smalltalk.IRMethod);
  1361. smalltalk.addMethod(
  1362. "_source",
  1363. smalltalk.method({
  1364. selector: "source",
  1365. category: 'accessing',
  1366. fn: function (){
  1367. var self=this;
  1368. return smalltalk.withContext(function($ctx1) { var $1;
  1369. $1=self["@source"];
  1370. return $1;
  1371. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRMethod)})},
  1372. args: [],
  1373. source: "source\x0a\x09^ source",
  1374. messageSends: [],
  1375. referencedClasses: []
  1376. }),
  1377. smalltalk.IRMethod);
  1378. smalltalk.addMethod(
  1379. "_source_",
  1380. smalltalk.method({
  1381. selector: "source:",
  1382. category: 'accessing',
  1383. fn: function (aString){
  1384. var self=this;
  1385. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1386. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRMethod)})},
  1387. args: ["aString"],
  1388. source: "source: aString\x0a\x09source := aString",
  1389. messageSends: [],
  1390. referencedClasses: []
  1391. }),
  1392. smalltalk.IRMethod);
  1393. smalltalk.addMethod(
  1394. "_superSends",
  1395. smalltalk.method({
  1396. selector: "superSends",
  1397. category: 'accessing',
  1398. fn: function (){
  1399. var self=this;
  1400. return smalltalk.withContext(function($ctx1) { var $1;
  1401. $1=self["@superSends"];
  1402. return $1;
  1403. }, function($ctx1) {$ctx1.fill(self,"superSends",{}, smalltalk.IRMethod)})},
  1404. args: [],
  1405. source: "superSends\x0a\x09^ superSends",
  1406. messageSends: [],
  1407. referencedClasses: []
  1408. }),
  1409. smalltalk.IRMethod);
  1410. smalltalk.addMethod(
  1411. "_superSends_",
  1412. smalltalk.method({
  1413. selector: "superSends:",
  1414. category: 'accessing',
  1415. fn: function (aCollection){
  1416. var self=this;
  1417. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  1418. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection}, smalltalk.IRMethod)})},
  1419. args: ["aCollection"],
  1420. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  1421. messageSends: [],
  1422. referencedClasses: []
  1423. }),
  1424. smalltalk.IRMethod);
  1425. smalltalk.addMethod(
  1426. "_theClass",
  1427. smalltalk.method({
  1428. selector: "theClass",
  1429. category: 'accessing',
  1430. fn: function (){
  1431. var self=this;
  1432. return smalltalk.withContext(function($ctx1) { var $1;
  1433. $1=self["@theClass"];
  1434. return $1;
  1435. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.IRMethod)})},
  1436. args: [],
  1437. source: "theClass\x0a\x09^ theClass",
  1438. messageSends: [],
  1439. referencedClasses: []
  1440. }),
  1441. smalltalk.IRMethod);
  1442. smalltalk.addMethod(
  1443. "_theClass_",
  1444. smalltalk.method({
  1445. selector: "theClass:",
  1446. category: 'accessing',
  1447. fn: function (aClass){
  1448. var self=this;
  1449. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  1450. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.IRMethod)})},
  1451. args: ["aClass"],
  1452. source: "theClass: aClass\x0a\x09theClass := aClass",
  1453. messageSends: [],
  1454. referencedClasses: []
  1455. }),
  1456. smalltalk.IRMethod);
  1457. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1458. smalltalk.IRReturn.comment="I am a local return instruction."
  1459. smalltalk.addMethod(
  1460. "_accept_",
  1461. smalltalk.method({
  1462. selector: "accept:",
  1463. category: 'visiting',
  1464. fn: function (aVisitor){
  1465. var self=this;
  1466. return smalltalk.withContext(function($ctx1) { var $1;
  1467. $1=_st(aVisitor)._visitIRReturn_(self);
  1468. return $1;
  1469. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRReturn)})},
  1470. args: ["aVisitor"],
  1471. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRReturn: self",
  1472. messageSends: ["visitIRReturn:"],
  1473. referencedClasses: []
  1474. }),
  1475. smalltalk.IRReturn);
  1476. smalltalk.addMethod(
  1477. "_canBeAssigned",
  1478. smalltalk.method({
  1479. selector: "canBeAssigned",
  1480. category: 'testing',
  1481. fn: function (){
  1482. var self=this;
  1483. return smalltalk.withContext(function($ctx1) { return false;
  1484. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{}, smalltalk.IRReturn)})},
  1485. args: [],
  1486. source: "canBeAssigned\x0a\x09^ false",
  1487. messageSends: [],
  1488. referencedClasses: []
  1489. }),
  1490. smalltalk.IRReturn);
  1491. smalltalk.addMethod(
  1492. "_isBlockReturn",
  1493. smalltalk.method({
  1494. selector: "isBlockReturn",
  1495. category: 'testing',
  1496. fn: function (){
  1497. var self=this;
  1498. return smalltalk.withContext(function($ctx1) { return false;
  1499. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{}, smalltalk.IRReturn)})},
  1500. args: [],
  1501. source: "isBlockReturn\x0a\x09^ false",
  1502. messageSends: [],
  1503. referencedClasses: []
  1504. }),
  1505. smalltalk.IRReturn);
  1506. smalltalk.addMethod(
  1507. "_isLocalReturn",
  1508. smalltalk.method({
  1509. selector: "isLocalReturn",
  1510. category: 'testing',
  1511. fn: function (){
  1512. var self=this;
  1513. return smalltalk.withContext(function($ctx1) { return true;
  1514. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRReturn)})},
  1515. args: [],
  1516. source: "isLocalReturn\x0a\x09^ true",
  1517. messageSends: [],
  1518. referencedClasses: []
  1519. }),
  1520. smalltalk.IRReturn);
  1521. smalltalk.addMethod(
  1522. "_isNonLocalReturn",
  1523. smalltalk.method({
  1524. selector: "isNonLocalReturn",
  1525. category: 'testing',
  1526. fn: function (){
  1527. var self=this;
  1528. return smalltalk.withContext(function($ctx1) { var $1;
  1529. $1=_st(_st(self)._isLocalReturn())._not();
  1530. return $1;
  1531. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn",{}, smalltalk.IRReturn)})},
  1532. args: [],
  1533. source: "isNonLocalReturn\x0a\x09^ self isLocalReturn not",
  1534. messageSends: ["not", "isLocalReturn"],
  1535. referencedClasses: []
  1536. }),
  1537. smalltalk.IRReturn);
  1538. smalltalk.addMethod(
  1539. "_isReturn",
  1540. smalltalk.method({
  1541. selector: "isReturn",
  1542. category: 'testing',
  1543. fn: function (){
  1544. var self=this;
  1545. return smalltalk.withContext(function($ctx1) { return true;
  1546. }, function($ctx1) {$ctx1.fill(self,"isReturn",{}, smalltalk.IRReturn)})},
  1547. args: [],
  1548. source: "isReturn\x0a\x09^ true",
  1549. messageSends: [],
  1550. referencedClasses: []
  1551. }),
  1552. smalltalk.IRReturn);
  1553. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1554. smalltalk.IRBlockReturn.comment="Smalltalk blocks return their last statement. I am a implicit block return instruction."
  1555. smalltalk.addMethod(
  1556. "_accept_",
  1557. smalltalk.method({
  1558. selector: "accept:",
  1559. category: 'visiting',
  1560. fn: function (aVisitor){
  1561. var self=this;
  1562. return smalltalk.withContext(function($ctx1) { var $1;
  1563. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1564. return $1;
  1565. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRBlockReturn)})},
  1566. args: ["aVisitor"],
  1567. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockReturn: self",
  1568. messageSends: ["visitIRBlockReturn:"],
  1569. referencedClasses: []
  1570. }),
  1571. smalltalk.IRBlockReturn);
  1572. smalltalk.addMethod(
  1573. "_isBlockReturn",
  1574. smalltalk.method({
  1575. selector: "isBlockReturn",
  1576. category: 'testing',
  1577. fn: function (){
  1578. var self=this;
  1579. return smalltalk.withContext(function($ctx1) { return true;
  1580. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{}, smalltalk.IRBlockReturn)})},
  1581. args: [],
  1582. source: "isBlockReturn\x0a\x09^ true",
  1583. messageSends: [],
  1584. referencedClasses: []
  1585. }),
  1586. smalltalk.IRBlockReturn);
  1587. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1588. 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"
  1589. smalltalk.addMethod(
  1590. "_accept_",
  1591. smalltalk.method({
  1592. selector: "accept:",
  1593. category: 'visiting',
  1594. fn: function (aVisitor){
  1595. var self=this;
  1596. return smalltalk.withContext(function($ctx1) { var $1;
  1597. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1598. return $1;
  1599. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRNonLocalReturn)})},
  1600. args: ["aVisitor"],
  1601. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRNonLocalReturn: self",
  1602. messageSends: ["visitIRNonLocalReturn:"],
  1603. referencedClasses: []
  1604. }),
  1605. smalltalk.IRNonLocalReturn);
  1606. smalltalk.addMethod(
  1607. "_isLocalReturn",
  1608. smalltalk.method({
  1609. selector: "isLocalReturn",
  1610. category: 'testing',
  1611. fn: function (){
  1612. var self=this;
  1613. return smalltalk.withContext(function($ctx1) { return false;
  1614. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{}, smalltalk.IRNonLocalReturn)})},
  1615. args: [],
  1616. source: "isLocalReturn\x0a\x09^ false",
  1617. messageSends: [],
  1618. referencedClasses: []
  1619. }),
  1620. smalltalk.IRNonLocalReturn);
  1621. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1622. smalltalk.addMethod(
  1623. "_accept_",
  1624. smalltalk.method({
  1625. selector: "accept:",
  1626. category: 'visiting',
  1627. fn: function (aVisitor){
  1628. var self=this;
  1629. return smalltalk.withContext(function($ctx1) { var $1;
  1630. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1631. return $1;
  1632. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRTempDeclaration)})},
  1633. args: ["aVisitor"],
  1634. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRTempDeclaration: self",
  1635. messageSends: ["visitIRTempDeclaration:"],
  1636. referencedClasses: []
  1637. }),
  1638. smalltalk.IRTempDeclaration);
  1639. smalltalk.addMethod(
  1640. "_isTempDeclaration",
  1641. smalltalk.method({
  1642. selector: "isTempDeclaration",
  1643. category: 'testing',
  1644. fn: function (){
  1645. var self=this;
  1646. return smalltalk.withContext(function($ctx1) { return true;
  1647. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{}, smalltalk.IRTempDeclaration)})},
  1648. args: [],
  1649. source: "isTempDeclaration\x0a\x09^ true",
  1650. messageSends: [],
  1651. referencedClasses: []
  1652. }),
  1653. smalltalk.IRTempDeclaration);
  1654. smalltalk.addMethod(
  1655. "_name",
  1656. smalltalk.method({
  1657. selector: "name",
  1658. category: 'accessing',
  1659. fn: function (){
  1660. var self=this;
  1661. return smalltalk.withContext(function($ctx1) { var $1;
  1662. $1=self["@name"];
  1663. return $1;
  1664. }, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.IRTempDeclaration)})},
  1665. args: [],
  1666. source: "name\x0a\x09^ name",
  1667. messageSends: [],
  1668. referencedClasses: []
  1669. }),
  1670. smalltalk.IRTempDeclaration);
  1671. smalltalk.addMethod(
  1672. "_name_",
  1673. smalltalk.method({
  1674. selector: "name:",
  1675. category: 'accessing',
  1676. fn: function (aString){
  1677. var self=this;
  1678. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  1679. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString}, smalltalk.IRTempDeclaration)})},
  1680. args: ["aString"],
  1681. source: "name: aString\x0a\x09name := aString",
  1682. messageSends: [],
  1683. referencedClasses: []
  1684. }),
  1685. smalltalk.IRTempDeclaration);
  1686. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1687. smalltalk.IRSend.comment="I am a message send instruction."
  1688. smalltalk.addMethod(
  1689. "_accept_",
  1690. smalltalk.method({
  1691. selector: "accept:",
  1692. category: 'visiting',
  1693. fn: function (aVisitor){
  1694. var self=this;
  1695. return smalltalk.withContext(function($ctx1) { var $1;
  1696. $1=_st(aVisitor)._visitIRSend_(self);
  1697. return $1;
  1698. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRSend)})},
  1699. args: ["aVisitor"],
  1700. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSend: self",
  1701. messageSends: ["visitIRSend:"],
  1702. referencedClasses: []
  1703. }),
  1704. smalltalk.IRSend);
  1705. smalltalk.addMethod(
  1706. "_classSend",
  1707. smalltalk.method({
  1708. selector: "classSend",
  1709. category: 'accessing',
  1710. fn: function (){
  1711. var self=this;
  1712. return smalltalk.withContext(function($ctx1) { var $1;
  1713. $1=self["@classSend"];
  1714. return $1;
  1715. }, function($ctx1) {$ctx1.fill(self,"classSend",{}, smalltalk.IRSend)})},
  1716. args: [],
  1717. source: "classSend\x0a\x09^ classSend",
  1718. messageSends: [],
  1719. referencedClasses: []
  1720. }),
  1721. smalltalk.IRSend);
  1722. smalltalk.addMethod(
  1723. "_classSend_",
  1724. smalltalk.method({
  1725. selector: "classSend:",
  1726. category: 'accessing',
  1727. fn: function (aClass){
  1728. var self=this;
  1729. return smalltalk.withContext(function($ctx1) { self["@classSend"]=aClass;
  1730. return self}, function($ctx1) {$ctx1.fill(self,"classSend:",{aClass:aClass}, smalltalk.IRSend)})},
  1731. args: ["aClass"],
  1732. source: "classSend: aClass\x0a\x09classSend := aClass",
  1733. messageSends: [],
  1734. referencedClasses: []
  1735. }),
  1736. smalltalk.IRSend);
  1737. smalltalk.addMethod(
  1738. "_index",
  1739. smalltalk.method({
  1740. selector: "index",
  1741. category: 'accessing',
  1742. fn: function (){
  1743. var self=this;
  1744. return smalltalk.withContext(function($ctx1) { var $1;
  1745. $1=self["@index"];
  1746. return $1;
  1747. }, function($ctx1) {$ctx1.fill(self,"index",{}, smalltalk.IRSend)})},
  1748. args: [],
  1749. source: "index\x0a\x09^ index",
  1750. messageSends: [],
  1751. referencedClasses: []
  1752. }),
  1753. smalltalk.IRSend);
  1754. smalltalk.addMethod(
  1755. "_index_",
  1756. smalltalk.method({
  1757. selector: "index:",
  1758. category: 'accessing',
  1759. fn: function (anInteger){
  1760. var self=this;
  1761. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  1762. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger}, smalltalk.IRSend)})},
  1763. args: ["anInteger"],
  1764. source: "index: anInteger\x0a\x09index := anInteger",
  1765. messageSends: [],
  1766. referencedClasses: []
  1767. }),
  1768. smalltalk.IRSend);
  1769. smalltalk.addMethod(
  1770. "_isSend",
  1771. smalltalk.method({
  1772. selector: "isSend",
  1773. category: 'testing',
  1774. fn: function (){
  1775. var self=this;
  1776. return smalltalk.withContext(function($ctx1) { return true;
  1777. }, function($ctx1) {$ctx1.fill(self,"isSend",{}, smalltalk.IRSend)})},
  1778. args: [],
  1779. source: "isSend\x0a\x09^ true",
  1780. messageSends: [],
  1781. referencedClasses: []
  1782. }),
  1783. smalltalk.IRSend);
  1784. smalltalk.addMethod(
  1785. "_javascriptSelector",
  1786. smalltalk.method({
  1787. selector: "javascriptSelector",
  1788. category: 'accessing',
  1789. fn: function (){
  1790. var self=this;
  1791. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1792. $2=_st(self)._classSend();
  1793. if(($receiver = $2) == nil || $receiver == undefined){
  1794. $1=_st(_st(self)._selector())._asSelector();
  1795. } else {
  1796. $1=_st(_st(self)._selector())._asSuperSelector();
  1797. };
  1798. return $1;
  1799. }, function($ctx1) {$ctx1.fill(self,"javascriptSelector",{}, smalltalk.IRSend)})},
  1800. args: [],
  1801. source: "javascriptSelector\x0a\x09^ self classSend \x0a \x09ifNil: [ self selector asSelector ]\x0a \x09ifNotNil: [ self selector asSuperSelector ]",
  1802. messageSends: ["ifNil:ifNotNil:", "asSelector", "selector", "asSuperSelector", "classSend"],
  1803. referencedClasses: []
  1804. }),
  1805. smalltalk.IRSend);
  1806. smalltalk.addMethod(
  1807. "_selector",
  1808. smalltalk.method({
  1809. selector: "selector",
  1810. category: 'accessing',
  1811. fn: function (){
  1812. var self=this;
  1813. return smalltalk.withContext(function($ctx1) { var $1;
  1814. $1=self["@selector"];
  1815. return $1;
  1816. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.IRSend)})},
  1817. args: [],
  1818. source: "selector\x0a\x09^ selector",
  1819. messageSends: [],
  1820. referencedClasses: []
  1821. }),
  1822. smalltalk.IRSend);
  1823. smalltalk.addMethod(
  1824. "_selector_",
  1825. smalltalk.method({
  1826. selector: "selector:",
  1827. category: 'accessing',
  1828. fn: function (aString){
  1829. var self=this;
  1830. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1831. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString}, smalltalk.IRSend)})},
  1832. args: ["aString"],
  1833. source: "selector: aString\x0a\x09selector := aString",
  1834. messageSends: [],
  1835. referencedClasses: []
  1836. }),
  1837. smalltalk.IRSend);
  1838. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1839. smalltalk.addMethod(
  1840. "_accept_",
  1841. smalltalk.method({
  1842. selector: "accept:",
  1843. category: 'visiting',
  1844. fn: function (aVisitor){
  1845. var self=this;
  1846. return smalltalk.withContext(function($ctx1) { var $1;
  1847. $1=_st(aVisitor)._visitIRSequence_(self);
  1848. return $1;
  1849. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRSequence)})},
  1850. args: ["aVisitor"],
  1851. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSequence: self",
  1852. messageSends: ["visitIRSequence:"],
  1853. referencedClasses: []
  1854. }),
  1855. smalltalk.IRSequence);
  1856. smalltalk.addMethod(
  1857. "_isSequence",
  1858. smalltalk.method({
  1859. selector: "isSequence",
  1860. category: 'testing',
  1861. fn: function (){
  1862. var self=this;
  1863. return smalltalk.withContext(function($ctx1) { return true;
  1864. }, function($ctx1) {$ctx1.fill(self,"isSequence",{}, smalltalk.IRSequence)})},
  1865. args: [],
  1866. source: "isSequence\x0a\x09^ true",
  1867. messageSends: [],
  1868. referencedClasses: []
  1869. }),
  1870. smalltalk.IRSequence);
  1871. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1872. smalltalk.addMethod(
  1873. "_accept_",
  1874. smalltalk.method({
  1875. selector: "accept:",
  1876. category: 'visiting',
  1877. fn: function (aVisitor){
  1878. var self=this;
  1879. return smalltalk.withContext(function($ctx1) { var $1;
  1880. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1881. return $1;
  1882. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRBlockSequence)})},
  1883. args: ["aVisitor"],
  1884. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockSequence: self",
  1885. messageSends: ["visitIRBlockSequence:"],
  1886. referencedClasses: []
  1887. }),
  1888. smalltalk.IRBlockSequence);
  1889. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1890. smalltalk.IRValue.comment="I am the simplest possible instruction. I represent a value."
  1891. smalltalk.addMethod(
  1892. "_accept_",
  1893. smalltalk.method({
  1894. selector: "accept:",
  1895. category: 'visiting',
  1896. fn: function (aVisitor){
  1897. var self=this;
  1898. return smalltalk.withContext(function($ctx1) { var $1;
  1899. $1=_st(aVisitor)._visitIRValue_(self);
  1900. return $1;
  1901. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRValue)})},
  1902. args: ["aVisitor"],
  1903. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRValue: self",
  1904. messageSends: ["visitIRValue:"],
  1905. referencedClasses: []
  1906. }),
  1907. smalltalk.IRValue);
  1908. smalltalk.addMethod(
  1909. "_value",
  1910. smalltalk.method({
  1911. selector: "value",
  1912. category: 'accessing',
  1913. fn: function (){
  1914. var self=this;
  1915. return smalltalk.withContext(function($ctx1) { var $1;
  1916. $1=self["@value"];
  1917. return $1;
  1918. }, function($ctx1) {$ctx1.fill(self,"value",{}, smalltalk.IRValue)})},
  1919. args: [],
  1920. source: "value\x0a\x09^value",
  1921. messageSends: [],
  1922. referencedClasses: []
  1923. }),
  1924. smalltalk.IRValue);
  1925. smalltalk.addMethod(
  1926. "_value_",
  1927. smalltalk.method({
  1928. selector: "value:",
  1929. category: 'accessing',
  1930. fn: function (aString){
  1931. var self=this;
  1932. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  1933. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString}, smalltalk.IRValue)})},
  1934. args: ["aString"],
  1935. source: "value: aString\x0a\x09value := aString",
  1936. messageSends: [],
  1937. referencedClasses: []
  1938. }),
  1939. smalltalk.IRValue);
  1940. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1941. smalltalk.IRVariable.comment="I am a variable instruction."
  1942. smalltalk.addMethod(
  1943. "_accept_",
  1944. smalltalk.method({
  1945. selector: "accept:",
  1946. category: 'visiting',
  1947. fn: function (aVisitor){
  1948. var self=this;
  1949. return smalltalk.withContext(function($ctx1) { var $1;
  1950. $1=_st(aVisitor)._visitIRVariable_(self);
  1951. return $1;
  1952. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRVariable)})},
  1953. args: ["aVisitor"],
  1954. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVariable: self",
  1955. messageSends: ["visitIRVariable:"],
  1956. referencedClasses: []
  1957. }),
  1958. smalltalk.IRVariable);
  1959. smalltalk.addMethod(
  1960. "_isVariable",
  1961. smalltalk.method({
  1962. selector: "isVariable",
  1963. category: 'testing',
  1964. fn: function (){
  1965. var self=this;
  1966. return smalltalk.withContext(function($ctx1) { return true;
  1967. }, function($ctx1) {$ctx1.fill(self,"isVariable",{}, smalltalk.IRVariable)})},
  1968. args: [],
  1969. source: "isVariable\x0a\x09^ true",
  1970. messageSends: [],
  1971. referencedClasses: []
  1972. }),
  1973. smalltalk.IRVariable);
  1974. smalltalk.addMethod(
  1975. "_variable",
  1976. smalltalk.method({
  1977. selector: "variable",
  1978. category: 'accessing',
  1979. fn: function (){
  1980. var self=this;
  1981. return smalltalk.withContext(function($ctx1) { var $1;
  1982. $1=self["@variable"];
  1983. return $1;
  1984. }, function($ctx1) {$ctx1.fill(self,"variable",{}, smalltalk.IRVariable)})},
  1985. args: [],
  1986. source: "variable\x0a\x09^ variable",
  1987. messageSends: [],
  1988. referencedClasses: []
  1989. }),
  1990. smalltalk.IRVariable);
  1991. smalltalk.addMethod(
  1992. "_variable_",
  1993. smalltalk.method({
  1994. selector: "variable:",
  1995. category: 'accessing',
  1996. fn: function (aScopeVariable){
  1997. var self=this;
  1998. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  1999. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable}, smalltalk.IRVariable)})},
  2000. args: ["aScopeVariable"],
  2001. source: "variable: aScopeVariable\x0a\x09variable := aScopeVariable",
  2002. messageSends: [],
  2003. referencedClasses: []
  2004. }),
  2005. smalltalk.IRVariable);
  2006. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  2007. smalltalk.addMethod(
  2008. "_accept_",
  2009. smalltalk.method({
  2010. selector: "accept:",
  2011. category: 'visiting',
  2012. fn: function (aVisitor){
  2013. var self=this;
  2014. return smalltalk.withContext(function($ctx1) { var $1;
  2015. $1=_st(aVisitor)._visitIRVerbatim_(self);
  2016. return $1;
  2017. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRVerbatim)})},
  2018. args: ["aVisitor"],
  2019. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVerbatim: self",
  2020. messageSends: ["visitIRVerbatim:"],
  2021. referencedClasses: []
  2022. }),
  2023. smalltalk.IRVerbatim);
  2024. smalltalk.addMethod(
  2025. "_source",
  2026. smalltalk.method({
  2027. selector: "source",
  2028. category: 'accessing',
  2029. fn: function (){
  2030. var self=this;
  2031. return smalltalk.withContext(function($ctx1) { var $1;
  2032. $1=self["@source"];
  2033. return $1;
  2034. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.IRVerbatim)})},
  2035. args: [],
  2036. source: "source\x0a\x09^ source",
  2037. messageSends: [],
  2038. referencedClasses: []
  2039. }),
  2040. smalltalk.IRVerbatim);
  2041. smalltalk.addMethod(
  2042. "_source_",
  2043. smalltalk.method({
  2044. selector: "source:",
  2045. category: 'accessing',
  2046. fn: function (aString){
  2047. var self=this;
  2048. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  2049. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.IRVerbatim)})},
  2050. args: ["aString"],
  2051. source: "source: aString\x0a\x09source := aString",
  2052. messageSends: [],
  2053. referencedClasses: []
  2054. }),
  2055. smalltalk.IRVerbatim);
  2056. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  2057. smalltalk.addMethod(
  2058. "_visit_",
  2059. smalltalk.method({
  2060. selector: "visit:",
  2061. category: 'visiting',
  2062. fn: function (anIRInstruction){
  2063. var self=this;
  2064. return smalltalk.withContext(function($ctx1) { var $1;
  2065. $1=_st(anIRInstruction)._accept_(self);
  2066. return $1;
  2067. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction}, smalltalk.IRVisitor)})},
  2068. args: ["anIRInstruction"],
  2069. source: "visit: anIRInstruction\x0a\x09^ anIRInstruction accept: self",
  2070. messageSends: ["accept:"],
  2071. referencedClasses: []
  2072. }),
  2073. smalltalk.IRVisitor);
  2074. smalltalk.addMethod(
  2075. "_visitIRAssignment_",
  2076. smalltalk.method({
  2077. selector: "visitIRAssignment:",
  2078. category: 'visiting',
  2079. fn: function (anIRAssignment){
  2080. var self=this;
  2081. return smalltalk.withContext(function($ctx1) { var $1;
  2082. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  2083. return $1;
  2084. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRVisitor)})},
  2085. args: ["anIRAssignment"],
  2086. source: "visitIRAssignment: anIRAssignment\x0a\x09^ self visitIRInstruction: anIRAssignment",
  2087. messageSends: ["visitIRInstruction:"],
  2088. referencedClasses: []
  2089. }),
  2090. smalltalk.IRVisitor);
  2091. smalltalk.addMethod(
  2092. "_visitIRBlockReturn_",
  2093. smalltalk.method({
  2094. selector: "visitIRBlockReturn:",
  2095. category: 'visiting',
  2096. fn: function (anIRBlockReturn){
  2097. var self=this;
  2098. return smalltalk.withContext(function($ctx1) { var $1;
  2099. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  2100. return $1;
  2101. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn}, smalltalk.IRVisitor)})},
  2102. args: ["anIRBlockReturn"],
  2103. source: "visitIRBlockReturn: anIRBlockReturn\x0a\x09^ self visitIRReturn: anIRBlockReturn",
  2104. messageSends: ["visitIRReturn:"],
  2105. referencedClasses: []
  2106. }),
  2107. smalltalk.IRVisitor);
  2108. smalltalk.addMethod(
  2109. "_visitIRBlockSequence_",
  2110. smalltalk.method({
  2111. selector: "visitIRBlockSequence:",
  2112. category: 'visiting',
  2113. fn: function (anIRBlockSequence){
  2114. var self=this;
  2115. return smalltalk.withContext(function($ctx1) { var $1;
  2116. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  2117. return $1;
  2118. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence}, smalltalk.IRVisitor)})},
  2119. args: ["anIRBlockSequence"],
  2120. source: "visitIRBlockSequence: anIRBlockSequence\x0a\x09^ self visitIRSequence: anIRBlockSequence",
  2121. messageSends: ["visitIRSequence:"],
  2122. referencedClasses: []
  2123. }),
  2124. smalltalk.IRVisitor);
  2125. smalltalk.addMethod(
  2126. "_visitIRClosure_",
  2127. smalltalk.method({
  2128. selector: "visitIRClosure:",
  2129. category: 'visiting',
  2130. fn: function (anIRClosure){
  2131. var self=this;
  2132. return smalltalk.withContext(function($ctx1) { var $1;
  2133. $1=_st(self)._visitIRInstruction_(anIRClosure);
  2134. return $1;
  2135. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure}, smalltalk.IRVisitor)})},
  2136. args: ["anIRClosure"],
  2137. source: "visitIRClosure: anIRClosure\x0a\x09^ self visitIRInstruction: anIRClosure",
  2138. messageSends: ["visitIRInstruction:"],
  2139. referencedClasses: []
  2140. }),
  2141. smalltalk.IRVisitor);
  2142. smalltalk.addMethod(
  2143. "_visitIRDynamicArray_",
  2144. smalltalk.method({
  2145. selector: "visitIRDynamicArray:",
  2146. category: 'visiting',
  2147. fn: function (anIRDynamicArray){
  2148. var self=this;
  2149. return smalltalk.withContext(function($ctx1) { var $1;
  2150. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  2151. return $1;
  2152. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray}, smalltalk.IRVisitor)})},
  2153. args: ["anIRDynamicArray"],
  2154. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09^ self visitIRInstruction: anIRDynamicArray",
  2155. messageSends: ["visitIRInstruction:"],
  2156. referencedClasses: []
  2157. }),
  2158. smalltalk.IRVisitor);
  2159. smalltalk.addMethod(
  2160. "_visitIRDynamicDictionary_",
  2161. smalltalk.method({
  2162. selector: "visitIRDynamicDictionary:",
  2163. category: 'visiting',
  2164. fn: function (anIRDynamicDictionary){
  2165. var self=this;
  2166. return smalltalk.withContext(function($ctx1) { var $1;
  2167. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  2168. return $1;
  2169. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary}, smalltalk.IRVisitor)})},
  2170. args: ["anIRDynamicDictionary"],
  2171. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09^ self visitIRInstruction: anIRDynamicDictionary",
  2172. messageSends: ["visitIRInstruction:"],
  2173. referencedClasses: []
  2174. }),
  2175. smalltalk.IRVisitor);
  2176. smalltalk.addMethod(
  2177. "_visitIRInlinedClosure_",
  2178. smalltalk.method({
  2179. selector: "visitIRInlinedClosure:",
  2180. category: 'visiting',
  2181. fn: function (anIRInlinedClosure){
  2182. var self=this;
  2183. return smalltalk.withContext(function($ctx1) { var $1;
  2184. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  2185. return $1;
  2186. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure}, smalltalk.IRVisitor)})},
  2187. args: ["anIRInlinedClosure"],
  2188. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09^ self visitIRClosure: anIRInlinedClosure",
  2189. messageSends: ["visitIRClosure:"],
  2190. referencedClasses: []
  2191. }),
  2192. smalltalk.IRVisitor);
  2193. smalltalk.addMethod(
  2194. "_visitIRInlinedSequence_",
  2195. smalltalk.method({
  2196. selector: "visitIRInlinedSequence:",
  2197. category: 'visiting',
  2198. fn: function (anIRInlinedSequence){
  2199. var self=this;
  2200. return smalltalk.withContext(function($ctx1) { var $1;
  2201. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  2202. return $1;
  2203. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence}, smalltalk.IRVisitor)})},
  2204. args: ["anIRInlinedSequence"],
  2205. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09^ self visitIRSequence: anIRInlinedSequence",
  2206. messageSends: ["visitIRSequence:"],
  2207. referencedClasses: []
  2208. }),
  2209. smalltalk.IRVisitor);
  2210. smalltalk.addMethod(
  2211. "_visitIRInstruction_",
  2212. smalltalk.method({
  2213. selector: "visitIRInstruction:",
  2214. category: 'visiting',
  2215. fn: function (anIRInstruction){
  2216. var self=this;
  2217. return smalltalk.withContext(function($ctx1) { var $1;
  2218. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  2219. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2220. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2221. $1=anIRInstruction;
  2222. return $1;
  2223. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction}, smalltalk.IRVisitor)})},
  2224. args: ["anIRInstruction"],
  2225. source: "visitIRInstruction: anIRInstruction\x0a\x09anIRInstruction instructions do: [ :each | self visit: each ].\x0a\x09^ anIRInstruction",
  2226. messageSends: ["do:", "visit:", "instructions"],
  2227. referencedClasses: []
  2228. }),
  2229. smalltalk.IRVisitor);
  2230. smalltalk.addMethod(
  2231. "_visitIRMethod_",
  2232. smalltalk.method({
  2233. selector: "visitIRMethod:",
  2234. category: 'visiting',
  2235. fn: function (anIRMethod){
  2236. var self=this;
  2237. return smalltalk.withContext(function($ctx1) { var $1;
  2238. $1=_st(self)._visitIRInstruction_(anIRMethod);
  2239. return $1;
  2240. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod}, smalltalk.IRVisitor)})},
  2241. args: ["anIRMethod"],
  2242. source: "visitIRMethod: anIRMethod\x0a\x09^ self visitIRInstruction: anIRMethod",
  2243. messageSends: ["visitIRInstruction:"],
  2244. referencedClasses: []
  2245. }),
  2246. smalltalk.IRVisitor);
  2247. smalltalk.addMethod(
  2248. "_visitIRNonLocalReturn_",
  2249. smalltalk.method({
  2250. selector: "visitIRNonLocalReturn:",
  2251. category: 'visiting',
  2252. fn: function (anIRNonLocalReturn){
  2253. var self=this;
  2254. return smalltalk.withContext(function($ctx1) { var $1;
  2255. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  2256. return $1;
  2257. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRVisitor)})},
  2258. args: ["anIRNonLocalReturn"],
  2259. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self visitIRInstruction: anIRNonLocalReturn",
  2260. messageSends: ["visitIRInstruction:"],
  2261. referencedClasses: []
  2262. }),
  2263. smalltalk.IRVisitor);
  2264. smalltalk.addMethod(
  2265. "_visitIRNonLocalReturnHandling_",
  2266. smalltalk.method({
  2267. selector: "visitIRNonLocalReturnHandling:",
  2268. category: 'visiting',
  2269. fn: function (anIRNonLocalReturnHandling){
  2270. var self=this;
  2271. return smalltalk.withContext(function($ctx1) { var $1;
  2272. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  2273. return $1;
  2274. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling}, smalltalk.IRVisitor)})},
  2275. args: ["anIRNonLocalReturnHandling"],
  2276. source: "visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling\x0a\x09^ self visitIRInstruction: anIRNonLocalReturnHandling",
  2277. messageSends: ["visitIRInstruction:"],
  2278. referencedClasses: []
  2279. }),
  2280. smalltalk.IRVisitor);
  2281. smalltalk.addMethod(
  2282. "_visitIRReturn_",
  2283. smalltalk.method({
  2284. selector: "visitIRReturn:",
  2285. category: 'visiting',
  2286. fn: function (anIRReturn){
  2287. var self=this;
  2288. return smalltalk.withContext(function($ctx1) { var $1;
  2289. $1=_st(self)._visitIRInstruction_(anIRReturn);
  2290. return $1;
  2291. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRVisitor)})},
  2292. args: ["anIRReturn"],
  2293. source: "visitIRReturn: anIRReturn\x0a\x09^ self visitIRInstruction: anIRReturn",
  2294. messageSends: ["visitIRInstruction:"],
  2295. referencedClasses: []
  2296. }),
  2297. smalltalk.IRVisitor);
  2298. smalltalk.addMethod(
  2299. "_visitIRSend_",
  2300. smalltalk.method({
  2301. selector: "visitIRSend:",
  2302. category: 'visiting',
  2303. fn: function (anIRSend){
  2304. var self=this;
  2305. return smalltalk.withContext(function($ctx1) { var $1;
  2306. $1=_st(self)._visitIRInstruction_(anIRSend);
  2307. return $1;
  2308. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRVisitor)})},
  2309. args: ["anIRSend"],
  2310. source: "visitIRSend: anIRSend\x0a\x09^ self visitIRInstruction: anIRSend",
  2311. messageSends: ["visitIRInstruction:"],
  2312. referencedClasses: []
  2313. }),
  2314. smalltalk.IRVisitor);
  2315. smalltalk.addMethod(
  2316. "_visitIRSequence_",
  2317. smalltalk.method({
  2318. selector: "visitIRSequence:",
  2319. category: 'visiting',
  2320. fn: function (anIRSequence){
  2321. var self=this;
  2322. return smalltalk.withContext(function($ctx1) { var $1;
  2323. $1=_st(self)._visitIRInstruction_(anIRSequence);
  2324. return $1;
  2325. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence}, smalltalk.IRVisitor)})},
  2326. args: ["anIRSequence"],
  2327. source: "visitIRSequence: anIRSequence\x0a\x09^ self visitIRInstruction: anIRSequence",
  2328. messageSends: ["visitIRInstruction:"],
  2329. referencedClasses: []
  2330. }),
  2331. smalltalk.IRVisitor);
  2332. smalltalk.addMethod(
  2333. "_visitIRTempDeclaration_",
  2334. smalltalk.method({
  2335. selector: "visitIRTempDeclaration:",
  2336. category: 'visiting',
  2337. fn: function (anIRTempDeclaration){
  2338. var self=this;
  2339. return smalltalk.withContext(function($ctx1) { var $1;
  2340. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  2341. return $1;
  2342. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration}, smalltalk.IRVisitor)})},
  2343. args: ["anIRTempDeclaration"],
  2344. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09^ self visitIRInstruction: anIRTempDeclaration",
  2345. messageSends: ["visitIRInstruction:"],
  2346. referencedClasses: []
  2347. }),
  2348. smalltalk.IRVisitor);
  2349. smalltalk.addMethod(
  2350. "_visitIRValue_",
  2351. smalltalk.method({
  2352. selector: "visitIRValue:",
  2353. category: 'visiting',
  2354. fn: function (anIRValue){
  2355. var self=this;
  2356. return smalltalk.withContext(function($ctx1) { var $1;
  2357. $1=_st(self)._visitIRInstruction_(anIRValue);
  2358. return $1;
  2359. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue}, smalltalk.IRVisitor)})},
  2360. args: ["anIRValue"],
  2361. source: "visitIRValue: anIRValue\x0a\x09^ self visitIRInstruction: anIRValue",
  2362. messageSends: ["visitIRInstruction:"],
  2363. referencedClasses: []
  2364. }),
  2365. smalltalk.IRVisitor);
  2366. smalltalk.addMethod(
  2367. "_visitIRVariable_",
  2368. smalltalk.method({
  2369. selector: "visitIRVariable:",
  2370. category: 'visiting',
  2371. fn: function (anIRVariable){
  2372. var self=this;
  2373. return smalltalk.withContext(function($ctx1) { var $1;
  2374. $1=_st(self)._visitIRInstruction_(anIRVariable);
  2375. return $1;
  2376. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable}, smalltalk.IRVisitor)})},
  2377. args: ["anIRVariable"],
  2378. source: "visitIRVariable: anIRVariable\x0a\x09^ self visitIRInstruction: anIRVariable",
  2379. messageSends: ["visitIRInstruction:"],
  2380. referencedClasses: []
  2381. }),
  2382. smalltalk.IRVisitor);
  2383. smalltalk.addMethod(
  2384. "_visitIRVerbatim_",
  2385. smalltalk.method({
  2386. selector: "visitIRVerbatim:",
  2387. category: 'visiting',
  2388. fn: function (anIRVerbatim){
  2389. var self=this;
  2390. return smalltalk.withContext(function($ctx1) { var $1;
  2391. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  2392. return $1;
  2393. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim}, smalltalk.IRVisitor)})},
  2394. args: ["anIRVerbatim"],
  2395. source: "visitIRVerbatim: anIRVerbatim\x0a\x09^ self visitIRInstruction: anIRVerbatim",
  2396. messageSends: ["visitIRInstruction:"],
  2397. referencedClasses: []
  2398. }),
  2399. smalltalk.IRVisitor);
  2400. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  2401. smalltalk.addMethod(
  2402. "_contents",
  2403. smalltalk.method({
  2404. selector: "contents",
  2405. category: 'accessing',
  2406. fn: function (){
  2407. var self=this;
  2408. return smalltalk.withContext(function($ctx1) { var $1;
  2409. $1=_st(_st(self)._stream())._contents();
  2410. return $1;
  2411. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.IRJSTranslator)})},
  2412. args: [],
  2413. source: "contents\x0a\x09^ self stream contents",
  2414. messageSends: ["contents", "stream"],
  2415. referencedClasses: []
  2416. }),
  2417. smalltalk.IRJSTranslator);
  2418. smalltalk.addMethod(
  2419. "_initialize",
  2420. smalltalk.method({
  2421. selector: "initialize",
  2422. category: 'initialization',
  2423. fn: function (){
  2424. var self=this;
  2425. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  2426. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  2427. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.IRJSTranslator)})},
  2428. args: [],
  2429. source: "initialize\x0a\x09super initialize.\x0a\x09stream := JSStream new.",
  2430. messageSends: ["initialize", "new"],
  2431. referencedClasses: ["JSStream"]
  2432. }),
  2433. smalltalk.IRJSTranslator);
  2434. smalltalk.addMethod(
  2435. "_stream",
  2436. smalltalk.method({
  2437. selector: "stream",
  2438. category: 'accessing',
  2439. fn: function (){
  2440. var self=this;
  2441. return smalltalk.withContext(function($ctx1) { var $1;
  2442. $1=self["@stream"];
  2443. return $1;
  2444. }, function($ctx1) {$ctx1.fill(self,"stream",{}, smalltalk.IRJSTranslator)})},
  2445. args: [],
  2446. source: "stream\x0a\x09^ stream",
  2447. messageSends: [],
  2448. referencedClasses: []
  2449. }),
  2450. smalltalk.IRJSTranslator);
  2451. smalltalk.addMethod(
  2452. "_stream_",
  2453. smalltalk.method({
  2454. selector: "stream:",
  2455. category: 'accessing',
  2456. fn: function (aStream){
  2457. var self=this;
  2458. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  2459. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.IRJSTranslator)})},
  2460. args: ["aStream"],
  2461. source: "stream: aStream\x0a\x09stream := aStream",
  2462. messageSends: [],
  2463. referencedClasses: []
  2464. }),
  2465. smalltalk.IRJSTranslator);
  2466. smalltalk.addMethod(
  2467. "_visitIRAssignment_",
  2468. smalltalk.method({
  2469. selector: "visitIRAssignment:",
  2470. category: 'visiting',
  2471. fn: function (anIRAssignment){
  2472. var self=this;
  2473. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  2474. _st(_st(self)._stream())._nextPutAssignment();
  2475. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  2476. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRJSTranslator)})},
  2477. args: ["anIRAssignment"],
  2478. source: "visitIRAssignment: anIRAssignment\x0a\x09self visit: anIRAssignment instructions first.\x0a\x09self stream nextPutAssignment.\x0a\x09self visit: anIRAssignment instructions last.",
  2479. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"],
  2480. referencedClasses: []
  2481. }),
  2482. smalltalk.IRJSTranslator);
  2483. smalltalk.addMethod(
  2484. "_visitIRClosure_",
  2485. smalltalk.method({
  2486. selector: "visitIRClosure:",
  2487. category: 'visiting',
  2488. fn: function (anIRClosure){
  2489. var self=this;
  2490. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  2491. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  2492. return smalltalk.withContext(function($ctx3) { return _st(_st(each)._name())._asVariableName();
  2493. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})})));
  2494. return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  2495. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  2496. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2497. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),_st(anIRClosure)._arguments());
  2498. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure}, smalltalk.IRJSTranslator)})},
  2499. args: ["anIRClosure"],
  2500. 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",
  2501. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"],
  2502. referencedClasses: []
  2503. }),
  2504. smalltalk.IRJSTranslator);
  2505. smalltalk.addMethod(
  2506. "_visitIRDynamicArray_",
  2507. smalltalk.method({
  2508. selector: "visitIRDynamicArray:",
  2509. category: 'visiting',
  2510. fn: function (anIRDynamicArray){
  2511. var self=this;
  2512. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  2513. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  2514. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2515. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2516. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2517. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2518. _st(self["@stream"])._nextPutAll_("]");
  2519. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray}, smalltalk.IRJSTranslator)})},
  2520. args: ["anIRDynamicArray"],
  2521. 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: ']'",
  2522. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2523. referencedClasses: []
  2524. }),
  2525. smalltalk.IRJSTranslator);
  2526. smalltalk.addMethod(
  2527. "_visitIRDynamicDictionary_",
  2528. smalltalk.method({
  2529. selector: "visitIRDynamicDictionary:",
  2530. category: 'visiting',
  2531. fn: function (anIRDynamicDictionary){
  2532. var self=this;
  2533. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  2534. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  2535. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2536. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2537. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2538. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2539. _st(_st(self)._stream())._nextPutAll_("])");
  2540. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary}, smalltalk.IRJSTranslator)})},
  2541. args: ["anIRDynamicDictionary"],
  2542. 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: '])'",
  2543. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2544. referencedClasses: []
  2545. }),
  2546. smalltalk.IRJSTranslator);
  2547. smalltalk.addMethod(
  2548. "_visitIRMethod_",
  2549. smalltalk.method({
  2550. selector: "visitIRMethod:",
  2551. category: 'visiting',
  2552. fn: function (anIRMethod){
  2553. var self=this;
  2554. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$6,$7,$9,$10,$8,$5,$3;
  2555. $1=_st(self)._stream();
  2556. $2=anIRMethod;
  2557. $3=(function(){
  2558. return smalltalk.withContext(function($ctx2) { $4=_st(self)._stream();
  2559. $5=(function(){
  2560. return smalltalk.withContext(function($ctx3) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  2561. return smalltalk.withContext(function($ctx4) { return _st(_st(each)._name())._asVariableName();
  2562. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})));
  2563. $6=_st(self)._stream();
  2564. $7=anIRMethod;
  2565. $8=(function(){
  2566. return smalltalk.withContext(function($ctx4) { $9=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  2567. if(smalltalk.assert($9)){
  2568. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  2569. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  2570. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx1)})})));
  2571. };
  2572. $10=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  2573. if(smalltalk.assert($10)){
  2574. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  2575. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2576. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2577. } else {
  2578. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2579. };
  2580. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})});
  2581. return _st($6)._nextPutContextFor_during_($7,$8);
  2582. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
  2583. return _st($4)._nextPutFunctionWith_arguments_($5,_st(anIRMethod)._arguments());
  2584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  2585. _st($1)._nextPutMethodDeclaration_with_($2,$3);
  2586. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod}, smalltalk.IRJSTranslator)})},
  2587. args: ["anIRMethod"],
  2588. 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 ]",
  2589. 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"],
  2590. referencedClasses: []
  2591. }),
  2592. smalltalk.IRJSTranslator);
  2593. smalltalk.addMethod(
  2594. "_visitIRNonLocalReturn_",
  2595. smalltalk.method({
  2596. selector: "visitIRNonLocalReturn:",
  2597. category: 'visiting',
  2598. fn: function (anIRNonLocalReturn){
  2599. var self=this;
  2600. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  2601. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  2602. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2603. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRJSTranslator)})},
  2604. args: ["anIRNonLocalReturn"],
  2605. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09self stream nextPutNonLocalReturnWith: [\x0a\x09\x09super visitIRNonLocalReturn: anIRNonLocalReturn ]",
  2606. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"],
  2607. referencedClasses: []
  2608. }),
  2609. smalltalk.IRJSTranslator);
  2610. smalltalk.addMethod(
  2611. "_visitIRReturn_",
  2612. smalltalk.method({
  2613. selector: "visitIRReturn:",
  2614. category: 'visiting',
  2615. fn: function (anIRReturn){
  2616. var self=this;
  2617. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  2618. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  2619. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2620. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRJSTranslator)})},
  2621. args: ["anIRReturn"],
  2622. source: "visitIRReturn: anIRReturn\x0a\x09self stream nextPutReturnWith: [\x0a\x09\x09super visitIRReturn: anIRReturn ]",
  2623. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"],
  2624. referencedClasses: []
  2625. }),
  2626. smalltalk.IRJSTranslator);
  2627. smalltalk.addMethod(
  2628. "_visitIRSend_",
  2629. smalltalk.method({
  2630. selector: "visitIRSend:",
  2631. category: 'visiting',
  2632. fn: function (anIRSend){
  2633. var self=this;
  2634. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2635. $1=_st(anIRSend)._classSend();
  2636. if(($receiver = $1) == nil || $receiver == undefined){
  2637. _st(_st(self)._stream())._nextPutAll_("_st(");
  2638. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2639. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  2640. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2641. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2642. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2643. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2644. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2645. _st(_st(self)._stream())._nextPutAll_(")");
  2646. } else {
  2647. $2=_st(self)._stream();
  2648. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  2649. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  2650. $3=_st($2)._nextPutAll_("_st(");
  2651. $3;
  2652. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2653. _st(_st(self)._stream())._nextPutAll_("), [");
  2654. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2655. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2656. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2657. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2658. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2659. _st(_st(self)._stream())._nextPutAll_("])");
  2660. };
  2661. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRJSTranslator)})},
  2662. args: ["anIRSend"],
  2663. 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: '])' ]",
  2664. messageSends: ["ifNil:ifNotNil:", "nextPutAll:", "stream", "visit:", "first", "instructions", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "asJavascript", "classSend"],
  2665. referencedClasses: []
  2666. }),
  2667. smalltalk.IRJSTranslator);
  2668. smalltalk.addMethod(
  2669. "_visitIRSequence_",
  2670. smalltalk.method({
  2671. selector: "visitIRSequence:",
  2672. category: 'visiting',
  2673. fn: function (anIRSequence){
  2674. var self=this;
  2675. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  2676. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  2677. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  2678. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  2679. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2680. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence}, smalltalk.IRJSTranslator)})},
  2681. args: ["anIRSequence"],
  2682. source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence instructions do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ]]",
  2683. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
  2684. referencedClasses: []
  2685. }),
  2686. smalltalk.IRJSTranslator);
  2687. smalltalk.addMethod(
  2688. "_visitIRTempDeclaration_",
  2689. smalltalk.method({
  2690. selector: "visitIRTempDeclaration:",
  2691. category: 'visiting',
  2692. fn: function (anIRTempDeclaration){
  2693. var self=this;
  2694. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration}, smalltalk.IRJSTranslator)})},
  2695. args: ["anIRTempDeclaration"],
  2696. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09\x22self stream \x0a \x09nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';'; \x0a lf\x22",
  2697. messageSends: [],
  2698. referencedClasses: []
  2699. }),
  2700. smalltalk.IRJSTranslator);
  2701. smalltalk.addMethod(
  2702. "_visitIRValue_",
  2703. smalltalk.method({
  2704. selector: "visitIRValue:",
  2705. category: 'visiting',
  2706. fn: function (anIRValue){
  2707. var self=this;
  2708. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2709. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue}, smalltalk.IRJSTranslator)})},
  2710. args: ["anIRValue"],
  2711. source: "visitIRValue: anIRValue\x0a\x09self stream nextPutAll: anIRValue value asJavascript",
  2712. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"],
  2713. referencedClasses: []
  2714. }),
  2715. smalltalk.IRJSTranslator);
  2716. smalltalk.addMethod(
  2717. "_visitIRVariable_",
  2718. smalltalk.method({
  2719. selector: "visitIRVariable:",
  2720. category: 'visiting',
  2721. fn: function (anIRVariable){
  2722. var self=this;
  2723. return smalltalk.withContext(function($ctx1) { var $1;
  2724. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2725. if(smalltalk.assert($1)){
  2726. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  2727. } else {
  2728. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2729. };
  2730. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable}, smalltalk.IRJSTranslator)})},
  2731. args: ["anIRVariable"],
  2732. source: "visitIRVariable: anIRVariable\x0a\x09anIRVariable variable name = 'thisContext'\x0a \x09ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]\x0a \x09ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]",
  2733. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"],
  2734. referencedClasses: []
  2735. }),
  2736. smalltalk.IRJSTranslator);
  2737. smalltalk.addMethod(
  2738. "_visitIRVerbatim_",
  2739. smalltalk.method({
  2740. selector: "visitIRVerbatim:",
  2741. category: 'visiting',
  2742. fn: function (anIRVerbatim){
  2743. var self=this;
  2744. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  2745. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2746. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2747. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim}, smalltalk.IRJSTranslator)})},
  2748. args: ["anIRVerbatim"],
  2749. source: "visitIRVerbatim: anIRVerbatim\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self stream nextPutAll: anIRVerbatim source ]",
  2750. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"],
  2751. referencedClasses: []
  2752. }),
  2753. smalltalk.IRJSTranslator);
  2754. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2755. smalltalk.addMethod(
  2756. "_contents",
  2757. smalltalk.method({
  2758. selector: "contents",
  2759. category: 'accessing',
  2760. fn: function (){
  2761. var self=this;
  2762. return smalltalk.withContext(function($ctx1) { var $1;
  2763. $1=_st(self["@stream"])._contents();
  2764. return $1;
  2765. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.JSStream)})},
  2766. args: [],
  2767. source: "contents\x0a\x09^ stream contents",
  2768. messageSends: ["contents"],
  2769. referencedClasses: []
  2770. }),
  2771. smalltalk.JSStream);
  2772. smalltalk.addMethod(
  2773. "_initialize",
  2774. smalltalk.method({
  2775. selector: "initialize",
  2776. category: 'initialization',
  2777. fn: function (){
  2778. var self=this;
  2779. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  2780. self["@stream"]=_st("")._writeStream();
  2781. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.JSStream)})},
  2782. args: [],
  2783. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.",
  2784. messageSends: ["initialize", "writeStream"],
  2785. referencedClasses: []
  2786. }),
  2787. smalltalk.JSStream);
  2788. smalltalk.addMethod(
  2789. "_lf",
  2790. smalltalk.method({
  2791. selector: "lf",
  2792. category: 'streaming',
  2793. fn: function (){
  2794. var self=this;
  2795. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  2796. return self}, function($ctx1) {$ctx1.fill(self,"lf",{}, smalltalk.JSStream)})},
  2797. args: [],
  2798. source: "lf\x0a\x09stream lf",
  2799. messageSends: ["lf"],
  2800. referencedClasses: []
  2801. }),
  2802. smalltalk.JSStream);
  2803. smalltalk.addMethod(
  2804. "_nextPut_",
  2805. smalltalk.method({
  2806. selector: "nextPut:",
  2807. category: 'streaming',
  2808. fn: function (aString){
  2809. var self=this;
  2810. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  2811. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString}, smalltalk.JSStream)})},
  2812. args: ["aString"],
  2813. source: "nextPut: aString\x0a\x09stream nextPut: aString",
  2814. messageSends: ["nextPut:"],
  2815. referencedClasses: []
  2816. }),
  2817. smalltalk.JSStream);
  2818. smalltalk.addMethod(
  2819. "_nextPutAll_",
  2820. smalltalk.method({
  2821. selector: "nextPutAll:",
  2822. category: 'streaming',
  2823. fn: function (aString){
  2824. var self=this;
  2825. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  2826. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString}, smalltalk.JSStream)})},
  2827. args: ["aString"],
  2828. source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString",
  2829. messageSends: ["nextPutAll:"],
  2830. referencedClasses: []
  2831. }),
  2832. smalltalk.JSStream);
  2833. smalltalk.addMethod(
  2834. "_nextPutAssignment",
  2835. smalltalk.method({
  2836. selector: "nextPutAssignment",
  2837. category: 'streaming',
  2838. fn: function (){
  2839. var self=this;
  2840. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  2841. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{}, smalltalk.JSStream)})},
  2842. args: [],
  2843. source: "nextPutAssignment\x0a\x09stream nextPutAll: '='",
  2844. messageSends: ["nextPutAll:"],
  2845. referencedClasses: []
  2846. }),
  2847. smalltalk.JSStream);
  2848. smalltalk.addMethod(
  2849. "_nextPutBlockContextFor_during_",
  2850. smalltalk.method({
  2851. selector: "nextPutBlockContextFor:during:",
  2852. category: 'streaming',
  2853. fn: function (anIRClosure,aBlock){
  2854. var self=this;
  2855. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2856. $1=self;
  2857. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2858. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2859. _st(aBlock)._value();
  2860. $3=self;
  2861. _st($3)._nextPutAll_(_st(_st("}, function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2862. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  2863. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  2864. return smalltalk.withContext(function($ctx2) { $5=self;
  2865. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2866. _st($5)._nextPutAll_(":");
  2867. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2868. return $6;
  2869. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2870. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2871. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2872. $7=self;
  2873. _st($7)._nextPutAll_("},");
  2874. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._method())._scope())._alias()).__comma(")})"));
  2875. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock}, smalltalk.JSStream)})},
  2876. args: ["anIRClosure", "aBlock"],
  2877. 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 locals \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '},';\x0a nextPutAll: anIRClosure method scope alias, ')})'",
  2878. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "do:separatedBy:", "asVariableName", "locals", "method"],
  2879. referencedClasses: ["String"]
  2880. }),
  2881. smalltalk.JSStream);
  2882. smalltalk.addMethod(
  2883. "_nextPutClosureWith_arguments_",
  2884. smalltalk.method({
  2885. selector: "nextPutClosureWith:arguments:",
  2886. category: 'streaming',
  2887. fn: function (aBlock,anArray){
  2888. var self=this;
  2889. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2890. _st(self["@stream"])._nextPutAll_("(function(");
  2891. _st(anArray)._do_separatedBy_((function(each){
  2892. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2893. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2894. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2895. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2896. $1=self["@stream"];
  2897. _st($1)._nextPutAll_("){");
  2898. $2=_st($1)._lf();
  2899. _st(aBlock)._value();
  2900. _st(self["@stream"])._nextPutAll_("})");
  2901. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray}, smalltalk.JSStream)})},
  2902. args: ["aBlock", "anArray"],
  2903. 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: '})'",
  2904. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  2905. referencedClasses: []
  2906. }),
  2907. smalltalk.JSStream);
  2908. smalltalk.addMethod(
  2909. "_nextPutContextFor_during_",
  2910. smalltalk.method({
  2911. selector: "nextPutContextFor:during:",
  2912. category: 'streaming',
  2913. fn: function (aMethod,aBlock){
  2914. var self=this;
  2915. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2916. $1=self;
  2917. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  2918. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2919. _st(aBlock)._value();
  2920. $3=self;
  2921. _st($3)._nextPutAll_(_st(_st(_st("}, function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  2922. $4=_st($3)._nextPutAll_(_st(_st(".fill(self,").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  2923. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  2924. return smalltalk.withContext(function($ctx2) { $5=self;
  2925. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2926. _st($5)._nextPutAll_(":");
  2927. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2928. return $6;
  2929. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2930. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2931. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2932. $7=self;
  2933. _st($7)._nextPutAll_("}, ");
  2934. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  2935. $8=_st($7)._nextPutAll_(")})");
  2936. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock}, smalltalk.JSStream)})},
  2937. args: ["aMethod", "aBlock"],
  2938. 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 locals \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '}, ';\x0a nextPutAll: aMethod theClass asJavascript;\x0a nextPutAll: ')})'",
  2939. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "locals", "theClass"],
  2940. referencedClasses: ["String"]
  2941. }),
  2942. smalltalk.JSStream);
  2943. smalltalk.addMethod(
  2944. "_nextPutFunctionWith_arguments_",
  2945. smalltalk.method({
  2946. selector: "nextPutFunctionWith:arguments:",
  2947. category: 'streaming',
  2948. fn: function (aBlock,anArray){
  2949. var self=this;
  2950. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2951. _st(self["@stream"])._nextPutAll_("fn: function(");
  2952. _st(anArray)._do_separatedBy_((function(each){
  2953. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2954. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2955. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2956. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2957. $1=self["@stream"];
  2958. _st($1)._nextPutAll_("){");
  2959. $2=_st($1)._lf();
  2960. $3=self["@stream"];
  2961. _st($3)._nextPutAll_("var self=this;");
  2962. $4=_st($3)._lf();
  2963. _st(aBlock)._value();
  2964. _st(self["@stream"])._nextPutAll_("}");
  2965. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray}, smalltalk.JSStream)})},
  2966. args: ["aBlock", "anArray"],
  2967. 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: '}'",
  2968. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  2969. referencedClasses: []
  2970. }),
  2971. smalltalk.JSStream);
  2972. smalltalk.addMethod(
  2973. "_nextPutIf_with_",
  2974. smalltalk.method({
  2975. selector: "nextPutIf:with:",
  2976. category: 'streaming',
  2977. fn: function (aBlock,anotherBlock){
  2978. var self=this;
  2979. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2980. _st(self["@stream"])._nextPutAll_("if(");
  2981. _st(aBlock)._value();
  2982. $1=self["@stream"];
  2983. _st($1)._nextPutAll_("){");
  2984. $2=_st($1)._lf();
  2985. _st(anotherBlock)._value();
  2986. _st(self["@stream"])._nextPutAll_("}");
  2987. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock}, smalltalk.JSStream)})},
  2988. args: ["aBlock", "anotherBlock"],
  2989. source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
  2990. messageSends: ["nextPutAll:", "value", "lf"],
  2991. referencedClasses: []
  2992. }),
  2993. smalltalk.JSStream);
  2994. smalltalk.addMethod(
  2995. "_nextPutIfElse_with_with_",
  2996. smalltalk.method({
  2997. selector: "nextPutIfElse:with:with:",
  2998. category: 'streaming',
  2999. fn: function (aBlock,ifBlock,elseBlock){
  3000. var self=this;
  3001. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3002. _st(self["@stream"])._nextPutAll_("if(");
  3003. _st(aBlock)._value();
  3004. $1=self["@stream"];
  3005. _st($1)._nextPutAll_("){");
  3006. $2=_st($1)._lf();
  3007. _st(ifBlock)._value();
  3008. $3=self["@stream"];
  3009. _st($3)._nextPutAll_("} else {");
  3010. $4=_st($3)._lf();
  3011. _st(elseBlock)._value();
  3012. _st(self["@stream"])._nextPutAll_("}");
  3013. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock}, smalltalk.JSStream)})},
  3014. args: ["aBlock", "ifBlock", "elseBlock"],
  3015. 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: '}'",
  3016. messageSends: ["nextPutAll:", "value", "lf"],
  3017. referencedClasses: []
  3018. }),
  3019. smalltalk.JSStream);
  3020. smalltalk.addMethod(
  3021. "_nextPutMethodDeclaration_with_",
  3022. smalltalk.method({
  3023. selector: "nextPutMethodDeclaration:with:",
  3024. category: 'streaming',
  3025. fn: function (aMethod,aBlock){
  3026. var self=this;
  3027. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  3028. $1=self["@stream"];
  3029. _st($1)._nextPutAll_("smalltalk.method({");
  3030. _st($1)._lf();
  3031. _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  3032. _st($1)._lf();
  3033. _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  3034. $2=_st($1)._lf();
  3035. _st(aBlock)._value();
  3036. $3=self["@stream"];
  3037. _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  3038. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  3039. _st($3)._lf();
  3040. _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  3041. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  3042. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asArray())._asJavascript())).__comma(","));
  3043. _st($3)._lf();
  3044. $4=_st($3)._nextPutAll_("referencedClasses: [");
  3045. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  3046. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  3047. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3048. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3049. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3050. $5=self["@stream"];
  3051. _st($5)._nextPutAll_("]");
  3052. $6=_st($5)._nextPutAll_("})");
  3053. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock}, smalltalk.JSStream)})},
  3054. args: ["aMethod", "aBlock"],
  3055. 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: '})'",
  3056. messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"],
  3057. referencedClasses: ["String"]
  3058. }),
  3059. smalltalk.JSStream);
  3060. smalltalk.addMethod(
  3061. "_nextPutNonLocalReturnHandlingWith_",
  3062. smalltalk.method({
  3063. selector: "nextPutNonLocalReturnHandlingWith:",
  3064. category: 'streaming',
  3065. fn: function (aBlock){
  3066. var self=this;
  3067. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3068. $1=self["@stream"];
  3069. _st($1)._nextPutAll_("var $early={};");
  3070. _st($1)._lf();
  3071. _st($1)._nextPutAll_("try {");
  3072. $2=_st($1)._lf();
  3073. _st(aBlock)._value();
  3074. $3=self["@stream"];
  3075. _st($3)._nextPutAll_("}");
  3076. _st($3)._lf();
  3077. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  3078. $4=_st($3)._lf();
  3079. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3080. args: ["aBlock"],
  3081. 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",
  3082. messageSends: ["nextPutAll:", "lf", "value"],
  3083. referencedClasses: []
  3084. }),
  3085. smalltalk.JSStream);
  3086. smalltalk.addMethod(
  3087. "_nextPutNonLocalReturnWith_",
  3088. smalltalk.method({
  3089. selector: "nextPutNonLocalReturnWith:",
  3090. category: 'streaming',
  3091. fn: function (aBlock){
  3092. var self=this;
  3093. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  3094. _st(aBlock)._value();
  3095. _st(self["@stream"])._nextPutAll_("]");
  3096. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3097. args: ["aBlock"],
  3098. source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: 'throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']'",
  3099. messageSends: ["nextPutAll:", "value"],
  3100. referencedClasses: []
  3101. }),
  3102. smalltalk.JSStream);
  3103. smalltalk.addMethod(
  3104. "_nextPutReturn",
  3105. smalltalk.method({
  3106. selector: "nextPutReturn",
  3107. category: 'streaming',
  3108. fn: function (){
  3109. var self=this;
  3110. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  3111. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{}, smalltalk.JSStream)})},
  3112. args: [],
  3113. source: "nextPutReturn\x0a\x09stream nextPutAll: 'return '",
  3114. messageSends: ["nextPutAll:"],
  3115. referencedClasses: []
  3116. }),
  3117. smalltalk.JSStream);
  3118. smalltalk.addMethod(
  3119. "_nextPutReturnWith_",
  3120. smalltalk.method({
  3121. selector: "nextPutReturnWith:",
  3122. category: 'streaming',
  3123. fn: function (aBlock){
  3124. var self=this;
  3125. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  3126. _st(aBlock)._value();
  3127. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3128. args: ["aBlock"],
  3129. source: "nextPutReturnWith: aBlock\x0a\x09self nextPutReturn.\x0a\x09aBlock value",
  3130. messageSends: ["nextPutReturn", "value"],
  3131. referencedClasses: []
  3132. }),
  3133. smalltalk.JSStream);
  3134. smalltalk.addMethod(
  3135. "_nextPutSequenceWith_",
  3136. smalltalk.method({
  3137. selector: "nextPutSequenceWith:",
  3138. category: 'streaming',
  3139. fn: function (aBlock){
  3140. var self=this;
  3141. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  3142. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3143. args: ["aBlock"],
  3144. 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",
  3145. messageSends: ["value"],
  3146. referencedClasses: []
  3147. }),
  3148. smalltalk.JSStream);
  3149. smalltalk.addMethod(
  3150. "_nextPutStatement_with_",
  3151. smalltalk.method({
  3152. selector: "nextPutStatement:with:",
  3153. category: 'streaming',
  3154. fn: function (anInteger,aBlock){
  3155. var self=this;
  3156. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3157. $1=self["@stream"];
  3158. _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  3159. $2=_st($1)._lf();
  3160. _st(self)._nextPutStatementWith_(aBlock);
  3161. $3=self["@stream"];
  3162. _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  3163. $4=_st($3)._lf();
  3164. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:",{anInteger:anInteger,aBlock:aBlock}, smalltalk.JSStream)})},
  3165. args: ["anInteger", "aBlock"],
  3166. 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",
  3167. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"],
  3168. referencedClasses: []
  3169. }),
  3170. smalltalk.JSStream);
  3171. smalltalk.addMethod(
  3172. "_nextPutStatementWith_",
  3173. smalltalk.method({
  3174. selector: "nextPutStatementWith:",
  3175. category: 'streaming',
  3176. fn: function (aBlock){
  3177. var self=this;
  3178. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3179. _st(aBlock)._value();
  3180. $1=self["@stream"];
  3181. _st($1)._nextPutAll_(";");
  3182. $2=_st($1)._lf();
  3183. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock}, smalltalk.JSStream)})},
  3184. args: ["aBlock"],
  3185. source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
  3186. messageSends: ["value", "nextPutAll:", "lf"],
  3187. referencedClasses: []
  3188. }),
  3189. smalltalk.JSStream);
  3190. smalltalk.addMethod(
  3191. "_nextPutVar_",
  3192. smalltalk.method({
  3193. selector: "nextPutVar:",
  3194. category: 'streaming',
  3195. fn: function (aString){
  3196. var self=this;
  3197. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3198. $1=self["@stream"];
  3199. _st($1)._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
  3200. $2=_st($1)._lf();
  3201. return self}, function($ctx1) {$ctx1.fill(self,"nextPutVar:",{aString:aString}, smalltalk.JSStream)})},
  3202. args: ["aString"],
  3203. source: "nextPutVar: aString\x0a\x09stream nextPutAll: 'var ', aString, ';'; lf",
  3204. messageSends: ["nextPutAll:", ",", "lf"],
  3205. referencedClasses: []
  3206. }),
  3207. smalltalk.JSStream);
  3208. smalltalk.addMethod(
  3209. "_nextPutVars_",
  3210. smalltalk.method({
  3211. selector: "nextPutVars:",
  3212. category: 'streaming',
  3213. fn: function (aCollection){
  3214. var self=this;
  3215. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  3216. var $early={};
  3217. try {
  3218. _st(aCollection)._ifEmpty_((function(){
  3219. return smalltalk.withContext(function($ctx2) { $1=self;
  3220. throw $early=[$1];
  3221. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3222. _st(self["@stream"])._nextPutAll_("var ");
  3223. _st(aCollection)._do_separatedBy_((function(each){
  3224. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  3225. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3226. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3227. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3228. $2=self["@stream"];
  3229. _st($2)._nextPutAll_(";");
  3230. $3=_st($2)._lf();
  3231. return self}
  3232. catch(e) {if(e===$early)return e[0]; throw e}
  3233. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection}, smalltalk.JSStream)})},
  3234. args: ["aCollection"],
  3235. 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",
  3236. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"],
  3237. referencedClasses: []
  3238. }),
  3239. smalltalk.JSStream);
  3240. smalltalk.addMethod(
  3241. "_appendToInstruction_",
  3242. smalltalk.method({
  3243. selector: "appendToInstruction:",
  3244. category: '*Compiler-IR',
  3245. fn: function (anIRInstruction){
  3246. var self=this;
  3247. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  3248. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction}, smalltalk.BlockClosure)})},
  3249. args: ["anIRInstruction"],
  3250. source: "appendToInstruction: anIRInstruction\x0a anIRInstruction appendBlock: self",
  3251. messageSends: ["appendBlock:"],
  3252. referencedClasses: []
  3253. }),
  3254. smalltalk.BlockClosure);
  3255. smalltalk.addMethod(
  3256. "_asVariableName",
  3257. smalltalk.method({
  3258. selector: "asVariableName",
  3259. category: '*Compiler-IR',
  3260. fn: function (){
  3261. var self=this;
  3262. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3263. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  3264. if(smalltalk.assert($2)){
  3265. $1=_st(self).__comma("_");
  3266. } else {
  3267. $1=self;
  3268. };
  3269. return $1;
  3270. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{}, smalltalk.String)})},
  3271. args: [],
  3272. source: "asVariableName\x0a\x09^ (Smalltalk current reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
  3273. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  3274. referencedClasses: ["Smalltalk"]
  3275. }),
  3276. smalltalk.String);