Compiler-IR.js 121 KB

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