Compiler-IR.deploy.js 82 KB

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