1
0

Compiler-IR.deploy.js 90 KB

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