Compiler-IR.deploy.js 92 KB

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