Compiler-IR.deploy.js 92 KB

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