Compiler-IR.deploy.js 79 KB

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