Compiler-IR.js 129 KB

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