Compiler-IR.js 126 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479
  1. smalltalk.addPackage('Compiler-IR', {});
  2. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
  3. smalltalk.IRASTTranslator.comment="I am the AST (abstract syntax tree) visitor responsible for building the intermediate representation graph.\x0aI rely on a builder object, instance of IRBuilder."
  4. smalltalk.addMethod(
  5. "_alias_",
  6. smalltalk.method({
  7. selector: "alias:",
  8. category: 'visiting',
  9. fn: function (aNode){
  10. var self=this;
  11. var variable;
  12. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7;
  13. $1=_st(aNode)._isImmutable();
  14. if(smalltalk.assert($1)){
  15. $2=_st(self)._visit_(aNode);
  16. return $2;
  17. };
  18. $3=_st((smalltalk.IRVariable || IRVariable))._new();
  19. _st($3)._variable_(_st(_st((smalltalk.AliasVar || AliasVar))._new())._name_(_st("$").__comma(_st(self)._nextAlias())));
  20. $4=_st($3)._yourself();
  21. variable=$4;
  22. $5=_st((smalltalk.IRAssignment || IRAssignment))._new();
  23. _st($5)._add_(variable);
  24. _st($5)._add_(_st(self)._visit_(aNode));
  25. $6=_st($5)._yourself();
  26. _st(_st(self)._sequence())._add_($6);
  27. _st(_st(_st(self)._method())._internalVariables())._add_(variable);
  28. $7=variable;
  29. return $7;
  30. }, function($ctx1) {$ctx1.fill(self,"alias:", [aNode], {variable:variable}, smalltalk.IRASTTranslator)})},
  31. args: ["aNode"],
  32. source: "alias: aNode\x0a\x09| variable |\x0a\x0a\x09aNode isImmutable ifTrue: [ ^ self visit: aNode ].\x0a\x0a\x09variable := IRVariable new \x0a\x09\x09variable: (AliasVar new name: '$', self nextAlias); \x0a\x09\x09yourself.\x0a\x0a\x09self sequence add: (IRAssignment new\x0a\x09\x09add: variable;\x0a\x09\x09add: (self visit: aNode);\x0a\x09\x09yourself).\x0a\x0a\x09self method internalVariables add: variable.\x0a\x0a\x09^ variable",
  33. messageSends: ["ifTrue:", "visit:", "isImmutable", "variable:", "name:", ",", "nextAlias", "new", "yourself", "add:", "sequence", "internalVariables", "method"],
  34. referencedClasses: ["AliasVar", "IRVariable", "IRAssignment"]
  35. }),
  36. smalltalk.IRASTTranslator);
  37. smalltalk.addMethod(
  38. "_aliasTemporally_",
  39. smalltalk.method({
  40. selector: "aliasTemporally:",
  41. category: 'visiting',
  42. fn: function (aCollection){
  43. var self=this;
  44. var threshold,result;
  45. return smalltalk.withContext(function($ctx1) { var $1,$3,$2,$4,$6,$8,$7,$5,$9;
  46. threshold=(0);
  47. $1=aCollection;
  48. $2=(function(each,i){
  49. return smalltalk.withContext(function($ctx2) { $3=_st(each)._subtreeNeedsAliasing();
  50. if(smalltalk.assert($3)){
  51. threshold=i;
  52. return threshold;
  53. };
  54. }, function($ctx2) {$ctx2.fillBlock([each,i], {})})});
  55. _st($1)._withIndexDo_($2);
  56. result=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  57. $4=aCollection;
  58. $5=(function(each,i){
  59. return smalltalk.withContext(function($ctx2) { $6=result;
  60. $8=_st(i).__lt_eq(threshold);
  61. if(smalltalk.assert($8)){
  62. $7=_st(self)._alias_(each);
  63. } else {
  64. $7=_st(self)._visit_(each);
  65. };
  66. return _st($6)._add_($7);
  67. }, function($ctx2) {$ctx2.fillBlock([each,i], {})})});
  68. _st($4)._withIndexDo_($5);
  69. $9=result;
  70. return $9;
  71. }, function($ctx1) {$ctx1.fill(self,"aliasTemporally:", [aCollection], {threshold:threshold,result:result}, smalltalk.IRASTTranslator)})},
  72. args: ["aCollection"],
  73. source: "aliasTemporally: aCollection\x0a\x09\x22https://github.com/NicolasPetton/amber/issues/296\x0a \x0a If a node is aliased, all preceding ones are aliased as well.\x0a The tree is iterated twice. First we get the aliasing dependency, \x0a then the aliasing itself is done\x22\x0a\x0a\x09| threshold result |\x0a threshold := 0.\x0a \x0a aCollection withIndexDo: [ :each :i |\x0a each subtreeNeedsAliasing\x0a\x09\x09 ifTrue: [ threshold := i ]].\x0a\x0a\x09result := OrderedCollection new.\x0a\x09aCollection withIndexDo: [ :each :i | \x0a\x09\x09result add: (i <= threshold\x0a\x09\x09\x09ifTrue: [ self alias: each ]\x0a\x09\x09\x09ifFalse: [ self visit: each ])].\x0a\x0a ^result",
  74. messageSends: ["withIndexDo:", "ifTrue:", "subtreeNeedsAliasing", "new", "add:", "ifTrue:ifFalse:", "alias:", "visit:", "<="],
  75. referencedClasses: ["OrderedCollection"]
  76. }),
  77. smalltalk.IRASTTranslator);
  78. smalltalk.addMethod(
  79. "_method",
  80. smalltalk.method({
  81. selector: "method",
  82. category: 'accessing',
  83. fn: function (){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx1) { var $1;
  86. $1=self["@method"];
  87. return $1;
  88. }, function($ctx1) {$ctx1.fill(self,"method", [], {}, smalltalk.IRASTTranslator)})},
  89. args: [],
  90. source: "method\x0a\x09^ method",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. smalltalk.IRASTTranslator);
  95. smalltalk.addMethod(
  96. "_method_",
  97. smalltalk.method({
  98. selector: "method:",
  99. category: 'accessing',
  100. fn: function (anIRMethod){
  101. var self=this;
  102. return smalltalk.withContext(function($ctx1) { self["@method"]=anIRMethod;
  103. return self}, function($ctx1) {$ctx1.fill(self,"method:", [anIRMethod], {}, smalltalk.IRASTTranslator)})},
  104. args: ["anIRMethod"],
  105. source: "method: anIRMethod\x0a\x09method := anIRMethod",
  106. messageSends: [],
  107. referencedClasses: []
  108. }),
  109. smalltalk.IRASTTranslator);
  110. smalltalk.addMethod(
  111. "_nextAlias",
  112. smalltalk.method({
  113. selector: "nextAlias",
  114. category: 'accessing',
  115. fn: function (){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) { var $1,$2;
  118. $1=self["@nextAlias"];
  119. if(($receiver = $1) == nil || $receiver == undefined){
  120. self["@nextAlias"]=(0);
  121. self["@nextAlias"];
  122. } else {
  123. $1;
  124. };
  125. self["@nextAlias"]=_st(self["@nextAlias"]).__plus((1));
  126. $2=_st(self["@nextAlias"])._asString();
  127. return $2;
  128. }, function($ctx1) {$ctx1.fill(self,"nextAlias", [], {}, smalltalk.IRASTTranslator)})},
  129. args: [],
  130. source: "nextAlias\x0a\x09nextAlias ifNil: [ nextAlias := 0 ].\x0a\x09nextAlias := nextAlias + 1.\x0a\x09^ nextAlias asString",
  131. messageSends: ["ifNil:", "+", "asString"],
  132. referencedClasses: []
  133. }),
  134. smalltalk.IRASTTranslator);
  135. smalltalk.addMethod(
  136. "_sequence",
  137. smalltalk.method({
  138. selector: "sequence",
  139. category: 'accessing',
  140. fn: function (){
  141. var self=this;
  142. return smalltalk.withContext(function($ctx1) { var $1;
  143. $1=self["@sequence"];
  144. return $1;
  145. }, function($ctx1) {$ctx1.fill(self,"sequence", [], {}, smalltalk.IRASTTranslator)})},
  146. args: [],
  147. source: "sequence\x0a\x09^ sequence",
  148. messageSends: [],
  149. referencedClasses: []
  150. }),
  151. smalltalk.IRASTTranslator);
  152. smalltalk.addMethod(
  153. "_sequence_",
  154. smalltalk.method({
  155. selector: "sequence:",
  156. category: 'accessing',
  157. fn: function (anIRSequence){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) { self["@sequence"]=anIRSequence;
  160. return self}, function($ctx1) {$ctx1.fill(self,"sequence:", [anIRSequence], {}, smalltalk.IRASTTranslator)})},
  161. args: ["anIRSequence"],
  162. source: "sequence: anIRSequence\x0a\x09sequence := anIRSequence",
  163. messageSends: [],
  164. referencedClasses: []
  165. }),
  166. smalltalk.IRASTTranslator);
  167. smalltalk.addMethod(
  168. "_source",
  169. smalltalk.method({
  170. selector: "source",
  171. category: 'accessing',
  172. fn: function (){
  173. var self=this;
  174. return smalltalk.withContext(function($ctx1) { var $1;
  175. $1=self["@source"];
  176. return $1;
  177. }, function($ctx1) {$ctx1.fill(self,"source", [], {}, smalltalk.IRASTTranslator)})},
  178. args: [],
  179. source: "source\x0a\x09^ source",
  180. messageSends: [],
  181. referencedClasses: []
  182. }),
  183. smalltalk.IRASTTranslator);
  184. smalltalk.addMethod(
  185. "_source_",
  186. smalltalk.method({
  187. selector: "source:",
  188. category: 'accessing',
  189. fn: function (aString){
  190. var self=this;
  191. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  192. return self}, function($ctx1) {$ctx1.fill(self,"source:", [aString], {}, smalltalk.IRASTTranslator)})},
  193. args: ["aString"],
  194. source: "source: aString\x0a\x09source := aString",
  195. messageSends: [],
  196. referencedClasses: []
  197. }),
  198. smalltalk.IRASTTranslator);
  199. smalltalk.addMethod(
  200. "_theClass",
  201. smalltalk.method({
  202. selector: "theClass",
  203. category: 'accessing',
  204. fn: function (){
  205. var self=this;
  206. return smalltalk.withContext(function($ctx1) { var $1;
  207. $1=self["@theClass"];
  208. return $1;
  209. }, function($ctx1) {$ctx1.fill(self,"theClass", [], {}, smalltalk.IRASTTranslator)})},
  210. args: [],
  211. source: "theClass\x0a\x09^ theClass",
  212. messageSends: [],
  213. referencedClasses: []
  214. }),
  215. smalltalk.IRASTTranslator);
  216. smalltalk.addMethod(
  217. "_theClass_",
  218. smalltalk.method({
  219. selector: "theClass:",
  220. category: 'accessing',
  221. fn: function (aClass){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  224. return self}, function($ctx1) {$ctx1.fill(self,"theClass:", [aClass], {}, smalltalk.IRASTTranslator)})},
  225. args: ["aClass"],
  226. source: "theClass: aClass\x0a\x09theClass := aClass",
  227. messageSends: [],
  228. referencedClasses: []
  229. }),
  230. smalltalk.IRASTTranslator);
  231. smalltalk.addMethod(
  232. "_visitAssignmentNode_",
  233. smalltalk.method({
  234. selector: "visitAssignmentNode:",
  235. category: 'visiting',
  236. fn: function (aNode){
  237. var self=this;
  238. var left,right,assignment;
  239. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  240. right=_st(self)._visit_(_st(aNode)._right());
  241. left=_st(self)._visit_(_st(aNode)._left());
  242. $1=_st((smalltalk.IRAssignment || IRAssignment))._new();
  243. _st($1)._add_(left);
  244. _st($1)._add_(right);
  245. $2=_st($1)._yourself();
  246. _st(_st(self)._sequence())._add_($2);
  247. $3=left;
  248. return $3;
  249. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:", [aNode], {left:left,right:right,assignment:assignment}, smalltalk.IRASTTranslator)})},
  250. args: ["aNode"],
  251. source: "visitAssignmentNode: aNode\x0a\x09| left right assignment |\x0a\x09right := self visit: aNode right.\x0a\x09left := self visit: aNode left.\x0a\x09self sequence add: (IRAssignment new \x0a\x09\x09add: left;\x0a\x09\x09add: right;\x0a\x09\x09yourself).\x0a\x09^ left",
  252. messageSends: ["visit:", "right", "left", "add:", "new", "yourself", "sequence"],
  253. referencedClasses: ["IRAssignment"]
  254. }),
  255. smalltalk.IRASTTranslator);
  256. smalltalk.addMethod(
  257. "_visitBlockNode_",
  258. smalltalk.method({
  259. selector: "visitBlockNode:",
  260. category: 'visiting',
  261. fn: function (aNode){
  262. var self=this;
  263. var closure;
  264. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  265. $1=_st((smalltalk.IRClosure || IRClosure))._new();
  266. _st($1)._arguments_(_st(aNode)._parameters());
  267. _st($1)._scope_(_st(aNode)._scope());
  268. $2=_st($1)._yourself();
  269. closure=$2;
  270. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  271. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  272. _st($3)._name_(_st(each)._name());
  273. _st($3)._scope_(_st(aNode)._scope());
  274. $4=_st($3)._yourself();
  275. return _st(closure)._add_($4);
  276. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  277. _st(_st(aNode)._nodes())._do_((function(each){
  278. return smalltalk.withContext(function($ctx2) { return _st(closure)._add_(_st(self)._visit_(each));
  279. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  280. $5=closure;
  281. return $5;
  282. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:", [aNode], {closure:closure}, smalltalk.IRASTTranslator)})},
  283. args: ["aNode"],
  284. source: "visitBlockNode: aNode\x0a\x09| closure |\x0a\x09closure := IRClosure new\x0a\x09\x09arguments: aNode parameters;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself.\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09closure add: (IRTempDeclaration new \x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x09aNode nodes do: [ :each | closure add: (self visit: each) ].\x0a\x09^ closure",
  285. messageSends: ["arguments:", "parameters", "new", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "temps", "visit:", "nodes"],
  286. referencedClasses: ["IRClosure", "IRTempDeclaration"]
  287. }),
  288. smalltalk.IRASTTranslator);
  289. smalltalk.addMethod(
  290. "_visitBlockSequenceNode_",
  291. smalltalk.method({
  292. selector: "visitBlockSequenceNode:",
  293. category: 'visiting',
  294. fn: function (aNode){
  295. var self=this;
  296. return smalltalk.withContext(function($ctx1) { var $2,$3,$5,$7,$8,$9,$6,$4,$1;
  297. $2=self;
  298. $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
  299. $4=(function(){
  300. return smalltalk.withContext(function($ctx2) { $5=_st(aNode)._nodes();
  301. $6=(function(){
  302. return smalltalk.withContext(function($ctx3) { _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  303. return smalltalk.withContext(function($ctx4) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  304. }, function($ctx4) {$ctx4.fillBlock([each], {})})}));
  305. $7=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
  306. if(smalltalk.assert($7)){
  307. return _st(_st(self)._sequence())._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  308. } else {
  309. $8=_st((smalltalk.IRBlockReturn || IRBlockReturn))._new();
  310. _st($8)._add_(_st(self)._visit_(_st(_st(aNode)._nodes())._last()));
  311. $9=_st($8)._yourself();
  312. return _st(_st(self)._sequence())._add_($9);
  313. };
  314. }, function($ctx3) {$ctx3.fillBlock([], {})})});
  315. return _st($5)._ifNotEmpty_($6);
  316. }, function($ctx2) {$ctx2.fillBlock([], {})})});
  317. $1=_st($2)._withSequence_do_($3,$4);
  318. return $1;
  319. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:", [aNode], {}, smalltalk.IRASTTranslator)})},
  320. args: ["aNode"],
  321. source: "visitBlockSequenceNode: aNode\x0a\x09^ self\x0a\x09\x09withSequence: IRBlockSequence new\x0a\x09\x09do: [ \x0a\x09\x09\x09aNode nodes ifNotEmpty: [\x0a\x09\x09\x09\x09aNode nodes allButLast do: [ :each | \x0a\x09\x09\x09\x09\x09self sequence add: (self visit: each) ].\x0a\x09\x09\x09\x09aNode nodes last isReturnNode \x0a\x09\x09\x09\x09\x09ifFalse: [ self sequence add: (IRBlockReturn new add: (self visit: aNode nodes last); yourself) ]\x0a\x09\x09\x09\x09\x09ifTrue: [ self sequence add: (self visit: aNode nodes last) ]]]",
  322. messageSends: ["withSequence:do:", "new", "ifNotEmpty:", "do:", "add:", "visit:", "sequence", "allButLast", "nodes", "ifFalse:ifTrue:", "last", "yourself", "isReturnNode"],
  323. referencedClasses: ["IRBlockSequence", "IRBlockReturn"]
  324. }),
  325. smalltalk.IRASTTranslator);
  326. smalltalk.addMethod(
  327. "_visitCascadeNode_",
  328. smalltalk.method({
  329. selector: "visitCascadeNode:",
  330. category: 'visiting',
  331. fn: function (aNode){
  332. var self=this;
  333. var alias;
  334. return smalltalk.withContext(function($ctx1) { var $1,$2;
  335. $1=_st(_st(aNode)._receiver())._isImmutable();
  336. if(! smalltalk.assert($1)){
  337. alias=_st(self)._alias_(_st(aNode)._receiver());
  338. alias;
  339. _st(_st(aNode)._nodes())._do_((function(each){
  340. return smalltalk.withContext(function($ctx2) { return _st(each)._receiver_(_st(_st((smalltalk.VariableNode || VariableNode))._new())._binding_(_st(alias)._variable()));
  341. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  342. };
  343. _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  344. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._sequence())._add_(_st(self)._visit_(each));
  345. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  346. $2=_st(self)._alias_(_st(_st(aNode)._nodes())._last());
  347. return $2;
  348. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:", [aNode], {alias:alias}, smalltalk.IRASTTranslator)})},
  349. args: ["aNode"],
  350. source: "visitCascadeNode: aNode\x0a\x09| alias |\x0a\x0a\x09aNode receiver isImmutable ifFalse: [ \x0a\x09\x09alias := self alias: aNode receiver.\x0a\x09\x09aNode nodes do: [ :each |\x0a\x09\x09\x09each receiver: (VariableNode new binding: alias variable) ]].\x0a\x0a\x09aNode nodes allButLast do: [ :each |\x0a\x09\x09self sequence add: (self visit: each) ].\x0a\x0a\x09^ self alias: aNode nodes last",
  351. messageSends: ["ifFalse:", "alias:", "receiver", "do:", "receiver:", "binding:", "variable", "new", "nodes", "isImmutable", "add:", "visit:", "sequence", "allButLast", "last"],
  352. referencedClasses: ["VariableNode"]
  353. }),
  354. smalltalk.IRASTTranslator);
  355. smalltalk.addMethod(
  356. "_visitDynamicArrayNode_",
  357. smalltalk.method({
  358. selector: "visitDynamicArrayNode:",
  359. category: 'visiting',
  360. fn: function (aNode){
  361. var self=this;
  362. var array;
  363. return smalltalk.withContext(function($ctx1) { var $1;
  364. array=_st((smalltalk.IRDynamicArray || IRDynamicArray))._new();
  365. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  366. return smalltalk.withContext(function($ctx2) { return _st(array)._add_(each);
  367. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  368. $1=array;
  369. return $1;
  370. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:", [aNode], {array:array}, smalltalk.IRASTTranslator)})},
  371. args: ["aNode"],
  372. source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09array := IRDynamicArray new.\x0a\x09(self aliasTemporally: aNode nodes) do: [:each | array add: each].\x0a\x09^ array",
  373. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
  374. referencedClasses: ["IRDynamicArray"]
  375. }),
  376. smalltalk.IRASTTranslator);
  377. smalltalk.addMethod(
  378. "_visitDynamicDictionaryNode_",
  379. smalltalk.method({
  380. selector: "visitDynamicDictionaryNode:",
  381. category: 'visiting',
  382. fn: function (aNode){
  383. var self=this;
  384. var dictionary;
  385. return smalltalk.withContext(function($ctx1) { var $1;
  386. dictionary=_st((smalltalk.IRDynamicDictionary || IRDynamicDictionary))._new();
  387. _st(_st(self)._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  388. return smalltalk.withContext(function($ctx2) { return _st(dictionary)._add_(each);
  389. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  390. $1=dictionary;
  391. return $1;
  392. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:", [aNode], {dictionary:dictionary}, smalltalk.IRASTTranslator)})},
  393. args: ["aNode"],
  394. source: "visitDynamicDictionaryNode: aNode\x0a\x09| dictionary |\x0a\x09dictionary := IRDynamicDictionary new.\x0a (self aliasTemporally: aNode nodes) do: [:each | dictionary add: each].\x0a\x09^ dictionary",
  395. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"],
  396. referencedClasses: ["IRDynamicDictionary"]
  397. }),
  398. smalltalk.IRASTTranslator);
  399. smalltalk.addMethod(
  400. "_visitJSStatementNode_",
  401. smalltalk.method({
  402. selector: "visitJSStatementNode:",
  403. category: 'visiting',
  404. fn: function (aNode){
  405. var self=this;
  406. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  407. $2=_st((smalltalk.IRVerbatim || IRVerbatim))._new();
  408. _st($2)._source_(_st(aNode)._source());
  409. $3=_st($2)._yourself();
  410. $1=$3;
  411. return $1;
  412. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:", [aNode], {}, smalltalk.IRASTTranslator)})},
  413. args: ["aNode"],
  414. source: "visitJSStatementNode: aNode\x0a\x09^ IRVerbatim new\x0a\x09\x09source: aNode source;\x0a\x09\x09yourself",
  415. messageSends: ["source:", "source", "new", "yourself"],
  416. referencedClasses: ["IRVerbatim"]
  417. }),
  418. smalltalk.IRASTTranslator);
  419. smalltalk.addMethod(
  420. "_visitMethodNode_",
  421. smalltalk.method({
  422. selector: "visitMethodNode:",
  423. category: 'visiting',
  424. fn: function (aNode){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  427. $1=_st((smalltalk.IRMethod || IRMethod))._new();
  428. _st($1)._source_(_st(self)._source());
  429. _st($1)._theClass_(_st(self)._theClass());
  430. _st($1)._arguments_(_st(aNode)._arguments());
  431. _st($1)._selector_(_st(aNode)._selector());
  432. _st($1)._messageSends_(_st(aNode)._messageSends());
  433. _st($1)._superSends_(_st(aNode)._superSends());
  434. _st($1)._classReferences_(_st(aNode)._classReferences());
  435. _st($1)._scope_(_st(aNode)._scope());
  436. $2=_st($1)._yourself();
  437. _st(self)._method_($2);
  438. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  439. return smalltalk.withContext(function($ctx2) { $3=_st((smalltalk.IRTempDeclaration || IRTempDeclaration))._new();
  440. _st($3)._name_(_st(each)._name());
  441. _st($3)._scope_(_st(aNode)._scope());
  442. $4=_st($3)._yourself();
  443. return _st(_st(self)._method())._add_($4);
  444. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  445. _st(_st(aNode)._nodes())._do_((function(each){
  446. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._method())._add_(_st(self)._visit_(each));
  447. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  448. $5=_st(_st(aNode)._scope())._hasLocalReturn();
  449. if(! smalltalk.assert($5)){
  450. $6=_st((smalltalk.IRVariable || IRVariable))._new();
  451. _st($6)._variable_(_st(_st(_st(aNode)._scope())._pseudoVars())._at_("self"));
  452. $7=_st($6)._yourself();
  453. _st(_st(_st(self)._method())._add_(_st((smalltalk.IRReturn || IRReturn))._new()))._add_($7);
  454. };
  455. $8=_st(self)._method();
  456. return $8;
  457. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:", [aNode], {}, smalltalk.IRASTTranslator)})},
  458. args: ["aNode"],
  459. source: "visitMethodNode: aNode\x0a\x0a\x09self method: (IRMethod new\x0a\x09\x09source: self source;\x0a theClass: self theClass;\x0a\x09\x09arguments: aNode arguments;\x0a\x09\x09selector: aNode selector;\x0a\x09\x09messageSends: aNode messageSends;\x0a superSends: aNode superSends;\x0a\x09\x09classReferences: aNode classReferences;\x0a\x09\x09scope: aNode scope;\x0a\x09\x09yourself).\x0a\x0a\x09aNode scope temps do: [ :each |\x0a\x09\x09self method add: (IRTempDeclaration new\x0a\x09\x09\x09name: each name;\x0a scope: aNode scope;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09aNode nodes do: [ :each | self method add: (self visit: each) ].\x0a\x0a\x09aNode scope hasLocalReturn ifFalse: [\x0a\x09\x09(self method add: IRReturn new) add: (IRVariable new\x0a\x09\x09\x09variable: (aNode scope pseudoVars at: 'self');\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09^ self method",
  460. messageSends: ["method:", "source:", "source", "new", "theClass:", "theClass", "arguments:", "arguments", "selector:", "selector", "messageSends:", "messageSends", "superSends:", "superSends", "classReferences:", "classReferences", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "method", "temps", "visit:", "nodes", "ifFalse:", "variable:", "at:", "pseudoVars", "hasLocalReturn"],
  461. referencedClasses: ["IRMethod", "IRTempDeclaration", "IRVariable", "IRReturn"]
  462. }),
  463. smalltalk.IRASTTranslator);
  464. smalltalk.addMethod(
  465. "_visitReturnNode_",
  466. smalltalk.method({
  467. selector: "visitReturnNode:",
  468. category: 'visiting',
  469. fn: function (aNode){
  470. var self=this;
  471. var return_;
  472. return smalltalk.withContext(function($ctx1) { var $1,$2;
  473. $1=_st(aNode)._nonLocalReturn();
  474. if(smalltalk.assert($1)){
  475. return_=_st((smalltalk.IRNonLocalReturn || IRNonLocalReturn))._new();
  476. } else {
  477. return_=_st((smalltalk.IRReturn || IRReturn))._new();
  478. };
  479. _st(return_)._scope_(_st(aNode)._scope());
  480. _st(_st(aNode)._nodes())._do_((function(each){
  481. return smalltalk.withContext(function($ctx2) { return _st(return_)._add_(_st(self)._alias_(each));
  482. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  483. $2=return_;
  484. return $2;
  485. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:", [aNode], {return_:return_}, smalltalk.IRASTTranslator)})},
  486. args: ["aNode"],
  487. source: "visitReturnNode: aNode\x0a\x09| return |\x0a\x09return := aNode nonLocalReturn \x0a\x09\x09ifTrue: [ IRNonLocalReturn new ]\x0a\x09\x09ifFalse: [ IRReturn new ].\x0a\x09return scope: aNode scope.\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09return add: (self alias: each) ].\x0a\x09^ return",
  488. messageSends: ["ifTrue:ifFalse:", "new", "nonLocalReturn", "scope:", "scope", "do:", "add:", "alias:", "nodes"],
  489. referencedClasses: ["IRNonLocalReturn", "IRReturn"]
  490. }),
  491. smalltalk.IRASTTranslator);
  492. smalltalk.addMethod(
  493. "_visitSendNode_",
  494. smalltalk.method({
  495. selector: "visitSendNode:",
  496. category: 'visiting',
  497. fn: function (aNode){
  498. var self=this;
  499. var send,all,receiver,arguments;
  500. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  501. send=_st((smalltalk.IRSend || IRSend))._new();
  502. $1=send;
  503. _st($1)._selector_(_st(aNode)._selector());
  504. $2=_st($1)._index_(_st(aNode)._index());
  505. $3=_st(aNode)._superSend();
  506. if(smalltalk.assert($3)){
  507. _st(send)._classSend_(_st(_st(self)._theClass())._superclass());
  508. };
  509. all=_st(self)._aliasTemporally_(_st([_st(aNode)._receiver()]).__comma(_st(aNode)._arguments()));
  510. receiver=_st(all)._first();
  511. arguments=_st(all)._allButFirst();
  512. _st(send)._add_(receiver);
  513. _st(arguments)._do_((function(each){
  514. return smalltalk.withContext(function($ctx2) { return _st(send)._add_(each);
  515. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  516. $4=send;
  517. return $4;
  518. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:", [aNode], {send:send,all:all,receiver:receiver,arguments:arguments}, smalltalk.IRASTTranslator)})},
  519. args: ["aNode"],
  520. source: "visitSendNode: aNode\x0a\x09| send all receiver arguments |\x0a\x09send := IRSend new.\x0a\x09send \x0a\x09\x09selector: aNode selector;\x0a\x09\x09index: aNode index.\x0a\x09aNode superSend ifTrue: [ send classSend: self theClass superclass ].\x0a \x0a all := self aliasTemporally: { aNode receiver }, aNode arguments.\x0a\x09receiver := all first.\x0a\x09arguments := all allButFirst.\x0a\x0a\x09send add: receiver.\x0a\x09arguments do: [ :each | send add: each ].\x0a\x0a\x09^ send",
  521. messageSends: ["new", "selector:", "selector", "index:", "index", "ifTrue:", "classSend:", "superclass", "theClass", "superSend", "aliasTemporally:", ",", "arguments", "receiver", "first", "allButFirst", "add:", "do:"],
  522. referencedClasses: ["IRSend"]
  523. }),
  524. smalltalk.IRASTTranslator);
  525. smalltalk.addMethod(
  526. "_visitSequenceNode_",
  527. smalltalk.method({
  528. selector: "visitSequenceNode:",
  529. category: 'visiting',
  530. fn: function (aNode){
  531. var self=this;
  532. return smalltalk.withContext(function($ctx1) { var $2,$3,$5,$7,$6,$4,$1;
  533. $2=self;
  534. $3=_st((smalltalk.IRSequence || IRSequence))._new();
  535. $4=(function(){
  536. return smalltalk.withContext(function($ctx2) { $5=_st(aNode)._nodes();
  537. $6=(function(each){
  538. var instruction;
  539. return smalltalk.withContext(function($ctx3) { instruction=_st(self)._visit_(each);
  540. instruction;
  541. $7=_st(instruction)._isVariable();
  542. if(! smalltalk.assert($7)){
  543. return _st(_st(self)._sequence())._add_(instruction);
  544. };
  545. }, function($ctx3) {$ctx3.fillBlock([each], {instruction:instruction})})});
  546. return _st($5)._do_($6);
  547. }, function($ctx2) {$ctx2.fillBlock([], {})})});
  548. $1=_st($2)._withSequence_do_($3,$4);
  549. return $1;
  550. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:", [aNode], {}, smalltalk.IRASTTranslator)})},
  551. args: ["aNode"],
  552. source: "visitSequenceNode: aNode\x0a\x09^ self \x0a\x09\x09withSequence: IRSequence new \x09\x0a\x09\x09do: [\x0a\x09\x09\x09aNode nodes do: [ :each | | instruction |\x0a\x09\x09\x09\x09instruction := self visit: each.\x0a\x09\x09\x09\x09instruction isVariable ifFalse: [\x0a\x09\x09\x09\x09\x09self sequence add: instruction ]]]",
  553. messageSends: ["withSequence:do:", "new", "do:", "visit:", "ifFalse:", "add:", "sequence", "isVariable", "nodes"],
  554. referencedClasses: ["IRSequence"]
  555. }),
  556. smalltalk.IRASTTranslator);
  557. smalltalk.addMethod(
  558. "_visitValueNode_",
  559. smalltalk.method({
  560. selector: "visitValueNode:",
  561. category: 'visiting',
  562. fn: function (aNode){
  563. var self=this;
  564. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  565. $2=_st((smalltalk.IRValue || IRValue))._new();
  566. _st($2)._value_(_st(aNode)._value());
  567. $3=_st($2)._yourself();
  568. $1=$3;
  569. return $1;
  570. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:", [aNode], {}, smalltalk.IRASTTranslator)})},
  571. args: ["aNode"],
  572. source: "visitValueNode: aNode\x0a\x09^ IRValue new \x0a\x09\x09value: aNode value; \x0a\x09\x09yourself",
  573. messageSends: ["value:", "value", "new", "yourself"],
  574. referencedClasses: ["IRValue"]
  575. }),
  576. smalltalk.IRASTTranslator);
  577. smalltalk.addMethod(
  578. "_visitVariableNode_",
  579. smalltalk.method({
  580. selector: "visitVariableNode:",
  581. category: 'visiting',
  582. fn: function (aNode){
  583. var self=this;
  584. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  585. $2=_st((smalltalk.IRVariable || IRVariable))._new();
  586. _st($2)._variable_(_st(aNode)._binding());
  587. $3=_st($2)._yourself();
  588. $1=$3;
  589. return $1;
  590. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:", [aNode], {}, smalltalk.IRASTTranslator)})},
  591. args: ["aNode"],
  592. source: "visitVariableNode: aNode\x0a\x09^ IRVariable new \x0a\x09\x09variable: aNode binding; \x0a\x09\x09yourself",
  593. messageSends: ["variable:", "binding", "new", "yourself"],
  594. referencedClasses: ["IRVariable"]
  595. }),
  596. smalltalk.IRASTTranslator);
  597. smalltalk.addMethod(
  598. "_withSequence_do_",
  599. smalltalk.method({
  600. selector: "withSequence:do:",
  601. category: 'accessing',
  602. fn: function (aSequence,aBlock){
  603. var self=this;
  604. var outerSequence;
  605. return smalltalk.withContext(function($ctx1) { var $1;
  606. outerSequence=_st(self)._sequence();
  607. _st(self)._sequence_(aSequence);
  608. _st(aBlock)._value();
  609. _st(self)._sequence_(outerSequence);
  610. $1=aSequence;
  611. return $1;
  612. }, function($ctx1) {$ctx1.fill(self,"withSequence:do:", [aSequence,aBlock], {outerSequence:outerSequence}, smalltalk.IRASTTranslator)})},
  613. args: ["aSequence", "aBlock"],
  614. source: "withSequence: aSequence do: aBlock\x0a\x09| outerSequence |\x0a\x09outerSequence := self sequence.\x0a\x09self sequence: aSequence.\x0a\x09aBlock value.\x0a\x09self sequence: outerSequence.\x0a\x09^ aSequence",
  615. messageSends: ["sequence", "sequence:", "value"],
  616. referencedClasses: []
  617. }),
  618. smalltalk.IRASTTranslator);
  619. smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler-IR');
  620. smalltalk.IRInstruction.comment="I am the abstract root class of the IR (intermediate representation) instructions class hierarchy.\x0aThe IR graph is used to emit JavaScript code using a JSStream."
  621. smalltalk.addMethod(
  622. "_accept_",
  623. smalltalk.method({
  624. selector: "accept:",
  625. category: 'visiting',
  626. fn: function (aVisitor){
  627. var self=this;
  628. return smalltalk.withContext(function($ctx1) { var $1;
  629. $1=_st(aVisitor)._visitIRInstruction_(self);
  630. return $1;
  631. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRInstruction)})},
  632. args: ["aVisitor"],
  633. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInstruction: self",
  634. messageSends: ["visitIRInstruction:"],
  635. referencedClasses: []
  636. }),
  637. smalltalk.IRInstruction);
  638. smalltalk.addMethod(
  639. "_add_",
  640. smalltalk.method({
  641. selector: "add:",
  642. category: 'building',
  643. fn: function (anObject){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx1) { var $1;
  646. _st(anObject)._parent_(self);
  647. $1=_st(_st(self)._instructions())._add_(anObject);
  648. return $1;
  649. }, function($ctx1) {$ctx1.fill(self,"add:", [anObject], {}, smalltalk.IRInstruction)})},
  650. args: ["anObject"],
  651. source: "add: anObject\x0a\x09anObject parent: self.\x0a\x09^ self instructions add: anObject",
  652. messageSends: ["parent:", "add:", "instructions"],
  653. referencedClasses: []
  654. }),
  655. smalltalk.IRInstruction);
  656. smalltalk.addMethod(
  657. "_canBeAssigned",
  658. smalltalk.method({
  659. selector: "canBeAssigned",
  660. category: 'testing',
  661. fn: function (){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) { return true;
  664. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned", [], {}, smalltalk.IRInstruction)})},
  665. args: [],
  666. source: "canBeAssigned\x0a\x09^ true",
  667. messageSends: [],
  668. referencedClasses: []
  669. }),
  670. smalltalk.IRInstruction);
  671. smalltalk.addMethod(
  672. "_instructions",
  673. smalltalk.method({
  674. selector: "instructions",
  675. category: 'accessing',
  676. fn: function (){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) { var $2,$1;
  679. $2=self["@instructions"];
  680. if(($receiver = $2) == nil || $receiver == undefined){
  681. self["@instructions"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  682. $1=self["@instructions"];
  683. } else {
  684. $1=$2;
  685. };
  686. return $1;
  687. }, function($ctx1) {$ctx1.fill(self,"instructions", [], {}, smalltalk.IRInstruction)})},
  688. args: [],
  689. source: "instructions\x0a\x09^ instructions ifNil: [ instructions := OrderedCollection new ]",
  690. messageSends: ["ifNil:", "new"],
  691. referencedClasses: ["OrderedCollection"]
  692. }),
  693. smalltalk.IRInstruction);
  694. smalltalk.addMethod(
  695. "_isClosure",
  696. smalltalk.method({
  697. selector: "isClosure",
  698. category: 'testing',
  699. fn: function (){
  700. var self=this;
  701. return smalltalk.withContext(function($ctx1) { return false;
  702. }, function($ctx1) {$ctx1.fill(self,"isClosure", [], {}, smalltalk.IRInstruction)})},
  703. args: [],
  704. source: "isClosure\x0a\x09^ false",
  705. messageSends: [],
  706. referencedClasses: []
  707. }),
  708. smalltalk.IRInstruction);
  709. smalltalk.addMethod(
  710. "_isInlined",
  711. smalltalk.method({
  712. selector: "isInlined",
  713. category: 'testing',
  714. fn: function (){
  715. var self=this;
  716. return smalltalk.withContext(function($ctx1) { return false;
  717. }, function($ctx1) {$ctx1.fill(self,"isInlined", [], {}, smalltalk.IRInstruction)})},
  718. args: [],
  719. source: "isInlined\x0a\x09^ false",
  720. messageSends: [],
  721. referencedClasses: []
  722. }),
  723. smalltalk.IRInstruction);
  724. smalltalk.addMethod(
  725. "_isLocalReturn",
  726. smalltalk.method({
  727. selector: "isLocalReturn",
  728. category: 'testing',
  729. fn: function (){
  730. var self=this;
  731. return smalltalk.withContext(function($ctx1) { return false;
  732. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn", [], {}, smalltalk.IRInstruction)})},
  733. args: [],
  734. source: "isLocalReturn\x0a\x09^ false",
  735. messageSends: [],
  736. referencedClasses: []
  737. }),
  738. smalltalk.IRInstruction);
  739. smalltalk.addMethod(
  740. "_isReturn",
  741. smalltalk.method({
  742. selector: "isReturn",
  743. category: 'testing',
  744. fn: function (){
  745. var self=this;
  746. return smalltalk.withContext(function($ctx1) { return false;
  747. }, function($ctx1) {$ctx1.fill(self,"isReturn", [], {}, smalltalk.IRInstruction)})},
  748. args: [],
  749. source: "isReturn\x0a\x09^ false",
  750. messageSends: [],
  751. referencedClasses: []
  752. }),
  753. smalltalk.IRInstruction);
  754. smalltalk.addMethod(
  755. "_isSend",
  756. smalltalk.method({
  757. selector: "isSend",
  758. category: 'testing',
  759. fn: function (){
  760. var self=this;
  761. return smalltalk.withContext(function($ctx1) { return false;
  762. }, function($ctx1) {$ctx1.fill(self,"isSend", [], {}, smalltalk.IRInstruction)})},
  763. args: [],
  764. source: "isSend\x0a\x09^ false",
  765. messageSends: [],
  766. referencedClasses: []
  767. }),
  768. smalltalk.IRInstruction);
  769. smalltalk.addMethod(
  770. "_isSequence",
  771. smalltalk.method({
  772. selector: "isSequence",
  773. category: 'testing',
  774. fn: function (){
  775. var self=this;
  776. return smalltalk.withContext(function($ctx1) { return false;
  777. }, function($ctx1) {$ctx1.fill(self,"isSequence", [], {}, smalltalk.IRInstruction)})},
  778. args: [],
  779. source: "isSequence\x0a\x09^ false",
  780. messageSends: [],
  781. referencedClasses: []
  782. }),
  783. smalltalk.IRInstruction);
  784. smalltalk.addMethod(
  785. "_isTempDeclaration",
  786. smalltalk.method({
  787. selector: "isTempDeclaration",
  788. category: 'testing',
  789. fn: function (){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) { return false;
  792. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration", [], {}, smalltalk.IRInstruction)})},
  793. args: [],
  794. source: "isTempDeclaration\x0a\x09^ false",
  795. messageSends: [],
  796. referencedClasses: []
  797. }),
  798. smalltalk.IRInstruction);
  799. smalltalk.addMethod(
  800. "_isVariable",
  801. smalltalk.method({
  802. selector: "isVariable",
  803. category: 'testing',
  804. fn: function (){
  805. var self=this;
  806. return smalltalk.withContext(function($ctx1) { return false;
  807. }, function($ctx1) {$ctx1.fill(self,"isVariable", [], {}, smalltalk.IRInstruction)})},
  808. args: [],
  809. source: "isVariable\x0a\x09^ false",
  810. messageSends: [],
  811. referencedClasses: []
  812. }),
  813. smalltalk.IRInstruction);
  814. smalltalk.addMethod(
  815. "_parent",
  816. smalltalk.method({
  817. selector: "parent",
  818. category: 'accessing',
  819. fn: function (){
  820. var self=this;
  821. return smalltalk.withContext(function($ctx1) { var $1;
  822. $1=self["@parent"];
  823. return $1;
  824. }, function($ctx1) {$ctx1.fill(self,"parent", [], {}, smalltalk.IRInstruction)})},
  825. args: [],
  826. source: "parent\x0a\x09^ parent",
  827. messageSends: [],
  828. referencedClasses: []
  829. }),
  830. smalltalk.IRInstruction);
  831. smalltalk.addMethod(
  832. "_parent_",
  833. smalltalk.method({
  834. selector: "parent:",
  835. category: 'accessing',
  836. fn: function (anIRInstruction){
  837. var self=this;
  838. return smalltalk.withContext(function($ctx1) { self["@parent"]=anIRInstruction;
  839. return self}, function($ctx1) {$ctx1.fill(self,"parent:", [anIRInstruction], {}, smalltalk.IRInstruction)})},
  840. args: ["anIRInstruction"],
  841. source: "parent: anIRInstruction\x0a\x09parent := anIRInstruction",
  842. messageSends: [],
  843. referencedClasses: []
  844. }),
  845. smalltalk.IRInstruction);
  846. smalltalk.addMethod(
  847. "_remove",
  848. smalltalk.method({
  849. selector: "remove",
  850. category: 'building',
  851. fn: function (){
  852. var self=this;
  853. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._remove_(self);
  854. return self}, function($ctx1) {$ctx1.fill(self,"remove", [], {}, smalltalk.IRInstruction)})},
  855. args: [],
  856. source: "remove\x0a\x09self parent remove: self",
  857. messageSends: ["remove:", "parent"],
  858. referencedClasses: []
  859. }),
  860. smalltalk.IRInstruction);
  861. smalltalk.addMethod(
  862. "_remove_",
  863. smalltalk.method({
  864. selector: "remove:",
  865. category: 'building',
  866. fn: function (anIRInstruction){
  867. var self=this;
  868. return smalltalk.withContext(function($ctx1) { _st(_st(self)._instructions())._remove_(anIRInstruction);
  869. return self}, function($ctx1) {$ctx1.fill(self,"remove:", [anIRInstruction], {}, smalltalk.IRInstruction)})},
  870. args: ["anIRInstruction"],
  871. source: "remove: anIRInstruction\x0a\x09self instructions remove: anIRInstruction",
  872. messageSends: ["remove:", "instructions"],
  873. referencedClasses: []
  874. }),
  875. smalltalk.IRInstruction);
  876. smalltalk.addMethod(
  877. "_replace_with_",
  878. smalltalk.method({
  879. selector: "replace:with:",
  880. category: 'building',
  881. fn: function (anIRInstruction,anotherIRInstruction){
  882. var self=this;
  883. return smalltalk.withContext(function($ctx1) { _st(anotherIRInstruction)._parent_(self);
  884. _st(_st(self)._instructions())._at_put_(_st(_st(self)._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
  885. return self}, function($ctx1) {$ctx1.fill(self,"replace:with:", [anIRInstruction,anotherIRInstruction], {}, smalltalk.IRInstruction)})},
  886. args: ["anIRInstruction", "anotherIRInstruction"],
  887. source: "replace: anIRInstruction with: anotherIRInstruction\x0a\x09anotherIRInstruction parent: self.\x0a\x09self instructions \x0a\x09\x09at: (self instructions indexOf: anIRInstruction)\x0a\x09\x09put: anotherIRInstruction",
  888. messageSends: ["parent:", "at:put:", "indexOf:", "instructions"],
  889. referencedClasses: []
  890. }),
  891. smalltalk.IRInstruction);
  892. smalltalk.addMethod(
  893. "_replaceWith_",
  894. smalltalk.method({
  895. selector: "replaceWith:",
  896. category: 'building',
  897. fn: function (anIRInstruction){
  898. var self=this;
  899. return smalltalk.withContext(function($ctx1) { _st(_st(self)._parent())._replace_with_(self,anIRInstruction);
  900. return self}, function($ctx1) {$ctx1.fill(self,"replaceWith:", [anIRInstruction], {}, smalltalk.IRInstruction)})},
  901. args: ["anIRInstruction"],
  902. source: "replaceWith: anIRInstruction\x0a\x09self parent replace: self with: anIRInstruction",
  903. messageSends: ["replace:with:", "parent"],
  904. referencedClasses: []
  905. }),
  906. smalltalk.IRInstruction);
  907. smalltalk.addMethod(
  908. "_on_",
  909. smalltalk.method({
  910. selector: "on:",
  911. category: 'instance creation',
  912. fn: function (aBuilder){
  913. var self=this;
  914. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  915. $2=_st(self)._new();
  916. _st($2)._builder_(aBuilder);
  917. $3=_st($2)._yourself();
  918. $1=$3;
  919. return $1;
  920. }, function($ctx1) {$ctx1.fill(self,"on:", [aBuilder], {}, smalltalk.IRInstruction.klass)})},
  921. args: ["aBuilder"],
  922. source: "on: aBuilder\x0a\x09^ self new\x0a\x09\x09builder: aBuilder;\x0a\x09\x09yourself",
  923. messageSends: ["builder:", "new", "yourself"],
  924. referencedClasses: []
  925. }),
  926. smalltalk.IRInstruction.klass);
  927. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  928. smalltalk.addMethod(
  929. "_accept_",
  930. smalltalk.method({
  931. selector: "accept:",
  932. category: 'visiting',
  933. fn: function (aVisitor){
  934. var self=this;
  935. return smalltalk.withContext(function($ctx1) { var $1;
  936. $1=_st(aVisitor)._visitIRAssignment_(self);
  937. return $1;
  938. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRAssignment)})},
  939. args: ["aVisitor"],
  940. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRAssignment: self",
  941. messageSends: ["visitIRAssignment:"],
  942. referencedClasses: []
  943. }),
  944. smalltalk.IRAssignment);
  945. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  946. smalltalk.addMethod(
  947. "_accept_",
  948. smalltalk.method({
  949. selector: "accept:",
  950. category: 'visiting',
  951. fn: function (aVisitor){
  952. var self=this;
  953. return smalltalk.withContext(function($ctx1) { var $1;
  954. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  955. return $1;
  956. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRDynamicArray)})},
  957. args: ["aVisitor"],
  958. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicArray: self",
  959. messageSends: ["visitIRDynamicArray:"],
  960. referencedClasses: []
  961. }),
  962. smalltalk.IRDynamicArray);
  963. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  964. smalltalk.addMethod(
  965. "_accept_",
  966. smalltalk.method({
  967. selector: "accept:",
  968. category: 'visiting',
  969. fn: function (aVisitor){
  970. var self=this;
  971. return smalltalk.withContext(function($ctx1) { var $1;
  972. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  973. return $1;
  974. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRDynamicDictionary)})},
  975. args: ["aVisitor"],
  976. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRDynamicDictionary: self",
  977. messageSends: ["visitIRDynamicDictionary:"],
  978. referencedClasses: []
  979. }),
  980. smalltalk.IRDynamicDictionary);
  981. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  982. smalltalk.addMethod(
  983. "_scope",
  984. smalltalk.method({
  985. selector: "scope",
  986. category: 'accessing',
  987. fn: function (){
  988. var self=this;
  989. return smalltalk.withContext(function($ctx1) { var $1;
  990. $1=self["@scope"];
  991. return $1;
  992. }, function($ctx1) {$ctx1.fill(self,"scope", [], {}, smalltalk.IRScopedInstruction)})},
  993. args: [],
  994. source: "scope\x0a\x09^ scope",
  995. messageSends: [],
  996. referencedClasses: []
  997. }),
  998. smalltalk.IRScopedInstruction);
  999. smalltalk.addMethod(
  1000. "_scope_",
  1001. smalltalk.method({
  1002. selector: "scope:",
  1003. category: 'accessing',
  1004. fn: function (aScope){
  1005. var self=this;
  1006. return smalltalk.withContext(function($ctx1) { self["@scope"]=aScope;
  1007. return self}, function($ctx1) {$ctx1.fill(self,"scope:", [aScope], {}, smalltalk.IRScopedInstruction)})},
  1008. args: ["aScope"],
  1009. source: "scope: aScope\x0a\x09scope := aScope",
  1010. messageSends: [],
  1011. referencedClasses: []
  1012. }),
  1013. smalltalk.IRScopedInstruction);
  1014. smalltalk.addClass('IRClosure', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  1015. smalltalk.addMethod(
  1016. "_accept_",
  1017. smalltalk.method({
  1018. selector: "accept:",
  1019. category: 'visiting',
  1020. fn: function (aVisitor){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx1) { var $1;
  1023. $1=_st(aVisitor)._visitIRClosure_(self);
  1024. return $1;
  1025. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRClosure)})},
  1026. args: ["aVisitor"],
  1027. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRClosure: self",
  1028. messageSends: ["visitIRClosure:"],
  1029. referencedClasses: []
  1030. }),
  1031. smalltalk.IRClosure);
  1032. smalltalk.addMethod(
  1033. "_arguments",
  1034. smalltalk.method({
  1035. selector: "arguments",
  1036. category: 'accessing',
  1037. fn: function (){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1040. $2=self["@arguments"];
  1041. if(($receiver = $2) == nil || $receiver == undefined){
  1042. $1=[];
  1043. } else {
  1044. $1=$2;
  1045. };
  1046. return $1;
  1047. }, function($ctx1) {$ctx1.fill(self,"arguments", [], {}, smalltalk.IRClosure)})},
  1048. args: [],
  1049. source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
  1050. messageSends: ["ifNil:"],
  1051. referencedClasses: []
  1052. }),
  1053. smalltalk.IRClosure);
  1054. smalltalk.addMethod(
  1055. "_arguments_",
  1056. smalltalk.method({
  1057. selector: "arguments:",
  1058. category: 'accessing',
  1059. fn: function (aCollection){
  1060. var self=this;
  1061. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  1062. return self}, function($ctx1) {$ctx1.fill(self,"arguments:", [aCollection], {}, smalltalk.IRClosure)})},
  1063. args: ["aCollection"],
  1064. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1065. messageSends: [],
  1066. referencedClasses: []
  1067. }),
  1068. smalltalk.IRClosure);
  1069. smalltalk.addMethod(
  1070. "_isClosure",
  1071. smalltalk.method({
  1072. selector: "isClosure",
  1073. category: 'testing',
  1074. fn: function (){
  1075. var self=this;
  1076. return smalltalk.withContext(function($ctx1) { return true;
  1077. }, function($ctx1) {$ctx1.fill(self,"isClosure", [], {}, smalltalk.IRClosure)})},
  1078. args: [],
  1079. source: "isClosure\x0a\x09^ true",
  1080. messageSends: [],
  1081. referencedClasses: []
  1082. }),
  1083. smalltalk.IRClosure);
  1084. smalltalk.addMethod(
  1085. "_scope_",
  1086. smalltalk.method({
  1087. selector: "scope:",
  1088. category: 'accessing',
  1089. fn: function (aScope){
  1090. var self=this;
  1091. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  1092. _st(aScope)._instruction_(self);
  1093. return self}, function($ctx1) {$ctx1.fill(self,"scope:", [aScope], {}, smalltalk.IRClosure)})},
  1094. args: ["aScope"],
  1095. source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
  1096. messageSends: ["scope:", "instruction:"],
  1097. referencedClasses: []
  1098. }),
  1099. smalltalk.IRClosure);
  1100. smalltalk.addMethod(
  1101. "_sequence",
  1102. smalltalk.method({
  1103. selector: "sequence",
  1104. category: 'accessing',
  1105. fn: function (){
  1106. var self=this;
  1107. return smalltalk.withContext(function($ctx1) { var $1;
  1108. $1=_st(_st(self)._instructions())._last();
  1109. return $1;
  1110. }, function($ctx1) {$ctx1.fill(self,"sequence", [], {}, smalltalk.IRClosure)})},
  1111. args: [],
  1112. source: "sequence\x0a\x09^ self instructions last",
  1113. messageSends: ["last", "instructions"],
  1114. referencedClasses: []
  1115. }),
  1116. smalltalk.IRClosure);
  1117. smalltalk.addMethod(
  1118. "_tempDeclarations",
  1119. smalltalk.method({
  1120. selector: "tempDeclarations",
  1121. category: 'accessing',
  1122. fn: function (){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx1) { var $1;
  1125. $1=_st(_st(self)._instructions())._select_((function(each){
  1126. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  1127. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  1128. return $1;
  1129. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations", [], {}, smalltalk.IRClosure)})},
  1130. args: [],
  1131. source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a \x09each isTempDeclaration ]",
  1132. messageSends: ["select:", "isTempDeclaration", "instructions"],
  1133. referencedClasses: []
  1134. }),
  1135. smalltalk.IRClosure);
  1136. smalltalk.addClass('IRMethod', smalltalk.IRScopedInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'arguments', 'internalVariables'], 'Compiler-IR');
  1137. smalltalk.IRMethod.comment="I am a method instruction"
  1138. smalltalk.addMethod(
  1139. "_accept_",
  1140. smalltalk.method({
  1141. selector: "accept:",
  1142. category: 'visiting',
  1143. fn: function (aVisitor){
  1144. var self=this;
  1145. return smalltalk.withContext(function($ctx1) { var $1;
  1146. $1=_st(aVisitor)._visitIRMethod_(self);
  1147. return $1;
  1148. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRMethod)})},
  1149. args: ["aVisitor"],
  1150. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRMethod: self",
  1151. messageSends: ["visitIRMethod:"],
  1152. referencedClasses: []
  1153. }),
  1154. smalltalk.IRMethod);
  1155. smalltalk.addMethod(
  1156. "_arguments",
  1157. smalltalk.method({
  1158. selector: "arguments",
  1159. category: 'accessing',
  1160. fn: function (){
  1161. var self=this;
  1162. return smalltalk.withContext(function($ctx1) { var $1;
  1163. $1=self["@arguments"];
  1164. return $1;
  1165. }, function($ctx1) {$ctx1.fill(self,"arguments", [], {}, smalltalk.IRMethod)})},
  1166. args: [],
  1167. source: "arguments\x0a\x09^ arguments",
  1168. messageSends: [],
  1169. referencedClasses: []
  1170. }),
  1171. smalltalk.IRMethod);
  1172. smalltalk.addMethod(
  1173. "_arguments_",
  1174. smalltalk.method({
  1175. selector: "arguments:",
  1176. category: 'accessing',
  1177. fn: function (aCollection){
  1178. var self=this;
  1179. return smalltalk.withContext(function($ctx1) { self["@arguments"]=aCollection;
  1180. return self}, function($ctx1) {$ctx1.fill(self,"arguments:", [aCollection], {}, smalltalk.IRMethod)})},
  1181. args: ["aCollection"],
  1182. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1183. messageSends: [],
  1184. referencedClasses: []
  1185. }),
  1186. smalltalk.IRMethod);
  1187. smalltalk.addMethod(
  1188. "_classReferences",
  1189. smalltalk.method({
  1190. selector: "classReferences",
  1191. category: 'accessing',
  1192. fn: function (){
  1193. var self=this;
  1194. return smalltalk.withContext(function($ctx1) { var $1;
  1195. $1=self["@classReferences"];
  1196. return $1;
  1197. }, function($ctx1) {$ctx1.fill(self,"classReferences", [], {}, smalltalk.IRMethod)})},
  1198. args: [],
  1199. source: "classReferences\x0a\x09^ classReferences",
  1200. messageSends: [],
  1201. referencedClasses: []
  1202. }),
  1203. smalltalk.IRMethod);
  1204. smalltalk.addMethod(
  1205. "_classReferences_",
  1206. smalltalk.method({
  1207. selector: "classReferences:",
  1208. category: 'accessing',
  1209. fn: function (aCollection){
  1210. var self=this;
  1211. return smalltalk.withContext(function($ctx1) { self["@classReferences"]=aCollection;
  1212. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:", [aCollection], {}, smalltalk.IRMethod)})},
  1213. args: ["aCollection"],
  1214. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  1215. messageSends: [],
  1216. referencedClasses: []
  1217. }),
  1218. smalltalk.IRMethod);
  1219. smalltalk.addMethod(
  1220. "_internalVariables",
  1221. smalltalk.method({
  1222. selector: "internalVariables",
  1223. category: 'accessing',
  1224. fn: function (){
  1225. var self=this;
  1226. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1227. $2=self["@internalVariables"];
  1228. if(($receiver = $2) == nil || $receiver == undefined){
  1229. self["@internalVariables"]=_st((smalltalk.Set || Set))._new();
  1230. $1=self["@internalVariables"];
  1231. } else {
  1232. $1=$2;
  1233. };
  1234. return $1;
  1235. }, function($ctx1) {$ctx1.fill(self,"internalVariables", [], {}, smalltalk.IRMethod)})},
  1236. args: [],
  1237. source: "internalVariables\x0a\x09^ internalVariables ifNil: [ internalVariables := Set new ]",
  1238. messageSends: ["ifNil:", "new"],
  1239. referencedClasses: ["Set"]
  1240. }),
  1241. smalltalk.IRMethod);
  1242. smalltalk.addMethod(
  1243. "_messageSends",
  1244. smalltalk.method({
  1245. selector: "messageSends",
  1246. category: 'accessing',
  1247. fn: function (){
  1248. var self=this;
  1249. return smalltalk.withContext(function($ctx1) { var $1;
  1250. $1=self["@messageSends"];
  1251. return $1;
  1252. }, function($ctx1) {$ctx1.fill(self,"messageSends", [], {}, smalltalk.IRMethod)})},
  1253. args: [],
  1254. source: "messageSends\x0a\x09^ messageSends",
  1255. messageSends: [],
  1256. referencedClasses: []
  1257. }),
  1258. smalltalk.IRMethod);
  1259. smalltalk.addMethod(
  1260. "_messageSends_",
  1261. smalltalk.method({
  1262. selector: "messageSends:",
  1263. category: 'accessing',
  1264. fn: function (aCollection){
  1265. var self=this;
  1266. return smalltalk.withContext(function($ctx1) { self["@messageSends"]=aCollection;
  1267. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:", [aCollection], {}, smalltalk.IRMethod)})},
  1268. args: ["aCollection"],
  1269. source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
  1270. messageSends: [],
  1271. referencedClasses: []
  1272. }),
  1273. smalltalk.IRMethod);
  1274. smalltalk.addMethod(
  1275. "_scope_",
  1276. smalltalk.method({
  1277. selector: "scope:",
  1278. category: 'accessing',
  1279. fn: function (aScope){
  1280. var self=this;
  1281. return smalltalk.withContext(function($ctx1) { smalltalk.IRScopedInstruction.fn.prototype._scope_.apply(_st(self), [aScope]);
  1282. _st(aScope)._instruction_(self);
  1283. return self}, function($ctx1) {$ctx1.fill(self,"scope:", [aScope], {}, smalltalk.IRMethod)})},
  1284. args: ["aScope"],
  1285. source: "scope: aScope\x0a\x09super scope: aScope.\x0a\x09aScope instruction: self",
  1286. messageSends: ["scope:", "instruction:"],
  1287. referencedClasses: []
  1288. }),
  1289. smalltalk.IRMethod);
  1290. smalltalk.addMethod(
  1291. "_selector",
  1292. smalltalk.method({
  1293. selector: "selector",
  1294. category: 'accessing',
  1295. fn: function (){
  1296. var self=this;
  1297. return smalltalk.withContext(function($ctx1) { var $1;
  1298. $1=self["@selector"];
  1299. return $1;
  1300. }, function($ctx1) {$ctx1.fill(self,"selector", [], {}, smalltalk.IRMethod)})},
  1301. args: [],
  1302. source: "selector\x0a\x09^ selector",
  1303. messageSends: [],
  1304. referencedClasses: []
  1305. }),
  1306. smalltalk.IRMethod);
  1307. smalltalk.addMethod(
  1308. "_selector_",
  1309. smalltalk.method({
  1310. selector: "selector:",
  1311. category: 'accessing',
  1312. fn: function (aString){
  1313. var self=this;
  1314. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1315. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], {}, smalltalk.IRMethod)})},
  1316. args: ["aString"],
  1317. source: "selector: aString\x0a\x09selector := aString",
  1318. messageSends: [],
  1319. referencedClasses: []
  1320. }),
  1321. smalltalk.IRMethod);
  1322. smalltalk.addMethod(
  1323. "_source",
  1324. smalltalk.method({
  1325. selector: "source",
  1326. category: 'accessing',
  1327. fn: function (){
  1328. var self=this;
  1329. return smalltalk.withContext(function($ctx1) { var $1;
  1330. $1=self["@source"];
  1331. return $1;
  1332. }, function($ctx1) {$ctx1.fill(self,"source", [], {}, smalltalk.IRMethod)})},
  1333. args: [],
  1334. source: "source\x0a\x09^ source",
  1335. messageSends: [],
  1336. referencedClasses: []
  1337. }),
  1338. smalltalk.IRMethod);
  1339. smalltalk.addMethod(
  1340. "_source_",
  1341. smalltalk.method({
  1342. selector: "source:",
  1343. category: 'accessing',
  1344. fn: function (aString){
  1345. var self=this;
  1346. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  1347. return self}, function($ctx1) {$ctx1.fill(self,"source:", [aString], {}, smalltalk.IRMethod)})},
  1348. args: ["aString"],
  1349. source: "source: aString\x0a\x09source := aString",
  1350. messageSends: [],
  1351. referencedClasses: []
  1352. }),
  1353. smalltalk.IRMethod);
  1354. smalltalk.addMethod(
  1355. "_superSends",
  1356. smalltalk.method({
  1357. selector: "superSends",
  1358. category: 'accessing',
  1359. fn: function (){
  1360. var self=this;
  1361. return smalltalk.withContext(function($ctx1) { var $1;
  1362. $1=self["@superSends"];
  1363. return $1;
  1364. }, function($ctx1) {$ctx1.fill(self,"superSends", [], {}, smalltalk.IRMethod)})},
  1365. args: [],
  1366. source: "superSends\x0a\x09^ superSends",
  1367. messageSends: [],
  1368. referencedClasses: []
  1369. }),
  1370. smalltalk.IRMethod);
  1371. smalltalk.addMethod(
  1372. "_superSends_",
  1373. smalltalk.method({
  1374. selector: "superSends:",
  1375. category: 'accessing',
  1376. fn: function (aCollection){
  1377. var self=this;
  1378. return smalltalk.withContext(function($ctx1) { self["@superSends"]=aCollection;
  1379. return self}, function($ctx1) {$ctx1.fill(self,"superSends:", [aCollection], {}, smalltalk.IRMethod)})},
  1380. args: ["aCollection"],
  1381. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  1382. messageSends: [],
  1383. referencedClasses: []
  1384. }),
  1385. smalltalk.IRMethod);
  1386. smalltalk.addMethod(
  1387. "_tempDeclarations",
  1388. smalltalk.method({
  1389. selector: "tempDeclarations",
  1390. category: 'accessing',
  1391. fn: function (){
  1392. var self=this;
  1393. return smalltalk.withContext(function($ctx1) { var $1;
  1394. $1=_st(_st(self)._instructions())._select_((function(each){
  1395. return smalltalk.withContext(function($ctx2) { return _st(each)._isTempDeclaration();
  1396. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  1397. return $1;
  1398. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations", [], {}, smalltalk.IRMethod)})},
  1399. args: [],
  1400. source: "tempDeclarations\x0a\x09^ self instructions select: [ :each | \x0a \x09each isTempDeclaration ]",
  1401. messageSends: ["select:", "isTempDeclaration", "instructions"],
  1402. referencedClasses: []
  1403. }),
  1404. smalltalk.IRMethod);
  1405. smalltalk.addMethod(
  1406. "_theClass",
  1407. smalltalk.method({
  1408. selector: "theClass",
  1409. category: 'accessing',
  1410. fn: function (){
  1411. var self=this;
  1412. return smalltalk.withContext(function($ctx1) { var $1;
  1413. $1=self["@theClass"];
  1414. return $1;
  1415. }, function($ctx1) {$ctx1.fill(self,"theClass", [], {}, smalltalk.IRMethod)})},
  1416. args: [],
  1417. source: "theClass\x0a\x09^ theClass",
  1418. messageSends: [],
  1419. referencedClasses: []
  1420. }),
  1421. smalltalk.IRMethod);
  1422. smalltalk.addMethod(
  1423. "_theClass_",
  1424. smalltalk.method({
  1425. selector: "theClass:",
  1426. category: 'accessing',
  1427. fn: function (aClass){
  1428. var self=this;
  1429. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  1430. return self}, function($ctx1) {$ctx1.fill(self,"theClass:", [aClass], {}, smalltalk.IRMethod)})},
  1431. args: ["aClass"],
  1432. source: "theClass: aClass\x0a\x09theClass := aClass",
  1433. messageSends: [],
  1434. referencedClasses: []
  1435. }),
  1436. smalltalk.IRMethod);
  1437. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1438. smalltalk.IRReturn.comment="I am a local return instruction."
  1439. smalltalk.addMethod(
  1440. "_accept_",
  1441. smalltalk.method({
  1442. selector: "accept:",
  1443. category: 'visiting',
  1444. fn: function (aVisitor){
  1445. var self=this;
  1446. return smalltalk.withContext(function($ctx1) { var $1;
  1447. $1=_st(aVisitor)._visitIRReturn_(self);
  1448. return $1;
  1449. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRReturn)})},
  1450. args: ["aVisitor"],
  1451. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRReturn: self",
  1452. messageSends: ["visitIRReturn:"],
  1453. referencedClasses: []
  1454. }),
  1455. smalltalk.IRReturn);
  1456. smalltalk.addMethod(
  1457. "_canBeAssigned",
  1458. smalltalk.method({
  1459. selector: "canBeAssigned",
  1460. category: 'testing',
  1461. fn: function (){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) { return false;
  1464. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned", [], {}, smalltalk.IRReturn)})},
  1465. args: [],
  1466. source: "canBeAssigned\x0a\x09^ false",
  1467. messageSends: [],
  1468. referencedClasses: []
  1469. }),
  1470. smalltalk.IRReturn);
  1471. smalltalk.addMethod(
  1472. "_isBlockReturn",
  1473. smalltalk.method({
  1474. selector: "isBlockReturn",
  1475. category: 'testing',
  1476. fn: function (){
  1477. var self=this;
  1478. return smalltalk.withContext(function($ctx1) { return false;
  1479. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn", [], {}, smalltalk.IRReturn)})},
  1480. args: [],
  1481. source: "isBlockReturn\x0a\x09^ false",
  1482. messageSends: [],
  1483. referencedClasses: []
  1484. }),
  1485. smalltalk.IRReturn);
  1486. smalltalk.addMethod(
  1487. "_isLocalReturn",
  1488. smalltalk.method({
  1489. selector: "isLocalReturn",
  1490. category: 'testing',
  1491. fn: function (){
  1492. var self=this;
  1493. return smalltalk.withContext(function($ctx1) { return true;
  1494. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn", [], {}, smalltalk.IRReturn)})},
  1495. args: [],
  1496. source: "isLocalReturn\x0a\x09^ true",
  1497. messageSends: [],
  1498. referencedClasses: []
  1499. }),
  1500. smalltalk.IRReturn);
  1501. smalltalk.addMethod(
  1502. "_isNonLocalReturn",
  1503. smalltalk.method({
  1504. selector: "isNonLocalReturn",
  1505. category: 'testing',
  1506. fn: function (){
  1507. var self=this;
  1508. return smalltalk.withContext(function($ctx1) { var $1;
  1509. $1=_st(_st(self)._isLocalReturn())._not();
  1510. return $1;
  1511. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn", [], {}, smalltalk.IRReturn)})},
  1512. args: [],
  1513. source: "isNonLocalReturn\x0a\x09^ self isLocalReturn not",
  1514. messageSends: ["not", "isLocalReturn"],
  1515. referencedClasses: []
  1516. }),
  1517. smalltalk.IRReturn);
  1518. smalltalk.addMethod(
  1519. "_isReturn",
  1520. smalltalk.method({
  1521. selector: "isReturn",
  1522. category: 'testing',
  1523. fn: function (){
  1524. var self=this;
  1525. return smalltalk.withContext(function($ctx1) { return true;
  1526. }, function($ctx1) {$ctx1.fill(self,"isReturn", [], {}, smalltalk.IRReturn)})},
  1527. args: [],
  1528. source: "isReturn\x0a\x09^ true",
  1529. messageSends: [],
  1530. referencedClasses: []
  1531. }),
  1532. smalltalk.IRReturn);
  1533. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1534. smalltalk.IRBlockReturn.comment="Smalltalk blocks return their last statement. I am a implicit block return instruction."
  1535. smalltalk.addMethod(
  1536. "_accept_",
  1537. smalltalk.method({
  1538. selector: "accept:",
  1539. category: 'visiting',
  1540. fn: function (aVisitor){
  1541. var self=this;
  1542. return smalltalk.withContext(function($ctx1) { var $1;
  1543. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1544. return $1;
  1545. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRBlockReturn)})},
  1546. args: ["aVisitor"],
  1547. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockReturn: self",
  1548. messageSends: ["visitIRBlockReturn:"],
  1549. referencedClasses: []
  1550. }),
  1551. smalltalk.IRBlockReturn);
  1552. smalltalk.addMethod(
  1553. "_isBlockReturn",
  1554. smalltalk.method({
  1555. selector: "isBlockReturn",
  1556. category: 'testing',
  1557. fn: function (){
  1558. var self=this;
  1559. return smalltalk.withContext(function($ctx1) { return true;
  1560. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn", [], {}, smalltalk.IRBlockReturn)})},
  1561. args: [],
  1562. source: "isBlockReturn\x0a\x09^ true",
  1563. messageSends: [],
  1564. referencedClasses: []
  1565. }),
  1566. smalltalk.IRBlockReturn);
  1567. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1568. smalltalk.IRNonLocalReturn.comment="I am a non local return instruction.\x0aNon local returns are handled using a try/catch JS statement.\x0a\x0aSee IRNonLocalReturnHandling class"
  1569. smalltalk.addMethod(
  1570. "_accept_",
  1571. smalltalk.method({
  1572. selector: "accept:",
  1573. category: 'visiting',
  1574. fn: function (aVisitor){
  1575. var self=this;
  1576. return smalltalk.withContext(function($ctx1) { var $1;
  1577. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1578. return $1;
  1579. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRNonLocalReturn)})},
  1580. args: ["aVisitor"],
  1581. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRNonLocalReturn: self",
  1582. messageSends: ["visitIRNonLocalReturn:"],
  1583. referencedClasses: []
  1584. }),
  1585. smalltalk.IRNonLocalReturn);
  1586. smalltalk.addMethod(
  1587. "_isLocalReturn",
  1588. smalltalk.method({
  1589. selector: "isLocalReturn",
  1590. category: 'testing',
  1591. fn: function (){
  1592. var self=this;
  1593. return smalltalk.withContext(function($ctx1) { return false;
  1594. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn", [], {}, smalltalk.IRNonLocalReturn)})},
  1595. args: [],
  1596. source: "isLocalReturn\x0a\x09^ false",
  1597. messageSends: [],
  1598. referencedClasses: []
  1599. }),
  1600. smalltalk.IRNonLocalReturn);
  1601. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1602. smalltalk.addMethod(
  1603. "_accept_",
  1604. smalltalk.method({
  1605. selector: "accept:",
  1606. category: 'visiting',
  1607. fn: function (aVisitor){
  1608. var self=this;
  1609. return smalltalk.withContext(function($ctx1) { var $1;
  1610. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1611. return $1;
  1612. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRTempDeclaration)})},
  1613. args: ["aVisitor"],
  1614. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRTempDeclaration: self",
  1615. messageSends: ["visitIRTempDeclaration:"],
  1616. referencedClasses: []
  1617. }),
  1618. smalltalk.IRTempDeclaration);
  1619. smalltalk.addMethod(
  1620. "_isTempDeclaration",
  1621. smalltalk.method({
  1622. selector: "isTempDeclaration",
  1623. category: 'testing',
  1624. fn: function (){
  1625. var self=this;
  1626. return smalltalk.withContext(function($ctx1) { return true;
  1627. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration", [], {}, smalltalk.IRTempDeclaration)})},
  1628. args: [],
  1629. source: "isTempDeclaration\x0a\x09^ true",
  1630. messageSends: [],
  1631. referencedClasses: []
  1632. }),
  1633. smalltalk.IRTempDeclaration);
  1634. smalltalk.addMethod(
  1635. "_name",
  1636. smalltalk.method({
  1637. selector: "name",
  1638. category: 'accessing',
  1639. fn: function (){
  1640. var self=this;
  1641. return smalltalk.withContext(function($ctx1) { var $1;
  1642. $1=self["@name"];
  1643. return $1;
  1644. }, function($ctx1) {$ctx1.fill(self,"name", [], {}, smalltalk.IRTempDeclaration)})},
  1645. args: [],
  1646. source: "name\x0a\x09^ name",
  1647. messageSends: [],
  1648. referencedClasses: []
  1649. }),
  1650. smalltalk.IRTempDeclaration);
  1651. smalltalk.addMethod(
  1652. "_name_",
  1653. smalltalk.method({
  1654. selector: "name:",
  1655. category: 'accessing',
  1656. fn: function (aString){
  1657. var self=this;
  1658. return smalltalk.withContext(function($ctx1) { self["@name"]=aString;
  1659. return self}, function($ctx1) {$ctx1.fill(self,"name:", [aString], {}, smalltalk.IRTempDeclaration)})},
  1660. args: ["aString"],
  1661. source: "name: aString\x0a\x09name := aString",
  1662. messageSends: [],
  1663. referencedClasses: []
  1664. }),
  1665. smalltalk.IRTempDeclaration);
  1666. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1667. smalltalk.IRSend.comment="I am a message send instruction."
  1668. smalltalk.addMethod(
  1669. "_accept_",
  1670. smalltalk.method({
  1671. selector: "accept:",
  1672. category: 'visiting',
  1673. fn: function (aVisitor){
  1674. var self=this;
  1675. return smalltalk.withContext(function($ctx1) { var $1;
  1676. $1=_st(aVisitor)._visitIRSend_(self);
  1677. return $1;
  1678. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRSend)})},
  1679. args: ["aVisitor"],
  1680. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSend: self",
  1681. messageSends: ["visitIRSend:"],
  1682. referencedClasses: []
  1683. }),
  1684. smalltalk.IRSend);
  1685. smalltalk.addMethod(
  1686. "_classSend",
  1687. smalltalk.method({
  1688. selector: "classSend",
  1689. category: 'accessing',
  1690. fn: function (){
  1691. var self=this;
  1692. return smalltalk.withContext(function($ctx1) { var $1;
  1693. $1=self["@classSend"];
  1694. return $1;
  1695. }, function($ctx1) {$ctx1.fill(self,"classSend", [], {}, smalltalk.IRSend)})},
  1696. args: [],
  1697. source: "classSend\x0a\x09^ classSend",
  1698. messageSends: [],
  1699. referencedClasses: []
  1700. }),
  1701. smalltalk.IRSend);
  1702. smalltalk.addMethod(
  1703. "_classSend_",
  1704. smalltalk.method({
  1705. selector: "classSend:",
  1706. category: 'accessing',
  1707. fn: function (aClass){
  1708. var self=this;
  1709. return smalltalk.withContext(function($ctx1) { self["@classSend"]=aClass;
  1710. return self}, function($ctx1) {$ctx1.fill(self,"classSend:", [aClass], {}, smalltalk.IRSend)})},
  1711. args: ["aClass"],
  1712. source: "classSend: aClass\x0a\x09classSend := aClass",
  1713. messageSends: [],
  1714. referencedClasses: []
  1715. }),
  1716. smalltalk.IRSend);
  1717. smalltalk.addMethod(
  1718. "_index",
  1719. smalltalk.method({
  1720. selector: "index",
  1721. category: 'accessing',
  1722. fn: function (){
  1723. var self=this;
  1724. return smalltalk.withContext(function($ctx1) { var $1;
  1725. $1=self["@index"];
  1726. return $1;
  1727. }, function($ctx1) {$ctx1.fill(self,"index", [], {}, smalltalk.IRSend)})},
  1728. args: [],
  1729. source: "index\x0a\x09^ index",
  1730. messageSends: [],
  1731. referencedClasses: []
  1732. }),
  1733. smalltalk.IRSend);
  1734. smalltalk.addMethod(
  1735. "_index_",
  1736. smalltalk.method({
  1737. selector: "index:",
  1738. category: 'accessing',
  1739. fn: function (anInteger){
  1740. var self=this;
  1741. return smalltalk.withContext(function($ctx1) { self["@index"]=anInteger;
  1742. return self}, function($ctx1) {$ctx1.fill(self,"index:", [anInteger], {}, smalltalk.IRSend)})},
  1743. args: ["anInteger"],
  1744. source: "index: anInteger\x0a\x09index := anInteger",
  1745. messageSends: [],
  1746. referencedClasses: []
  1747. }),
  1748. smalltalk.IRSend);
  1749. smalltalk.addMethod(
  1750. "_isSend",
  1751. smalltalk.method({
  1752. selector: "isSend",
  1753. category: 'testing',
  1754. fn: function (){
  1755. var self=this;
  1756. return smalltalk.withContext(function($ctx1) { return true;
  1757. }, function($ctx1) {$ctx1.fill(self,"isSend", [], {}, smalltalk.IRSend)})},
  1758. args: [],
  1759. source: "isSend\x0a\x09^ true",
  1760. messageSends: [],
  1761. referencedClasses: []
  1762. }),
  1763. smalltalk.IRSend);
  1764. smalltalk.addMethod(
  1765. "_javascriptSelector",
  1766. smalltalk.method({
  1767. selector: "javascriptSelector",
  1768. category: 'accessing',
  1769. fn: function (){
  1770. var self=this;
  1771. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1772. $2=_st(self)._classSend();
  1773. if(($receiver = $2) == nil || $receiver == undefined){
  1774. $1=_st(_st(self)._selector())._asSelector();
  1775. } else {
  1776. $1=_st(_st(self)._selector())._asSuperSelector();
  1777. };
  1778. return $1;
  1779. }, function($ctx1) {$ctx1.fill(self,"javascriptSelector", [], {}, smalltalk.IRSend)})},
  1780. args: [],
  1781. source: "javascriptSelector\x0a\x09^ self classSend \x0a \x09ifNil: [ self selector asSelector ]\x0a \x09ifNotNil: [ self selector asSuperSelector ]",
  1782. messageSends: ["ifNil:ifNotNil:", "asSelector", "selector", "asSuperSelector", "classSend"],
  1783. referencedClasses: []
  1784. }),
  1785. smalltalk.IRSend);
  1786. smalltalk.addMethod(
  1787. "_selector",
  1788. smalltalk.method({
  1789. selector: "selector",
  1790. category: 'accessing',
  1791. fn: function (){
  1792. var self=this;
  1793. return smalltalk.withContext(function($ctx1) { var $1;
  1794. $1=self["@selector"];
  1795. return $1;
  1796. }, function($ctx1) {$ctx1.fill(self,"selector", [], {}, smalltalk.IRSend)})},
  1797. args: [],
  1798. source: "selector\x0a\x09^ selector",
  1799. messageSends: [],
  1800. referencedClasses: []
  1801. }),
  1802. smalltalk.IRSend);
  1803. smalltalk.addMethod(
  1804. "_selector_",
  1805. smalltalk.method({
  1806. selector: "selector:",
  1807. category: 'accessing',
  1808. fn: function (aString){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1811. return self}, function($ctx1) {$ctx1.fill(self,"selector:", [aString], {}, smalltalk.IRSend)})},
  1812. args: ["aString"],
  1813. source: "selector: aString\x0a\x09selector := aString",
  1814. messageSends: [],
  1815. referencedClasses: []
  1816. }),
  1817. smalltalk.IRSend);
  1818. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1819. smalltalk.addMethod(
  1820. "_accept_",
  1821. smalltalk.method({
  1822. selector: "accept:",
  1823. category: 'visiting',
  1824. fn: function (aVisitor){
  1825. var self=this;
  1826. return smalltalk.withContext(function($ctx1) { var $1;
  1827. $1=_st(aVisitor)._visitIRSequence_(self);
  1828. return $1;
  1829. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRSequence)})},
  1830. args: ["aVisitor"],
  1831. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSequence: self",
  1832. messageSends: ["visitIRSequence:"],
  1833. referencedClasses: []
  1834. }),
  1835. smalltalk.IRSequence);
  1836. smalltalk.addMethod(
  1837. "_isSequence",
  1838. smalltalk.method({
  1839. selector: "isSequence",
  1840. category: 'testing',
  1841. fn: function (){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) { return true;
  1844. }, function($ctx1) {$ctx1.fill(self,"isSequence", [], {}, smalltalk.IRSequence)})},
  1845. args: [],
  1846. source: "isSequence\x0a\x09^ true",
  1847. messageSends: [],
  1848. referencedClasses: []
  1849. }),
  1850. smalltalk.IRSequence);
  1851. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1852. smalltalk.addMethod(
  1853. "_accept_",
  1854. smalltalk.method({
  1855. selector: "accept:",
  1856. category: 'visiting',
  1857. fn: function (aVisitor){
  1858. var self=this;
  1859. return smalltalk.withContext(function($ctx1) { var $1;
  1860. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1861. return $1;
  1862. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRBlockSequence)})},
  1863. args: ["aVisitor"],
  1864. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockSequence: self",
  1865. messageSends: ["visitIRBlockSequence:"],
  1866. referencedClasses: []
  1867. }),
  1868. smalltalk.IRBlockSequence);
  1869. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1870. smalltalk.IRValue.comment="I am the simplest possible instruction. I represent a value."
  1871. smalltalk.addMethod(
  1872. "_accept_",
  1873. smalltalk.method({
  1874. selector: "accept:",
  1875. category: 'visiting',
  1876. fn: function (aVisitor){
  1877. var self=this;
  1878. return smalltalk.withContext(function($ctx1) { var $1;
  1879. $1=_st(aVisitor)._visitIRValue_(self);
  1880. return $1;
  1881. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRValue)})},
  1882. args: ["aVisitor"],
  1883. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRValue: self",
  1884. messageSends: ["visitIRValue:"],
  1885. referencedClasses: []
  1886. }),
  1887. smalltalk.IRValue);
  1888. smalltalk.addMethod(
  1889. "_value",
  1890. smalltalk.method({
  1891. selector: "value",
  1892. category: 'accessing',
  1893. fn: function (){
  1894. var self=this;
  1895. return smalltalk.withContext(function($ctx1) { var $1;
  1896. $1=self["@value"];
  1897. return $1;
  1898. }, function($ctx1) {$ctx1.fill(self,"value", [], {}, smalltalk.IRValue)})},
  1899. args: [],
  1900. source: "value\x0a\x09^value",
  1901. messageSends: [],
  1902. referencedClasses: []
  1903. }),
  1904. smalltalk.IRValue);
  1905. smalltalk.addMethod(
  1906. "_value_",
  1907. smalltalk.method({
  1908. selector: "value:",
  1909. category: 'accessing',
  1910. fn: function (aString){
  1911. var self=this;
  1912. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  1913. return self}, function($ctx1) {$ctx1.fill(self,"value:", [aString], {}, smalltalk.IRValue)})},
  1914. args: ["aString"],
  1915. source: "value: aString\x0a\x09value := aString",
  1916. messageSends: [],
  1917. referencedClasses: []
  1918. }),
  1919. smalltalk.IRValue);
  1920. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1921. smalltalk.IRVariable.comment="I am a variable instruction."
  1922. smalltalk.addMethod(
  1923. "_accept_",
  1924. smalltalk.method({
  1925. selector: "accept:",
  1926. category: 'visiting',
  1927. fn: function (aVisitor){
  1928. var self=this;
  1929. return smalltalk.withContext(function($ctx1) { var $1;
  1930. $1=_st(aVisitor)._visitIRVariable_(self);
  1931. return $1;
  1932. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRVariable)})},
  1933. args: ["aVisitor"],
  1934. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVariable: self",
  1935. messageSends: ["visitIRVariable:"],
  1936. referencedClasses: []
  1937. }),
  1938. smalltalk.IRVariable);
  1939. smalltalk.addMethod(
  1940. "_isVariable",
  1941. smalltalk.method({
  1942. selector: "isVariable",
  1943. category: 'testing',
  1944. fn: function (){
  1945. var self=this;
  1946. return smalltalk.withContext(function($ctx1) { return true;
  1947. }, function($ctx1) {$ctx1.fill(self,"isVariable", [], {}, smalltalk.IRVariable)})},
  1948. args: [],
  1949. source: "isVariable\x0a\x09^ true",
  1950. messageSends: [],
  1951. referencedClasses: []
  1952. }),
  1953. smalltalk.IRVariable);
  1954. smalltalk.addMethod(
  1955. "_variable",
  1956. smalltalk.method({
  1957. selector: "variable",
  1958. category: 'accessing',
  1959. fn: function (){
  1960. var self=this;
  1961. return smalltalk.withContext(function($ctx1) { var $1;
  1962. $1=self["@variable"];
  1963. return $1;
  1964. }, function($ctx1) {$ctx1.fill(self,"variable", [], {}, smalltalk.IRVariable)})},
  1965. args: [],
  1966. source: "variable\x0a\x09^ variable",
  1967. messageSends: [],
  1968. referencedClasses: []
  1969. }),
  1970. smalltalk.IRVariable);
  1971. smalltalk.addMethod(
  1972. "_variable_",
  1973. smalltalk.method({
  1974. selector: "variable:",
  1975. category: 'accessing',
  1976. fn: function (aScopeVariable){
  1977. var self=this;
  1978. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  1979. return self}, function($ctx1) {$ctx1.fill(self,"variable:", [aScopeVariable], {}, smalltalk.IRVariable)})},
  1980. args: ["aScopeVariable"],
  1981. source: "variable: aScopeVariable\x0a\x09variable := aScopeVariable",
  1982. messageSends: [],
  1983. referencedClasses: []
  1984. }),
  1985. smalltalk.IRVariable);
  1986. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1987. smalltalk.addMethod(
  1988. "_accept_",
  1989. smalltalk.method({
  1990. selector: "accept:",
  1991. category: 'visiting',
  1992. fn: function (aVisitor){
  1993. var self=this;
  1994. return smalltalk.withContext(function($ctx1) { var $1;
  1995. $1=_st(aVisitor)._visitIRVerbatim_(self);
  1996. return $1;
  1997. }, function($ctx1) {$ctx1.fill(self,"accept:", [aVisitor], {}, smalltalk.IRVerbatim)})},
  1998. args: ["aVisitor"],
  1999. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVerbatim: self",
  2000. messageSends: ["visitIRVerbatim:"],
  2001. referencedClasses: []
  2002. }),
  2003. smalltalk.IRVerbatim);
  2004. smalltalk.addMethod(
  2005. "_source",
  2006. smalltalk.method({
  2007. selector: "source",
  2008. category: 'accessing',
  2009. fn: function (){
  2010. var self=this;
  2011. return smalltalk.withContext(function($ctx1) { var $1;
  2012. $1=self["@source"];
  2013. return $1;
  2014. }, function($ctx1) {$ctx1.fill(self,"source", [], {}, smalltalk.IRVerbatim)})},
  2015. args: [],
  2016. source: "source\x0a\x09^ source",
  2017. messageSends: [],
  2018. referencedClasses: []
  2019. }),
  2020. smalltalk.IRVerbatim);
  2021. smalltalk.addMethod(
  2022. "_source_",
  2023. smalltalk.method({
  2024. selector: "source:",
  2025. category: 'accessing',
  2026. fn: function (aString){
  2027. var self=this;
  2028. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  2029. return self}, function($ctx1) {$ctx1.fill(self,"source:", [aString], {}, smalltalk.IRVerbatim)})},
  2030. args: ["aString"],
  2031. source: "source: aString\x0a\x09source := aString",
  2032. messageSends: [],
  2033. referencedClasses: []
  2034. }),
  2035. smalltalk.IRVerbatim);
  2036. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  2037. smalltalk.addMethod(
  2038. "_visit_",
  2039. smalltalk.method({
  2040. selector: "visit:",
  2041. category: 'visiting',
  2042. fn: function (anIRInstruction){
  2043. var self=this;
  2044. return smalltalk.withContext(function($ctx1) { var $1;
  2045. $1=_st(anIRInstruction)._accept_(self);
  2046. return $1;
  2047. }, function($ctx1) {$ctx1.fill(self,"visit:", [anIRInstruction], {}, smalltalk.IRVisitor)})},
  2048. args: ["anIRInstruction"],
  2049. source: "visit: anIRInstruction\x0a\x09^ anIRInstruction accept: self",
  2050. messageSends: ["accept:"],
  2051. referencedClasses: []
  2052. }),
  2053. smalltalk.IRVisitor);
  2054. smalltalk.addMethod(
  2055. "_visitIRAssignment_",
  2056. smalltalk.method({
  2057. selector: "visitIRAssignment:",
  2058. category: 'visiting',
  2059. fn: function (anIRAssignment){
  2060. var self=this;
  2061. return smalltalk.withContext(function($ctx1) { var $1;
  2062. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  2063. return $1;
  2064. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:", [anIRAssignment], {}, smalltalk.IRVisitor)})},
  2065. args: ["anIRAssignment"],
  2066. source: "visitIRAssignment: anIRAssignment\x0a\x09^ self visitIRInstruction: anIRAssignment",
  2067. messageSends: ["visitIRInstruction:"],
  2068. referencedClasses: []
  2069. }),
  2070. smalltalk.IRVisitor);
  2071. smalltalk.addMethod(
  2072. "_visitIRBlockReturn_",
  2073. smalltalk.method({
  2074. selector: "visitIRBlockReturn:",
  2075. category: 'visiting',
  2076. fn: function (anIRBlockReturn){
  2077. var self=this;
  2078. return smalltalk.withContext(function($ctx1) { var $1;
  2079. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  2080. return $1;
  2081. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:", [anIRBlockReturn], {}, smalltalk.IRVisitor)})},
  2082. args: ["anIRBlockReturn"],
  2083. source: "visitIRBlockReturn: anIRBlockReturn\x0a\x09^ self visitIRReturn: anIRBlockReturn",
  2084. messageSends: ["visitIRReturn:"],
  2085. referencedClasses: []
  2086. }),
  2087. smalltalk.IRVisitor);
  2088. smalltalk.addMethod(
  2089. "_visitIRBlockSequence_",
  2090. smalltalk.method({
  2091. selector: "visitIRBlockSequence:",
  2092. category: 'visiting',
  2093. fn: function (anIRBlockSequence){
  2094. var self=this;
  2095. return smalltalk.withContext(function($ctx1) { var $1;
  2096. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  2097. return $1;
  2098. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:", [anIRBlockSequence], {}, smalltalk.IRVisitor)})},
  2099. args: ["anIRBlockSequence"],
  2100. source: "visitIRBlockSequence: anIRBlockSequence\x0a\x09^ self visitIRSequence: anIRBlockSequence",
  2101. messageSends: ["visitIRSequence:"],
  2102. referencedClasses: []
  2103. }),
  2104. smalltalk.IRVisitor);
  2105. smalltalk.addMethod(
  2106. "_visitIRClosure_",
  2107. smalltalk.method({
  2108. selector: "visitIRClosure:",
  2109. category: 'visiting',
  2110. fn: function (anIRClosure){
  2111. var self=this;
  2112. return smalltalk.withContext(function($ctx1) { var $1;
  2113. $1=_st(self)._visitIRInstruction_(anIRClosure);
  2114. return $1;
  2115. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:", [anIRClosure], {}, smalltalk.IRVisitor)})},
  2116. args: ["anIRClosure"],
  2117. source: "visitIRClosure: anIRClosure\x0a\x09^ self visitIRInstruction: anIRClosure",
  2118. messageSends: ["visitIRInstruction:"],
  2119. referencedClasses: []
  2120. }),
  2121. smalltalk.IRVisitor);
  2122. smalltalk.addMethod(
  2123. "_visitIRDynamicArray_",
  2124. smalltalk.method({
  2125. selector: "visitIRDynamicArray:",
  2126. category: 'visiting',
  2127. fn: function (anIRDynamicArray){
  2128. var self=this;
  2129. return smalltalk.withContext(function($ctx1) { var $1;
  2130. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  2131. return $1;
  2132. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:", [anIRDynamicArray], {}, smalltalk.IRVisitor)})},
  2133. args: ["anIRDynamicArray"],
  2134. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09^ self visitIRInstruction: anIRDynamicArray",
  2135. messageSends: ["visitIRInstruction:"],
  2136. referencedClasses: []
  2137. }),
  2138. smalltalk.IRVisitor);
  2139. smalltalk.addMethod(
  2140. "_visitIRDynamicDictionary_",
  2141. smalltalk.method({
  2142. selector: "visitIRDynamicDictionary:",
  2143. category: 'visiting',
  2144. fn: function (anIRDynamicDictionary){
  2145. var self=this;
  2146. return smalltalk.withContext(function($ctx1) { var $1;
  2147. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  2148. return $1;
  2149. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:", [anIRDynamicDictionary], {}, smalltalk.IRVisitor)})},
  2150. args: ["anIRDynamicDictionary"],
  2151. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09^ self visitIRInstruction: anIRDynamicDictionary",
  2152. messageSends: ["visitIRInstruction:"],
  2153. referencedClasses: []
  2154. }),
  2155. smalltalk.IRVisitor);
  2156. smalltalk.addMethod(
  2157. "_visitIRInlinedClosure_",
  2158. smalltalk.method({
  2159. selector: "visitIRInlinedClosure:",
  2160. category: 'visiting',
  2161. fn: function (anIRInlinedClosure){
  2162. var self=this;
  2163. return smalltalk.withContext(function($ctx1) { var $1;
  2164. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  2165. return $1;
  2166. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:", [anIRInlinedClosure], {}, smalltalk.IRVisitor)})},
  2167. args: ["anIRInlinedClosure"],
  2168. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09^ self visitIRClosure: anIRInlinedClosure",
  2169. messageSends: ["visitIRClosure:"],
  2170. referencedClasses: []
  2171. }),
  2172. smalltalk.IRVisitor);
  2173. smalltalk.addMethod(
  2174. "_visitIRInlinedSequence_",
  2175. smalltalk.method({
  2176. selector: "visitIRInlinedSequence:",
  2177. category: 'visiting',
  2178. fn: function (anIRInlinedSequence){
  2179. var self=this;
  2180. return smalltalk.withContext(function($ctx1) { var $1;
  2181. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  2182. return $1;
  2183. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:", [anIRInlinedSequence], {}, smalltalk.IRVisitor)})},
  2184. args: ["anIRInlinedSequence"],
  2185. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09^ self visitIRSequence: anIRInlinedSequence",
  2186. messageSends: ["visitIRSequence:"],
  2187. referencedClasses: []
  2188. }),
  2189. smalltalk.IRVisitor);
  2190. smalltalk.addMethod(
  2191. "_visitIRInstruction_",
  2192. smalltalk.method({
  2193. selector: "visitIRInstruction:",
  2194. category: 'visiting',
  2195. fn: function (anIRInstruction){
  2196. var self=this;
  2197. return smalltalk.withContext(function($ctx1) { var $1;
  2198. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  2199. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2200. }, function($ctx2) {$ctx2.fillBlock([each], {})})}));
  2201. $1=anIRInstruction;
  2202. return $1;
  2203. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:", [anIRInstruction], {}, smalltalk.IRVisitor)})},
  2204. args: ["anIRInstruction"],
  2205. source: "visitIRInstruction: anIRInstruction\x0a\x09anIRInstruction instructions do: [ :each | self visit: each ].\x0a\x09^ anIRInstruction",
  2206. messageSends: ["do:", "visit:", "instructions"],
  2207. referencedClasses: []
  2208. }),
  2209. smalltalk.IRVisitor);
  2210. smalltalk.addMethod(
  2211. "_visitIRMethod_",
  2212. smalltalk.method({
  2213. selector: "visitIRMethod:",
  2214. category: 'visiting',
  2215. fn: function (anIRMethod){
  2216. var self=this;
  2217. return smalltalk.withContext(function($ctx1) { var $1;
  2218. $1=_st(self)._visitIRInstruction_(anIRMethod);
  2219. return $1;
  2220. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:", [anIRMethod], {}, smalltalk.IRVisitor)})},
  2221. args: ["anIRMethod"],
  2222. source: "visitIRMethod: anIRMethod\x0a\x09^ self visitIRInstruction: anIRMethod",
  2223. messageSends: ["visitIRInstruction:"],
  2224. referencedClasses: []
  2225. }),
  2226. smalltalk.IRVisitor);
  2227. smalltalk.addMethod(
  2228. "_visitIRNonLocalReturn_",
  2229. smalltalk.method({
  2230. selector: "visitIRNonLocalReturn:",
  2231. category: 'visiting',
  2232. fn: function (anIRNonLocalReturn){
  2233. var self=this;
  2234. return smalltalk.withContext(function($ctx1) { var $1;
  2235. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  2236. return $1;
  2237. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:", [anIRNonLocalReturn], {}, smalltalk.IRVisitor)})},
  2238. args: ["anIRNonLocalReturn"],
  2239. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self visitIRInstruction: anIRNonLocalReturn",
  2240. messageSends: ["visitIRInstruction:"],
  2241. referencedClasses: []
  2242. }),
  2243. smalltalk.IRVisitor);
  2244. smalltalk.addMethod(
  2245. "_visitIRNonLocalReturnHandling_",
  2246. smalltalk.method({
  2247. selector: "visitIRNonLocalReturnHandling:",
  2248. category: 'visiting',
  2249. fn: function (anIRNonLocalReturnHandling){
  2250. var self=this;
  2251. return smalltalk.withContext(function($ctx1) { var $1;
  2252. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  2253. return $1;
  2254. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:", [anIRNonLocalReturnHandling], {}, smalltalk.IRVisitor)})},
  2255. args: ["anIRNonLocalReturnHandling"],
  2256. source: "visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling\x0a\x09^ self visitIRInstruction: anIRNonLocalReturnHandling",
  2257. messageSends: ["visitIRInstruction:"],
  2258. referencedClasses: []
  2259. }),
  2260. smalltalk.IRVisitor);
  2261. smalltalk.addMethod(
  2262. "_visitIRReturn_",
  2263. smalltalk.method({
  2264. selector: "visitIRReturn:",
  2265. category: 'visiting',
  2266. fn: function (anIRReturn){
  2267. var self=this;
  2268. return smalltalk.withContext(function($ctx1) { var $1;
  2269. $1=_st(self)._visitIRInstruction_(anIRReturn);
  2270. return $1;
  2271. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:", [anIRReturn], {}, smalltalk.IRVisitor)})},
  2272. args: ["anIRReturn"],
  2273. source: "visitIRReturn: anIRReturn\x0a\x09^ self visitIRInstruction: anIRReturn",
  2274. messageSends: ["visitIRInstruction:"],
  2275. referencedClasses: []
  2276. }),
  2277. smalltalk.IRVisitor);
  2278. smalltalk.addMethod(
  2279. "_visitIRSend_",
  2280. smalltalk.method({
  2281. selector: "visitIRSend:",
  2282. category: 'visiting',
  2283. fn: function (anIRSend){
  2284. var self=this;
  2285. return smalltalk.withContext(function($ctx1) { var $1;
  2286. $1=_st(self)._visitIRInstruction_(anIRSend);
  2287. return $1;
  2288. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:", [anIRSend], {}, smalltalk.IRVisitor)})},
  2289. args: ["anIRSend"],
  2290. source: "visitIRSend: anIRSend\x0a\x09^ self visitIRInstruction: anIRSend",
  2291. messageSends: ["visitIRInstruction:"],
  2292. referencedClasses: []
  2293. }),
  2294. smalltalk.IRVisitor);
  2295. smalltalk.addMethod(
  2296. "_visitIRSequence_",
  2297. smalltalk.method({
  2298. selector: "visitIRSequence:",
  2299. category: 'visiting',
  2300. fn: function (anIRSequence){
  2301. var self=this;
  2302. return smalltalk.withContext(function($ctx1) { var $1;
  2303. $1=_st(self)._visitIRInstruction_(anIRSequence);
  2304. return $1;
  2305. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:", [anIRSequence], {}, smalltalk.IRVisitor)})},
  2306. args: ["anIRSequence"],
  2307. source: "visitIRSequence: anIRSequence\x0a\x09^ self visitIRInstruction: anIRSequence",
  2308. messageSends: ["visitIRInstruction:"],
  2309. referencedClasses: []
  2310. }),
  2311. smalltalk.IRVisitor);
  2312. smalltalk.addMethod(
  2313. "_visitIRTempDeclaration_",
  2314. smalltalk.method({
  2315. selector: "visitIRTempDeclaration:",
  2316. category: 'visiting',
  2317. fn: function (anIRTempDeclaration){
  2318. var self=this;
  2319. return smalltalk.withContext(function($ctx1) { var $1;
  2320. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  2321. return $1;
  2322. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:", [anIRTempDeclaration], {}, smalltalk.IRVisitor)})},
  2323. args: ["anIRTempDeclaration"],
  2324. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09^ self visitIRInstruction: anIRTempDeclaration",
  2325. messageSends: ["visitIRInstruction:"],
  2326. referencedClasses: []
  2327. }),
  2328. smalltalk.IRVisitor);
  2329. smalltalk.addMethod(
  2330. "_visitIRValue_",
  2331. smalltalk.method({
  2332. selector: "visitIRValue:",
  2333. category: 'visiting',
  2334. fn: function (anIRValue){
  2335. var self=this;
  2336. return smalltalk.withContext(function($ctx1) { var $1;
  2337. $1=_st(self)._visitIRInstruction_(anIRValue);
  2338. return $1;
  2339. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:", [anIRValue], {}, smalltalk.IRVisitor)})},
  2340. args: ["anIRValue"],
  2341. source: "visitIRValue: anIRValue\x0a\x09^ self visitIRInstruction: anIRValue",
  2342. messageSends: ["visitIRInstruction:"],
  2343. referencedClasses: []
  2344. }),
  2345. smalltalk.IRVisitor);
  2346. smalltalk.addMethod(
  2347. "_visitIRVariable_",
  2348. smalltalk.method({
  2349. selector: "visitIRVariable:",
  2350. category: 'visiting',
  2351. fn: function (anIRVariable){
  2352. var self=this;
  2353. return smalltalk.withContext(function($ctx1) { var $1;
  2354. $1=_st(self)._visitIRInstruction_(anIRVariable);
  2355. return $1;
  2356. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:", [anIRVariable], {}, smalltalk.IRVisitor)})},
  2357. args: ["anIRVariable"],
  2358. source: "visitIRVariable: anIRVariable\x0a\x09^ self visitIRInstruction: anIRVariable",
  2359. messageSends: ["visitIRInstruction:"],
  2360. referencedClasses: []
  2361. }),
  2362. smalltalk.IRVisitor);
  2363. smalltalk.addMethod(
  2364. "_visitIRVerbatim_",
  2365. smalltalk.method({
  2366. selector: "visitIRVerbatim:",
  2367. category: 'visiting',
  2368. fn: function (anIRVerbatim){
  2369. var self=this;
  2370. return smalltalk.withContext(function($ctx1) { var $1;
  2371. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  2372. return $1;
  2373. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:", [anIRVerbatim], {}, smalltalk.IRVisitor)})},
  2374. args: ["anIRVerbatim"],
  2375. source: "visitIRVerbatim: anIRVerbatim\x0a\x09^ self visitIRInstruction: anIRVerbatim",
  2376. messageSends: ["visitIRInstruction:"],
  2377. referencedClasses: []
  2378. }),
  2379. smalltalk.IRVisitor);
  2380. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  2381. smalltalk.addMethod(
  2382. "_contents",
  2383. smalltalk.method({
  2384. selector: "contents",
  2385. category: 'accessing',
  2386. fn: function (){
  2387. var self=this;
  2388. return smalltalk.withContext(function($ctx1) { var $1;
  2389. $1=_st(_st(self)._stream())._contents();
  2390. return $1;
  2391. }, function($ctx1) {$ctx1.fill(self,"contents", [], {}, smalltalk.IRJSTranslator)})},
  2392. args: [],
  2393. source: "contents\x0a\x09^ self stream contents",
  2394. messageSends: ["contents", "stream"],
  2395. referencedClasses: []
  2396. }),
  2397. smalltalk.IRJSTranslator);
  2398. smalltalk.addMethod(
  2399. "_initialize",
  2400. smalltalk.method({
  2401. selector: "initialize",
  2402. category: 'initialization',
  2403. fn: function (){
  2404. var self=this;
  2405. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  2406. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  2407. return self}, function($ctx1) {$ctx1.fill(self,"initialize", [], {}, smalltalk.IRJSTranslator)})},
  2408. args: [],
  2409. source: "initialize\x0a\x09super initialize.\x0a\x09stream := JSStream new.",
  2410. messageSends: ["initialize", "new"],
  2411. referencedClasses: ["JSStream"]
  2412. }),
  2413. smalltalk.IRJSTranslator);
  2414. smalltalk.addMethod(
  2415. "_stream",
  2416. smalltalk.method({
  2417. selector: "stream",
  2418. category: 'accessing',
  2419. fn: function (){
  2420. var self=this;
  2421. return smalltalk.withContext(function($ctx1) { var $1;
  2422. $1=self["@stream"];
  2423. return $1;
  2424. }, function($ctx1) {$ctx1.fill(self,"stream", [], {}, smalltalk.IRJSTranslator)})},
  2425. args: [],
  2426. source: "stream\x0a\x09^ stream",
  2427. messageSends: [],
  2428. referencedClasses: []
  2429. }),
  2430. smalltalk.IRJSTranslator);
  2431. smalltalk.addMethod(
  2432. "_stream_",
  2433. smalltalk.method({
  2434. selector: "stream:",
  2435. category: 'accessing',
  2436. fn: function (aStream){
  2437. var self=this;
  2438. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  2439. return self}, function($ctx1) {$ctx1.fill(self,"stream:", [aStream], {}, smalltalk.IRJSTranslator)})},
  2440. args: ["aStream"],
  2441. source: "stream: aStream\x0a\x09stream := aStream",
  2442. messageSends: [],
  2443. referencedClasses: []
  2444. }),
  2445. smalltalk.IRJSTranslator);
  2446. smalltalk.addMethod(
  2447. "_visitIRAssignment_",
  2448. smalltalk.method({
  2449. selector: "visitIRAssignment:",
  2450. category: 'visiting',
  2451. fn: function (anIRAssignment){
  2452. var self=this;
  2453. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  2454. _st(_st(self)._stream())._nextPutAssignment();
  2455. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  2456. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:", [anIRAssignment], {}, smalltalk.IRJSTranslator)})},
  2457. args: ["anIRAssignment"],
  2458. source: "visitIRAssignment: anIRAssignment\x0a\x09self visit: anIRAssignment instructions first.\x0a\x09self stream nextPutAssignment.\x0a\x09self visit: anIRAssignment instructions last.",
  2459. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"],
  2460. referencedClasses: []
  2461. }),
  2462. smalltalk.IRJSTranslator);
  2463. smalltalk.addMethod(
  2464. "_visitIRClosure_",
  2465. smalltalk.method({
  2466. selector: "visitIRClosure:",
  2467. category: 'visiting',
  2468. fn: function (anIRClosure){
  2469. var self=this;
  2470. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  2471. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  2472. return smalltalk.withContext(function($ctx3) { return _st(_st(each)._name())._asVariableName();
  2473. }, function($ctx3) {$ctx3.fillBlock([each], {})})})));
  2474. return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  2475. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  2476. }, function($ctx3) {$ctx3.fillBlock([], {})})}));
  2477. }, function($ctx2) {$ctx2.fillBlock([], {})})}),_st(anIRClosure)._arguments());
  2478. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:", [anIRClosure], {}, smalltalk.IRJSTranslator)})},
  2479. args: ["anIRClosure"],
  2480. source: "visitIRClosure: anIRClosure\x0a\x09self stream \x0a\x09\x09nextPutClosureWith: [ \x0a \x09self stream nextPutVars: (anIRClosure tempDeclarations collect: [ :each |\x0a \x09\x09\x09\x09each name asVariableName ]).\x0a \x09self stream \x0a \x09nextPutBlockContextFor: anIRClosure\x0a during: [ super visitIRClosure: anIRClosure ] ]\x0a\x09\x09arguments: anIRClosure arguments",
  2481. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"],
  2482. referencedClasses: []
  2483. }),
  2484. smalltalk.IRJSTranslator);
  2485. smalltalk.addMethod(
  2486. "_visitIRDynamicArray_",
  2487. smalltalk.method({
  2488. selector: "visitIRDynamicArray:",
  2489. category: 'visiting',
  2490. fn: function (anIRDynamicArray){
  2491. var self=this;
  2492. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  2493. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  2494. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2495. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2496. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2497. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2498. _st(self["@stream"])._nextPutAll_("]");
  2499. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:", [anIRDynamicArray], {}, smalltalk.IRJSTranslator)})},
  2500. args: ["anIRDynamicArray"],
  2501. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09self stream nextPutAll: '['.\x0a\x09anIRDynamicArray instructions\x0a\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ']'",
  2502. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2503. referencedClasses: []
  2504. }),
  2505. smalltalk.IRJSTranslator);
  2506. smalltalk.addMethod(
  2507. "_visitIRDynamicDictionary_",
  2508. smalltalk.method({
  2509. selector: "visitIRDynamicDictionary:",
  2510. category: 'visiting',
  2511. fn: function (anIRDynamicDictionary){
  2512. var self=this;
  2513. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  2514. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  2515. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2516. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2517. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2518. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2519. _st(_st(self)._stream())._nextPutAll_("])");
  2520. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:", [anIRDynamicDictionary], {}, smalltalk.IRJSTranslator)})},
  2521. args: ["anIRDynamicDictionary"],
  2522. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09self stream nextPutAll: 'smalltalk.HashedCollection._fromPairs_(['.\x0a\x09\x09anIRDynamicDictionary instructions \x0a\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09separatedBy: [self stream nextPutAll: ',' ].\x0a\x09self stream nextPutAll: '])'",
  2523. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2524. referencedClasses: []
  2525. }),
  2526. smalltalk.IRJSTranslator);
  2527. smalltalk.addMethod(
  2528. "_visitIRMethod_",
  2529. smalltalk.method({
  2530. selector: "visitIRMethod:",
  2531. category: 'visiting',
  2532. fn: function (anIRMethod){
  2533. var self=this;
  2534. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$6,$7,$9,$10,$8,$5,$3;
  2535. $1=_st(self)._stream();
  2536. $2=anIRMethod;
  2537. $3=(function(){
  2538. return smalltalk.withContext(function($ctx2) { $4=_st(self)._stream();
  2539. $5=(function(){
  2540. return smalltalk.withContext(function($ctx3) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  2541. return smalltalk.withContext(function($ctx4) { return _st(_st(each)._name())._asVariableName();
  2542. }, function($ctx4) {$ctx4.fillBlock([each], {})})})));
  2543. $6=_st(self)._stream();
  2544. $7=anIRMethod;
  2545. $8=(function(){
  2546. return smalltalk.withContext(function($ctx4) { $9=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  2547. if(smalltalk.assert($9)){
  2548. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  2549. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  2550. }, function($ctx5) {$ctx5.fillBlock([each], {})})})));
  2551. };
  2552. $10=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  2553. if(smalltalk.assert($10)){
  2554. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  2555. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2556. }, function($ctx5) {$ctx5.fillBlock([], {})})}));
  2557. } else {
  2558. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2559. };
  2560. }, function($ctx4) {$ctx4.fillBlock([], {})})});
  2561. return _st($6)._nextPutContextFor_during_($7,$8);
  2562. }, function($ctx3) {$ctx3.fillBlock([], {})})});
  2563. return _st($4)._nextPutFunctionWith_arguments_($5,_st(anIRMethod)._arguments());
  2564. }, function($ctx2) {$ctx2.fillBlock([], {})})});
  2565. _st($1)._nextPutMethodDeclaration_with_($2,$3);
  2566. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:", [anIRMethod], {}, smalltalk.IRJSTranslator)})},
  2567. args: ["anIRMethod"],
  2568. source: "visitIRMethod: anIRMethod\x0a\x09self stream\x0a\x09\x09nextPutMethodDeclaration: anIRMethod \x0a\x09\x09with: [ self stream \x0a\x09\x09\x09nextPutFunctionWith: [ \x0a \x09self stream nextPutVars: (anIRMethod tempDeclarations collect: [ :each |\x0a \x09\x09\x09\x09each name asVariableName ]).\x0a \x09self stream nextPutContextFor: anIRMethod during: [\x0a\x09\x09\x09\x09anIRMethod internalVariables notEmpty ifTrue: [\x0a\x09\x09\x09\x09\x09self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |\x0a\x09\x09\x09\x09\x09\x09each variable alias ]) ].\x0a\x09\x09\x09\x09anIRMethod scope hasNonLocalReturn \x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09self stream nextPutNonLocalReturnHandlingWith: [\x0a\x09\x09\x09\x09\x09\x09\x09super visitIRMethod: anIRMethod ]]\x0a\x09\x09\x09\x09\x09ifFalse: [ super visitIRMethod: anIRMethod ]]]\x0a\x09\x09\x09arguments: anIRMethod arguments ]",
  2569. messageSends: ["nextPutMethodDeclaration:with:", "nextPutFunctionWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutContextFor:during:", "ifTrue:", "alias", "variable", "asArray", "internalVariables", "notEmpty", "ifTrue:ifFalse:", "nextPutNonLocalReturnHandlingWith:", "visitIRMethod:", "hasNonLocalReturn", "scope", "arguments"],
  2570. referencedClasses: []
  2571. }),
  2572. smalltalk.IRJSTranslator);
  2573. smalltalk.addMethod(
  2574. "_visitIRNonLocalReturn_",
  2575. smalltalk.method({
  2576. selector: "visitIRNonLocalReturn:",
  2577. category: 'visiting',
  2578. fn: function (anIRNonLocalReturn){
  2579. var self=this;
  2580. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  2581. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  2582. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2583. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:", [anIRNonLocalReturn], {}, smalltalk.IRJSTranslator)})},
  2584. args: ["anIRNonLocalReturn"],
  2585. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09self stream nextPutNonLocalReturnWith: [\x0a\x09\x09super visitIRNonLocalReturn: anIRNonLocalReturn ]",
  2586. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"],
  2587. referencedClasses: []
  2588. }),
  2589. smalltalk.IRJSTranslator);
  2590. smalltalk.addMethod(
  2591. "_visitIRReturn_",
  2592. smalltalk.method({
  2593. selector: "visitIRReturn:",
  2594. category: 'visiting',
  2595. fn: function (anIRReturn){
  2596. var self=this;
  2597. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  2598. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  2599. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2600. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:", [anIRReturn], {}, smalltalk.IRJSTranslator)})},
  2601. args: ["anIRReturn"],
  2602. source: "visitIRReturn: anIRReturn\x0a\x09self stream nextPutReturnWith: [\x0a\x09\x09super visitIRReturn: anIRReturn ]",
  2603. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"],
  2604. referencedClasses: []
  2605. }),
  2606. smalltalk.IRJSTranslator);
  2607. smalltalk.addMethod(
  2608. "_visitIRSend_",
  2609. smalltalk.method({
  2610. selector: "visitIRSend:",
  2611. category: 'visiting',
  2612. fn: function (anIRSend){
  2613. var self=this;
  2614. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2615. $1=_st(anIRSend)._classSend();
  2616. if(($receiver = $1) == nil || $receiver == undefined){
  2617. _st(_st(self)._stream())._nextPutAll_("_st(");
  2618. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2619. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  2620. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2621. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2622. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2623. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2624. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2625. _st(_st(self)._stream())._nextPutAll_(")");
  2626. } else {
  2627. $2=_st(self)._stream();
  2628. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  2629. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  2630. $3=_st($2)._nextPutAll_("_st(");
  2631. $3;
  2632. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2633. _st(_st(self)._stream())._nextPutAll_("), [");
  2634. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2635. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2636. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2637. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2638. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2639. _st(_st(self)._stream())._nextPutAll_("])");
  2640. };
  2641. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:", [anIRSend], {}, smalltalk.IRJSTranslator)})},
  2642. args: ["anIRSend"],
  2643. source: "visitIRSend: anIRSend\x0a\x09anIRSend classSend \x0a \x09ifNil: [\x0a\x09\x09\x09self stream nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a \x09\x09 \x09self stream nextPutAll: ').', anIRSend selector asSelector, '('.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09ifNotNil: [ \x0a\x09\x09\x09self stream \x0a \x09nextPutAll: anIRSend classSend asJavascript, '.fn.prototype.';\x0a\x09\x09\x09\x09nextPutAll: anIRSend selector asSelector, '.apply(';\x0a\x09\x09\x09\x09nextPutAll: '_st('.\x0a\x09\x09\x09self visit: anIRSend instructions first.\x0a\x09\x09\x09self stream nextPutAll: '), ['.\x0a\x09\x09\x09anIRSend instructions allButFirst\x0a\x09\x09\x09\x09do: [ :each | self visit: each ]\x0a\x09\x09\x09\x09separatedBy: [ self stream nextPutAll: ',' ].\x0a\x09\x09\x09self stream nextPutAll: '])' ]",
  2644. messageSends: ["ifNil:ifNotNil:", "nextPutAll:", "stream", "visit:", "first", "instructions", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "asJavascript", "classSend"],
  2645. referencedClasses: []
  2646. }),
  2647. smalltalk.IRJSTranslator);
  2648. smalltalk.addMethod(
  2649. "_visitIRSequence_",
  2650. smalltalk.method({
  2651. selector: "visitIRSequence:",
  2652. category: 'visiting',
  2653. fn: function (anIRSequence){
  2654. var self=this;
  2655. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  2656. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  2657. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  2658. }, function($ctx3) {$ctx3.fillBlock([each], {})})}));
  2659. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2660. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:", [anIRSequence], {}, smalltalk.IRJSTranslator)})},
  2661. args: ["anIRSequence"],
  2662. source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence instructions do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ]]",
  2663. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
  2664. referencedClasses: []
  2665. }),
  2666. smalltalk.IRJSTranslator);
  2667. smalltalk.addMethod(
  2668. "_visitIRTempDeclaration_",
  2669. smalltalk.method({
  2670. selector: "visitIRTempDeclaration:",
  2671. category: 'visiting',
  2672. fn: function (anIRTempDeclaration){
  2673. var self=this;
  2674. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:", [anIRTempDeclaration], {}, smalltalk.IRJSTranslator)})},
  2675. args: ["anIRTempDeclaration"],
  2676. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09\x22self stream \x0a \x09nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';'; \x0a lf\x22",
  2677. messageSends: [],
  2678. referencedClasses: []
  2679. }),
  2680. smalltalk.IRJSTranslator);
  2681. smalltalk.addMethod(
  2682. "_visitIRValue_",
  2683. smalltalk.method({
  2684. selector: "visitIRValue:",
  2685. category: 'visiting',
  2686. fn: function (anIRValue){
  2687. var self=this;
  2688. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2689. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:", [anIRValue], {}, smalltalk.IRJSTranslator)})},
  2690. args: ["anIRValue"],
  2691. source: "visitIRValue: anIRValue\x0a\x09self stream nextPutAll: anIRValue value asJavascript",
  2692. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"],
  2693. referencedClasses: []
  2694. }),
  2695. smalltalk.IRJSTranslator);
  2696. smalltalk.addMethod(
  2697. "_visitIRVariable_",
  2698. smalltalk.method({
  2699. selector: "visitIRVariable:",
  2700. category: 'visiting',
  2701. fn: function (anIRVariable){
  2702. var self=this;
  2703. return smalltalk.withContext(function($ctx1) { var $1;
  2704. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2705. if(smalltalk.assert($1)){
  2706. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  2707. } else {
  2708. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2709. };
  2710. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:", [anIRVariable], {}, smalltalk.IRJSTranslator)})},
  2711. args: ["anIRVariable"],
  2712. source: "visitIRVariable: anIRVariable\x0a\x09anIRVariable variable name = 'thisContext'\x0a \x09ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]\x0a \x09ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]",
  2713. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"],
  2714. referencedClasses: []
  2715. }),
  2716. smalltalk.IRJSTranslator);
  2717. smalltalk.addMethod(
  2718. "_visitIRVerbatim_",
  2719. smalltalk.method({
  2720. selector: "visitIRVerbatim:",
  2721. category: 'visiting',
  2722. fn: function (anIRVerbatim){
  2723. var self=this;
  2724. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  2725. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2726. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2727. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:", [anIRVerbatim], {}, smalltalk.IRJSTranslator)})},
  2728. args: ["anIRVerbatim"],
  2729. source: "visitIRVerbatim: anIRVerbatim\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self stream nextPutAll: anIRVerbatim source ]",
  2730. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"],
  2731. referencedClasses: []
  2732. }),
  2733. smalltalk.IRJSTranslator);
  2734. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2735. smalltalk.addMethod(
  2736. "_contents",
  2737. smalltalk.method({
  2738. selector: "contents",
  2739. category: 'accessing',
  2740. fn: function (){
  2741. var self=this;
  2742. return smalltalk.withContext(function($ctx1) { var $1;
  2743. $1=_st(self["@stream"])._contents();
  2744. return $1;
  2745. }, function($ctx1) {$ctx1.fill(self,"contents", [], {}, smalltalk.JSStream)})},
  2746. args: [],
  2747. source: "contents\x0a\x09^ stream contents",
  2748. messageSends: ["contents"],
  2749. referencedClasses: []
  2750. }),
  2751. smalltalk.JSStream);
  2752. smalltalk.addMethod(
  2753. "_initialize",
  2754. smalltalk.method({
  2755. selector: "initialize",
  2756. category: 'initialization',
  2757. fn: function (){
  2758. var self=this;
  2759. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  2760. self["@stream"]=_st("")._writeStream();
  2761. return self}, function($ctx1) {$ctx1.fill(self,"initialize", [], {}, smalltalk.JSStream)})},
  2762. args: [],
  2763. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.",
  2764. messageSends: ["initialize", "writeStream"],
  2765. referencedClasses: []
  2766. }),
  2767. smalltalk.JSStream);
  2768. smalltalk.addMethod(
  2769. "_lf",
  2770. smalltalk.method({
  2771. selector: "lf",
  2772. category: 'streaming',
  2773. fn: function (){
  2774. var self=this;
  2775. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  2776. return self}, function($ctx1) {$ctx1.fill(self,"lf", [], {}, smalltalk.JSStream)})},
  2777. args: [],
  2778. source: "lf\x0a\x09stream lf",
  2779. messageSends: ["lf"],
  2780. referencedClasses: []
  2781. }),
  2782. smalltalk.JSStream);
  2783. smalltalk.addMethod(
  2784. "_nextPut_",
  2785. smalltalk.method({
  2786. selector: "nextPut:",
  2787. category: 'streaming',
  2788. fn: function (aString){
  2789. var self=this;
  2790. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  2791. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:", [aString], {}, smalltalk.JSStream)})},
  2792. args: ["aString"],
  2793. source: "nextPut: aString\x0a\x09stream nextPut: aString",
  2794. messageSends: ["nextPut:"],
  2795. referencedClasses: []
  2796. }),
  2797. smalltalk.JSStream);
  2798. smalltalk.addMethod(
  2799. "_nextPutAll_",
  2800. smalltalk.method({
  2801. selector: "nextPutAll:",
  2802. category: 'streaming',
  2803. fn: function (aString){
  2804. var self=this;
  2805. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  2806. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:", [aString], {}, smalltalk.JSStream)})},
  2807. args: ["aString"],
  2808. source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString",
  2809. messageSends: ["nextPutAll:"],
  2810. referencedClasses: []
  2811. }),
  2812. smalltalk.JSStream);
  2813. smalltalk.addMethod(
  2814. "_nextPutAssignment",
  2815. smalltalk.method({
  2816. selector: "nextPutAssignment",
  2817. category: 'streaming',
  2818. fn: function (){
  2819. var self=this;
  2820. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  2821. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment", [], {}, smalltalk.JSStream)})},
  2822. args: [],
  2823. source: "nextPutAssignment\x0a\x09stream nextPutAll: '='",
  2824. messageSends: ["nextPutAll:"],
  2825. referencedClasses: []
  2826. }),
  2827. smalltalk.JSStream);
  2828. smalltalk.addMethod(
  2829. "_nextPutBlockContextFor_during_",
  2830. smalltalk.method({
  2831. selector: "nextPutBlockContextFor:during:",
  2832. category: 'streaming',
  2833. fn: function (anIRClosure,aBlock){
  2834. var self=this;
  2835. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  2836. $1=self;
  2837. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2838. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2839. _st(aBlock)._value();
  2840. $3=self;
  2841. _st($3)._nextPutAll_(_st(_st("}, function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2842. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock(["));
  2843. _st(_st(anIRClosure)._arguments())._do_separatedBy_((function(each){
  2844. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(_st(each)._asVariableName());
  2845. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2846. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2847. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2848. _st(self)._nextPutAll_("], {");
  2849. _st(_st(anIRClosure)._tempDeclarations())._do_separatedBy_((function(each){
  2850. return smalltalk.withContext(function($ctx2) { $5=self;
  2851. _st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2852. _st($5)._nextPutAll_(":");
  2853. $6=_st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2854. return $6;
  2855. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2856. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2857. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2858. _st(self)._nextPutAll_("})})");
  2859. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:", [anIRClosure,aBlock], {}, smalltalk.JSStream)})},
  2860. args: ["anIRClosure", "aBlock"],
  2861. source: "nextPutBlockContextFor: anIRClosure during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {'; \x0a nextPutAll: String cr.\x0a \x0a aBlock value.\x0a \x0a self \x0a \x09nextPutAll: '}, function(', anIRClosure scope alias, ') {';\x0a nextPutAll: anIRClosure scope alias, '.fillBlock(['.\x0a \x0a anIRClosure arguments \x0a \x09do: [ :each | self nextPutAll: each asVariableName ]\x0a \x09separatedBy: [ self nextPutAll: ',' ].\x0a self nextPutAll: '], {'.\x0a \x0a anIRClosure tempDeclarations \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each name asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each name asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '})})'",
  2862. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "do:separatedBy:", "asVariableName", "arguments", "name", "tempDeclarations"],
  2863. referencedClasses: ["String"]
  2864. }),
  2865. smalltalk.JSStream);
  2866. smalltalk.addMethod(
  2867. "_nextPutClosureWith_arguments_",
  2868. smalltalk.method({
  2869. selector: "nextPutClosureWith:arguments:",
  2870. category: 'streaming',
  2871. fn: function (aBlock,anArray){
  2872. var self=this;
  2873. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2874. _st(self["@stream"])._nextPutAll_("(function(");
  2875. _st(anArray)._do_separatedBy_((function(each){
  2876. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2877. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2878. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2879. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2880. $1=self["@stream"];
  2881. _st($1)._nextPutAll_("){");
  2882. $2=_st($1)._lf();
  2883. _st(aBlock)._value();
  2884. _st(self["@stream"])._nextPutAll_("})");
  2885. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:", [aBlock,anArray], {}, smalltalk.JSStream)})},
  2886. args: ["aBlock", "anArray"],
  2887. source: "nextPutClosureWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: '(function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '})'",
  2888. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  2889. referencedClasses: []
  2890. }),
  2891. smalltalk.JSStream);
  2892. smalltalk.addMethod(
  2893. "_nextPutContextFor_during_",
  2894. smalltalk.method({
  2895. selector: "nextPutContextFor:during:",
  2896. category: 'streaming',
  2897. fn: function (aMethod,aBlock){
  2898. var self=this;
  2899. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2900. $1=self;
  2901. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  2902. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2903. _st(aBlock)._value();
  2904. $3=self;
  2905. _st($3)._nextPutAll_(_st(_st(_st("}, function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  2906. $4=_st($3)._nextPutAll_(_st(_st(".fill(self,").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(", ["));
  2907. _st(_st(aMethod)._arguments())._do_separatedBy_((function(each){
  2908. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(_st(each)._asVariableName());
  2909. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2910. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2911. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2912. _st(self)._nextPutAll_("], {");
  2913. _st(_st(aMethod)._tempDeclarations())._do_separatedBy_((function(each){
  2914. return smalltalk.withContext(function($ctx2) { $5=self;
  2915. _st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2916. _st($5)._nextPutAll_(":");
  2917. $6=_st($5)._nextPutAll_(_st(_st(each)._name())._asVariableName());
  2918. return $6;
  2919. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2920. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2921. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2922. $7=self;
  2923. _st($7)._nextPutAll_("}, ");
  2924. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  2925. $8=_st($7)._nextPutAll_(")})");
  2926. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:", [aMethod,aBlock], {}, smalltalk.JSStream)})},
  2927. args: ["aMethod", "aBlock"],
  2928. source: "nextPutContextFor: aMethod during: aBlock\x0a\x09self \x0a \x09nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; \x0a nextPutAll: String cr.\x0a aBlock value.\x0a \x0a self \x0a \x09nextPutAll: '}, function(', aMethod scope alias, ') {', aMethod scope alias; \x0a nextPutAll: '.fill(self,', aMethod selector asJavascript, ', ['.\x0a \x0a aMethod arguments \x0a \x09do: [ :each | self nextPutAll: each asVariableName ]\x0a \x09separatedBy: [ self nextPutAll: ',' ].\x0a self nextPutAll: '], {'.\x0a \x0a aMethod tempDeclarations \x0a \x09do: [ :each |\x0a \x09\x09self \x0a \x09\x09nextPutAll: each name asVariableName;\x0a \x09 \x09nextPutAll: ':';\x0a \x09\x09nextPutAll: each name asVariableName]\x0a\x09\x09separatedBy: [ self nextPutAll: ',' ].\x0a \x0a self\x0a \x09nextPutAll: '}, ';\x0a nextPutAll: aMethod theClass asJavascript;\x0a nextPutAll: ')})'",
  2929. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "arguments", "name", "tempDeclarations", "theClass"],
  2930. referencedClasses: ["String"]
  2931. }),
  2932. smalltalk.JSStream);
  2933. smalltalk.addMethod(
  2934. "_nextPutFunctionWith_arguments_",
  2935. smalltalk.method({
  2936. selector: "nextPutFunctionWith:arguments:",
  2937. category: 'streaming',
  2938. fn: function (aBlock,anArray){
  2939. var self=this;
  2940. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2941. _st(self["@stream"])._nextPutAll_("fn: function(");
  2942. _st(anArray)._do_separatedBy_((function(each){
  2943. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2944. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  2945. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2946. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  2947. $1=self["@stream"];
  2948. _st($1)._nextPutAll_("){");
  2949. $2=_st($1)._lf();
  2950. $3=self["@stream"];
  2951. _st($3)._nextPutAll_("var self=this;");
  2952. $4=_st($3)._lf();
  2953. _st(aBlock)._value();
  2954. _st(self["@stream"])._nextPutAll_("}");
  2955. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:", [aBlock,anArray], {}, smalltalk.JSStream)})},
  2956. args: ["aBlock", "anArray"],
  2957. source: "nextPutFunctionWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each asVariableName ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09stream nextPutAll: 'var self=this;'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '}'",
  2958. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  2959. referencedClasses: []
  2960. }),
  2961. smalltalk.JSStream);
  2962. smalltalk.addMethod(
  2963. "_nextPutIf_with_",
  2964. smalltalk.method({
  2965. selector: "nextPutIf:with:",
  2966. category: 'streaming',
  2967. fn: function (aBlock,anotherBlock){
  2968. var self=this;
  2969. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2970. _st(self["@stream"])._nextPutAll_("if(");
  2971. _st(aBlock)._value();
  2972. $1=self["@stream"];
  2973. _st($1)._nextPutAll_("){");
  2974. $2=_st($1)._lf();
  2975. _st(anotherBlock)._value();
  2976. _st(self["@stream"])._nextPutAll_("}");
  2977. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:", [aBlock,anotherBlock], {}, smalltalk.JSStream)})},
  2978. args: ["aBlock", "anotherBlock"],
  2979. source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
  2980. messageSends: ["nextPutAll:", "value", "lf"],
  2981. referencedClasses: []
  2982. }),
  2983. smalltalk.JSStream);
  2984. smalltalk.addMethod(
  2985. "_nextPutIfElse_with_with_",
  2986. smalltalk.method({
  2987. selector: "nextPutIfElse:with:with:",
  2988. category: 'streaming',
  2989. fn: function (aBlock,ifBlock,elseBlock){
  2990. var self=this;
  2991. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2992. _st(self["@stream"])._nextPutAll_("if(");
  2993. _st(aBlock)._value();
  2994. $1=self["@stream"];
  2995. _st($1)._nextPutAll_("){");
  2996. $2=_st($1)._lf();
  2997. _st(ifBlock)._value();
  2998. $3=self["@stream"];
  2999. _st($3)._nextPutAll_("} else {");
  3000. $4=_st($3)._lf();
  3001. _st(elseBlock)._value();
  3002. _st(self["@stream"])._nextPutAll_("}");
  3003. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:", [aBlock,ifBlock,elseBlock], {}, smalltalk.JSStream)})},
  3004. args: ["aBlock", "ifBlock", "elseBlock"],
  3005. source: "nextPutIfElse: aBlock with: ifBlock with: elseBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09ifBlock value.\x0a\x09stream nextPutAll: '} else {'; lf.\x0a\x09elseBlock value.\x0a\x09stream nextPutAll: '}'",
  3006. messageSends: ["nextPutAll:", "value", "lf"],
  3007. referencedClasses: []
  3008. }),
  3009. smalltalk.JSStream);
  3010. smalltalk.addMethod(
  3011. "_nextPutMethodDeclaration_with_",
  3012. smalltalk.method({
  3013. selector: "nextPutMethodDeclaration:with:",
  3014. category: 'streaming',
  3015. fn: function (aMethod,aBlock){
  3016. var self=this;
  3017. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  3018. $1=self["@stream"];
  3019. _st($1)._nextPutAll_("smalltalk.method({");
  3020. _st($1)._lf();
  3021. _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  3022. _st($1)._lf();
  3023. _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  3024. $2=_st($1)._lf();
  3025. _st(aBlock)._value();
  3026. $3=self["@stream"];
  3027. _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  3028. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  3029. _st($3)._lf();
  3030. _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  3031. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  3032. }, function($ctx2) {$ctx2.fillBlock([each], {})})})))._asArray())._asJavascript())).__comma(","));
  3033. _st($3)._lf();
  3034. $4=_st($3)._nextPutAll_("referencedClasses: [");
  3035. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  3036. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  3037. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  3038. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3039. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  3040. $5=self["@stream"];
  3041. _st($5)._nextPutAll_("]");
  3042. $6=_st($5)._nextPutAll_("})");
  3043. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:", [aMethod,aBlock], {}, smalltalk.JSStream)})},
  3044. args: ["aMethod", "aBlock"],
  3045. source: "nextPutMethodDeclaration: aMethod with: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'smalltalk.method({'; lf;\x0a\x09\x09nextPutAll: 'selector: \x22', aMethod selector, '\x22,'; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf. \x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: aMethod messageSends asArray asJavascript, ','; lf;\x0a nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09aMethod classReferences \x0a\x09\x09do: [:each | stream nextPutAll: each asJavascript]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream \x0a\x09\x09nextPutAll: ']';\x0a\x09\x09nextPutAll: '})'",
  3046. messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"],
  3047. referencedClasses: ["String"]
  3048. }),
  3049. smalltalk.JSStream);
  3050. smalltalk.addMethod(
  3051. "_nextPutNonLocalReturnHandlingWith_",
  3052. smalltalk.method({
  3053. selector: "nextPutNonLocalReturnHandlingWith:",
  3054. category: 'streaming',
  3055. fn: function (aBlock){
  3056. var self=this;
  3057. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3058. $1=self["@stream"];
  3059. _st($1)._nextPutAll_("var $early={};");
  3060. _st($1)._lf();
  3061. _st($1)._nextPutAll_("try {");
  3062. $2=_st($1)._lf();
  3063. _st(aBlock)._value();
  3064. $3=self["@stream"];
  3065. _st($3)._nextPutAll_("}");
  3066. _st($3)._lf();
  3067. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  3068. $4=_st($3)._lf();
  3069. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:", [aBlock], {}, smalltalk.JSStream)})},
  3070. args: ["aBlock"],
  3071. source: "nextPutNonLocalReturnHandlingWith: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'var $early={};'; lf;\x0a\x09\x09nextPutAll: 'try {'; lf.\x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: '}'; lf;\x0a\x09\x09nextPutAll: 'catch(e) {if(e===$early)return e[0]; throw e}'; lf",
  3072. messageSends: ["nextPutAll:", "lf", "value"],
  3073. referencedClasses: []
  3074. }),
  3075. smalltalk.JSStream);
  3076. smalltalk.addMethod(
  3077. "_nextPutNonLocalReturnWith_",
  3078. smalltalk.method({
  3079. selector: "nextPutNonLocalReturnWith:",
  3080. category: 'streaming',
  3081. fn: function (aBlock){
  3082. var self=this;
  3083. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  3084. _st(aBlock)._value();
  3085. _st(self["@stream"])._nextPutAll_("]");
  3086. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:", [aBlock], {}, smalltalk.JSStream)})},
  3087. args: ["aBlock"],
  3088. source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: 'throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']'",
  3089. messageSends: ["nextPutAll:", "value"],
  3090. referencedClasses: []
  3091. }),
  3092. smalltalk.JSStream);
  3093. smalltalk.addMethod(
  3094. "_nextPutReturn",
  3095. smalltalk.method({
  3096. selector: "nextPutReturn",
  3097. category: 'streaming',
  3098. fn: function (){
  3099. var self=this;
  3100. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  3101. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn", [], {}, smalltalk.JSStream)})},
  3102. args: [],
  3103. source: "nextPutReturn\x0a\x09stream nextPutAll: 'return '",
  3104. messageSends: ["nextPutAll:"],
  3105. referencedClasses: []
  3106. }),
  3107. smalltalk.JSStream);
  3108. smalltalk.addMethod(
  3109. "_nextPutReturnWith_",
  3110. smalltalk.method({
  3111. selector: "nextPutReturnWith:",
  3112. category: 'streaming',
  3113. fn: function (aBlock){
  3114. var self=this;
  3115. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  3116. _st(aBlock)._value();
  3117. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:", [aBlock], {}, smalltalk.JSStream)})},
  3118. args: ["aBlock"],
  3119. source: "nextPutReturnWith: aBlock\x0a\x09self nextPutReturn.\x0a\x09aBlock value",
  3120. messageSends: ["nextPutReturn", "value"],
  3121. referencedClasses: []
  3122. }),
  3123. smalltalk.JSStream);
  3124. smalltalk.addMethod(
  3125. "_nextPutSequenceWith_",
  3126. smalltalk.method({
  3127. selector: "nextPutSequenceWith:",
  3128. category: 'streaming',
  3129. fn: function (aBlock){
  3130. var self=this;
  3131. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  3132. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:", [aBlock], {}, smalltalk.JSStream)})},
  3133. args: ["aBlock"],
  3134. source: "nextPutSequenceWith: aBlock\x0a\x09\x22stream \x0a\x09\x09nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf.\x22\x0a\x09aBlock value.\x0a\x09\x22stream \x0a\x09\x09nextPutAll: '};'; lf\x22",
  3135. messageSends: ["value"],
  3136. referencedClasses: []
  3137. }),
  3138. smalltalk.JSStream);
  3139. smalltalk.addMethod(
  3140. "_nextPutStatement_with_",
  3141. smalltalk.method({
  3142. selector: "nextPutStatement:with:",
  3143. category: 'streaming',
  3144. fn: function (anInteger,aBlock){
  3145. var self=this;
  3146. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3147. $1=self["@stream"];
  3148. _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  3149. $2=_st($1)._lf();
  3150. _st(self)._nextPutStatementWith_(aBlock);
  3151. $3=self["@stream"];
  3152. _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  3153. $4=_st($3)._lf();
  3154. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:", [anInteger,aBlock], {}, smalltalk.JSStream)})},
  3155. args: ["anInteger", "aBlock"],
  3156. source: "nextPutStatement: anInteger with: aBlock\x0a\x09stream nextPutAll: 'case ', anInteger asString, ':'; lf.\x0a\x09self nextPutStatementWith: aBlock.\x0a\x09stream nextPutAll: 'smalltalk.thisContext.pc=', (anInteger + 1) asString, ';'; lf",
  3157. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"],
  3158. referencedClasses: []
  3159. }),
  3160. smalltalk.JSStream);
  3161. smalltalk.addMethod(
  3162. "_nextPutStatementWith_",
  3163. smalltalk.method({
  3164. selector: "nextPutStatementWith:",
  3165. category: 'streaming',
  3166. fn: function (aBlock){
  3167. var self=this;
  3168. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3169. _st(aBlock)._value();
  3170. $1=self["@stream"];
  3171. _st($1)._nextPutAll_(";");
  3172. $2=_st($1)._lf();
  3173. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:", [aBlock], {}, smalltalk.JSStream)})},
  3174. args: ["aBlock"],
  3175. source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
  3176. messageSends: ["value", "nextPutAll:", "lf"],
  3177. referencedClasses: []
  3178. }),
  3179. smalltalk.JSStream);
  3180. smalltalk.addMethod(
  3181. "_nextPutVar_",
  3182. smalltalk.method({
  3183. selector: "nextPutVar:",
  3184. category: 'streaming',
  3185. fn: function (aString){
  3186. var self=this;
  3187. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3188. $1=self["@stream"];
  3189. _st($1)._nextPutAll_(_st(_st("var ").__comma(aString)).__comma(";"));
  3190. $2=_st($1)._lf();
  3191. return self}, function($ctx1) {$ctx1.fill(self,"nextPutVar:", [aString], {}, smalltalk.JSStream)})},
  3192. args: ["aString"],
  3193. source: "nextPutVar: aString\x0a\x09stream nextPutAll: 'var ', aString, ';'; lf",
  3194. messageSends: ["nextPutAll:", ",", "lf"],
  3195. referencedClasses: []
  3196. }),
  3197. smalltalk.JSStream);
  3198. smalltalk.addMethod(
  3199. "_nextPutVars_",
  3200. smalltalk.method({
  3201. selector: "nextPutVars:",
  3202. category: 'streaming',
  3203. fn: function (aCollection){
  3204. var self=this;
  3205. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  3206. var $early={};
  3207. try {
  3208. _st(aCollection)._ifEmpty_((function(){
  3209. return smalltalk.withContext(function($ctx2) { $1=self;
  3210. throw $early=[$1];
  3211. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  3212. _st(self["@stream"])._nextPutAll_("var ");
  3213. _st(aCollection)._do_separatedBy_((function(each){
  3214. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  3215. }, function($ctx2) {$ctx2.fillBlock([each], {})})}),(function(){
  3216. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3217. }, function($ctx2) {$ctx2.fillBlock([], {})})}));
  3218. $2=self["@stream"];
  3219. _st($2)._nextPutAll_(";");
  3220. $3=_st($2)._lf();
  3221. return self}
  3222. catch(e) {if(e===$early)return e[0]; throw e}
  3223. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:", [aCollection], {}, smalltalk.JSStream)})},
  3224. args: ["aCollection"],
  3225. source: "nextPutVars: aCollection\x0a\x09aCollection ifEmpty: [ ^self ].\x0a \x0a\x09stream nextPutAll: 'var '.\x0a\x09aCollection \x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ';'; lf",
  3226. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"],
  3227. referencedClasses: []
  3228. }),
  3229. smalltalk.JSStream);
  3230. smalltalk.addMethod(
  3231. "_appendToInstruction_",
  3232. smalltalk.method({
  3233. selector: "appendToInstruction:",
  3234. category: '*Compiler-IR',
  3235. fn: function (anIRInstruction){
  3236. var self=this;
  3237. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  3238. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:", [anIRInstruction], {}, smalltalk.BlockClosure)})},
  3239. args: ["anIRInstruction"],
  3240. source: "appendToInstruction: anIRInstruction\x0a anIRInstruction appendBlock: self",
  3241. messageSends: ["appendBlock:"],
  3242. referencedClasses: []
  3243. }),
  3244. smalltalk.BlockClosure);
  3245. smalltalk.addMethod(
  3246. "_asVariableName",
  3247. smalltalk.method({
  3248. selector: "asVariableName",
  3249. category: '*Compiler-IR',
  3250. fn: function (){
  3251. var self=this;
  3252. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3253. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  3254. if(smalltalk.assert($2)){
  3255. $1=_st(self).__comma("_");
  3256. } else {
  3257. $1=self;
  3258. };
  3259. return $1;
  3260. }, function($ctx1) {$ctx1.fill(self,"asVariableName", [], {}, smalltalk.String)})},
  3261. args: [],
  3262. source: "asVariableName\x0a\x09^ (Smalltalk current reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
  3263. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  3264. referencedClasses: ["Smalltalk"]
  3265. }),
  3266. smalltalk.String);