Compiler-IR.js 129 KB

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