Compiler-IR.deploy.js 93 KB

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