2
0

Compiler-IR.deploy.js 91 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754
  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=self._visit_(aNode);
  17. return $2;
  18. };
  19. $3=_st($IRVariable())._new();
  20. _st($3)._variable_(_st(_st($AliasVar())._new())._name_("$".__comma(self._nextAlias())));
  21. $4=_st($3)._yourself();
  22. variable=$4;
  23. $5=_st($IRAssignment())._new();
  24. _st($5)._add_(variable);
  25. _st($5)._add_(self._visit_(aNode));
  26. $6=_st($5)._yourself();
  27. _st(self._sequence())._add_($6);
  28. _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=self._alias_(each);
  59. } else {
  60. $3=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=self._visit_(_st(aNode)._right());
  187. left=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(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_(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=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(self._sequence())._add_(self._visit_(each));
  246. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
  247. $2=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
  248. if(smalltalk.assert($2)){
  249. return _st(self._sequence())._add_(self._visit_(_st(_st(aNode)._nodes())._last()));
  250. } else {
  251. $3=_st($IRBlockReturn())._new();
  252. _st($3)._add_(self._visit_(_st(_st(aNode)._nodes())._last()));
  253. $4=_st($3)._yourself();
  254. return _st(self._sequence())._add_($4);
  255. };
  256. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  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=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(self._sequence())._add_(self._visit_(each));
  283. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  284. $2=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(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(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(self._source())._crlfSanitized());
  356. _st($1)._theClass_(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. 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(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(self._method())._add_(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(self._method())._add_(_st($IRReturn())._new()))._add_($7);
  383. };
  384. $8=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_(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(self._theClass())._superclass());
  431. };
  432. all=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=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=self._visit_(each);
  459. instruction;
  460. $2=_st(instruction)._isVariable();
  461. if(! smalltalk.assert($2)){
  462. return _st(self._sequence())._add_(instruction);
  463. };
  464. }, function($ctx3) {$ctx3.fillBlock({each:each,instruction:instruction},$ctx2)})}));
  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=self._sequence();
  511. self._sequence_(aSequence);
  512. _st(aBlock)._value();
  513. 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(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(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: "needsBoxingAsReceiver",
  679. fn: function (){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) {
  682. return true;
  683. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRInstruction)})},
  684. messageSends: []}),
  685. smalltalk.IRInstruction);
  686. smalltalk.addMethod(
  687. smalltalk.method({
  688. selector: "parent",
  689. fn: function (){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx1) {
  692. var $1;
  693. $1=self["@parent"];
  694. return $1;
  695. }, function($ctx1) {$ctx1.fill(self,"parent",{},smalltalk.IRInstruction)})},
  696. messageSends: []}),
  697. smalltalk.IRInstruction);
  698. smalltalk.addMethod(
  699. smalltalk.method({
  700. selector: "parent:",
  701. fn: function (anIRInstruction){
  702. var self=this;
  703. return smalltalk.withContext(function($ctx1) {
  704. self["@parent"]=anIRInstruction;
  705. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  706. messageSends: []}),
  707. smalltalk.IRInstruction);
  708. smalltalk.addMethod(
  709. smalltalk.method({
  710. selector: "remove",
  711. fn: function (){
  712. var self=this;
  713. return smalltalk.withContext(function($ctx1) {
  714. _st(self._parent())._remove_(self);
  715. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.IRInstruction)})},
  716. messageSends: ["remove:", "parent"]}),
  717. smalltalk.IRInstruction);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "remove:",
  721. fn: function (anIRInstruction){
  722. var self=this;
  723. return smalltalk.withContext(function($ctx1) {
  724. _st(self._instructions())._remove_(anIRInstruction);
  725. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  726. messageSends: ["remove:", "instructions"]}),
  727. smalltalk.IRInstruction);
  728. smalltalk.addMethod(
  729. smalltalk.method({
  730. selector: "replace:with:",
  731. fn: function (anIRInstruction,anotherIRInstruction){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx1) {
  734. _st(anotherIRInstruction)._parent_(self);
  735. _st(self._instructions())._at_put_(_st(self._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
  736. return self}, function($ctx1) {$ctx1.fill(self,"replace:with:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction},smalltalk.IRInstruction)})},
  737. messageSends: ["parent:", "at:put:", "indexOf:", "instructions"]}),
  738. smalltalk.IRInstruction);
  739. smalltalk.addMethod(
  740. smalltalk.method({
  741. selector: "replaceWith:",
  742. fn: function (anIRInstruction){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. _st(self._parent())._replace_with_(self,anIRInstruction);
  746. return self}, function($ctx1) {$ctx1.fill(self,"replaceWith:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  747. messageSends: ["replace:with:", "parent"]}),
  748. smalltalk.IRInstruction);
  749. smalltalk.addMethod(
  750. smalltalk.method({
  751. selector: "on:",
  752. fn: function (aBuilder){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. var $2,$3,$1;
  756. $2=self._new();
  757. _st($2)._builder_(aBuilder);
  758. $3=_st($2)._yourself();
  759. $1=$3;
  760. return $1;
  761. }, function($ctx1) {$ctx1.fill(self,"on:",{aBuilder:aBuilder},smalltalk.IRInstruction.klass)})},
  762. messageSends: ["builder:", "new", "yourself"]}),
  763. smalltalk.IRInstruction.klass);
  764. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  765. smalltalk.addMethod(
  766. smalltalk.method({
  767. selector: "accept:",
  768. fn: function (aVisitor){
  769. var self=this;
  770. return smalltalk.withContext(function($ctx1) {
  771. var $1;
  772. $1=_st(aVisitor)._visitIRAssignment_(self);
  773. return $1;
  774. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRAssignment)})},
  775. messageSends: ["visitIRAssignment:"]}),
  776. smalltalk.IRAssignment);
  777. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  778. smalltalk.addMethod(
  779. smalltalk.method({
  780. selector: "accept:",
  781. fn: function (aVisitor){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) {
  784. var $1;
  785. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  786. return $1;
  787. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicArray)})},
  788. messageSends: ["visitIRDynamicArray:"]}),
  789. smalltalk.IRDynamicArray);
  790. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  791. smalltalk.addMethod(
  792. smalltalk.method({
  793. selector: "accept:",
  794. fn: function (aVisitor){
  795. var self=this;
  796. return smalltalk.withContext(function($ctx1) {
  797. var $1;
  798. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  799. return $1;
  800. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicDictionary)})},
  801. messageSends: ["visitIRDynamicDictionary:"]}),
  802. smalltalk.IRDynamicDictionary);
  803. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  804. smalltalk.addMethod(
  805. smalltalk.method({
  806. selector: "scope",
  807. fn: function (){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) {
  810. var $1;
  811. $1=self["@scope"];
  812. return $1;
  813. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.IRScopedInstruction)})},
  814. messageSends: []}),
  815. smalltalk.IRScopedInstruction);
  816. smalltalk.addMethod(
  817. smalltalk.method({
  818. selector: "scope:",
  819. fn: function (aScope){
  820. var self=this;
  821. return smalltalk.withContext(function($ctx1) {
  822. self["@scope"]=aScope;
  823. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRScopedInstruction)})},
  824. messageSends: []}),
  825. smalltalk.IRScopedInstruction);
  826. smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  827. smalltalk.addMethod(
  828. smalltalk.method({
  829. selector: "arguments",
  830. fn: function (){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) {
  833. var $2,$1;
  834. $2=self["@arguments"];
  835. if(($receiver = $2) == nil || $receiver == undefined){
  836. $1=[];
  837. } else {
  838. $1=$2;
  839. };
  840. return $1;
  841. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.IRClosureInstruction)})},
  842. messageSends: ["ifNil:"]}),
  843. smalltalk.IRClosureInstruction);
  844. smalltalk.addMethod(
  845. smalltalk.method({
  846. selector: "arguments:",
  847. fn: function (aCollection){
  848. var self=this;
  849. return smalltalk.withContext(function($ctx1) {
  850. self["@arguments"]=aCollection;
  851. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.IRClosureInstruction)})},
  852. messageSends: []}),
  853. smalltalk.IRClosureInstruction);
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "locals",
  857. fn: function (){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) {
  860. var $2,$3,$1;
  861. $2=_st(self._arguments())._copy();
  862. _st($2)._addAll_(_st(self._tempDeclarations())._collect_((function(each){
  863. return smalltalk.withContext(function($ctx2) {
  864. return _st(each)._name();
  865. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  866. $3=_st($2)._yourself();
  867. $1=$3;
  868. return $1;
  869. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.IRClosureInstruction)})},
  870. messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"]}),
  871. smalltalk.IRClosureInstruction);
  872. smalltalk.addMethod(
  873. smalltalk.method({
  874. selector: "scope:",
  875. fn: function (aScope){
  876. var self=this;
  877. return smalltalk.withContext(function($ctx1) {
  878. smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  879. _st(aScope)._instruction_(self);
  880. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRClosureInstruction)})},
  881. messageSends: ["scope:", "instruction:"]}),
  882. smalltalk.IRClosureInstruction);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "tempDeclarations",
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) {
  889. var $1;
  890. $1=_st(self._instructions())._select_((function(each){
  891. return smalltalk.withContext(function($ctx2) {
  892. return _st(each)._isTempDeclaration();
  893. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  894. return $1;
  895. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{},smalltalk.IRClosureInstruction)})},
  896. messageSends: ["select:", "isTempDeclaration", "instructions"]}),
  897. smalltalk.IRClosureInstruction);
  898. smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "accept:",
  902. fn: function (aVisitor){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) {
  905. var $1;
  906. $1=_st(aVisitor)._visitIRClosure_(self);
  907. return $1;
  908. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRClosure)})},
  909. messageSends: ["visitIRClosure:"]}),
  910. smalltalk.IRClosure);
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "isClosure",
  914. fn: function (){
  915. var self=this;
  916. return smalltalk.withContext(function($ctx1) {
  917. return true;
  918. }, function($ctx1) {$ctx1.fill(self,"isClosure",{},smalltalk.IRClosure)})},
  919. messageSends: []}),
  920. smalltalk.IRClosure);
  921. smalltalk.addMethod(
  922. smalltalk.method({
  923. selector: "sequence",
  924. fn: function (){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) {
  927. var $1;
  928. $1=_st(self._instructions())._last();
  929. return $1;
  930. }, function($ctx1) {$ctx1.fill(self,"sequence",{},smalltalk.IRClosure)})},
  931. messageSends: ["last", "instructions"]}),
  932. smalltalk.IRClosure);
  933. smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
  934. smalltalk.addMethod(
  935. smalltalk.method({
  936. selector: "accept:",
  937. fn: function (aVisitor){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) {
  940. var $1;
  941. $1=_st(aVisitor)._visitIRMethod_(self);
  942. return $1;
  943. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRMethod)})},
  944. messageSends: ["visitIRMethod:"]}),
  945. smalltalk.IRMethod);
  946. smalltalk.addMethod(
  947. smalltalk.method({
  948. selector: "classReferences",
  949. fn: function (){
  950. var self=this;
  951. return smalltalk.withContext(function($ctx1) {
  952. var $1;
  953. $1=self["@classReferences"];
  954. return $1;
  955. }, function($ctx1) {$ctx1.fill(self,"classReferences",{},smalltalk.IRMethod)})},
  956. messageSends: []}),
  957. smalltalk.IRMethod);
  958. smalltalk.addMethod(
  959. smalltalk.method({
  960. selector: "classReferences:",
  961. fn: function (aCollection){
  962. var self=this;
  963. return smalltalk.withContext(function($ctx1) {
  964. self["@classReferences"]=aCollection;
  965. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection},smalltalk.IRMethod)})},
  966. messageSends: []}),
  967. smalltalk.IRMethod);
  968. smalltalk.addMethod(
  969. smalltalk.method({
  970. selector: "internalVariables",
  971. fn: function (){
  972. var self=this;
  973. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  974. return smalltalk.withContext(function($ctx1) {
  975. var $2,$1;
  976. $2=self["@internalVariables"];
  977. if(($receiver = $2) == nil || $receiver == undefined){
  978. self["@internalVariables"]=_st($Set())._new();
  979. $1=self["@internalVariables"];
  980. } else {
  981. $1=$2;
  982. };
  983. return $1;
  984. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{},smalltalk.IRMethod)})},
  985. messageSends: ["ifNil:", "new"]}),
  986. smalltalk.IRMethod);
  987. smalltalk.addMethod(
  988. smalltalk.method({
  989. selector: "isMethod",
  990. fn: function (){
  991. var self=this;
  992. return smalltalk.withContext(function($ctx1) {
  993. return true;
  994. }, function($ctx1) {$ctx1.fill(self,"isMethod",{},smalltalk.IRMethod)})},
  995. messageSends: []}),
  996. smalltalk.IRMethod);
  997. smalltalk.addMethod(
  998. smalltalk.method({
  999. selector: "messageSends",
  1000. fn: function (){
  1001. var self=this;
  1002. return smalltalk.withContext(function($ctx1) {
  1003. var $1;
  1004. $1=self["@messageSends"];
  1005. return $1;
  1006. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.IRMethod)})},
  1007. messageSends: []}),
  1008. smalltalk.IRMethod);
  1009. smalltalk.addMethod(
  1010. smalltalk.method({
  1011. selector: "messageSends:",
  1012. fn: function (aCollection){
  1013. var self=this;
  1014. return smalltalk.withContext(function($ctx1) {
  1015. self["@messageSends"]=aCollection;
  1016. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1017. messageSends: []}),
  1018. smalltalk.IRMethod);
  1019. smalltalk.addMethod(
  1020. smalltalk.method({
  1021. selector: "method",
  1022. fn: function (){
  1023. var self=this;
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1;
  1026. $1=self;
  1027. return $1;
  1028. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRMethod)})},
  1029. messageSends: []}),
  1030. smalltalk.IRMethod);
  1031. smalltalk.addMethod(
  1032. smalltalk.method({
  1033. selector: "selector",
  1034. fn: function (){
  1035. var self=this;
  1036. return smalltalk.withContext(function($ctx1) {
  1037. var $1;
  1038. $1=self["@selector"];
  1039. return $1;
  1040. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRMethod)})},
  1041. messageSends: []}),
  1042. smalltalk.IRMethod);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "selector:",
  1046. fn: function (aString){
  1047. var self=this;
  1048. return smalltalk.withContext(function($ctx1) {
  1049. self["@selector"]=aString;
  1050. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRMethod)})},
  1051. messageSends: []}),
  1052. smalltalk.IRMethod);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "source",
  1056. fn: function (){
  1057. var self=this;
  1058. return smalltalk.withContext(function($ctx1) {
  1059. var $1;
  1060. $1=self["@source"];
  1061. return $1;
  1062. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRMethod)})},
  1063. messageSends: []}),
  1064. smalltalk.IRMethod);
  1065. smalltalk.addMethod(
  1066. smalltalk.method({
  1067. selector: "source:",
  1068. fn: function (aString){
  1069. var self=this;
  1070. return smalltalk.withContext(function($ctx1) {
  1071. self["@source"]=aString;
  1072. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRMethod)})},
  1073. messageSends: []}),
  1074. smalltalk.IRMethod);
  1075. smalltalk.addMethod(
  1076. smalltalk.method({
  1077. selector: "superSends",
  1078. fn: function (){
  1079. var self=this;
  1080. return smalltalk.withContext(function($ctx1) {
  1081. var $1;
  1082. $1=self["@superSends"];
  1083. return $1;
  1084. }, function($ctx1) {$ctx1.fill(self,"superSends",{},smalltalk.IRMethod)})},
  1085. messageSends: []}),
  1086. smalltalk.IRMethod);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "superSends:",
  1090. fn: function (aCollection){
  1091. var self=this;
  1092. return smalltalk.withContext(function($ctx1) {
  1093. self["@superSends"]=aCollection;
  1094. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1095. messageSends: []}),
  1096. smalltalk.IRMethod);
  1097. smalltalk.addMethod(
  1098. smalltalk.method({
  1099. selector: "theClass",
  1100. fn: function (){
  1101. var self=this;
  1102. return smalltalk.withContext(function($ctx1) {
  1103. var $1;
  1104. $1=self["@theClass"];
  1105. return $1;
  1106. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.IRMethod)})},
  1107. messageSends: []}),
  1108. smalltalk.IRMethod);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "theClass:",
  1112. fn: function (aClass){
  1113. var self=this;
  1114. return smalltalk.withContext(function($ctx1) {
  1115. self["@theClass"]=aClass;
  1116. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.IRMethod)})},
  1117. messageSends: []}),
  1118. smalltalk.IRMethod);
  1119. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1120. smalltalk.addMethod(
  1121. smalltalk.method({
  1122. selector: "accept:",
  1123. fn: function (aVisitor){
  1124. var self=this;
  1125. return smalltalk.withContext(function($ctx1) {
  1126. var $1;
  1127. $1=_st(aVisitor)._visitIRReturn_(self);
  1128. return $1;
  1129. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRReturn)})},
  1130. messageSends: ["visitIRReturn:"]}),
  1131. smalltalk.IRReturn);
  1132. smalltalk.addMethod(
  1133. smalltalk.method({
  1134. selector: "canBeAssigned",
  1135. fn: function (){
  1136. var self=this;
  1137. return smalltalk.withContext(function($ctx1) {
  1138. return false;
  1139. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{},smalltalk.IRReturn)})},
  1140. messageSends: []}),
  1141. smalltalk.IRReturn);
  1142. smalltalk.addMethod(
  1143. smalltalk.method({
  1144. selector: "isBlockReturn",
  1145. fn: function (){
  1146. var self=this;
  1147. return smalltalk.withContext(function($ctx1) {
  1148. return false;
  1149. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRReturn)})},
  1150. messageSends: []}),
  1151. smalltalk.IRReturn);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "isLocalReturn",
  1155. fn: function (){
  1156. var self=this;
  1157. return smalltalk.withContext(function($ctx1) {
  1158. return true;
  1159. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRReturn)})},
  1160. messageSends: []}),
  1161. smalltalk.IRReturn);
  1162. smalltalk.addMethod(
  1163. smalltalk.method({
  1164. selector: "isNonLocalReturn",
  1165. fn: function (){
  1166. var self=this;
  1167. return smalltalk.withContext(function($ctx1) {
  1168. var $1;
  1169. $1=_st(self._isLocalReturn())._not();
  1170. return $1;
  1171. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn",{},smalltalk.IRReturn)})},
  1172. messageSends: ["not", "isLocalReturn"]}),
  1173. smalltalk.IRReturn);
  1174. smalltalk.addMethod(
  1175. smalltalk.method({
  1176. selector: "isReturn",
  1177. fn: function (){
  1178. var self=this;
  1179. return smalltalk.withContext(function($ctx1) {
  1180. return true;
  1181. }, function($ctx1) {$ctx1.fill(self,"isReturn",{},smalltalk.IRReturn)})},
  1182. messageSends: []}),
  1183. smalltalk.IRReturn);
  1184. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1185. smalltalk.addMethod(
  1186. smalltalk.method({
  1187. selector: "accept:",
  1188. fn: function (aVisitor){
  1189. var self=this;
  1190. return smalltalk.withContext(function($ctx1) {
  1191. var $1;
  1192. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1193. return $1;
  1194. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockReturn)})},
  1195. messageSends: ["visitIRBlockReturn:"]}),
  1196. smalltalk.IRBlockReturn);
  1197. smalltalk.addMethod(
  1198. smalltalk.method({
  1199. selector: "isBlockReturn",
  1200. fn: function (){
  1201. var self=this;
  1202. return smalltalk.withContext(function($ctx1) {
  1203. return true;
  1204. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRBlockReturn)})},
  1205. messageSends: []}),
  1206. smalltalk.IRBlockReturn);
  1207. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1208. smalltalk.addMethod(
  1209. smalltalk.method({
  1210. selector: "accept:",
  1211. fn: function (aVisitor){
  1212. var self=this;
  1213. return smalltalk.withContext(function($ctx1) {
  1214. var $1;
  1215. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1216. return $1;
  1217. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRNonLocalReturn)})},
  1218. messageSends: ["visitIRNonLocalReturn:"]}),
  1219. smalltalk.IRNonLocalReturn);
  1220. smalltalk.addMethod(
  1221. smalltalk.method({
  1222. selector: "isLocalReturn",
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) {
  1226. return false;
  1227. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRNonLocalReturn)})},
  1228. messageSends: []}),
  1229. smalltalk.IRNonLocalReturn);
  1230. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1231. smalltalk.addMethod(
  1232. smalltalk.method({
  1233. selector: "accept:",
  1234. fn: function (aVisitor){
  1235. var self=this;
  1236. return smalltalk.withContext(function($ctx1) {
  1237. var $1;
  1238. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1239. return $1;
  1240. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRTempDeclaration)})},
  1241. messageSends: ["visitIRTempDeclaration:"]}),
  1242. smalltalk.IRTempDeclaration);
  1243. smalltalk.addMethod(
  1244. smalltalk.method({
  1245. selector: "isTempDeclaration",
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. return true;
  1250. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{},smalltalk.IRTempDeclaration)})},
  1251. messageSends: []}),
  1252. smalltalk.IRTempDeclaration);
  1253. smalltalk.addMethod(
  1254. smalltalk.method({
  1255. selector: "name",
  1256. fn: function (){
  1257. var self=this;
  1258. return smalltalk.withContext(function($ctx1) {
  1259. var $1;
  1260. $1=self["@name"];
  1261. return $1;
  1262. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.IRTempDeclaration)})},
  1263. messageSends: []}),
  1264. smalltalk.IRTempDeclaration);
  1265. smalltalk.addMethod(
  1266. smalltalk.method({
  1267. selector: "name:",
  1268. fn: function (aString){
  1269. var self=this;
  1270. return smalltalk.withContext(function($ctx1) {
  1271. self["@name"]=aString;
  1272. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.IRTempDeclaration)})},
  1273. messageSends: []}),
  1274. smalltalk.IRTempDeclaration);
  1275. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1276. smalltalk.addMethod(
  1277. smalltalk.method({
  1278. selector: "accept:",
  1279. fn: function (aVisitor){
  1280. var self=this;
  1281. return smalltalk.withContext(function($ctx1) {
  1282. var $1;
  1283. $1=_st(aVisitor)._visitIRSend_(self);
  1284. return $1;
  1285. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSend)})},
  1286. messageSends: ["visitIRSend:"]}),
  1287. smalltalk.IRSend);
  1288. smalltalk.addMethod(
  1289. smalltalk.method({
  1290. selector: "classSend",
  1291. fn: function (){
  1292. var self=this;
  1293. return smalltalk.withContext(function($ctx1) {
  1294. var $1;
  1295. $1=self["@classSend"];
  1296. return $1;
  1297. }, function($ctx1) {$ctx1.fill(self,"classSend",{},smalltalk.IRSend)})},
  1298. messageSends: []}),
  1299. smalltalk.IRSend);
  1300. smalltalk.addMethod(
  1301. smalltalk.method({
  1302. selector: "classSend:",
  1303. fn: function (aClass){
  1304. var self=this;
  1305. return smalltalk.withContext(function($ctx1) {
  1306. self["@classSend"]=aClass;
  1307. return self}, function($ctx1) {$ctx1.fill(self,"classSend:",{aClass:aClass},smalltalk.IRSend)})},
  1308. messageSends: []}),
  1309. smalltalk.IRSend);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "index",
  1313. fn: function (){
  1314. var self=this;
  1315. return smalltalk.withContext(function($ctx1) {
  1316. var $1;
  1317. $1=self["@index"];
  1318. return $1;
  1319. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.IRSend)})},
  1320. messageSends: []}),
  1321. smalltalk.IRSend);
  1322. smalltalk.addMethod(
  1323. smalltalk.method({
  1324. selector: "index:",
  1325. fn: function (anInteger){
  1326. var self=this;
  1327. return smalltalk.withContext(function($ctx1) {
  1328. self["@index"]=anInteger;
  1329. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.IRSend)})},
  1330. messageSends: []}),
  1331. smalltalk.IRSend);
  1332. smalltalk.addMethod(
  1333. smalltalk.method({
  1334. selector: "isSend",
  1335. fn: function (){
  1336. var self=this;
  1337. return smalltalk.withContext(function($ctx1) {
  1338. return true;
  1339. }, function($ctx1) {$ctx1.fill(self,"isSend",{},smalltalk.IRSend)})},
  1340. messageSends: []}),
  1341. smalltalk.IRSend);
  1342. smalltalk.addMethod(
  1343. smalltalk.method({
  1344. selector: "selector",
  1345. fn: function (){
  1346. var self=this;
  1347. return smalltalk.withContext(function($ctx1) {
  1348. var $1;
  1349. $1=self["@selector"];
  1350. return $1;
  1351. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRSend)})},
  1352. messageSends: []}),
  1353. smalltalk.IRSend);
  1354. smalltalk.addMethod(
  1355. smalltalk.method({
  1356. selector: "selector:",
  1357. fn: function (aString){
  1358. var self=this;
  1359. return smalltalk.withContext(function($ctx1) {
  1360. self["@selector"]=aString;
  1361. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRSend)})},
  1362. messageSends: []}),
  1363. smalltalk.IRSend);
  1364. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1365. smalltalk.addMethod(
  1366. smalltalk.method({
  1367. selector: "accept:",
  1368. fn: function (aVisitor){
  1369. var self=this;
  1370. return smalltalk.withContext(function($ctx1) {
  1371. var $1;
  1372. $1=_st(aVisitor)._visitIRSequence_(self);
  1373. return $1;
  1374. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSequence)})},
  1375. messageSends: ["visitIRSequence:"]}),
  1376. smalltalk.IRSequence);
  1377. smalltalk.addMethod(
  1378. smalltalk.method({
  1379. selector: "isSequence",
  1380. fn: function (){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. return true;
  1384. }, function($ctx1) {$ctx1.fill(self,"isSequence",{},smalltalk.IRSequence)})},
  1385. messageSends: []}),
  1386. smalltalk.IRSequence);
  1387. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1388. smalltalk.addMethod(
  1389. smalltalk.method({
  1390. selector: "accept:",
  1391. fn: function (aVisitor){
  1392. var self=this;
  1393. return smalltalk.withContext(function($ctx1) {
  1394. var $1;
  1395. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1396. return $1;
  1397. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockSequence)})},
  1398. messageSends: ["visitIRBlockSequence:"]}),
  1399. smalltalk.IRBlockSequence);
  1400. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1401. smalltalk.addMethod(
  1402. smalltalk.method({
  1403. selector: "accept:",
  1404. fn: function (aVisitor){
  1405. var self=this;
  1406. return smalltalk.withContext(function($ctx1) {
  1407. var $1;
  1408. $1=_st(aVisitor)._visitIRValue_(self);
  1409. return $1;
  1410. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRValue)})},
  1411. messageSends: ["visitIRValue:"]}),
  1412. smalltalk.IRValue);
  1413. smalltalk.addMethod(
  1414. smalltalk.method({
  1415. selector: "needsBoxingAsReceiver",
  1416. fn: function (){
  1417. var self=this;
  1418. return smalltalk.withContext(function($ctx1) {
  1419. return false;
  1420. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRValue)})},
  1421. messageSends: []}),
  1422. smalltalk.IRValue);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "value",
  1426. fn: function (){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. var $1;
  1430. $1=self["@value"];
  1431. return $1;
  1432. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.IRValue)})},
  1433. messageSends: []}),
  1434. smalltalk.IRValue);
  1435. smalltalk.addMethod(
  1436. smalltalk.method({
  1437. selector: "value:",
  1438. fn: function (aString){
  1439. var self=this;
  1440. return smalltalk.withContext(function($ctx1) {
  1441. self["@value"]=aString;
  1442. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.IRValue)})},
  1443. messageSends: []}),
  1444. smalltalk.IRValue);
  1445. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1446. smalltalk.addMethod(
  1447. smalltalk.method({
  1448. selector: "accept:",
  1449. fn: function (aVisitor){
  1450. var self=this;
  1451. return smalltalk.withContext(function($ctx1) {
  1452. var $1;
  1453. $1=_st(aVisitor)._visitIRVariable_(self);
  1454. return $1;
  1455. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVariable)})},
  1456. messageSends: ["visitIRVariable:"]}),
  1457. smalltalk.IRVariable);
  1458. smalltalk.addMethod(
  1459. smalltalk.method({
  1460. selector: "isVariable",
  1461. fn: function (){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) {
  1464. return true;
  1465. }, function($ctx1) {$ctx1.fill(self,"isVariable",{},smalltalk.IRVariable)})},
  1466. messageSends: []}),
  1467. smalltalk.IRVariable);
  1468. smalltalk.addMethod(
  1469. smalltalk.method({
  1470. selector: "needsBoxingAsReceiver",
  1471. fn: function (){
  1472. var self=this;
  1473. return smalltalk.withContext(function($ctx1) {
  1474. var $1;
  1475. $1=_st(_st(self._variable())._isPseudoVar())._not();
  1476. return $1;
  1477. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRVariable)})},
  1478. messageSends: ["not", "isPseudoVar", "variable"]}),
  1479. smalltalk.IRVariable);
  1480. smalltalk.addMethod(
  1481. smalltalk.method({
  1482. selector: "variable",
  1483. fn: function (){
  1484. var self=this;
  1485. return smalltalk.withContext(function($ctx1) {
  1486. var $1;
  1487. $1=self["@variable"];
  1488. return $1;
  1489. }, function($ctx1) {$ctx1.fill(self,"variable",{},smalltalk.IRVariable)})},
  1490. messageSends: []}),
  1491. smalltalk.IRVariable);
  1492. smalltalk.addMethod(
  1493. smalltalk.method({
  1494. selector: "variable:",
  1495. fn: function (aScopeVariable){
  1496. var self=this;
  1497. return smalltalk.withContext(function($ctx1) {
  1498. self["@variable"]=aScopeVariable;
  1499. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable},smalltalk.IRVariable)})},
  1500. messageSends: []}),
  1501. smalltalk.IRVariable);
  1502. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1503. smalltalk.addMethod(
  1504. smalltalk.method({
  1505. selector: "accept:",
  1506. fn: function (aVisitor){
  1507. var self=this;
  1508. return smalltalk.withContext(function($ctx1) {
  1509. var $1;
  1510. $1=_st(aVisitor)._visitIRVerbatim_(self);
  1511. return $1;
  1512. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVerbatim)})},
  1513. messageSends: ["visitIRVerbatim:"]}),
  1514. smalltalk.IRVerbatim);
  1515. smalltalk.addMethod(
  1516. smalltalk.method({
  1517. selector: "source",
  1518. fn: function (){
  1519. var self=this;
  1520. return smalltalk.withContext(function($ctx1) {
  1521. var $1;
  1522. $1=self["@source"];
  1523. return $1;
  1524. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRVerbatim)})},
  1525. messageSends: []}),
  1526. smalltalk.IRVerbatim);
  1527. smalltalk.addMethod(
  1528. smalltalk.method({
  1529. selector: "source:",
  1530. fn: function (aString){
  1531. var self=this;
  1532. return smalltalk.withContext(function($ctx1) {
  1533. self["@source"]=aString;
  1534. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRVerbatim)})},
  1535. messageSends: []}),
  1536. smalltalk.IRVerbatim);
  1537. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  1538. smalltalk.addMethod(
  1539. smalltalk.method({
  1540. selector: "visit:",
  1541. fn: function (anIRInstruction){
  1542. var self=this;
  1543. return smalltalk.withContext(function($ctx1) {
  1544. var $1;
  1545. $1=_st(anIRInstruction)._accept_(self);
  1546. return $1;
  1547. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  1548. messageSends: ["accept:"]}),
  1549. smalltalk.IRVisitor);
  1550. smalltalk.addMethod(
  1551. smalltalk.method({
  1552. selector: "visitIRAssignment:",
  1553. fn: function (anIRAssignment){
  1554. var self=this;
  1555. return smalltalk.withContext(function($ctx1) {
  1556. var $1;
  1557. $1=self._visitIRInstruction_(anIRAssignment);
  1558. return $1;
  1559. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRVisitor)})},
  1560. messageSends: ["visitIRInstruction:"]}),
  1561. smalltalk.IRVisitor);
  1562. smalltalk.addMethod(
  1563. smalltalk.method({
  1564. selector: "visitIRBlockReturn:",
  1565. fn: function (anIRBlockReturn){
  1566. var self=this;
  1567. return smalltalk.withContext(function($ctx1) {
  1568. var $1;
  1569. $1=self._visitIRReturn_(anIRBlockReturn);
  1570. return $1;
  1571. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn},smalltalk.IRVisitor)})},
  1572. messageSends: ["visitIRReturn:"]}),
  1573. smalltalk.IRVisitor);
  1574. smalltalk.addMethod(
  1575. smalltalk.method({
  1576. selector: "visitIRBlockSequence:",
  1577. fn: function (anIRBlockSequence){
  1578. var self=this;
  1579. return smalltalk.withContext(function($ctx1) {
  1580. var $1;
  1581. $1=self._visitIRSequence_(anIRBlockSequence);
  1582. return $1;
  1583. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence},smalltalk.IRVisitor)})},
  1584. messageSends: ["visitIRSequence:"]}),
  1585. smalltalk.IRVisitor);
  1586. smalltalk.addMethod(
  1587. smalltalk.method({
  1588. selector: "visitIRClosure:",
  1589. fn: function (anIRClosure){
  1590. var self=this;
  1591. return smalltalk.withContext(function($ctx1) {
  1592. var $1;
  1593. $1=self._visitIRInstruction_(anIRClosure);
  1594. return $1;
  1595. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRVisitor)})},
  1596. messageSends: ["visitIRInstruction:"]}),
  1597. smalltalk.IRVisitor);
  1598. smalltalk.addMethod(
  1599. smalltalk.method({
  1600. selector: "visitIRDynamicArray:",
  1601. fn: function (anIRDynamicArray){
  1602. var self=this;
  1603. return smalltalk.withContext(function($ctx1) {
  1604. var $1;
  1605. $1=self._visitIRInstruction_(anIRDynamicArray);
  1606. return $1;
  1607. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRVisitor)})},
  1608. messageSends: ["visitIRInstruction:"]}),
  1609. smalltalk.IRVisitor);
  1610. smalltalk.addMethod(
  1611. smalltalk.method({
  1612. selector: "visitIRDynamicDictionary:",
  1613. fn: function (anIRDynamicDictionary){
  1614. var self=this;
  1615. return smalltalk.withContext(function($ctx1) {
  1616. var $1;
  1617. $1=self._visitIRInstruction_(anIRDynamicDictionary);
  1618. return $1;
  1619. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRVisitor)})},
  1620. messageSends: ["visitIRInstruction:"]}),
  1621. smalltalk.IRVisitor);
  1622. smalltalk.addMethod(
  1623. smalltalk.method({
  1624. selector: "visitIRInlinedClosure:",
  1625. fn: function (anIRInlinedClosure){
  1626. var self=this;
  1627. return smalltalk.withContext(function($ctx1) {
  1628. var $1;
  1629. $1=self._visitIRClosure_(anIRInlinedClosure);
  1630. return $1;
  1631. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},smalltalk.IRVisitor)})},
  1632. messageSends: ["visitIRClosure:"]}),
  1633. smalltalk.IRVisitor);
  1634. smalltalk.addMethod(
  1635. smalltalk.method({
  1636. selector: "visitIRInlinedSequence:",
  1637. fn: function (anIRInlinedSequence){
  1638. var self=this;
  1639. return smalltalk.withContext(function($ctx1) {
  1640. var $1;
  1641. $1=self._visitIRSequence_(anIRInlinedSequence);
  1642. return $1;
  1643. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence},smalltalk.IRVisitor)})},
  1644. messageSends: ["visitIRSequence:"]}),
  1645. smalltalk.IRVisitor);
  1646. smalltalk.addMethod(
  1647. smalltalk.method({
  1648. selector: "visitIRInstruction:",
  1649. fn: function (anIRInstruction){
  1650. var self=this;
  1651. return smalltalk.withContext(function($ctx1) {
  1652. var $1;
  1653. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  1654. return smalltalk.withContext(function($ctx2) {
  1655. return self._visit_(each);
  1656. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1657. $1=anIRInstruction;
  1658. return $1;
  1659. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  1660. messageSends: ["do:", "visit:", "instructions"]}),
  1661. smalltalk.IRVisitor);
  1662. smalltalk.addMethod(
  1663. smalltalk.method({
  1664. selector: "visitIRMethod:",
  1665. fn: function (anIRMethod){
  1666. var self=this;
  1667. return smalltalk.withContext(function($ctx1) {
  1668. var $1;
  1669. $1=self._visitIRInstruction_(anIRMethod);
  1670. return $1;
  1671. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRVisitor)})},
  1672. messageSends: ["visitIRInstruction:"]}),
  1673. smalltalk.IRVisitor);
  1674. smalltalk.addMethod(
  1675. smalltalk.method({
  1676. selector: "visitIRNonLocalReturn:",
  1677. fn: function (anIRNonLocalReturn){
  1678. var self=this;
  1679. return smalltalk.withContext(function($ctx1) {
  1680. var $1;
  1681. $1=self._visitIRInstruction_(anIRNonLocalReturn);
  1682. return $1;
  1683. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRVisitor)})},
  1684. messageSends: ["visitIRInstruction:"]}),
  1685. smalltalk.IRVisitor);
  1686. smalltalk.addMethod(
  1687. smalltalk.method({
  1688. selector: "visitIRNonLocalReturnHandling:",
  1689. fn: function (anIRNonLocalReturnHandling){
  1690. var self=this;
  1691. return smalltalk.withContext(function($ctx1) {
  1692. var $1;
  1693. $1=self._visitIRInstruction_(anIRNonLocalReturnHandling);
  1694. return $1;
  1695. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling},smalltalk.IRVisitor)})},
  1696. messageSends: ["visitIRInstruction:"]}),
  1697. smalltalk.IRVisitor);
  1698. smalltalk.addMethod(
  1699. smalltalk.method({
  1700. selector: "visitIRReturn:",
  1701. fn: function (anIRReturn){
  1702. var self=this;
  1703. return smalltalk.withContext(function($ctx1) {
  1704. var $1;
  1705. $1=self._visitIRInstruction_(anIRReturn);
  1706. return $1;
  1707. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRVisitor)})},
  1708. messageSends: ["visitIRInstruction:"]}),
  1709. smalltalk.IRVisitor);
  1710. smalltalk.addMethod(
  1711. smalltalk.method({
  1712. selector: "visitIRSend:",
  1713. fn: function (anIRSend){
  1714. var self=this;
  1715. return smalltalk.withContext(function($ctx1) {
  1716. var $1;
  1717. $1=self._visitIRInstruction_(anIRSend);
  1718. return $1;
  1719. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRVisitor)})},
  1720. messageSends: ["visitIRInstruction:"]}),
  1721. smalltalk.IRVisitor);
  1722. smalltalk.addMethod(
  1723. smalltalk.method({
  1724. selector: "visitIRSequence:",
  1725. fn: function (anIRSequence){
  1726. var self=this;
  1727. return smalltalk.withContext(function($ctx1) {
  1728. var $1;
  1729. $1=self._visitIRInstruction_(anIRSequence);
  1730. return $1;
  1731. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRVisitor)})},
  1732. messageSends: ["visitIRInstruction:"]}),
  1733. smalltalk.IRVisitor);
  1734. smalltalk.addMethod(
  1735. smalltalk.method({
  1736. selector: "visitIRTempDeclaration:",
  1737. fn: function (anIRTempDeclaration){
  1738. var self=this;
  1739. return smalltalk.withContext(function($ctx1) {
  1740. var $1;
  1741. $1=self._visitIRInstruction_(anIRTempDeclaration);
  1742. return $1;
  1743. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRVisitor)})},
  1744. messageSends: ["visitIRInstruction:"]}),
  1745. smalltalk.IRVisitor);
  1746. smalltalk.addMethod(
  1747. smalltalk.method({
  1748. selector: "visitIRValue:",
  1749. fn: function (anIRValue){
  1750. var self=this;
  1751. return smalltalk.withContext(function($ctx1) {
  1752. var $1;
  1753. $1=self._visitIRInstruction_(anIRValue);
  1754. return $1;
  1755. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRVisitor)})},
  1756. messageSends: ["visitIRInstruction:"]}),
  1757. smalltalk.IRVisitor);
  1758. smalltalk.addMethod(
  1759. smalltalk.method({
  1760. selector: "visitIRVariable:",
  1761. fn: function (anIRVariable){
  1762. var self=this;
  1763. return smalltalk.withContext(function($ctx1) {
  1764. var $1;
  1765. $1=self._visitIRInstruction_(anIRVariable);
  1766. return $1;
  1767. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRVisitor)})},
  1768. messageSends: ["visitIRInstruction:"]}),
  1769. smalltalk.IRVisitor);
  1770. smalltalk.addMethod(
  1771. smalltalk.method({
  1772. selector: "visitIRVerbatim:",
  1773. fn: function (anIRVerbatim){
  1774. var self=this;
  1775. return smalltalk.withContext(function($ctx1) {
  1776. var $1;
  1777. $1=self._visitIRInstruction_(anIRVerbatim);
  1778. return $1;
  1779. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRVisitor)})},
  1780. messageSends: ["visitIRInstruction:"]}),
  1781. smalltalk.IRVisitor);
  1782. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  1783. smalltalk.addMethod(
  1784. smalltalk.method({
  1785. selector: "contents",
  1786. fn: function (){
  1787. var self=this;
  1788. return smalltalk.withContext(function($ctx1) {
  1789. var $1;
  1790. $1=_st(self._stream())._contents();
  1791. return $1;
  1792. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.IRJSTranslator)})},
  1793. messageSends: ["contents", "stream"]}),
  1794. smalltalk.IRJSTranslator);
  1795. smalltalk.addMethod(
  1796. smalltalk.method({
  1797. selector: "initialize",
  1798. fn: function (){
  1799. var self=this;
  1800. function $JSStream(){return smalltalk.JSStream||(typeof JSStream=="undefined"?nil:JSStream)}
  1801. return smalltalk.withContext(function($ctx1) {
  1802. smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  1803. self["@stream"]=_st($JSStream())._new();
  1804. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.IRJSTranslator)})},
  1805. messageSends: ["initialize", "new"]}),
  1806. smalltalk.IRJSTranslator);
  1807. smalltalk.addMethod(
  1808. smalltalk.method({
  1809. selector: "stream",
  1810. fn: function (){
  1811. var self=this;
  1812. return smalltalk.withContext(function($ctx1) {
  1813. var $1;
  1814. $1=self["@stream"];
  1815. return $1;
  1816. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.IRJSTranslator)})},
  1817. messageSends: []}),
  1818. smalltalk.IRJSTranslator);
  1819. smalltalk.addMethod(
  1820. smalltalk.method({
  1821. selector: "stream:",
  1822. fn: function (aStream){
  1823. var self=this;
  1824. return smalltalk.withContext(function($ctx1) {
  1825. self["@stream"]=aStream;
  1826. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.IRJSTranslator)})},
  1827. messageSends: []}),
  1828. smalltalk.IRJSTranslator);
  1829. smalltalk.addMethod(
  1830. smalltalk.method({
  1831. selector: "visitIRAssignment:",
  1832. fn: function (anIRAssignment){
  1833. var self=this;
  1834. return smalltalk.withContext(function($ctx1) {
  1835. self._visit_(_st(_st(anIRAssignment)._instructions())._first());
  1836. _st(self._stream())._nextPutAssignment();
  1837. self._visit_(_st(_st(anIRAssignment)._instructions())._last());
  1838. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRJSTranslator)})},
  1839. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"]}),
  1840. smalltalk.IRJSTranslator);
  1841. smalltalk.addMethod(
  1842. smalltalk.method({
  1843. selector: "visitIRClosure:",
  1844. fn: function (anIRClosure){
  1845. var self=this;
  1846. return smalltalk.withContext(function($ctx1) {
  1847. _st(self._stream())._nextPutClosureWith_arguments_((function(){
  1848. return smalltalk.withContext(function($ctx2) {
  1849. _st(self._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  1850. return smalltalk.withContext(function($ctx3) {
  1851. return _st(_st(each)._name())._asVariableName();
  1852. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})})));
  1853. return _st(self._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  1854. return smalltalk.withContext(function($ctx3) {
  1855. return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  1856. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  1857. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),_st(anIRClosure)._arguments());
  1858. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRJSTranslator)})},
  1859. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"]}),
  1860. smalltalk.IRJSTranslator);
  1861. smalltalk.addMethod(
  1862. smalltalk.method({
  1863. selector: "visitIRDynamicArray:",
  1864. fn: function (anIRDynamicArray){
  1865. var self=this;
  1866. return smalltalk.withContext(function($ctx1) {
  1867. _st(self._stream())._nextPutAll_("[");
  1868. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  1869. return smalltalk.withContext(function($ctx2) {
  1870. return self._visit_(each);
  1871. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1872. return smalltalk.withContext(function($ctx2) {
  1873. return _st(self._stream())._nextPutAll_(",");
  1874. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1875. _st(self["@stream"])._nextPutAll_("]");
  1876. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRJSTranslator)})},
  1877. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"]}),
  1878. smalltalk.IRJSTranslator);
  1879. smalltalk.addMethod(
  1880. smalltalk.method({
  1881. selector: "visitIRDynamicDictionary:",
  1882. fn: function (anIRDynamicDictionary){
  1883. var self=this;
  1884. return smalltalk.withContext(function($ctx1) {
  1885. _st(self._stream())._nextPutAll_("smalltalk.HashedCollection._from_([");
  1886. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  1887. return smalltalk.withContext(function($ctx2) {
  1888. return self._visit_(each);
  1889. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1890. return smalltalk.withContext(function($ctx2) {
  1891. return _st(self._stream())._nextPutAll_(",");
  1892. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1893. _st(self._stream())._nextPutAll_("])");
  1894. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRJSTranslator)})},
  1895. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"]}),
  1896. smalltalk.IRJSTranslator);
  1897. smalltalk.addMethod(
  1898. smalltalk.method({
  1899. selector: "visitIRMethod:",
  1900. fn: function (anIRMethod){
  1901. var self=this;
  1902. return smalltalk.withContext(function($ctx1) {
  1903. var $1,$2;
  1904. _st(self._stream())._nextPutMethodDeclaration_with_(anIRMethod,(function(){
  1905. return smalltalk.withContext(function($ctx2) {
  1906. return _st(self._stream())._nextPutFunctionWith_arguments_((function(){
  1907. return smalltalk.withContext(function($ctx3) {
  1908. _st(self._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  1909. return smalltalk.withContext(function($ctx4) {
  1910. return _st(_st(each)._name())._asVariableName();
  1911. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})})));
  1912. _st(_st(anIRMethod)._classReferences())._do_((function(each){
  1913. return smalltalk.withContext(function($ctx4) {
  1914. return _st(self._stream())._nextPutClassRefFunction_(each);
  1915. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
  1916. return _st(self._stream())._nextPutContextFor_during_(anIRMethod,(function(){
  1917. return smalltalk.withContext(function($ctx4) {
  1918. $1=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  1919. if(smalltalk.assert($1)){
  1920. _st(self._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  1921. return smalltalk.withContext(function($ctx5) {
  1922. return _st(_st(each)._variable())._alias();
  1923. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx4)})})));
  1924. };
  1925. $2=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  1926. if(smalltalk.assert($2)){
  1927. return _st(self._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  1928. return smalltalk.withContext(function($ctx5) {
  1929. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1930. }, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
  1931. } else {
  1932. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1933. };
  1934. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  1935. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}),_st(anIRMethod)._arguments());
  1936. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1937. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRJSTranslator)})},
  1938. 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"]}),
  1939. smalltalk.IRJSTranslator);
  1940. smalltalk.addMethod(
  1941. smalltalk.method({
  1942. selector: "visitIRNonLocalReturn:",
  1943. fn: function (anIRNonLocalReturn){
  1944. var self=this;
  1945. return smalltalk.withContext(function($ctx1) {
  1946. _st(self._stream())._nextPutNonLocalReturnWith_((function(){
  1947. return smalltalk.withContext(function($ctx2) {
  1948. return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  1949. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1950. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRJSTranslator)})},
  1951. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"]}),
  1952. smalltalk.IRJSTranslator);
  1953. smalltalk.addMethod(
  1954. smalltalk.method({
  1955. selector: "visitIRReturn:",
  1956. fn: function (anIRReturn){
  1957. var self=this;
  1958. return smalltalk.withContext(function($ctx1) {
  1959. _st(self._stream())._nextPutReturnWith_((function(){
  1960. return smalltalk.withContext(function($ctx2) {
  1961. return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  1962. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1963. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRJSTranslator)})},
  1964. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"]}),
  1965. smalltalk.IRJSTranslator);
  1966. smalltalk.addMethod(
  1967. smalltalk.method({
  1968. selector: "visitIRSend:",
  1969. fn: function (anIRSend){
  1970. var self=this;
  1971. return smalltalk.withContext(function($ctx1) {
  1972. var $1;
  1973. $1=_st(anIRSend)._classSend();
  1974. if(($receiver = $1) == nil || $receiver == undefined){
  1975. self._visitSend_(anIRSend);
  1976. } else {
  1977. self._visitSuperSend_(anIRSend);
  1978. };
  1979. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  1980. messageSends: ["ifNil:ifNotNil:", "visitSend:", "visitSuperSend:", "classSend"]}),
  1981. smalltalk.IRJSTranslator);
  1982. smalltalk.addMethod(
  1983. smalltalk.method({
  1984. selector: "visitIRSequence:",
  1985. fn: function (anIRSequence){
  1986. var self=this;
  1987. return smalltalk.withContext(function($ctx1) {
  1988. _st(self._stream())._nextPutSequenceWith_((function(){
  1989. return smalltalk.withContext(function($ctx2) {
  1990. return _st(_st(anIRSequence)._instructions())._do_((function(each){
  1991. return smalltalk.withContext(function($ctx3) {
  1992. return _st(self._stream())._nextPutStatementWith_(self._visit_(each));
  1993. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  1994. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1995. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRJSTranslator)})},
  1996. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"]}),
  1997. smalltalk.IRJSTranslator);
  1998. smalltalk.addMethod(
  1999. smalltalk.method({
  2000. selector: "visitIRTempDeclaration:",
  2001. fn: function (anIRTempDeclaration){
  2002. var self=this;
  2003. return smalltalk.withContext(function($ctx1) {
  2004. return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRJSTranslator)})},
  2005. messageSends: []}),
  2006. smalltalk.IRJSTranslator);
  2007. smalltalk.addMethod(
  2008. smalltalk.method({
  2009. selector: "visitIRValue:",
  2010. fn: function (anIRValue){
  2011. var self=this;
  2012. return smalltalk.withContext(function($ctx1) {
  2013. _st(self._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2014. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRJSTranslator)})},
  2015. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"]}),
  2016. smalltalk.IRJSTranslator);
  2017. smalltalk.addMethod(
  2018. smalltalk.method({
  2019. selector: "visitIRVariable:",
  2020. fn: function (anIRVariable){
  2021. var self=this;
  2022. return smalltalk.withContext(function($ctx1) {
  2023. var $1;
  2024. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2025. if(smalltalk.assert($1)){
  2026. _st(self._stream())._nextPutAll_("smalltalk.getThisContext()");
  2027. } else {
  2028. _st(self._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2029. };
  2030. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRJSTranslator)})},
  2031. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"]}),
  2032. smalltalk.IRJSTranslator);
  2033. smalltalk.addMethod(
  2034. smalltalk.method({
  2035. selector: "visitIRVerbatim:",
  2036. fn: function (anIRVerbatim){
  2037. var self=this;
  2038. return smalltalk.withContext(function($ctx1) {
  2039. _st(self._stream())._nextPutStatementWith_((function(){
  2040. return smalltalk.withContext(function($ctx2) {
  2041. return _st(self._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2042. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2043. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRJSTranslator)})},
  2044. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"]}),
  2045. smalltalk.IRJSTranslator);
  2046. smalltalk.addMethod(
  2047. smalltalk.method({
  2048. selector: "visitReceiver:",
  2049. fn: function (anIRInstruction){
  2050. var self=this;
  2051. return smalltalk.withContext(function($ctx1) {
  2052. var $1,$2;
  2053. $1=_st(anIRInstruction)._needsBoxingAsReceiver();
  2054. if(! smalltalk.assert($1)){
  2055. $2=self._visit_(anIRInstruction);
  2056. return $2;
  2057. };
  2058. _st(self._stream())._nextPutAll_("_st(");
  2059. self._visit_(anIRInstruction);
  2060. _st(self._stream())._nextPutAll_(")");
  2061. return self}, function($ctx1) {$ctx1.fill(self,"visitReceiver:",{anIRInstruction:anIRInstruction},smalltalk.IRJSTranslator)})},
  2062. messageSends: ["ifFalse:", "visit:", "needsBoxingAsReceiver", "nextPutAll:", "stream"]}),
  2063. smalltalk.IRJSTranslator);
  2064. smalltalk.addMethod(
  2065. smalltalk.method({
  2066. selector: "visitSend:",
  2067. fn: function (anIRSend){
  2068. var self=this;
  2069. return smalltalk.withContext(function($ctx1) {
  2070. self._visitReceiver_(_st(_st(anIRSend)._instructions())._first());
  2071. _st(self._stream())._nextPutAll_(_st(".".__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  2072. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2073. return smalltalk.withContext(function($ctx2) {
  2074. return self._visit_(each);
  2075. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2076. return smalltalk.withContext(function($ctx2) {
  2077. return _st(self._stream())._nextPutAll_(",");
  2078. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2079. _st(self._stream())._nextPutAll_(")");
  2080. return self}, function($ctx1) {$ctx1.fill(self,"visitSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2081. messageSends: ["visitReceiver:", "first", "instructions", "nextPutAll:", ",", "asSelector", "selector", "stream", "do:separatedBy:", "visit:", "allButFirst"]}),
  2082. smalltalk.IRJSTranslator);
  2083. smalltalk.addMethod(
  2084. smalltalk.method({
  2085. selector: "visitSuperSend:",
  2086. fn: function (anIRSend){
  2087. var self=this;
  2088. return smalltalk.withContext(function($ctx1) {
  2089. var $1,$2;
  2090. $1=self._stream();
  2091. _st($1)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  2092. _st($1)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  2093. $2=_st($1)._nextPutAll_("_st(");
  2094. self._visit_(_st(_st(anIRSend)._instructions())._first());
  2095. _st(self._stream())._nextPutAll_("), [");
  2096. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2097. return smalltalk.withContext(function($ctx2) {
  2098. return self._visit_(each);
  2099. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2100. return smalltalk.withContext(function($ctx2) {
  2101. return _st(self._stream())._nextPutAll_(",");
  2102. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2103. _st(self._stream())._nextPutAll_("])");
  2104. return self}, function($ctx1) {$ctx1.fill(self,"visitSuperSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2105. messageSends: ["nextPutAll:", ",", "asJavascript", "classSend", "stream", "asSelector", "selector", "visit:", "first", "instructions", "do:separatedBy:", "allButFirst"]}),
  2106. smalltalk.IRJSTranslator);
  2107. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2108. smalltalk.addMethod(
  2109. smalltalk.method({
  2110. selector: "contents",
  2111. fn: function (){
  2112. var self=this;
  2113. return smalltalk.withContext(function($ctx1) {
  2114. var $1;
  2115. $1=_st(self["@stream"])._contents();
  2116. return $1;
  2117. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.JSStream)})},
  2118. messageSends: ["contents"]}),
  2119. smalltalk.JSStream);
  2120. smalltalk.addMethod(
  2121. smalltalk.method({
  2122. selector: "initialize",
  2123. fn: function (){
  2124. var self=this;
  2125. return smalltalk.withContext(function($ctx1) {
  2126. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  2127. self["@stream"]=""._writeStream();
  2128. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.JSStream)})},
  2129. messageSends: ["initialize", "writeStream"]}),
  2130. smalltalk.JSStream);
  2131. smalltalk.addMethod(
  2132. smalltalk.method({
  2133. selector: "lf",
  2134. fn: function (){
  2135. var self=this;
  2136. return smalltalk.withContext(function($ctx1) {
  2137. _st(self["@stream"])._lf();
  2138. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.JSStream)})},
  2139. messageSends: ["lf"]}),
  2140. smalltalk.JSStream);
  2141. smalltalk.addMethod(
  2142. smalltalk.method({
  2143. selector: "nextPut:",
  2144. fn: function (aString){
  2145. var self=this;
  2146. return smalltalk.withContext(function($ctx1) {
  2147. _st(self["@stream"])._nextPut_(aString);
  2148. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.JSStream)})},
  2149. messageSends: ["nextPut:"]}),
  2150. smalltalk.JSStream);
  2151. smalltalk.addMethod(
  2152. smalltalk.method({
  2153. selector: "nextPutAll:",
  2154. fn: function (aString){
  2155. var self=this;
  2156. return smalltalk.withContext(function($ctx1) {
  2157. _st(self["@stream"])._nextPutAll_(aString);
  2158. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString},smalltalk.JSStream)})},
  2159. messageSends: ["nextPutAll:"]}),
  2160. smalltalk.JSStream);
  2161. smalltalk.addMethod(
  2162. smalltalk.method({
  2163. selector: "nextPutAssignment",
  2164. fn: function (){
  2165. var self=this;
  2166. return smalltalk.withContext(function($ctx1) {
  2167. _st(self["@stream"])._nextPutAll_("=");
  2168. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{},smalltalk.JSStream)})},
  2169. messageSends: ["nextPutAll:"]}),
  2170. smalltalk.JSStream);
  2171. smalltalk.addMethod(
  2172. smalltalk.method({
  2173. selector: "nextPutBlockContextFor:during:",
  2174. fn: function (anIRClosure,aBlock){
  2175. var self=this;
  2176. return smalltalk.withContext(function($ctx1) {
  2177. var $1,$2,$3,$4,$5,$6,$7,$8;
  2178. $1=self;
  2179. _st($1)._nextPutAll_(_st("return smalltalk.withContext(function(".__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2180. $2=_st($1)._lf();
  2181. _st(aBlock)._value();
  2182. $3=self;
  2183. _st($3)._nextPutAll_(_st("}, function(".__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2184. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  2185. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  2186. return smalltalk.withContext(function($ctx2) {
  2187. $5=self;
  2188. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2189. _st($5)._nextPutAll_(":");
  2190. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2191. return $6;
  2192. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2193. return smalltalk.withContext(function($ctx2) {
  2194. return self._nextPutAll_(",");
  2195. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2196. $7=self;
  2197. _st($7)._nextPutAll_("},");
  2198. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._scope())._outerScope())._alias()).__comma(")})"));
  2199. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock},smalltalk.JSStream)})},
  2200. messageSends: ["nextPutAll:", ",", "alias", "scope", "lf", "value", "do:separatedBy:", "asVariableName", "locals", "outerScope"]}),
  2201. smalltalk.JSStream);
  2202. smalltalk.addMethod(
  2203. smalltalk.method({
  2204. selector: "nextPutClassRefFunction:",
  2205. fn: function (aString){
  2206. var self=this;
  2207. return smalltalk.withContext(function($ctx1) {
  2208. var $1,$2;
  2209. $1=self["@stream"];
  2210. _st($1)._nextPutAll_("function $");
  2211. _st($1)._nextPutAll_(aString);
  2212. _st($1)._nextPutAll_("(){return smalltalk.");
  2213. _st($1)._nextPutAll_(aString);
  2214. _st($1)._nextPutAll_("||(typeof ");
  2215. _st($1)._nextPutAll_(aString);
  2216. _st($1)._nextPutAll_("==\x22undefined\x22?nil:");
  2217. _st($1)._nextPutAll_(aString);
  2218. _st($1)._nextPutAll_(")}");
  2219. $2=_st($1)._lf();
  2220. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClassRefFunction:",{aString:aString},smalltalk.JSStream)})},
  2221. messageSends: ["nextPutAll:", "lf"]}),
  2222. smalltalk.JSStream);
  2223. smalltalk.addMethod(
  2224. smalltalk.method({
  2225. selector: "nextPutClosureWith:arguments:",
  2226. fn: function (aBlock,anArray){
  2227. var self=this;
  2228. return smalltalk.withContext(function($ctx1) {
  2229. var $1,$2;
  2230. _st(self["@stream"])._nextPutAll_("(function(");
  2231. _st(anArray)._do_separatedBy_((function(each){
  2232. return smalltalk.withContext(function($ctx2) {
  2233. return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2234. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2235. return smalltalk.withContext(function($ctx2) {
  2236. return _st(self["@stream"])._nextPut_(",");
  2237. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2238. $1=self["@stream"];
  2239. _st($1)._nextPutAll_("){");
  2240. $2=_st($1)._lf();
  2241. _st(aBlock)._value();
  2242. _st(self["@stream"])._nextPutAll_("})");
  2243. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2244. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"]}),
  2245. smalltalk.JSStream);
  2246. smalltalk.addMethod(
  2247. smalltalk.method({
  2248. selector: "nextPutContextFor:during:",
  2249. fn: function (aMethod,aBlock){
  2250. var self=this;
  2251. return smalltalk.withContext(function($ctx1) {
  2252. var $1,$2,$3,$4,$5,$6,$7,$8;
  2253. $1=self;
  2254. _st($1)._nextPutAll_(_st("return smalltalk.withContext(function(".__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  2255. $2=_st($1)._lf();
  2256. _st(aBlock)._value();
  2257. $3=self;
  2258. _st($3)._nextPutAll_(_st(_st("}, function(".__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  2259. $4=_st($3)._nextPutAll_(_st(".fill(self,".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  2260. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  2261. return smalltalk.withContext(function($ctx2) {
  2262. $5=self;
  2263. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2264. _st($5)._nextPutAll_(":");
  2265. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2266. return $6;
  2267. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2268. return smalltalk.withContext(function($ctx2) {
  2269. return self._nextPutAll_(",");
  2270. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2271. $7=self;
  2272. _st($7)._nextPutAll_("},");
  2273. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  2274. $8=_st($7)._nextPutAll_(")})");
  2275. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  2276. messageSends: ["nextPutAll:", ",", "alias", "scope", "lf", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "locals", "theClass"]}),
  2277. smalltalk.JSStream);
  2278. smalltalk.addMethod(
  2279. smalltalk.method({
  2280. selector: "nextPutFunctionWith:arguments:",
  2281. fn: function (aBlock,anArray){
  2282. var self=this;
  2283. return smalltalk.withContext(function($ctx1) {
  2284. var $1,$2,$3,$4;
  2285. _st(self["@stream"])._nextPutAll_("fn: function(");
  2286. _st(anArray)._do_separatedBy_((function(each){
  2287. return smalltalk.withContext(function($ctx2) {
  2288. return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2289. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2290. return smalltalk.withContext(function($ctx2) {
  2291. return _st(self["@stream"])._nextPut_(",");
  2292. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2293. $1=self["@stream"];
  2294. _st($1)._nextPutAll_("){");
  2295. $2=_st($1)._lf();
  2296. $3=self["@stream"];
  2297. _st($3)._nextPutAll_("var self=this;");
  2298. $4=_st($3)._lf();
  2299. _st(aBlock)._value();
  2300. _st(self["@stream"])._nextPutAll_("}");
  2301. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2302. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"]}),
  2303. smalltalk.JSStream);
  2304. smalltalk.addMethod(
  2305. smalltalk.method({
  2306. selector: "nextPutIf:with:",
  2307. fn: function (aBlock,anotherBlock){
  2308. var self=this;
  2309. return smalltalk.withContext(function($ctx1) {
  2310. var $1,$2;
  2311. _st(self["@stream"])._nextPutAll_("if(");
  2312. _st(aBlock)._value();
  2313. $1=self["@stream"];
  2314. _st($1)._nextPutAll_("){");
  2315. $2=_st($1)._lf();
  2316. _st(anotherBlock)._value();
  2317. _st(self["@stream"])._nextPutAll_("}");
  2318. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSStream)})},
  2319. messageSends: ["nextPutAll:", "value", "lf"]}),
  2320. smalltalk.JSStream);
  2321. smalltalk.addMethod(
  2322. smalltalk.method({
  2323. selector: "nextPutIfElse:with:with:",
  2324. fn: function (aBlock,ifBlock,elseBlock){
  2325. var self=this;
  2326. return smalltalk.withContext(function($ctx1) {
  2327. var $1,$2,$3,$4;
  2328. _st(self["@stream"])._nextPutAll_("if(");
  2329. _st(aBlock)._value();
  2330. $1=self["@stream"];
  2331. _st($1)._nextPutAll_("){");
  2332. $2=_st($1)._lf();
  2333. _st(ifBlock)._value();
  2334. $3=self["@stream"];
  2335. _st($3)._nextPutAll_("} else {");
  2336. $4=_st($3)._lf();
  2337. _st(elseBlock)._value();
  2338. _st(self["@stream"])._nextPutAll_("}");
  2339. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},smalltalk.JSStream)})},
  2340. messageSends: ["nextPutAll:", "value", "lf"]}),
  2341. smalltalk.JSStream);
  2342. smalltalk.addMethod(
  2343. smalltalk.method({
  2344. selector: "nextPutMethodDeclaration:with:",
  2345. fn: function (aMethod,aBlock){
  2346. var self=this;
  2347. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2348. return smalltalk.withContext(function($ctx1) {
  2349. var $1,$2,$3,$4,$5,$6;
  2350. $1=self["@stream"];
  2351. _st($1)._nextPutAll_("smalltalk.method({");
  2352. _st($1)._lf();
  2353. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  2354. _st($1)._lf();
  2355. _st($1)._nextPutAll_(_st("source: ".__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  2356. $2=_st($1)._lf();
  2357. _st(aBlock)._value();
  2358. $3=self["@stream"];
  2359. _st($3)._nextPutAll_(_st(",".__comma(_st($String())._lf())).__comma("messageSends: "));
  2360. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  2361. _st($3)._lf();
  2362. _st($3)._nextPutAll_(_st("args: ".__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  2363. return smalltalk.withContext(function($ctx2) {
  2364. return _st(each)._value();
  2365. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asArray())._asJavascript())).__comma(","));
  2366. _st($3)._lf();
  2367. $4=_st($3)._nextPutAll_("referencedClasses: [");
  2368. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  2369. return smalltalk.withContext(function($ctx2) {
  2370. return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  2371. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2372. return smalltalk.withContext(function($ctx2) {
  2373. return _st(self["@stream"])._nextPutAll_(",");
  2374. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2375. $5=self["@stream"];
  2376. _st($5)._nextPutAll_("]");
  2377. $6=_st($5)._nextPutAll_("})");
  2378. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  2379. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"]}),
  2380. smalltalk.JSStream);
  2381. smalltalk.addMethod(
  2382. smalltalk.method({
  2383. selector: "nextPutNonLocalReturnHandlingWith:",
  2384. fn: function (aBlock){
  2385. var self=this;
  2386. return smalltalk.withContext(function($ctx1) {
  2387. var $1,$2,$3,$4;
  2388. $1=self["@stream"];
  2389. _st($1)._nextPutAll_("var $early={};");
  2390. _st($1)._lf();
  2391. _st($1)._nextPutAll_("try {");
  2392. $2=_st($1)._lf();
  2393. _st(aBlock)._value();
  2394. $3=self["@stream"];
  2395. _st($3)._nextPutAll_("}");
  2396. _st($3)._lf();
  2397. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  2398. $4=_st($3)._lf();
  2399. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2400. messageSends: ["nextPutAll:", "lf", "value"]}),
  2401. smalltalk.JSStream);
  2402. smalltalk.addMethod(
  2403. smalltalk.method({
  2404. selector: "nextPutNonLocalReturnWith:",
  2405. fn: function (aBlock){
  2406. var self=this;
  2407. return smalltalk.withContext(function($ctx1) {
  2408. _st(self["@stream"])._nextPutAll_("throw $early=[");
  2409. _st(aBlock)._value();
  2410. _st(self["@stream"])._nextPutAll_("]");
  2411. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2412. messageSends: ["nextPutAll:", "value"]}),
  2413. smalltalk.JSStream);
  2414. smalltalk.addMethod(
  2415. smalltalk.method({
  2416. selector: "nextPutReturn",
  2417. fn: function (){
  2418. var self=this;
  2419. return smalltalk.withContext(function($ctx1) {
  2420. _st(self["@stream"])._nextPutAll_("return ");
  2421. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{},smalltalk.JSStream)})},
  2422. messageSends: ["nextPutAll:"]}),
  2423. smalltalk.JSStream);
  2424. smalltalk.addMethod(
  2425. smalltalk.method({
  2426. selector: "nextPutReturnWith:",
  2427. fn: function (aBlock){
  2428. var self=this;
  2429. return smalltalk.withContext(function($ctx1) {
  2430. self._nextPutReturn();
  2431. _st(aBlock)._value();
  2432. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2433. messageSends: ["nextPutReturn", "value"]}),
  2434. smalltalk.JSStream);
  2435. smalltalk.addMethod(
  2436. smalltalk.method({
  2437. selector: "nextPutSequenceWith:",
  2438. fn: function (aBlock){
  2439. var self=this;
  2440. return smalltalk.withContext(function($ctx1) {
  2441. _st(aBlock)._value();
  2442. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2443. messageSends: ["value"]}),
  2444. smalltalk.JSStream);
  2445. smalltalk.addMethod(
  2446. smalltalk.method({
  2447. selector: "nextPutStatement:with:",
  2448. fn: function (anInteger,aBlock){
  2449. var self=this;
  2450. return smalltalk.withContext(function($ctx1) {
  2451. var $1,$2,$3,$4;
  2452. $1=self["@stream"];
  2453. _st($1)._nextPutAll_(_st("case ".__comma(_st(anInteger)._asString())).__comma(":"));
  2454. $2=_st($1)._lf();
  2455. self._nextPutStatementWith_(aBlock);
  2456. $3=self["@stream"];
  2457. _st($3)._nextPutAll_(_st("smalltalk.thisContext.pc=".__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  2458. $4=_st($3)._lf();
  2459. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:",{anInteger:anInteger,aBlock:aBlock},smalltalk.JSStream)})},
  2460. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"]}),
  2461. smalltalk.JSStream);
  2462. smalltalk.addMethod(
  2463. smalltalk.method({
  2464. selector: "nextPutStatementWith:",
  2465. fn: function (aBlock){
  2466. var self=this;
  2467. return smalltalk.withContext(function($ctx1) {
  2468. var $1,$2;
  2469. _st(aBlock)._value();
  2470. $1=self["@stream"];
  2471. _st($1)._nextPutAll_(";");
  2472. $2=_st($1)._lf();
  2473. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2474. messageSends: ["value", "nextPutAll:", "lf"]}),
  2475. smalltalk.JSStream);
  2476. smalltalk.addMethod(
  2477. smalltalk.method({
  2478. selector: "nextPutVars:",
  2479. fn: function (aCollection){
  2480. var self=this;
  2481. return smalltalk.withContext(function($ctx1) {
  2482. var $1,$2,$3;
  2483. var $early={};
  2484. try {
  2485. _st(aCollection)._ifEmpty_((function(){
  2486. return smalltalk.withContext(function($ctx2) {
  2487. $1=self;
  2488. throw $early=[$1];
  2489. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2490. _st(self["@stream"])._nextPutAll_("var ");
  2491. _st(aCollection)._do_separatedBy_((function(each){
  2492. return smalltalk.withContext(function($ctx2) {
  2493. return _st(self["@stream"])._nextPutAll_(each);
  2494. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2495. return smalltalk.withContext(function($ctx2) {
  2496. return _st(self["@stream"])._nextPutAll_(",");
  2497. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2498. $2=self["@stream"];
  2499. _st($2)._nextPutAll_(";");
  2500. $3=_st($2)._lf();
  2501. return self}
  2502. catch(e) {if(e===$early)return e[0]; throw e}
  2503. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection},smalltalk.JSStream)})},
  2504. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"]}),
  2505. smalltalk.JSStream);
  2506. smalltalk.addMethod(
  2507. smalltalk.method({
  2508. selector: "appendToInstruction:",
  2509. fn: function (anIRInstruction){
  2510. var self=this;
  2511. return smalltalk.withContext(function($ctx1) {
  2512. _st(anIRInstruction)._appendBlock_(self);
  2513. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction},smalltalk.BlockClosure)})},
  2514. messageSends: ["appendBlock:"]}),
  2515. smalltalk.BlockClosure);
  2516. smalltalk.addMethod(
  2517. smalltalk.method({
  2518. selector: "asVariableName",
  2519. fn: function (){
  2520. var self=this;
  2521. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2522. return smalltalk.withContext(function($ctx1) {
  2523. var $2,$1;
  2524. $2=_st(_st(_st($Smalltalk())._current())._reservedWords())._includes_(self);
  2525. if(smalltalk.assert($2)){
  2526. $1=self.__comma("_");
  2527. } else {
  2528. $1=self;
  2529. };
  2530. return $1;
  2531. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{},smalltalk.String)})},
  2532. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"]}),
  2533. smalltalk.String);