Compiler-IR.js 125 KB

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