1
0

Compiler-IR.deploy.js 92 KB

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