2
0

Compiler-IR.deploy.js 55 KB

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