1
0

Compiler-IR.deploy.js 68 KB

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