Compiler-IR.js 140 KB

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