2
0

Compiler-IR.deploy.js 90 KB

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