Compiler-IR.js 128 KB

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