1
0

Compiler-IR.deploy.js 56 KB

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