Compiler-IR.deploy.js 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601
  1. smalltalk.addPackage('Compiler-IR');
  2. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
  3. smalltalk.addMethod(
  4. "_alias_",
  5. smalltalk.method({
  6. selector: "alias:",
  7. fn: function (aNode){
  8. var self=this;
  9. var variable;
  10. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7;
  11. $1=_st(aNode)._isImmutable();
  12. if(smalltalk.assert($1)){
  13. $2=_st(self)._visit_(aNode);
  14. return $2;
  15. };
  16. $3=_st((smalltalk.IRVariable || IRVariable))._new();
  17. _st($3)._variable_(_st(_st((smalltalk.AliasVar || AliasVar))._new())._name_(_st("$").__comma(_st(self)._nextAlias())));
  18. $4=_st($3)._yourself();
  19. variable=$4;
  20. $5=_st((smalltalk.IRAssignment || IRAssignment))._new();
  21. _st($5)._add_(variable);
  22. _st($5)._add_(_st(self)._visit_(aNode));
  23. $6=_st($5)._yourself();
  24. _st(_st(self)._sequence())._add_($6);
  25. _st(_st(_st(self)._method())._internalVariables())._add_(variable);
  26. $7=variable;
  27. return $7;
  28. }, function($ctx1) {$ctx1.fill(self,"alias:",{aNode:aNode,variable:variable},smalltalk.IRASTTranslator)})},
  29. messageSends: ["ifTrue:", "visit:", "isImmutable", "variable:", "name:", ",", "nextAlias", "new", "yourself", "add:", "sequence", "internalVariables", "method"]}),
  30. smalltalk.IRASTTranslator);
  31. smalltalk.addMethod(
  32. "_aliasTemporally_",
  33. smalltalk.method({
  34. selector: "aliasTemporally:",
  35. fn: function (aCollection){
  36. var self=this;
  37. var threshold,result;
  38. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$3,$5;
  39. threshold=(0);
  40. _st(aCollection)._withIndexDo_((function(each,i){
  41. return smalltalk.withContext(function($ctx2) { $1=_st(each)._subtreeNeedsAliasing();
  42. if(smalltalk.assert($1)){
  43. threshold=i;
  44. return threshold;
  45. };
  46. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  47. result=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  48. _st(aCollection)._withIndexDo_((function(each,i){
  49. return smalltalk.withContext(function($ctx2) { $2=result;
  50. $4=_st(i).__lt_eq(threshold);
  51. if(smalltalk.assert($4)){
  52. $3=_st(self)._alias_(each);
  53. } else {
  54. $3=_st(self)._visit_(each);
  55. };
  56. return _st($2)._add_($3);
  57. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  58. $5=result;
  59. return $5;
  60. }, function($ctx1) {$ctx1.fill(self,"aliasTemporally:",{aCollection:aCollection,threshold:threshold,result:result},smalltalk.IRASTTranslator)})},
  61. messageSends: ["withIndexDo:", "ifTrue:", "subtreeNeedsAliasing", "new", "add:", "ifTrue:ifFalse:", "alias:", "visit:", "<="]}),
  62. smalltalk.IRASTTranslator);
  63. smalltalk.addMethod(
  64. "_method",
  65. smalltalk.method({
  66. selector: "method",
  67. fn: function (){
  68. var self=this;
  69. return smalltalk.withContext(function($ctx1) { var $1;
  70. $1=self["@method"];
  71. return $1;
  72. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRASTTranslator)})},
  73. messageSends: []}),
  74. smalltalk.IRASTTranslator);
  75. smalltalk.addMethod(
  76. "_method_",
  77. smalltalk.method({
  78. selector: "method:",
  79. fn: function (anIRMethod){
  80. var self=this;
  81. return smalltalk.withContext(function($ctx1) { self["@method"]=anIRMethod;
  82. return self}, function($ctx1) {$ctx1.fill(self,"method:",{anIRMethod:anIRMethod},smalltalk.IRASTTranslator)})},
  83. messageSends: []}),
  84. smalltalk.IRASTTranslator);
  85. smalltalk.addMethod(
  86. "_nextAlias",
  87. smalltalk.method({
  88. selector: "nextAlias",
  89. fn: function (){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) { var $1,$2;
  92. $1=self["@nextAlias"];
  93. if(($receiver = $1) == nil || $receiver == undefined){
  94. self["@nextAlias"]=(0);
  95. self["@nextAlias"];
  96. } else {
  97. $1;
  98. };
  99. self["@nextAlias"]=_st(self["@nextAlias"]).__plus((1));
  100. $2=_st(self["@nextAlias"])._asString();
  101. return $2;
  102. }, function($ctx1) {$ctx1.fill(self,"nextAlias",{},smalltalk.IRASTTranslator)})},
  103. messageSends: ["ifNil:", "+", "asString"]}),
  104. smalltalk.IRASTTranslator);
  105. smalltalk.addMethod(
  106. "_sequence",
  107. smalltalk.method({
  108. selector: "sequence",
  109. fn: function (){
  110. var self=this;
  111. return smalltalk.withContext(function($ctx1) { var $1;
  112. $1=self["@sequence"];
  113. return $1;
  114. }, function($ctx1) {$ctx1.fill(self,"sequence",{},smalltalk.IRASTTranslator)})},
  115. messageSends: []}),
  116. smalltalk.IRASTTranslator);
  117. smalltalk.addMethod(
  118. "_sequence_",
  119. smalltalk.method({
  120. selector: "sequence:",
  121. fn: function (anIRSequence){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) { self["@sequence"]=anIRSequence;
  124. return self}, function($ctx1) {$ctx1.fill(self,"sequence:",{anIRSequence:anIRSequence},smalltalk.IRASTTranslator)})},
  125. messageSends: []}),
  126. smalltalk.IRASTTranslator);
  127. smalltalk.addMethod(
  128. "_source",
  129. smalltalk.method({
  130. selector: "source",
  131. fn: function (){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) { var $1;
  134. $1=self["@source"];
  135. return $1;
  136. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRASTTranslator)})},
  137. messageSends: []}),
  138. smalltalk.IRASTTranslator);
  139. smalltalk.addMethod(
  140. "_source_",
  141. smalltalk.method({
  142. selector: "source:",
  143. fn: function (aString){
  144. var self=this;
  145. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  146. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRASTTranslator)})},
  147. messageSends: []}),
  148. smalltalk.IRASTTranslator);
  149. smalltalk.addMethod(
  150. "_theClass",
  151. smalltalk.method({
  152. selector: "theClass",
  153. fn: function (){
  154. var self=this;
  155. return smalltalk.withContext(function($ctx1) { var $1;
  156. $1=self["@theClass"];
  157. return $1;
  158. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.IRASTTranslator)})},
  159. messageSends: []}),
  160. smalltalk.IRASTTranslator);
  161. smalltalk.addMethod(
  162. "_theClass_",
  163. smalltalk.method({
  164. selector: "theClass:",
  165. fn: function (aClass){
  166. var self=this;
  167. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  168. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.IRASTTranslator)})},
  169. messageSends: []}),
  170. smalltalk.IRASTTranslator);
  171. smalltalk.addMethod(
  172. "_visitAssignmentNode_",
  173. smalltalk.method({
  174. selector: "visitAssignmentNode:",
  175. fn: function (aNode){
  176. var self=this;
  177. var left,right,assignment;
  178. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  179. right=_st(self)._visit_(_st(aNode)._right());
  180. left=_st(self)._visit_(_st(aNode)._left());
  181. $1=_st((smalltalk.IRAssignment || IRAssignment))._new();
  182. _st($1)._add_(left);
  183. _st($1)._add_(right);
  184. $2=_st($1)._yourself();
  185. _st(_st(self)._sequence())._add_($2);
  186. $3=left;
  187. return $3;
  188. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,left:left,right:right,assignment:assignment},smalltalk.IRASTTranslator)})},
  189. messageSends: ["visit:", "right", "left", "add:", "new", "yourself", "sequence"]}),
  190. smalltalk.IRASTTranslator);
  191. smalltalk.addMethod(
  192. "_visitBlockNode_",
  193. smalltalk.method({
  194. selector: "visitBlockNode:",
  195. fn: function (aNode){
  196. var self=this;
  197. var closure;
  198. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  199. $1=_st((smalltalk.IRClosure || IRClosure))._new();
  200. _st($1)._arguments_(_st(aNode)._parameters());
  201. _st($1)._scope_(_st(aNode)._scope());
  202. $2=_st($1)._yourself();
  203. closure=$2;
  204. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  205. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  206. _st($3)._name_(_st(each)._name());
  207. _st($3)._scope_(_st(aNode)._scope());
  208. $4=_st($3)._yourself();
  209. return _st(closure)._add_($4);
  210. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  211. _st(_st(aNode)._nodes())._do_((function(each){
  212. return smalltalk.withContext(function($ctx2) { return _st(closure)._add_(_st(self)._visit_(each));
  213. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  214. $5=closure;
  215. return $5;
  216. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,closure:closure},smalltalk.IRASTTranslator)})},
  217. messageSends: ["arguments:", "parameters", "new", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "temps", "visit:", "nodes"]}),
  218. smalltalk.IRASTTranslator);
  219. smalltalk.addMethod(
  220. "_visitBlockSequenceNode_",
  221. smalltalk.method({
  222. selector: "visitBlockSequenceNode:",
  223. fn: function (aNode){
  224. var self=this;
  225. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$1;
  226. $1=_st(self)._withSequence_do_(_st((smalltalk.IRBlockSequence || IRBlockSequence))._new(),(function(){
  227. return smalltalk.withContext(function($ctx2) { return _st(_st(aNode)._nodes())._ifNotEmpty_((function(){
  228. return smalltalk.withContext(function($ctx3) { _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  229. return smalltalk.withContext(function($ctx4) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  230. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  231. $2=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
  232. if(smalltalk.assert($2)){
  233. return _st(_st(self)._sequence())._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  234. } else {
  235. $3=_st((smalltalk.IRBlockReturn || IRBlockReturn))._new();
  236. _st($3)._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  237. $4=_st($3)._yourself();
  238. return _st(_st(self)._sequence())._add_($4);
  239. };
  240. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  241. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  242. return $1;
  243. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  244. messageSends: ["withSequence:do:", "new", "ifNotEmpty:", "do:", "add:", "visit:", "sequence", "allButLast", "nodes", "ifFalse:ifTrue:", "last", "yourself", "isReturnNode"]}),
  245. smalltalk.IRASTTranslator);
  246. smalltalk.addMethod(
  247. "_visitCascadeNode_",
  248. smalltalk.method({
  249. selector: "visitCascadeNode:",
  250. fn: function (aNode){
  251. var self=this;
  252. var alias;
  253. return smalltalk.withContext(function($ctx1) { var $1,$2;
  254. $1=_st(_st(aNode)._receiver())._isImmutable();
  255. if(! smalltalk.assert($1)){
  256. alias=_st(self)._alias_(_st(aNode)._receiver());
  257. alias;
  258. _st(_st(aNode)._nodes())._do_((function(each){
  259. return smalltalk.withContext(function($ctx2) { return _st(each)._receiver_(_st(_st((smalltalk.VariableNode || VariableNode))._new())._binding_(_st(alias)._variable()));
  260. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  261. };
  262. _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  263. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  264. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  265. $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
  266. return $2;
  267. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode,alias:alias},smalltalk.IRASTTranslator)})},
  268. messageSends: ["ifFalse:", "alias:", "receiver", "do:", "receiver:", "binding:", "variable", "new", "nodes", "isImmutable", "add:", "visit:", "sequence", "allButLast", "last"]}),
  269. smalltalk.IRASTTranslator);
  270. smalltalk.addMethod(
  271. "_visitDynamicArrayNode_",
  272. smalltalk.method({
  273. selector: "visitDynamicArrayNode:",
  274. fn: function (aNode){
  275. var self=this;
  276. var array;
  277. return smalltalk.withContext(function($ctx1) { var $1;
  278. array=_st((smalltalk.IRDynamicArray || IRDynamicArray))._new();
  279. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  280. return smalltalk.withContext(function($ctx2) { return _st(array)._add_(each);
  281. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  282. $1=array;
  283. return $1;
  284. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.IRASTTranslator)})},
  285. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"]}),
  286. smalltalk.IRASTTranslator);
  287. smalltalk.addMethod(
  288. "_visitDynamicDictionaryNode_",
  289. smalltalk.method({
  290. selector: "visitDynamicDictionaryNode:",
  291. fn: function (aNode){
  292. var self=this;
  293. var dictionary;
  294. return smalltalk.withContext(function($ctx1) { var $1;
  295. dictionary=_st((smalltalk.IRDynamicDictionary || IRDynamicDictionary))._new();
  296. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  297. return smalltalk.withContext(function($ctx2) { return _st(dictionary)._add_(each);
  298. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  299. $1=dictionary;
  300. return $1;
  301. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,dictionary:dictionary},smalltalk.IRASTTranslator)})},
  302. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"]}),
  303. smalltalk.IRASTTranslator);
  304. smalltalk.addMethod(
  305. "_visitJSStatementNode_",
  306. smalltalk.method({
  307. selector: "visitJSStatementNode:",
  308. fn: function (aNode){
  309. var self=this;
  310. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  311. $2=_st((smalltalk.IRVerbatim || IRVerbatim))._new();
  312. _st($2)._source_(_st(aNode)._source());
  313. $3=_st($2)._yourself();
  314. $1=$3;
  315. return $1;
  316. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  317. messageSends: ["source:", "source", "new", "yourself"]}),
  318. smalltalk.IRASTTranslator);
  319. smalltalk.addMethod(
  320. "_visitMethodNode_",
  321. smalltalk.method({
  322. selector: "visitMethodNode:",
  323. fn: function (aNode){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  326. $1=_st((smalltalk.IRMethod || IRMethod))._new();
  327. _st($1)._source_(_st(self)._source());
  328. _st($1)._theClass_(_st(self)._theClass());
  329. _st($1)._arguments_(_st(aNode)._arguments());
  330. _st($1)._selector_(_st(aNode)._selector());
  331. _st($1)._messageSends_(_st(aNode)._messageSends());
  332. _st($1)._superSends_(_st(aNode)._superSends());
  333. _st($1)._classReferences_(_st(aNode)._classReferences());
  334. _st($1)._scope_(_st(aNode)._scope());
  335. $2=_st($1)._yourself();
  336. _st(self)._method_($2);
  337. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  338. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  339. _st($3)._name_(_st(each)._name());
  340. _st($3)._scope_(_st(aNode)._scope());
  341. $4=_st($3)._yourself();
  342. return _st(_st(self)._method())._add_($4);
  343. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  344. _st(_st(aNode)._nodes())._do_((function(each){
  345. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._method())._add_(_st(self)._visit_(each));
  346. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  347. $5=_st(_st(aNode)._scope())._hasLocalReturn();
  348. if(! smalltalk.assert($5)){
  349. $6=_st((smalltalk.IRVariable || IRVariable))._new();
  350. _st($6)._variable_(_st(_st(_st(aNode)._scope())._pseudoVars())._at_("self"));
  351. $7=_st($6)._yourself();
  352. _st(_st(_st(self)._method())._add_(_st((smalltalk.IRReturn || IRReturn))._new()))._add_($7);
  353. };
  354. $8=_st(self)._method();
  355. return $8;
  356. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  357. 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"]}),
  358. smalltalk.IRASTTranslator);
  359. smalltalk.addMethod(
  360. "_visitReturnNode_",
  361. smalltalk.method({
  362. selector: "visitReturnNode:",
  363. fn: function (aNode){
  364. var self=this;
  365. var return_;
  366. return smalltalk.withContext(function($ctx1) { var $1,$2;
  367. $1=_st(aNode)._nonLocalReturn();
  368. if(smalltalk.assert($1)){
  369. return_=_st((smalltalk.IRNonLocalReturn || IRNonLocalReturn))._new();
  370. } else {
  371. return_=_st((smalltalk.IRReturn || IRReturn))._new();
  372. };
  373. _st(return_)._scope_(_st(aNode)._scope());
  374. _st(_st(aNode)._nodes())._do_((function(each){
  375. return smalltalk.withContext(function($ctx2) { return _st(return_)._add_(_st(self)._alias_(each));
  376. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  377. $2=return_;
  378. return $2;
  379. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode,return_:return_},smalltalk.IRASTTranslator)})},
  380. messageSends: ["ifTrue:ifFalse:", "new", "nonLocalReturn", "scope:", "scope", "do:", "add:", "alias:", "nodes"]}),
  381. smalltalk.IRASTTranslator);
  382. smalltalk.addMethod(
  383. "_visitSendNode_",
  384. smalltalk.method({
  385. selector: "visitSendNode:",
  386. fn: function (aNode){
  387. var self=this;
  388. var send,all,receiver,arguments;
  389. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  390. send=_st((smalltalk.IRSend || IRSend))._new();
  391. $1=send;
  392. _st($1)._selector_(_st(aNode)._selector());
  393. $2=_st($1)._index_(_st(aNode)._index());
  394. $3=_st(aNode)._superSend();
  395. if(smalltalk.assert($3)){
  396. _st(send)._classSend_(_st(_st(self)._theClass())._superclass());
  397. };
  398. all=_st(self)._aliasTemporally_(_st([_st(aNode)._receiver()]).__comma(_st(aNode)._arguments()));
  399. receiver=_st(all)._first();
  400. arguments=_st(all)._allButFirst();
  401. _st(send)._add_(receiver);
  402. _st(arguments)._do_((function(each){
  403. return smalltalk.withContext(function($ctx2) { return _st(send)._add_(each);
  404. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  405. $4=send;
  406. return $4;
  407. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,send:send,all:all,receiver:receiver,arguments:arguments},smalltalk.IRASTTranslator)})},
  408. messageSends: ["new", "selector:", "selector", "index:", "index", "ifTrue:", "classSend:", "superclass", "theClass", "superSend", "aliasTemporally:", ",", "arguments", "receiver", "first", "allButFirst", "add:", "do:"]}),
  409. smalltalk.IRASTTranslator);
  410. smalltalk.addMethod(
  411. "_visitSequenceNode_",
  412. smalltalk.method({
  413. selector: "visitSequenceNode:",
  414. fn: function (aNode){
  415. var self=this;
  416. return smalltalk.withContext(function($ctx1) { var $2,$1;
  417. $1=_st(self)._withSequence_do_(_st((smalltalk.IRSequence || IRSequence))._new(),(function(){
  418. return smalltalk.withContext(function($ctx2) { return _st(_st(aNode)._nodes())._do_((function(each){
  419. var instruction;
  420. return smalltalk.withContext(function($ctx3) { instruction=_st(self)._visit_(each);
  421. instruction;
  422. $2=_st(instruction)._isVariable();
  423. if(! smalltalk.assert($2)){
  424. return _st(_st(self)._sequence())._add_(instruction);
  425. };
  426. }, function($ctx3) {$ctx3.fillBlock({each:each,instruction:instruction},$ctx1)})}));
  427. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  428. return $1;
  429. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  430. messageSends: ["withSequence:do:", "new", "do:", "visit:", "ifFalse:", "add:", "sequence", "isVariable", "nodes"]}),
  431. smalltalk.IRASTTranslator);
  432. smalltalk.addMethod(
  433. "_visitValueNode_",
  434. smalltalk.method({
  435. selector: "visitValueNode:",
  436. fn: function (aNode){
  437. var self=this;
  438. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  439. $2=_st((smalltalk.IRValue || IRValue))._new();
  440. _st($2)._value_(_st(aNode)._value());
  441. $3=_st($2)._yourself();
  442. $1=$3;
  443. return $1;
  444. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  445. messageSends: ["value:", "value", "new", "yourself"]}),
  446. smalltalk.IRASTTranslator);
  447. smalltalk.addMethod(
  448. "_visitVariableNode_",
  449. smalltalk.method({
  450. selector: "visitVariableNode:",
  451. fn: function (aNode){
  452. var self=this;
  453. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  454. $2=_st((smalltalk.IRVariable || IRVariable))._new();
  455. _st($2)._variable_(_st(aNode)._binding());
  456. $3=_st($2)._yourself();
  457. $1=$3;
  458. return $1;
  459. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  460. messageSends: ["variable:", "binding", "new", "yourself"]}),
  461. smalltalk.IRASTTranslator);
  462. smalltalk.addMethod(
  463. "_withSequence_do_",
  464. smalltalk.method({
  465. selector: "withSequence:do:",
  466. fn: function (aSequence,aBlock){
  467. var self=this;
  468. var outerSequence;
  469. return smalltalk.withContext(function($ctx1) { var $1;
  470. outerSequence=_st(self)._sequence();
  471. _st(self)._sequence_(aSequence);
  472. _st(aBlock)._value();
  473. _st(self)._sequence_(outerSequence);
  474. $1=aSequence;
  475. return $1;
  476. }, function($ctx1) {$ctx1.fill(self,"withSequence:do:",{aSequence:aSequence,aBlock:aBlock,outerSequence:outerSequence},smalltalk.IRASTTranslator)})},
  477. messageSends: ["sequence", "sequence:", "value"]}),
  478. smalltalk.IRASTTranslator);
  479. smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler-IR');
  480. smalltalk.addMethod(
  481. "_accept_",
  482. smalltalk.method({
  483. selector: "accept:",
  484. fn: function (aVisitor){
  485. var self=this;
  486. return smalltalk.withContext(function($ctx1) { var $1;
  487. $1=_st(aVisitor)._visitIRInstruction_(self);
  488. return $1;
  489. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRInstruction)})},
  490. messageSends: ["visitIRInstruction:"]}),
  491. smalltalk.IRInstruction);
  492. smalltalk.addMethod(
  493. "_add_",
  494. smalltalk.method({
  495. selector: "add:",
  496. fn: function (anObject){
  497. var self=this;
  498. return smalltalk.withContext(function($ctx1) { var $1;
  499. _st(anObject)._parent_(self);
  500. $1=_st(_st(self)._instructions())._add_(anObject);
  501. return $1;
  502. }, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.IRInstruction)})},
  503. messageSends: ["parent:", "add:", "instructions"]}),
  504. smalltalk.IRInstruction);
  505. smalltalk.addMethod(
  506. "_canBeAssigned",
  507. smalltalk.method({
  508. selector: "canBeAssigned",
  509. fn: function (){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) { return true;
  512. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{},smalltalk.IRInstruction)})},
  513. messageSends: []}),
  514. smalltalk.IRInstruction);
  515. smalltalk.addMethod(
  516. "_instructions",
  517. smalltalk.method({
  518. selector: "instructions",
  519. fn: function (){
  520. var self=this;
  521. return smalltalk.withContext(function($ctx1) { var $2,$1;
  522. $2=self["@instructions"];
  523. if(($receiver = $2) == nil || $receiver == undefined){
  524. self["@instructions"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  525. $1=self["@instructions"];
  526. } else {
  527. $1=$2;
  528. };
  529. return $1;
  530. }, function($ctx1) {$ctx1.fill(self,"instructions",{},smalltalk.IRInstruction)})},
  531. messageSends: ["ifNil:", "new"]}),
  532. smalltalk.IRInstruction);
  533. smalltalk.addMethod(
  534. "_isClosure",
  535. smalltalk.method({
  536. selector: "isClosure",
  537. fn: function (){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx1) { return false;
  540. }, function($ctx1) {$ctx1.fill(self,"isClosure",{},smalltalk.IRInstruction)})},
  541. messageSends: []}),
  542. smalltalk.IRInstruction);
  543. smalltalk.addMethod(
  544. "_isInlined",
  545. smalltalk.method({
  546. selector: "isInlined",
  547. fn: function (){
  548. var self=this;
  549. return smalltalk.withContext(function($ctx1) { return false;
  550. }, function($ctx1) {$ctx1.fill(self,"isInlined",{},smalltalk.IRInstruction)})},
  551. messageSends: []}),
  552. smalltalk.IRInstruction);
  553. smalltalk.addMethod(
  554. "_isLocalReturn",
  555. smalltalk.method({
  556. selector: "isLocalReturn",
  557. fn: function (){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) { return false;
  560. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRInstruction)})},
  561. messageSends: []}),
  562. smalltalk.IRInstruction);
  563. smalltalk.addMethod(
  564. "_isMethod",
  565. smalltalk.method({
  566. selector: "isMethod",
  567. fn: function (){
  568. var self=this;
  569. return smalltalk.withContext(function($ctx1) { return false;
  570. }, function($ctx1) {$ctx1.fill(self,"isMethod",{},smalltalk.IRInstruction)})},
  571. messageSends: []}),
  572. smalltalk.IRInstruction);
  573. smalltalk.addMethod(
  574. "_isReturn",
  575. smalltalk.method({
  576. selector: "isReturn",
  577. fn: function (){
  578. var self=this;
  579. return smalltalk.withContext(function($ctx1) { return false;
  580. }, function($ctx1) {$ctx1.fill(self,"isReturn",{},smalltalk.IRInstruction)})},
  581. messageSends: []}),
  582. smalltalk.IRInstruction);
  583. smalltalk.addMethod(
  584. "_isSend",
  585. smalltalk.method({
  586. selector: "isSend",
  587. fn: function (){
  588. var self=this;
  589. return smalltalk.withContext(function($ctx1) { return false;
  590. }, function($ctx1) {$ctx1.fill(self,"isSend",{},smalltalk.IRInstruction)})},
  591. messageSends: []}),
  592. smalltalk.IRInstruction);
  593. smalltalk.addMethod(
  594. "_isSequence",
  595. smalltalk.method({
  596. selector: "isSequence",
  597. fn: function (){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) { return false;
  600. }, function($ctx1) {$ctx1.fill(self,"isSequence",{},smalltalk.IRInstruction)})},
  601. messageSends: []}),
  602. smalltalk.IRInstruction);
  603. smalltalk.addMethod(
  604. "_isTempDeclaration",
  605. smalltalk.method({
  606. selector: "isTempDeclaration",
  607. fn: function (){
  608. var self=this;
  609. return smalltalk.withContext(function($ctx1) { return false;
  610. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{},smalltalk.IRInstruction)})},
  611. messageSends: []}),
  612. smalltalk.IRInstruction);
  613. smalltalk.addMethod(
  614. "_isVariable",
  615. smalltalk.method({
  616. selector: "isVariable",
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) { return false;
  620. }, function($ctx1) {$ctx1.fill(self,"isVariable",{},smalltalk.IRInstruction)})},
  621. messageSends: []}),
  622. smalltalk.IRInstruction);
  623. smalltalk.addMethod(
  624. "_method",
  625. smalltalk.method({
  626. selector: "method",
  627. fn: function (){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx1) { var $1;
  630. $1=_st(_st(self)._parent())._method();
  631. return $1;
  632. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRInstruction)})},
  633. messageSends: ["method", "parent"]}),
  634. smalltalk.IRInstruction);
  635. smalltalk.addMethod(
  636. "_parent",
  637. smalltalk.method({
  638. selector: "parent",
  639. fn: function (){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) { var $1;
  642. $1=self["@parent"];
  643. return $1;
  644. }, function($ctx1) {$ctx1.fill(self,"parent",{},smalltalk.IRInstruction)})},
  645. messageSends: []}),
  646. smalltalk.IRInstruction);
  647. smalltalk.addMethod(
  648. "_parent_",
  649. smalltalk.method({
  650. selector: "parent:",
  651. fn: function (anIRInstruction){
  652. var self=this;
  653. return smalltalk.withContext(function($ctx1) { self["@parent"]=anIRInstruction;
  654. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  655. messageSends: []}),
  656. smalltalk.IRInstruction);
  657. smalltalk.addMethod(
  658. "_remove",
  659. smalltalk.method({
  660. selector: "remove",
  661. fn: function (){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._remove_(self);
  664. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.IRInstruction)})},
  665. messageSends: ["remove:", "parent"]}),
  666. smalltalk.IRInstruction);
  667. smalltalk.addMethod(
  668. "_remove_",
  669. smalltalk.method({
  670. selector: "remove:",
  671. fn: function (anIRInstruction){
  672. var self=this;
  673. return smalltalk.withContext(function($ctx1) { _st(_st(self)._instructions())._remove_(anIRInstruction);
  674. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  675. messageSends: ["remove:", "instructions"]}),
  676. smalltalk.IRInstruction);
  677. smalltalk.addMethod(
  678. "_replace_with_",
  679. smalltalk.method({
  680. selector: "replace:with:",
  681. fn: function (anIRInstruction,anotherIRInstruction){
  682. var self=this;
  683. return smalltalk.withContext(function($ctx1) { _st(anotherIRInstruction)._parent_(self);
  684. _st(_st(self)._instructions())._at_put_(_st(_st(self)._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
  685. return self}, function($ctx1) {$ctx1.fill(self,"replace:with:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction},smalltalk.IRInstruction)})},
  686. messageSends: ["parent:", "at:put:", "indexOf:", "instructions"]}),
  687. smalltalk.IRInstruction);
  688. smalltalk.addMethod(
  689. "_replaceWith_",
  690. smalltalk.method({
  691. selector: "replaceWith:",
  692. fn: function (anIRInstruction){
  693. var self=this;
  694. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._replace_with_(self,anIRInstruction);
  695. return self}, function($ctx1) {$ctx1.fill(self,"replaceWith:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  696. messageSends: ["replace:with:", "parent"]}),
  697. smalltalk.IRInstruction);
  698. smalltalk.addMethod(
  699. "_on_",
  700. smalltalk.method({
  701. selector: "on:",
  702. fn: function (aBuilder){
  703. var self=this;
  704. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  705. $2=_st(self)._new();
  706. _st($2)._builder_(aBuilder);
  707. $3=_st($2)._yourself();
  708. $1=$3;
  709. return $1;
  710. }, function($ctx1) {$ctx1.fill(self,"on:",{aBuilder:aBuilder},smalltalk.IRInstruction.klass)})},
  711. messageSends: ["builder:", "new", "yourself"]}),
  712. smalltalk.IRInstruction.klass);
  713. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  714. smalltalk.addMethod(
  715. "_accept_",
  716. smalltalk.method({
  717. selector: "accept:",
  718. fn: function (aVisitor){
  719. var self=this;
  720. return smalltalk.withContext(function($ctx1) { var $1;
  721. $1=_st(aVisitor)._visitIRAssignment_(self);
  722. return $1;
  723. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRAssignment)})},
  724. messageSends: ["visitIRAssignment:"]}),
  725. smalltalk.IRAssignment);
  726. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  727. smalltalk.addMethod(
  728. "_accept_",
  729. smalltalk.method({
  730. selector: "accept:",
  731. fn: function (aVisitor){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx1) { var $1;
  734. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  735. return $1;
  736. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicArray)})},
  737. messageSends: ["visitIRDynamicArray:"]}),
  738. smalltalk.IRDynamicArray);
  739. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  740. smalltalk.addMethod(
  741. "_accept_",
  742. smalltalk.method({
  743. selector: "accept:",
  744. fn: function (aVisitor){
  745. var self=this;
  746. return smalltalk.withContext(function($ctx1) { var $1;
  747. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  748. return $1;
  749. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicDictionary)})},
  750. messageSends: ["visitIRDynamicDictionary:"]}),
  751. smalltalk.IRDynamicDictionary);
  752. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  753. smalltalk.addMethod(
  754. "_scope",
  755. smalltalk.method({
  756. selector: "scope",
  757. fn: function (){
  758. var self=this;
  759. return smalltalk.withContext(function($ctx1) { var $1;
  760. $1=self["@scope"];
  761. return $1;
  762. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.IRScopedInstruction)})},
  763. messageSends: []}),
  764. smalltalk.IRScopedInstruction);
  765. smalltalk.addMethod(
  766. "_scope_",
  767. smalltalk.method({
  768. selector: "scope:",
  769. fn: function (aScope){
  770. var self=this;
  771. return smalltalk.withContext(function($ctx1) { self["@scope"]=aScope;
  772. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRScopedInstruction)})},
  773. messageSends: []}),
  774. smalltalk.IRScopedInstruction);
  775. smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  776. smalltalk.addMethod(
  777. "_arguments",
  778. smalltalk.method({
  779. selector: "arguments",
  780. fn: function (){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx1) { var $2,$1;
  783. $2=self["@arguments"];
  784. if(($receiver = $2) == nil || $receiver == undefined){
  785. $1=[];
  786. } else {
  787. $1=$2;
  788. };
  789. return $1;
  790. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.IRClosureInstruction)})},
  791. messageSends: ["ifNil:"]}),
  792. smalltalk.IRClosureInstruction);
  793. smalltalk.addMethod(
  794. "_arguments_",
  795. smalltalk.method({
  796. selector: "arguments:",
  797. fn: function (aCollection){
  798. var self=this;
  799. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  800. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.IRClosureInstruction)})},
  801. messageSends: []}),
  802. smalltalk.IRClosureInstruction);
  803. smalltalk.addMethod(
  804. "_locals",
  805. smalltalk.method({
  806. selector: "locals",
  807. fn: function (){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  810. $2=_st(_st(self)._arguments())._copy();
  811. _st($2)._addAll_(_st(_st(self)._tempDeclarations())._collect_((function(each){
  812. return smalltalk.withContext(function($ctx2) { return _st(each)._name();
  813. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  814. $3=_st($2)._yourself();
  815. $1=$3;
  816. return $1;
  817. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.IRClosureInstruction)})},
  818. messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"]}),
  819. smalltalk.IRClosureInstruction);
  820. smalltalk.addMethod(
  821. "_scope_",
  822. smalltalk.method({
  823. selector: "scope:",
  824. fn: function (aScope){
  825. var self=this;
  826. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  827. _st(aScope)._instruction_(self);
  828. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRClosureInstruction)})},
  829. messageSends: ["scope:", "instruction:"]}),
  830. smalltalk.IRClosureInstruction);
  831. smalltalk.addMethod(
  832. "_tempDeclarations",
  833. smalltalk.method({
  834. selector: "tempDeclarations",
  835. fn: function (){
  836. var self=this;
  837. return smalltalk.withContext(function($ctx1) { var $1;
  838. $1=_st(_st(self)._instructions())._select_((function(each){
  839. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  840. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  841. return $1;
  842. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{},smalltalk.IRClosureInstruction)})},
  843. messageSends: ["select:", "isTempDeclaration", "instructions"]}),
  844. smalltalk.IRClosureInstruction);
  845. smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
  846. smalltalk.addMethod(
  847. "_accept_",
  848. smalltalk.method({
  849. selector: "accept:",
  850. fn: function (aVisitor){
  851. var self=this;
  852. return smalltalk.withContext(function($ctx1) { var $1;
  853. $1=_st(aVisitor)._visitIRClosure_(self);
  854. return $1;
  855. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRClosure)})},
  856. messageSends: ["visitIRClosure:"]}),
  857. smalltalk.IRClosure);
  858. smalltalk.addMethod(
  859. "_isClosure",
  860. smalltalk.method({
  861. selector: "isClosure",
  862. fn: function (){
  863. var self=this;
  864. return smalltalk.withContext(function($ctx1) { return true;
  865. }, function($ctx1) {$ctx1.fill(self,"isClosure",{},smalltalk.IRClosure)})},
  866. messageSends: []}),
  867. smalltalk.IRClosure);
  868. smalltalk.addMethod(
  869. "_sequence",
  870. smalltalk.method({
  871. selector: "sequence",
  872. fn: function (){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) { var $1;
  875. $1=_st(_st(self)._instructions())._last();
  876. return $1;
  877. }, function($ctx1) {$ctx1.fill(self,"sequence",{},smalltalk.IRClosure)})},
  878. messageSends: ["last", "instructions"]}),
  879. smalltalk.IRClosure);
  880. smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
  881. smalltalk.addMethod(
  882. "_accept_",
  883. smalltalk.method({
  884. selector: "accept:",
  885. fn: function (aVisitor){
  886. var self=this;
  887. return smalltalk.withContext(function($ctx1) { var $1;
  888. $1=_st(aVisitor)._visitIRMethod_(self);
  889. return $1;
  890. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRMethod)})},
  891. messageSends: ["visitIRMethod:"]}),
  892. smalltalk.IRMethod);
  893. smalltalk.addMethod(
  894. "_classReferences",
  895. smalltalk.method({
  896. selector: "classReferences",
  897. fn: function (){
  898. var self=this;
  899. return smalltalk.withContext(function($ctx1) { var $1;
  900. $1=self["@classReferences"];
  901. return $1;
  902. }, function($ctx1) {$ctx1.fill(self,"classReferences",{},smalltalk.IRMethod)})},
  903. messageSends: []}),
  904. smalltalk.IRMethod);
  905. smalltalk.addMethod(
  906. "_classReferences_",
  907. smalltalk.method({
  908. selector: "classReferences:",
  909. fn: function (aCollection){
  910. var self=this;
  911. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  912. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection},smalltalk.IRMethod)})},
  913. messageSends: []}),
  914. smalltalk.IRMethod);
  915. smalltalk.addMethod(
  916. "_internalVariables",
  917. smalltalk.method({
  918. selector: "internalVariables",
  919. fn: function (){
  920. var self=this;
  921. return smalltalk.withContext(function($ctx1) { var $2,$1;
  922. $2=self["@internalVariables"];
  923. if(($receiver = $2) == nil || $receiver == undefined){
  924. self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
  925. $1=self["@internalVariables"];
  926. } else {
  927. $1=$2;
  928. };
  929. return $1;
  930. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{},smalltalk.IRMethod)})},
  931. messageSends: ["ifNil:", "new"]}),
  932. smalltalk.IRMethod);
  933. smalltalk.addMethod(
  934. "_isMethod",
  935. smalltalk.method({
  936. selector: "isMethod",
  937. fn: function (){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) { return true;
  940. }, function($ctx1) {$ctx1.fill(self,"isMethod",{},smalltalk.IRMethod)})},
  941. messageSends: []}),
  942. smalltalk.IRMethod);
  943. smalltalk.addMethod(
  944. "_messageSends",
  945. smalltalk.method({
  946. selector: "messageSends",
  947. fn: function (){
  948. var self=this;
  949. return smalltalk.withContext(function($ctx1) { var $1;
  950. $1=self["@messageSends"];
  951. return $1;
  952. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.IRMethod)})},
  953. messageSends: []}),
  954. smalltalk.IRMethod);
  955. smalltalk.addMethod(
  956. "_messageSends_",
  957. smalltalk.method({
  958. selector: "messageSends:",
  959. fn: function (aCollection){
  960. var self=this;
  961. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  962. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  963. messageSends: []}),
  964. smalltalk.IRMethod);
  965. smalltalk.addMethod(
  966. "_method",
  967. smalltalk.method({
  968. selector: "method",
  969. fn: function (){
  970. var self=this;
  971. return smalltalk.withContext(function($ctx1) { var $1;
  972. $1=self;
  973. return $1;
  974. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRMethod)})},
  975. messageSends: []}),
  976. smalltalk.IRMethod);
  977. smalltalk.addMethod(
  978. "_selector",
  979. smalltalk.method({
  980. selector: "selector",
  981. fn: function (){
  982. var self=this;
  983. return smalltalk.withContext(function($ctx1) { var $1;
  984. $1=self["@selector"];
  985. return $1;
  986. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRMethod)})},
  987. messageSends: []}),
  988. smalltalk.IRMethod);
  989. smalltalk.addMethod(
  990. "_selector_",
  991. smalltalk.method({
  992. selector: "selector:",
  993. fn: function (aString){
  994. var self=this;
  995. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  996. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRMethod)})},
  997. messageSends: []}),
  998. smalltalk.IRMethod);
  999. smalltalk.addMethod(
  1000. "_source",
  1001. smalltalk.method({
  1002. selector: "source",
  1003. fn: function (){
  1004. var self=this;
  1005. return smalltalk.withContext(function($ctx1) { var $1;
  1006. $1=self["@source"];
  1007. return $1;
  1008. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRMethod)})},
  1009. messageSends: []}),
  1010. smalltalk.IRMethod);
  1011. smalltalk.addMethod(
  1012. "_source_",
  1013. smalltalk.method({
  1014. selector: "source:",
  1015. fn: function (aString){
  1016. var self=this;
  1017. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1018. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRMethod)})},
  1019. messageSends: []}),
  1020. smalltalk.IRMethod);
  1021. smalltalk.addMethod(
  1022. "_superSends",
  1023. smalltalk.method({
  1024. selector: "superSends",
  1025. fn: function (){
  1026. var self=this;
  1027. return smalltalk.withContext(function($ctx1) { var $1;
  1028. $1=self["@superSends"];
  1029. return $1;
  1030. }, function($ctx1) {$ctx1.fill(self,"superSends",{},smalltalk.IRMethod)})},
  1031. messageSends: []}),
  1032. smalltalk.IRMethod);
  1033. smalltalk.addMethod(
  1034. "_superSends_",
  1035. smalltalk.method({
  1036. selector: "superSends:",
  1037. fn: function (aCollection){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  1040. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1041. messageSends: []}),
  1042. smalltalk.IRMethod);
  1043. smalltalk.addMethod(
  1044. "_theClass",
  1045. smalltalk.method({
  1046. selector: "theClass",
  1047. fn: function (){
  1048. var self=this;
  1049. return smalltalk.withContext(function($ctx1) { var $1;
  1050. $1=self["@theClass"];
  1051. return $1;
  1052. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.IRMethod)})},
  1053. messageSends: []}),
  1054. smalltalk.IRMethod);
  1055. smalltalk.addMethod(
  1056. "_theClass_",
  1057. smalltalk.method({
  1058. selector: "theClass:",
  1059. fn: function (aClass){
  1060. var self=this;
  1061. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  1062. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.IRMethod)})},
  1063. messageSends: []}),
  1064. smalltalk.IRMethod);
  1065. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1066. smalltalk.addMethod(
  1067. "_accept_",
  1068. smalltalk.method({
  1069. selector: "accept:",
  1070. fn: function (aVisitor){
  1071. var self=this;
  1072. return smalltalk.withContext(function($ctx1) { var $1;
  1073. $1=_st(aVisitor)._visitIRReturn_(self);
  1074. return $1;
  1075. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRReturn)})},
  1076. messageSends: ["visitIRReturn:"]}),
  1077. smalltalk.IRReturn);
  1078. smalltalk.addMethod(
  1079. "_canBeAssigned",
  1080. smalltalk.method({
  1081. selector: "canBeAssigned",
  1082. fn: function (){
  1083. var self=this;
  1084. return smalltalk.withContext(function($ctx1) { return false;
  1085. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{},smalltalk.IRReturn)})},
  1086. messageSends: []}),
  1087. smalltalk.IRReturn);
  1088. smalltalk.addMethod(
  1089. "_isBlockReturn",
  1090. smalltalk.method({
  1091. selector: "isBlockReturn",
  1092. fn: function (){
  1093. var self=this;
  1094. return smalltalk.withContext(function($ctx1) { return false;
  1095. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRReturn)})},
  1096. messageSends: []}),
  1097. smalltalk.IRReturn);
  1098. smalltalk.addMethod(
  1099. "_isLocalReturn",
  1100. smalltalk.method({
  1101. selector: "isLocalReturn",
  1102. fn: function (){
  1103. var self=this;
  1104. return smalltalk.withContext(function($ctx1) { return true;
  1105. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRReturn)})},
  1106. messageSends: []}),
  1107. smalltalk.IRReturn);
  1108. smalltalk.addMethod(
  1109. "_isNonLocalReturn",
  1110. smalltalk.method({
  1111. selector: "isNonLocalReturn",
  1112. fn: function (){
  1113. var self=this;
  1114. return smalltalk.withContext(function($ctx1) { var $1;
  1115. $1=_st(_st(self)._isLocalReturn())._not();
  1116. return $1;
  1117. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn",{},smalltalk.IRReturn)})},
  1118. messageSends: ["not", "isLocalReturn"]}),
  1119. smalltalk.IRReturn);
  1120. smalltalk.addMethod(
  1121. "_isReturn",
  1122. smalltalk.method({
  1123. selector: "isReturn",
  1124. fn: function (){
  1125. var self=this;
  1126. return smalltalk.withContext(function($ctx1) { return true;
  1127. }, function($ctx1) {$ctx1.fill(self,"isReturn",{},smalltalk.IRReturn)})},
  1128. messageSends: []}),
  1129. smalltalk.IRReturn);
  1130. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1131. smalltalk.addMethod(
  1132. "_accept_",
  1133. smalltalk.method({
  1134. selector: "accept:",
  1135. fn: function (aVisitor){
  1136. var self=this;
  1137. return smalltalk.withContext(function($ctx1) { var $1;
  1138. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1139. return $1;
  1140. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockReturn)})},
  1141. messageSends: ["visitIRBlockReturn:"]}),
  1142. smalltalk.IRBlockReturn);
  1143. smalltalk.addMethod(
  1144. "_isBlockReturn",
  1145. smalltalk.method({
  1146. selector: "isBlockReturn",
  1147. fn: function (){
  1148. var self=this;
  1149. return smalltalk.withContext(function($ctx1) { return true;
  1150. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRBlockReturn)})},
  1151. messageSends: []}),
  1152. smalltalk.IRBlockReturn);
  1153. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1154. smalltalk.addMethod(
  1155. "_accept_",
  1156. smalltalk.method({
  1157. selector: "accept:",
  1158. fn: function (aVisitor){
  1159. var self=this;
  1160. return smalltalk.withContext(function($ctx1) { var $1;
  1161. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1162. return $1;
  1163. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRNonLocalReturn)})},
  1164. messageSends: ["visitIRNonLocalReturn:"]}),
  1165. smalltalk.IRNonLocalReturn);
  1166. smalltalk.addMethod(
  1167. "_isLocalReturn",
  1168. smalltalk.method({
  1169. selector: "isLocalReturn",
  1170. fn: function (){
  1171. var self=this;
  1172. return smalltalk.withContext(function($ctx1) { return false;
  1173. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRNonLocalReturn)})},
  1174. messageSends: []}),
  1175. smalltalk.IRNonLocalReturn);
  1176. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1177. smalltalk.addMethod(
  1178. "_accept_",
  1179. smalltalk.method({
  1180. selector: "accept:",
  1181. fn: function (aVisitor){
  1182. var self=this;
  1183. return smalltalk.withContext(function($ctx1) { var $1;
  1184. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1185. return $1;
  1186. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRTempDeclaration)})},
  1187. messageSends: ["visitIRTempDeclaration:"]}),
  1188. smalltalk.IRTempDeclaration);
  1189. smalltalk.addMethod(
  1190. "_isTempDeclaration",
  1191. smalltalk.method({
  1192. selector: "isTempDeclaration",
  1193. fn: function (){
  1194. var self=this;
  1195. return smalltalk.withContext(function($ctx1) { return true;
  1196. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{},smalltalk.IRTempDeclaration)})},
  1197. messageSends: []}),
  1198. smalltalk.IRTempDeclaration);
  1199. smalltalk.addMethod(
  1200. "_name",
  1201. smalltalk.method({
  1202. selector: "name",
  1203. fn: function (){
  1204. var self=this;
  1205. return smalltalk.withContext(function($ctx1) { var $1;
  1206. $1=self["@name"];
  1207. return $1;
  1208. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.IRTempDeclaration)})},
  1209. messageSends: []}),
  1210. smalltalk.IRTempDeclaration);
  1211. smalltalk.addMethod(
  1212. "_name_",
  1213. smalltalk.method({
  1214. selector: "name:",
  1215. fn: function (aString){
  1216. var self=this;
  1217. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  1218. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.IRTempDeclaration)})},
  1219. messageSends: []}),
  1220. smalltalk.IRTempDeclaration);
  1221. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1222. smalltalk.addMethod(
  1223. "_accept_",
  1224. smalltalk.method({
  1225. selector: "accept:",
  1226. fn: function (aVisitor){
  1227. var self=this;
  1228. return smalltalk.withContext(function($ctx1) { var $1;
  1229. $1=_st(aVisitor)._visitIRSend_(self);
  1230. return $1;
  1231. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSend)})},
  1232. messageSends: ["visitIRSend:"]}),
  1233. smalltalk.IRSend);
  1234. smalltalk.addMethod(
  1235. "_classSend",
  1236. smalltalk.method({
  1237. selector: "classSend",
  1238. fn: function (){
  1239. var self=this;
  1240. return smalltalk.withContext(function($ctx1) { var $1;
  1241. $1=self["@classSend"];
  1242. return $1;
  1243. }, function($ctx1) {$ctx1.fill(self,"classSend",{},smalltalk.IRSend)})},
  1244. messageSends: []}),
  1245. smalltalk.IRSend);
  1246. smalltalk.addMethod(
  1247. "_classSend_",
  1248. smalltalk.method({
  1249. selector: "classSend:",
  1250. fn: function (aClass){
  1251. var self=this;
  1252. return smalltalk.withContext(function($ctx1) { self["@classSend"]=aClass;
  1253. return self}, function($ctx1) {$ctx1.fill(self,"classSend:",{aClass:aClass},smalltalk.IRSend)})},
  1254. messageSends: []}),
  1255. smalltalk.IRSend);
  1256. smalltalk.addMethod(
  1257. "_index",
  1258. smalltalk.method({
  1259. selector: "index",
  1260. fn: function (){
  1261. var self=this;
  1262. return smalltalk.withContext(function($ctx1) { var $1;
  1263. $1=self["@index"];
  1264. return $1;
  1265. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.IRSend)})},
  1266. messageSends: []}),
  1267. smalltalk.IRSend);
  1268. smalltalk.addMethod(
  1269. "_index_",
  1270. smalltalk.method({
  1271. selector: "index:",
  1272. fn: function (anInteger){
  1273. var self=this;
  1274. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  1275. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.IRSend)})},
  1276. messageSends: []}),
  1277. smalltalk.IRSend);
  1278. smalltalk.addMethod(
  1279. "_isSend",
  1280. smalltalk.method({
  1281. selector: "isSend",
  1282. fn: function (){
  1283. var self=this;
  1284. return smalltalk.withContext(function($ctx1) { return true;
  1285. }, function($ctx1) {$ctx1.fill(self,"isSend",{},smalltalk.IRSend)})},
  1286. messageSends: []}),
  1287. smalltalk.IRSend);
  1288. smalltalk.addMethod(
  1289. "_javascriptSelector",
  1290. smalltalk.method({
  1291. selector: "javascriptSelector",
  1292. fn: function (){
  1293. var self=this;
  1294. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1295. $2=_st(self)._classSend();
  1296. if(($receiver = $2) == nil || $receiver == undefined){
  1297. $1=_st(_st(self)._selector())._asSelector();
  1298. } else {
  1299. $1=_st(_st(self)._selector())._asSuperSelector();
  1300. };
  1301. return $1;
  1302. }, function($ctx1) {$ctx1.fill(self,"javascriptSelector",{},smalltalk.IRSend)})},
  1303. messageSends: ["ifNil:ifNotNil:", "asSelector", "selector", "asSuperSelector", "classSend"]}),
  1304. smalltalk.IRSend);
  1305. smalltalk.addMethod(
  1306. "_selector",
  1307. smalltalk.method({
  1308. selector: "selector",
  1309. fn: function (){
  1310. var self=this;
  1311. return smalltalk.withContext(function($ctx1) { var $1;
  1312. $1=self["@selector"];
  1313. return $1;
  1314. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRSend)})},
  1315. messageSends: []}),
  1316. smalltalk.IRSend);
  1317. smalltalk.addMethod(
  1318. "_selector_",
  1319. smalltalk.method({
  1320. selector: "selector:",
  1321. fn: function (aString){
  1322. var self=this;
  1323. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1324. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRSend)})},
  1325. messageSends: []}),
  1326. smalltalk.IRSend);
  1327. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1328. smalltalk.addMethod(
  1329. "_accept_",
  1330. smalltalk.method({
  1331. selector: "accept:",
  1332. fn: function (aVisitor){
  1333. var self=this;
  1334. return smalltalk.withContext(function($ctx1) { var $1;
  1335. $1=_st(aVisitor)._visitIRSequence_(self);
  1336. return $1;
  1337. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSequence)})},
  1338. messageSends: ["visitIRSequence:"]}),
  1339. smalltalk.IRSequence);
  1340. smalltalk.addMethod(
  1341. "_isSequence",
  1342. smalltalk.method({
  1343. selector: "isSequence",
  1344. fn: function (){
  1345. var self=this;
  1346. return smalltalk.withContext(function($ctx1) { return true;
  1347. }, function($ctx1) {$ctx1.fill(self,"isSequence",{},smalltalk.IRSequence)})},
  1348. messageSends: []}),
  1349. smalltalk.IRSequence);
  1350. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1351. smalltalk.addMethod(
  1352. "_accept_",
  1353. smalltalk.method({
  1354. selector: "accept:",
  1355. fn: function (aVisitor){
  1356. var self=this;
  1357. return smalltalk.withContext(function($ctx1) { var $1;
  1358. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1359. return $1;
  1360. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockSequence)})},
  1361. messageSends: ["visitIRBlockSequence:"]}),
  1362. smalltalk.IRBlockSequence);
  1363. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1364. smalltalk.addMethod(
  1365. "_accept_",
  1366. smalltalk.method({
  1367. selector: "accept:",
  1368. fn: function (aVisitor){
  1369. var self=this;
  1370. return smalltalk.withContext(function($ctx1) { var $1;
  1371. $1=_st(aVisitor)._visitIRValue_(self);
  1372. return $1;
  1373. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRValue)})},
  1374. messageSends: ["visitIRValue:"]}),
  1375. smalltalk.IRValue);
  1376. smalltalk.addMethod(
  1377. "_value",
  1378. smalltalk.method({
  1379. selector: "value",
  1380. fn: function (){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) { var $1;
  1383. $1=self["@value"];
  1384. return $1;
  1385. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.IRValue)})},
  1386. messageSends: []}),
  1387. smalltalk.IRValue);
  1388. smalltalk.addMethod(
  1389. "_value_",
  1390. smalltalk.method({
  1391. selector: "value:",
  1392. fn: function (aString){
  1393. var self=this;
  1394. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  1395. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.IRValue)})},
  1396. messageSends: []}),
  1397. smalltalk.IRValue);
  1398. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1399. smalltalk.addMethod(
  1400. "_accept_",
  1401. smalltalk.method({
  1402. selector: "accept:",
  1403. fn: function (aVisitor){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx1) { var $1;
  1406. $1=_st(aVisitor)._visitIRVariable_(self);
  1407. return $1;
  1408. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVariable)})},
  1409. messageSends: ["visitIRVariable:"]}),
  1410. smalltalk.IRVariable);
  1411. smalltalk.addMethod(
  1412. "_isVariable",
  1413. smalltalk.method({
  1414. selector: "isVariable",
  1415. fn: function (){
  1416. var self=this;
  1417. return smalltalk.withContext(function($ctx1) { return true;
  1418. }, function($ctx1) {$ctx1.fill(self,"isVariable",{},smalltalk.IRVariable)})},
  1419. messageSends: []}),
  1420. smalltalk.IRVariable);
  1421. smalltalk.addMethod(
  1422. "_variable",
  1423. smalltalk.method({
  1424. selector: "variable",
  1425. fn: function (){
  1426. var self=this;
  1427. return smalltalk.withContext(function($ctx1) { var $1;
  1428. $1=self["@variable"];
  1429. return $1;
  1430. }, function($ctx1) {$ctx1.fill(self,"variable",{},smalltalk.IRVariable)})},
  1431. messageSends: []}),
  1432. smalltalk.IRVariable);
  1433. smalltalk.addMethod(
  1434. "_variable_",
  1435. smalltalk.method({
  1436. selector: "variable:",
  1437. fn: function (aScopeVariable){
  1438. var self=this;
  1439. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  1440. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable},smalltalk.IRVariable)})},
  1441. messageSends: []}),
  1442. smalltalk.IRVariable);
  1443. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1444. smalltalk.addMethod(
  1445. "_accept_",
  1446. smalltalk.method({
  1447. selector: "accept:",
  1448. fn: function (aVisitor){
  1449. var self=this;
  1450. return smalltalk.withContext(function($ctx1) { var $1;
  1451. $1=_st(aVisitor)._visitIRVerbatim_(self);
  1452. return $1;
  1453. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVerbatim)})},
  1454. messageSends: ["visitIRVerbatim:"]}),
  1455. smalltalk.IRVerbatim);
  1456. smalltalk.addMethod(
  1457. "_source",
  1458. smalltalk.method({
  1459. selector: "source",
  1460. fn: function (){
  1461. var self=this;
  1462. return smalltalk.withContext(function($ctx1) { var $1;
  1463. $1=self["@source"];
  1464. return $1;
  1465. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRVerbatim)})},
  1466. messageSends: []}),
  1467. smalltalk.IRVerbatim);
  1468. smalltalk.addMethod(
  1469. "_source_",
  1470. smalltalk.method({
  1471. selector: "source:",
  1472. fn: function (aString){
  1473. var self=this;
  1474. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1475. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRVerbatim)})},
  1476. messageSends: []}),
  1477. smalltalk.IRVerbatim);
  1478. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  1479. smalltalk.addMethod(
  1480. "_visit_",
  1481. smalltalk.method({
  1482. selector: "visit:",
  1483. fn: function (anIRInstruction){
  1484. var self=this;
  1485. return smalltalk.withContext(function($ctx1) { var $1;
  1486. $1=_st(anIRInstruction)._accept_(self);
  1487. return $1;
  1488. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  1489. messageSends: ["accept:"]}),
  1490. smalltalk.IRVisitor);
  1491. smalltalk.addMethod(
  1492. "_visitIRAssignment_",
  1493. smalltalk.method({
  1494. selector: "visitIRAssignment:",
  1495. fn: function (anIRAssignment){
  1496. var self=this;
  1497. return smalltalk.withContext(function($ctx1) { var $1;
  1498. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  1499. return $1;
  1500. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRVisitor)})},
  1501. messageSends: ["visitIRInstruction:"]}),
  1502. smalltalk.IRVisitor);
  1503. smalltalk.addMethod(
  1504. "_visitIRBlockReturn_",
  1505. smalltalk.method({
  1506. selector: "visitIRBlockReturn:",
  1507. fn: function (anIRBlockReturn){
  1508. var self=this;
  1509. return smalltalk.withContext(function($ctx1) { var $1;
  1510. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  1511. return $1;
  1512. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn},smalltalk.IRVisitor)})},
  1513. messageSends: ["visitIRReturn:"]}),
  1514. smalltalk.IRVisitor);
  1515. smalltalk.addMethod(
  1516. "_visitIRBlockSequence_",
  1517. smalltalk.method({
  1518. selector: "visitIRBlockSequence:",
  1519. fn: function (anIRBlockSequence){
  1520. var self=this;
  1521. return smalltalk.withContext(function($ctx1) { var $1;
  1522. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  1523. return $1;
  1524. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence},smalltalk.IRVisitor)})},
  1525. messageSends: ["visitIRSequence:"]}),
  1526. smalltalk.IRVisitor);
  1527. smalltalk.addMethod(
  1528. "_visitIRClosure_",
  1529. smalltalk.method({
  1530. selector: "visitIRClosure:",
  1531. fn: function (anIRClosure){
  1532. var self=this;
  1533. return smalltalk.withContext(function($ctx1) { var $1;
  1534. $1=_st(self)._visitIRInstruction_(anIRClosure);
  1535. return $1;
  1536. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRVisitor)})},
  1537. messageSends: ["visitIRInstruction:"]}),
  1538. smalltalk.IRVisitor);
  1539. smalltalk.addMethod(
  1540. "_visitIRDynamicArray_",
  1541. smalltalk.method({
  1542. selector: "visitIRDynamicArray:",
  1543. fn: function (anIRDynamicArray){
  1544. var self=this;
  1545. return smalltalk.withContext(function($ctx1) { var $1;
  1546. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  1547. return $1;
  1548. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRVisitor)})},
  1549. messageSends: ["visitIRInstruction:"]}),
  1550. smalltalk.IRVisitor);
  1551. smalltalk.addMethod(
  1552. "_visitIRDynamicDictionary_",
  1553. smalltalk.method({
  1554. selector: "visitIRDynamicDictionary:",
  1555. fn: function (anIRDynamicDictionary){
  1556. var self=this;
  1557. return smalltalk.withContext(function($ctx1) { var $1;
  1558. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  1559. return $1;
  1560. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRVisitor)})},
  1561. messageSends: ["visitIRInstruction:"]}),
  1562. smalltalk.IRVisitor);
  1563. smalltalk.addMethod(
  1564. "_visitIRInlinedClosure_",
  1565. smalltalk.method({
  1566. selector: "visitIRInlinedClosure:",
  1567. fn: function (anIRInlinedClosure){
  1568. var self=this;
  1569. return smalltalk.withContext(function($ctx1) { var $1;
  1570. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  1571. return $1;
  1572. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},smalltalk.IRVisitor)})},
  1573. messageSends: ["visitIRClosure:"]}),
  1574. smalltalk.IRVisitor);
  1575. smalltalk.addMethod(
  1576. "_visitIRInlinedSequence_",
  1577. smalltalk.method({
  1578. selector: "visitIRInlinedSequence:",
  1579. fn: function (anIRInlinedSequence){
  1580. var self=this;
  1581. return smalltalk.withContext(function($ctx1) { var $1;
  1582. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  1583. return $1;
  1584. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence},smalltalk.IRVisitor)})},
  1585. messageSends: ["visitIRSequence:"]}),
  1586. smalltalk.IRVisitor);
  1587. smalltalk.addMethod(
  1588. "_visitIRInstruction_",
  1589. smalltalk.method({
  1590. selector: "visitIRInstruction:",
  1591. fn: function (anIRInstruction){
  1592. var self=this;
  1593. return smalltalk.withContext(function($ctx1) { var $1;
  1594. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  1595. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1596. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1597. $1=anIRInstruction;
  1598. return $1;
  1599. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  1600. messageSends: ["do:", "visit:", "instructions"]}),
  1601. smalltalk.IRVisitor);
  1602. smalltalk.addMethod(
  1603. "_visitIRMethod_",
  1604. smalltalk.method({
  1605. selector: "visitIRMethod:",
  1606. fn: function (anIRMethod){
  1607. var self=this;
  1608. return smalltalk.withContext(function($ctx1) { var $1;
  1609. $1=_st(self)._visitIRInstruction_(anIRMethod);
  1610. return $1;
  1611. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRVisitor)})},
  1612. messageSends: ["visitIRInstruction:"]}),
  1613. smalltalk.IRVisitor);
  1614. smalltalk.addMethod(
  1615. "_visitIRNonLocalReturn_",
  1616. smalltalk.method({
  1617. selector: "visitIRNonLocalReturn:",
  1618. fn: function (anIRNonLocalReturn){
  1619. var self=this;
  1620. return smalltalk.withContext(function($ctx1) { var $1;
  1621. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  1622. return $1;
  1623. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRVisitor)})},
  1624. messageSends: ["visitIRInstruction:"]}),
  1625. smalltalk.IRVisitor);
  1626. smalltalk.addMethod(
  1627. "_visitIRNonLocalReturnHandling_",
  1628. smalltalk.method({
  1629. selector: "visitIRNonLocalReturnHandling:",
  1630. fn: function (anIRNonLocalReturnHandling){
  1631. var self=this;
  1632. return smalltalk.withContext(function($ctx1) { var $1;
  1633. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  1634. return $1;
  1635. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling},smalltalk.IRVisitor)})},
  1636. messageSends: ["visitIRInstruction:"]}),
  1637. smalltalk.IRVisitor);
  1638. smalltalk.addMethod(
  1639. "_visitIRReturn_",
  1640. smalltalk.method({
  1641. selector: "visitIRReturn:",
  1642. fn: function (anIRReturn){
  1643. var self=this;
  1644. return smalltalk.withContext(function($ctx1) { var $1;
  1645. $1=_st(self)._visitIRInstruction_(anIRReturn);
  1646. return $1;
  1647. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRVisitor)})},
  1648. messageSends: ["visitIRInstruction:"]}),
  1649. smalltalk.IRVisitor);
  1650. smalltalk.addMethod(
  1651. "_visitIRSend_",
  1652. smalltalk.method({
  1653. selector: "visitIRSend:",
  1654. fn: function (anIRSend){
  1655. var self=this;
  1656. return smalltalk.withContext(function($ctx1) { var $1;
  1657. $1=_st(self)._visitIRInstruction_(anIRSend);
  1658. return $1;
  1659. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRVisitor)})},
  1660. messageSends: ["visitIRInstruction:"]}),
  1661. smalltalk.IRVisitor);
  1662. smalltalk.addMethod(
  1663. "_visitIRSequence_",
  1664. smalltalk.method({
  1665. selector: "visitIRSequence:",
  1666. fn: function (anIRSequence){
  1667. var self=this;
  1668. return smalltalk.withContext(function($ctx1) { var $1;
  1669. $1=_st(self)._visitIRInstruction_(anIRSequence);
  1670. return $1;
  1671. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRVisitor)})},
  1672. messageSends: ["visitIRInstruction:"]}),
  1673. smalltalk.IRVisitor);
  1674. smalltalk.addMethod(
  1675. "_visitIRTempDeclaration_",
  1676. smalltalk.method({
  1677. selector: "visitIRTempDeclaration:",
  1678. fn: function (anIRTempDeclaration){
  1679. var self=this;
  1680. return smalltalk.withContext(function($ctx1) { var $1;
  1681. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  1682. return $1;
  1683. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRVisitor)})},
  1684. messageSends: ["visitIRInstruction:"]}),
  1685. smalltalk.IRVisitor);
  1686. smalltalk.addMethod(
  1687. "_visitIRValue_",
  1688. smalltalk.method({
  1689. selector: "visitIRValue:",
  1690. fn: function (anIRValue){
  1691. var self=this;
  1692. return smalltalk.withContext(function($ctx1) { var $1;
  1693. $1=_st(self)._visitIRInstruction_(anIRValue);
  1694. return $1;
  1695. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRVisitor)})},
  1696. messageSends: ["visitIRInstruction:"]}),
  1697. smalltalk.IRVisitor);
  1698. smalltalk.addMethod(
  1699. "_visitIRVariable_",
  1700. smalltalk.method({
  1701. selector: "visitIRVariable:",
  1702. fn: function (anIRVariable){
  1703. var self=this;
  1704. return smalltalk.withContext(function($ctx1) { var $1;
  1705. $1=_st(self)._visitIRInstruction_(anIRVariable);
  1706. return $1;
  1707. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRVisitor)})},
  1708. messageSends: ["visitIRInstruction:"]}),
  1709. smalltalk.IRVisitor);
  1710. smalltalk.addMethod(
  1711. "_visitIRVerbatim_",
  1712. smalltalk.method({
  1713. selector: "visitIRVerbatim:",
  1714. fn: function (anIRVerbatim){
  1715. var self=this;
  1716. return smalltalk.withContext(function($ctx1) { var $1;
  1717. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  1718. return $1;
  1719. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRVisitor)})},
  1720. messageSends: ["visitIRInstruction:"]}),
  1721. smalltalk.IRVisitor);
  1722. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  1723. smalltalk.addMethod(
  1724. "_contents",
  1725. smalltalk.method({
  1726. selector: "contents",
  1727. fn: function (){
  1728. var self=this;
  1729. return smalltalk.withContext(function($ctx1) { var $1;
  1730. $1=_st(_st(self)._stream())._contents();
  1731. return $1;
  1732. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.IRJSTranslator)})},
  1733. messageSends: ["contents", "stream"]}),
  1734. smalltalk.IRJSTranslator);
  1735. smalltalk.addMethod(
  1736. "_initialize",
  1737. smalltalk.method({
  1738. selector: "initialize",
  1739. fn: function (){
  1740. var self=this;
  1741. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  1742. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  1743. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.IRJSTranslator)})},
  1744. messageSends: ["initialize", "new"]}),
  1745. smalltalk.IRJSTranslator);
  1746. smalltalk.addMethod(
  1747. "_stream",
  1748. smalltalk.method({
  1749. selector: "stream",
  1750. fn: function (){
  1751. var self=this;
  1752. return smalltalk.withContext(function($ctx1) { var $1;
  1753. $1=self["@stream"];
  1754. return $1;
  1755. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.IRJSTranslator)})},
  1756. messageSends: []}),
  1757. smalltalk.IRJSTranslator);
  1758. smalltalk.addMethod(
  1759. "_stream_",
  1760. smalltalk.method({
  1761. selector: "stream:",
  1762. fn: function (aStream){
  1763. var self=this;
  1764. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  1765. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.IRJSTranslator)})},
  1766. messageSends: []}),
  1767. smalltalk.IRJSTranslator);
  1768. smalltalk.addMethod(
  1769. "_visitIRAssignment_",
  1770. smalltalk.method({
  1771. selector: "visitIRAssignment:",
  1772. fn: function (anIRAssignment){
  1773. var self=this;
  1774. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  1775. _st(_st(self)._stream())._nextPutAssignment();
  1776. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  1777. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRJSTranslator)})},
  1778. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"]}),
  1779. smalltalk.IRJSTranslator);
  1780. smalltalk.addMethod(
  1781. "_visitIRClosure_",
  1782. smalltalk.method({
  1783. selector: "visitIRClosure:",
  1784. fn: function (anIRClosure){
  1785. var self=this;
  1786. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  1787. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  1788. return smalltalk.withContext(function($ctx3) { return _st(_st(each)._name())._asVariableName();
  1789. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})})));
  1790. return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  1791. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  1792. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1793. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),_st(anIRClosure)._arguments());
  1794. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRJSTranslator)})},
  1795. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"]}),
  1796. smalltalk.IRJSTranslator);
  1797. smalltalk.addMethod(
  1798. "_visitIRDynamicArray_",
  1799. smalltalk.method({
  1800. selector: "visitIRDynamicArray:",
  1801. fn: function (anIRDynamicArray){
  1802. var self=this;
  1803. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  1804. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  1805. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1806. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1807. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1808. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1809. _st(self["@stream"])._nextPutAll_("]");
  1810. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRJSTranslator)})},
  1811. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"]}),
  1812. smalltalk.IRJSTranslator);
  1813. smalltalk.addMethod(
  1814. "_visitIRDynamicDictionary_",
  1815. smalltalk.method({
  1816. selector: "visitIRDynamicDictionary:",
  1817. fn: function (anIRDynamicDictionary){
  1818. var self=this;
  1819. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  1820. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  1821. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1822. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1823. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1824. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1825. _st(_st(self)._stream())._nextPutAll_("])");
  1826. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRJSTranslator)})},
  1827. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"]}),
  1828. smalltalk.IRJSTranslator);
  1829. smalltalk.addMethod(
  1830. "_visitIRMethod_",
  1831. smalltalk.method({
  1832. selector: "visitIRMethod:",
  1833. fn: function (anIRMethod){
  1834. var self=this;
  1835. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1836. _st(_st(self)._stream())._nextPutMethodDeclaration_with_(anIRMethod,(function(){
  1837. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutFunctionWith_arguments_((function(){
  1838. return smalltalk.withContext(function($ctx3) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  1839. return smalltalk.withContext(function($ctx4) { return _st(_st(each)._name())._asVariableName();
  1840. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})));
  1841. return _st(_st(self)._stream())._nextPutContextFor_during_(anIRMethod,(function(){
  1842. return smalltalk.withContext(function($ctx4) { $1=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  1843. if(smalltalk.assert($1)){
  1844. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  1845. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  1846. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx1)})})));
  1847. };
  1848. $2=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  1849. if(smalltalk.assert($2)){
  1850. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  1851. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1852. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1853. } else {
  1854. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1855. };
  1856. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1857. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),_st(anIRMethod)._arguments());
  1858. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1859. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRJSTranslator)})},
  1860. 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"]}),
  1861. smalltalk.IRJSTranslator);
  1862. smalltalk.addMethod(
  1863. "_visitIRNonLocalReturn_",
  1864. smalltalk.method({
  1865. selector: "visitIRNonLocalReturn:",
  1866. fn: function (anIRNonLocalReturn){
  1867. var self=this;
  1868. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  1869. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  1870. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1871. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRJSTranslator)})},
  1872. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"]}),
  1873. smalltalk.IRJSTranslator);
  1874. smalltalk.addMethod(
  1875. "_visitIRReturn_",
  1876. smalltalk.method({
  1877. selector: "visitIRReturn:",
  1878. fn: function (anIRReturn){
  1879. var self=this;
  1880. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  1881. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  1882. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1883. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRJSTranslator)})},
  1884. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"]}),
  1885. smalltalk.IRJSTranslator);
  1886. smalltalk.addMethod(
  1887. "_visitIRSend_",
  1888. smalltalk.method({
  1889. selector: "visitIRSend:",
  1890. fn: function (anIRSend){
  1891. var self=this;
  1892. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  1893. $1=_st(anIRSend)._classSend();
  1894. if(($receiver = $1) == nil || $receiver == undefined){
  1895. _st(_st(self)._stream())._nextPutAll_("_st(");
  1896. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  1897. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  1898. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  1899. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1900. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1901. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1902. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1903. _st(_st(self)._stream())._nextPutAll_(")");
  1904. } else {
  1905. $2=_st(self)._stream();
  1906. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  1907. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  1908. $3=_st($2)._nextPutAll_("_st(");
  1909. $3;
  1910. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  1911. _st(_st(self)._stream())._nextPutAll_("), [");
  1912. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  1913. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  1914. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1915. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  1916. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1917. _st(_st(self)._stream())._nextPutAll_("])");
  1918. };
  1919. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  1920. messageSends: ["ifNil:ifNotNil:", "nextPutAll:", "stream", "visit:", "first", "instructions", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "asJavascript", "classSend"]}),
  1921. smalltalk.IRJSTranslator);
  1922. smalltalk.addMethod(
  1923. "_visitIRSequence_",
  1924. smalltalk.method({
  1925. selector: "visitIRSequence:",
  1926. fn: function (anIRSequence){
  1927. var self=this;
  1928. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  1929. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  1930. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  1931. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1932. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1933. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRJSTranslator)})},
  1934. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"]}),
  1935. smalltalk.IRJSTranslator);
  1936. smalltalk.addMethod(
  1937. "_visitIRTempDeclaration_",
  1938. smalltalk.method({
  1939. selector: "visitIRTempDeclaration:",
  1940. fn: function (anIRTempDeclaration){
  1941. var self=this;
  1942. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRJSTranslator)})},
  1943. messageSends: []}),
  1944. smalltalk.IRJSTranslator);
  1945. smalltalk.addMethod(
  1946. "_visitIRValue_",
  1947. smalltalk.method({
  1948. selector: "visitIRValue:",
  1949. fn: function (anIRValue){
  1950. var self=this;
  1951. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  1952. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRJSTranslator)})},
  1953. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"]}),
  1954. smalltalk.IRJSTranslator);
  1955. smalltalk.addMethod(
  1956. "_visitIRVariable_",
  1957. smalltalk.method({
  1958. selector: "visitIRVariable:",
  1959. fn: function (anIRVariable){
  1960. var self=this;
  1961. return smalltalk.withContext(function($ctx1) { var $1;
  1962. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  1963. if(smalltalk.assert($1)){
  1964. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  1965. } else {
  1966. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  1967. };
  1968. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRJSTranslator)})},
  1969. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"]}),
  1970. smalltalk.IRJSTranslator);
  1971. smalltalk.addMethod(
  1972. "_visitIRVerbatim_",
  1973. smalltalk.method({
  1974. selector: "visitIRVerbatim:",
  1975. fn: function (anIRVerbatim){
  1976. var self=this;
  1977. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  1978. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  1979. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1980. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRJSTranslator)})},
  1981. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"]}),
  1982. smalltalk.IRJSTranslator);
  1983. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  1984. smalltalk.addMethod(
  1985. "_contents",
  1986. smalltalk.method({
  1987. selector: "contents",
  1988. fn: function (){
  1989. var self=this;
  1990. return smalltalk.withContext(function($ctx1) { var $1;
  1991. $1=_st(self["@stream"])._contents();
  1992. return $1;
  1993. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.JSStream)})},
  1994. messageSends: ["contents"]}),
  1995. smalltalk.JSStream);
  1996. smalltalk.addMethod(
  1997. "_initialize",
  1998. smalltalk.method({
  1999. selector: "initialize",
  2000. fn: function (){
  2001. var self=this;
  2002. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  2003. self["@stream"]=_st("")._writeStream();
  2004. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.JSStream)})},
  2005. messageSends: ["initialize", "writeStream"]}),
  2006. smalltalk.JSStream);
  2007. smalltalk.addMethod(
  2008. "_lf",
  2009. smalltalk.method({
  2010. selector: "lf",
  2011. fn: function (){
  2012. var self=this;
  2013. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  2014. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.JSStream)})},
  2015. messageSends: ["lf"]}),
  2016. smalltalk.JSStream);
  2017. smalltalk.addMethod(
  2018. "_nextPut_",
  2019. smalltalk.method({
  2020. selector: "nextPut:",
  2021. fn: function (aString){
  2022. var self=this;
  2023. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  2024. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.JSStream)})},
  2025. messageSends: ["nextPut:"]}),
  2026. smalltalk.JSStream);
  2027. smalltalk.addMethod(
  2028. "_nextPutAll_",
  2029. smalltalk.method({
  2030. selector: "nextPutAll:",
  2031. fn: function (aString){
  2032. var self=this;
  2033. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  2034. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString},smalltalk.JSStream)})},
  2035. messageSends: ["nextPutAll:"]}),
  2036. smalltalk.JSStream);
  2037. smalltalk.addMethod(
  2038. "_nextPutAssignment",
  2039. smalltalk.method({
  2040. selector: "nextPutAssignment",
  2041. fn: function (){
  2042. var self=this;
  2043. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  2044. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{},smalltalk.JSStream)})},
  2045. messageSends: ["nextPutAll:"]}),
  2046. smalltalk.JSStream);
  2047. smalltalk.addMethod(
  2048. "_nextPutBlockContextFor_during_",
  2049. smalltalk.method({
  2050. selector: "nextPutBlockContextFor:during:",
  2051. fn: function (anIRClosure,aBlock){
  2052. var self=this;
  2053. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2054. $1=self;
  2055. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2056. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2057. _st(aBlock)._value();
  2058. $3=self;
  2059. _st($3)._nextPutAll_(_st(_st("}, function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2060. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  2061. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  2062. return smalltalk.withContext(function($ctx2) { $5=self;
  2063. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2064. _st($5)._nextPutAll_(":");
  2065. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2066. return $6;
  2067. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2068. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2069. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2070. $7=self;
  2071. _st($7)._nextPutAll_("},");
  2072. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._method())._scope())._alias()).__comma(")})"));
  2073. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock},smalltalk.JSStream)})},
  2074. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "do:separatedBy:", "asVariableName", "locals", "method"]}),
  2075. smalltalk.JSStream);
  2076. smalltalk.addMethod(
  2077. "_nextPutClosureWith_arguments_",
  2078. smalltalk.method({
  2079. selector: "nextPutClosureWith:arguments:",
  2080. fn: function (aBlock,anArray){
  2081. var self=this;
  2082. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2083. _st(self["@stream"])._nextPutAll_("(function(");
  2084. _st(anArray)._do_separatedBy_((function(each){
  2085. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2086. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2087. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2088. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2089. $1=self["@stream"];
  2090. _st($1)._nextPutAll_("){");
  2091. $2=_st($1)._lf();
  2092. _st(aBlock)._value();
  2093. _st(self["@stream"])._nextPutAll_("})");
  2094. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2095. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"]}),
  2096. smalltalk.JSStream);
  2097. smalltalk.addMethod(
  2098. "_nextPutContextFor_during_",
  2099. smalltalk.method({
  2100. selector: "nextPutContextFor:during:",
  2101. fn: function (aMethod,aBlock){
  2102. var self=this;
  2103. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2104. $1=self;
  2105. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  2106. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2107. _st(aBlock)._value();
  2108. $3=self;
  2109. _st($3)._nextPutAll_(_st(_st(_st("}, function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  2110. $4=_st($3)._nextPutAll_(_st(_st(".fill(self,").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  2111. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  2112. return smalltalk.withContext(function($ctx2) { $5=self;
  2113. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2114. _st($5)._nextPutAll_(":");
  2115. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2116. return $6;
  2117. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2118. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2119. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2120. $7=self;
  2121. _st($7)._nextPutAll_("},");
  2122. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  2123. $8=_st($7)._nextPutAll_(")})");
  2124. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  2125. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "locals", "theClass"]}),
  2126. smalltalk.JSStream);
  2127. smalltalk.addMethod(
  2128. "_nextPutFunctionWith_arguments_",
  2129. smalltalk.method({
  2130. selector: "nextPutFunctionWith:arguments:",
  2131. fn: function (aBlock,anArray){
  2132. var self=this;
  2133. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2134. _st(self["@stream"])._nextPutAll_("fn: function(");
  2135. _st(anArray)._do_separatedBy_((function(each){
  2136. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2137. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2138. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2139. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2140. $1=self["@stream"];
  2141. _st($1)._nextPutAll_("){");
  2142. $2=_st($1)._lf();
  2143. $3=self["@stream"];
  2144. _st($3)._nextPutAll_("var self=this;");
  2145. $4=_st($3)._lf();
  2146. _st(aBlock)._value();
  2147. _st(self["@stream"])._nextPutAll_("}");
  2148. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2149. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"]}),
  2150. smalltalk.JSStream);
  2151. smalltalk.addMethod(
  2152. "_nextPutIf_with_",
  2153. smalltalk.method({
  2154. selector: "nextPutIf:with:",
  2155. fn: function (aBlock,anotherBlock){
  2156. var self=this;
  2157. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2158. _st(self["@stream"])._nextPutAll_("if(");
  2159. _st(aBlock)._value();
  2160. $1=self["@stream"];
  2161. _st($1)._nextPutAll_("){");
  2162. $2=_st($1)._lf();
  2163. _st(anotherBlock)._value();
  2164. _st(self["@stream"])._nextPutAll_("}");
  2165. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSStream)})},
  2166. messageSends: ["nextPutAll:", "value", "lf"]}),
  2167. smalltalk.JSStream);
  2168. smalltalk.addMethod(
  2169. "_nextPutIfElse_with_with_",
  2170. smalltalk.method({
  2171. selector: "nextPutIfElse:with:with:",
  2172. fn: function (aBlock,ifBlock,elseBlock){
  2173. var self=this;
  2174. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2175. _st(self["@stream"])._nextPutAll_("if(");
  2176. _st(aBlock)._value();
  2177. $1=self["@stream"];
  2178. _st($1)._nextPutAll_("){");
  2179. $2=_st($1)._lf();
  2180. _st(ifBlock)._value();
  2181. $3=self["@stream"];
  2182. _st($3)._nextPutAll_("} else {");
  2183. $4=_st($3)._lf();
  2184. _st(elseBlock)._value();
  2185. _st(self["@stream"])._nextPutAll_("}");
  2186. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},smalltalk.JSStream)})},
  2187. messageSends: ["nextPutAll:", "value", "lf"]}),
  2188. smalltalk.JSStream);
  2189. smalltalk.addMethod(
  2190. "_nextPutMethodDeclaration_with_",
  2191. smalltalk.method({
  2192. selector: "nextPutMethodDeclaration:with:",
  2193. fn: function (aMethod,aBlock){
  2194. var self=this;
  2195. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  2196. $1=self["@stream"];
  2197. _st($1)._nextPutAll_("smalltalk.method({");
  2198. _st($1)._lf();
  2199. _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  2200. _st($1)._lf();
  2201. _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  2202. $2=_st($1)._lf();
  2203. _st(aBlock)._value();
  2204. $3=self["@stream"];
  2205. _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  2206. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  2207. _st($3)._lf();
  2208. _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  2209. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  2210. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asArray())._asJavascript())).__comma(","));
  2211. _st($3)._lf();
  2212. $4=_st($3)._nextPutAll_("referencedClasses: [");
  2213. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  2214. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  2215. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2216. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  2217. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2218. $5=self["@stream"];
  2219. _st($5)._nextPutAll_("]");
  2220. $6=_st($5)._nextPutAll_("})");
  2221. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  2222. messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"]}),
  2223. smalltalk.JSStream);
  2224. smalltalk.addMethod(
  2225. "_nextPutNonLocalReturnHandlingWith_",
  2226. smalltalk.method({
  2227. selector: "nextPutNonLocalReturnHandlingWith:",
  2228. fn: function (aBlock){
  2229. var self=this;
  2230. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2231. $1=self["@stream"];
  2232. _st($1)._nextPutAll_("var $early={};");
  2233. _st($1)._lf();
  2234. _st($1)._nextPutAll_("try {");
  2235. $2=_st($1)._lf();
  2236. _st(aBlock)._value();
  2237. $3=self["@stream"];
  2238. _st($3)._nextPutAll_("}");
  2239. _st($3)._lf();
  2240. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  2241. $4=_st($3)._lf();
  2242. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2243. messageSends: ["nextPutAll:", "lf", "value"]}),
  2244. smalltalk.JSStream);
  2245. smalltalk.addMethod(
  2246. "_nextPutNonLocalReturnWith_",
  2247. smalltalk.method({
  2248. selector: "nextPutNonLocalReturnWith:",
  2249. fn: function (aBlock){
  2250. var self=this;
  2251. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  2252. _st(aBlock)._value();
  2253. _st(self["@stream"])._nextPutAll_("]");
  2254. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2255. messageSends: ["nextPutAll:", "value"]}),
  2256. smalltalk.JSStream);
  2257. smalltalk.addMethod(
  2258. "_nextPutReturn",
  2259. smalltalk.method({
  2260. selector: "nextPutReturn",
  2261. fn: function (){
  2262. var self=this;
  2263. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  2264. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{},smalltalk.JSStream)})},
  2265. messageSends: ["nextPutAll:"]}),
  2266. smalltalk.JSStream);
  2267. smalltalk.addMethod(
  2268. "_nextPutReturnWith_",
  2269. smalltalk.method({
  2270. selector: "nextPutReturnWith:",
  2271. fn: function (aBlock){
  2272. var self=this;
  2273. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  2274. _st(aBlock)._value();
  2275. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2276. messageSends: ["nextPutReturn", "value"]}),
  2277. smalltalk.JSStream);
  2278. smalltalk.addMethod(
  2279. "_nextPutSequenceWith_",
  2280. smalltalk.method({
  2281. selector: "nextPutSequenceWith:",
  2282. fn: function (aBlock){
  2283. var self=this;
  2284. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  2285. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2286. messageSends: ["value"]}),
  2287. smalltalk.JSStream);
  2288. smalltalk.addMethod(
  2289. "_nextPutStatement_with_",
  2290. smalltalk.method({
  2291. selector: "nextPutStatement:with:",
  2292. fn: function (anInteger,aBlock){
  2293. var self=this;
  2294. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2295. $1=self["@stream"];
  2296. _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  2297. $2=_st($1)._lf();
  2298. _st(self)._nextPutStatementWith_(aBlock);
  2299. $3=self["@stream"];
  2300. _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  2301. $4=_st($3)._lf();
  2302. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:",{anInteger:anInteger,aBlock:aBlock},smalltalk.JSStream)})},
  2303. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"]}),
  2304. smalltalk.JSStream);
  2305. smalltalk.addMethod(
  2306. "_nextPutStatementWith_",
  2307. smalltalk.method({
  2308. selector: "nextPutStatementWith:",
  2309. fn: function (aBlock){
  2310. var self=this;
  2311. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2312. _st(aBlock)._value();
  2313. $1=self["@stream"];
  2314. _st($1)._nextPutAll_(";");
  2315. $2=_st($1)._lf();
  2316. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2317. messageSends: ["value", "nextPutAll:", "lf"]}),
  2318. smalltalk.JSStream);
  2319. smalltalk.addMethod(
  2320. "_nextPutVar_",
  2321. smalltalk.method({
  2322. selector: "nextPutVar:",
  2323. fn: function (aString){
  2324. var self=this;
  2325. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2326. $1=self["@stream"];
  2327. _st($1)._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
  2328. $2=_st($1)._lf();
  2329. return self}, function($ctx1) {$ctx1.fill(self,"nextPutVar:",{aString:aString},smalltalk.JSStream)})},
  2330. messageSends: ["nextPutAll:", ",", "lf"]}),
  2331. smalltalk.JSStream);
  2332. smalltalk.addMethod(
  2333. "_nextPutVars_",
  2334. smalltalk.method({
  2335. selector: "nextPutVars:",
  2336. fn: function (aCollection){
  2337. var self=this;
  2338. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2339. var $early={};
  2340. try {
  2341. _st(aCollection)._ifEmpty_((function(){
  2342. return smalltalk.withContext(function($ctx2) { $1=self;
  2343. throw $early=[$1];
  2344. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2345. _st(self["@stream"])._nextPutAll_("var ");
  2346. _st(aCollection)._do_separatedBy_((function(each){
  2347. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  2348. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2349. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  2350. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2351. $2=self["@stream"];
  2352. _st($2)._nextPutAll_(";");
  2353. $3=_st($2)._lf();
  2354. return self}
  2355. catch(e) {if(e===$early)return e[0]; throw e}
  2356. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection},smalltalk.JSStream)})},
  2357. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"]}),
  2358. smalltalk.JSStream);
  2359. smalltalk.addMethod(
  2360. "_appendToInstruction_",
  2361. smalltalk.method({
  2362. selector: "appendToInstruction:",
  2363. fn: function (anIRInstruction){
  2364. var self=this;
  2365. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  2366. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction},smalltalk.BlockClosure)})},
  2367. messageSends: ["appendBlock:"]}),
  2368. smalltalk.BlockClosure);
  2369. smalltalk.addMethod(
  2370. "_asVariableName",
  2371. smalltalk.method({
  2372. selector: "asVariableName",
  2373. fn: function (){
  2374. var self=this;
  2375. return smalltalk.withContext(function($ctx1) { var $2,$1;
  2376. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  2377. if(smalltalk.assert($2)){
  2378. $1=_st(self).__comma("_");
  2379. } else {
  2380. $1=self;
  2381. };
  2382. return $1;
  2383. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{},smalltalk.String)})},
  2384. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"]}),
  2385. smalltalk.String);