Compiler-IR.deploy.js 94 KB

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