Compiler-IR.js 124 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428
  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. "_selector",
  1772. smalltalk.method({
  1773. selector: "selector",
  1774. category: 'accessing',
  1775. fn: function (){
  1776. var self=this;
  1777. return smalltalk.withContext(function($ctx1) { var $1;
  1778. $1=self["@selector"];
  1779. return $1;
  1780. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRSend)})},
  1781. args: [],
  1782. source: "selector\x0a\x09^ selector",
  1783. messageSends: [],
  1784. referencedClasses: []
  1785. }),
  1786. smalltalk.IRSend);
  1787. smalltalk.addMethod(
  1788. "_selector_",
  1789. smalltalk.method({
  1790. selector: "selector:",
  1791. category: 'accessing',
  1792. fn: function (aString){
  1793. var self=this;
  1794. return smalltalk.withContext(function($ctx1) { self["@selector"]=aString;
  1795. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRSend)})},
  1796. args: ["aString"],
  1797. source: "selector: aString\x0a\x09selector := aString",
  1798. messageSends: [],
  1799. referencedClasses: []
  1800. }),
  1801. smalltalk.IRSend);
  1802. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1803. smalltalk.addMethod(
  1804. "_accept_",
  1805. smalltalk.method({
  1806. selector: "accept:",
  1807. category: 'visiting',
  1808. fn: function (aVisitor){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) { var $1;
  1811. $1=_st(aVisitor)._visitIRSequence_(self);
  1812. return $1;
  1813. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSequence)})},
  1814. args: ["aVisitor"],
  1815. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRSequence: self",
  1816. messageSends: ["visitIRSequence:"],
  1817. referencedClasses: []
  1818. }),
  1819. smalltalk.IRSequence);
  1820. smalltalk.addMethod(
  1821. "_isSequence",
  1822. smalltalk.method({
  1823. selector: "isSequence",
  1824. category: 'testing',
  1825. fn: function (){
  1826. var self=this;
  1827. return smalltalk.withContext(function($ctx1) { return true;
  1828. }, function($ctx1) {$ctx1.fill(self,"isSequence",{},smalltalk.IRSequence)})},
  1829. args: [],
  1830. source: "isSequence\x0a\x09^ true",
  1831. messageSends: [],
  1832. referencedClasses: []
  1833. }),
  1834. smalltalk.IRSequence);
  1835. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1836. smalltalk.addMethod(
  1837. "_accept_",
  1838. smalltalk.method({
  1839. selector: "accept:",
  1840. category: 'visiting',
  1841. fn: function (aVisitor){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) { var $1;
  1844. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1845. return $1;
  1846. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockSequence)})},
  1847. args: ["aVisitor"],
  1848. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRBlockSequence: self",
  1849. messageSends: ["visitIRBlockSequence:"],
  1850. referencedClasses: []
  1851. }),
  1852. smalltalk.IRBlockSequence);
  1853. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1854. smalltalk.IRValue.comment="I am the simplest possible instruction. I represent a value."
  1855. smalltalk.addMethod(
  1856. "_accept_",
  1857. smalltalk.method({
  1858. selector: "accept:",
  1859. category: 'visiting',
  1860. fn: function (aVisitor){
  1861. var self=this;
  1862. return smalltalk.withContext(function($ctx1) { var $1;
  1863. $1=_st(aVisitor)._visitIRValue_(self);
  1864. return $1;
  1865. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRValue)})},
  1866. args: ["aVisitor"],
  1867. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRValue: self",
  1868. messageSends: ["visitIRValue:"],
  1869. referencedClasses: []
  1870. }),
  1871. smalltalk.IRValue);
  1872. smalltalk.addMethod(
  1873. "_value",
  1874. smalltalk.method({
  1875. selector: "value",
  1876. category: 'accessing',
  1877. fn: function (){
  1878. var self=this;
  1879. return smalltalk.withContext(function($ctx1) { var $1;
  1880. $1=self["@value"];
  1881. return $1;
  1882. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.IRValue)})},
  1883. args: [],
  1884. source: "value\x0a\x09^value",
  1885. messageSends: [],
  1886. referencedClasses: []
  1887. }),
  1888. smalltalk.IRValue);
  1889. smalltalk.addMethod(
  1890. "_value_",
  1891. smalltalk.method({
  1892. selector: "value:",
  1893. category: 'accessing',
  1894. fn: function (aString){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) { self["@value"]=aString;
  1897. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.IRValue)})},
  1898. args: ["aString"],
  1899. source: "value: aString\x0a\x09value := aString",
  1900. messageSends: [],
  1901. referencedClasses: []
  1902. }),
  1903. smalltalk.IRValue);
  1904. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1905. smalltalk.IRVariable.comment="I am a variable instruction."
  1906. smalltalk.addMethod(
  1907. "_accept_",
  1908. smalltalk.method({
  1909. selector: "accept:",
  1910. category: 'visiting',
  1911. fn: function (aVisitor){
  1912. var self=this;
  1913. return smalltalk.withContext(function($ctx1) { var $1;
  1914. $1=_st(aVisitor)._visitIRVariable_(self);
  1915. return $1;
  1916. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVariable)})},
  1917. args: ["aVisitor"],
  1918. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVariable: self",
  1919. messageSends: ["visitIRVariable:"],
  1920. referencedClasses: []
  1921. }),
  1922. smalltalk.IRVariable);
  1923. smalltalk.addMethod(
  1924. "_isVariable",
  1925. smalltalk.method({
  1926. selector: "isVariable",
  1927. category: 'testing',
  1928. fn: function (){
  1929. var self=this;
  1930. return smalltalk.withContext(function($ctx1) { return true;
  1931. }, function($ctx1) {$ctx1.fill(self,"isVariable",{},smalltalk.IRVariable)})},
  1932. args: [],
  1933. source: "isVariable\x0a\x09^ true",
  1934. messageSends: [],
  1935. referencedClasses: []
  1936. }),
  1937. smalltalk.IRVariable);
  1938. smalltalk.addMethod(
  1939. "_variable",
  1940. smalltalk.method({
  1941. selector: "variable",
  1942. category: 'accessing',
  1943. fn: function (){
  1944. var self=this;
  1945. return smalltalk.withContext(function($ctx1) { var $1;
  1946. $1=self["@variable"];
  1947. return $1;
  1948. }, function($ctx1) {$ctx1.fill(self,"variable",{},smalltalk.IRVariable)})},
  1949. args: [],
  1950. source: "variable\x0a\x09^ variable",
  1951. messageSends: [],
  1952. referencedClasses: []
  1953. }),
  1954. smalltalk.IRVariable);
  1955. smalltalk.addMethod(
  1956. "_variable_",
  1957. smalltalk.method({
  1958. selector: "variable:",
  1959. category: 'accessing',
  1960. fn: function (aScopeVariable){
  1961. var self=this;
  1962. return smalltalk.withContext(function($ctx1) { self["@variable"]=aScopeVariable;
  1963. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable},smalltalk.IRVariable)})},
  1964. args: ["aScopeVariable"],
  1965. source: "variable: aScopeVariable\x0a\x09variable := aScopeVariable",
  1966. messageSends: [],
  1967. referencedClasses: []
  1968. }),
  1969. smalltalk.IRVariable);
  1970. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1971. smalltalk.addMethod(
  1972. "_accept_",
  1973. smalltalk.method({
  1974. selector: "accept:",
  1975. category: 'visiting',
  1976. fn: function (aVisitor){
  1977. var self=this;
  1978. return smalltalk.withContext(function($ctx1) { var $1;
  1979. $1=_st(aVisitor)._visitIRVerbatim_(self);
  1980. return $1;
  1981. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVerbatim)})},
  1982. args: ["aVisitor"],
  1983. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRVerbatim: self",
  1984. messageSends: ["visitIRVerbatim:"],
  1985. referencedClasses: []
  1986. }),
  1987. smalltalk.IRVerbatim);
  1988. smalltalk.addMethod(
  1989. "_source",
  1990. smalltalk.method({
  1991. selector: "source",
  1992. category: 'accessing',
  1993. fn: function (){
  1994. var self=this;
  1995. return smalltalk.withContext(function($ctx1) { var $1;
  1996. $1=self["@source"];
  1997. return $1;
  1998. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRVerbatim)})},
  1999. args: [],
  2000. source: "source\x0a\x09^ source",
  2001. messageSends: [],
  2002. referencedClasses: []
  2003. }),
  2004. smalltalk.IRVerbatim);
  2005. smalltalk.addMethod(
  2006. "_source_",
  2007. smalltalk.method({
  2008. selector: "source:",
  2009. category: 'accessing',
  2010. fn: function (aString){
  2011. var self=this;
  2012. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  2013. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRVerbatim)})},
  2014. args: ["aString"],
  2015. source: "source: aString\x0a\x09source := aString",
  2016. messageSends: [],
  2017. referencedClasses: []
  2018. }),
  2019. smalltalk.IRVerbatim);
  2020. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  2021. smalltalk.addMethod(
  2022. "_visit_",
  2023. smalltalk.method({
  2024. selector: "visit:",
  2025. category: 'visiting',
  2026. fn: function (anIRInstruction){
  2027. var self=this;
  2028. return smalltalk.withContext(function($ctx1) { var $1;
  2029. $1=_st(anIRInstruction)._accept_(self);
  2030. return $1;
  2031. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  2032. args: ["anIRInstruction"],
  2033. source: "visit: anIRInstruction\x0a\x09^ anIRInstruction accept: self",
  2034. messageSends: ["accept:"],
  2035. referencedClasses: []
  2036. }),
  2037. smalltalk.IRVisitor);
  2038. smalltalk.addMethod(
  2039. "_visitIRAssignment_",
  2040. smalltalk.method({
  2041. selector: "visitIRAssignment:",
  2042. category: 'visiting',
  2043. fn: function (anIRAssignment){
  2044. var self=this;
  2045. return smalltalk.withContext(function($ctx1) { var $1;
  2046. $1=_st(self)._visitIRInstruction_(anIRAssignment);
  2047. return $1;
  2048. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRVisitor)})},
  2049. args: ["anIRAssignment"],
  2050. source: "visitIRAssignment: anIRAssignment\x0a\x09^ self visitIRInstruction: anIRAssignment",
  2051. messageSends: ["visitIRInstruction:"],
  2052. referencedClasses: []
  2053. }),
  2054. smalltalk.IRVisitor);
  2055. smalltalk.addMethod(
  2056. "_visitIRBlockReturn_",
  2057. smalltalk.method({
  2058. selector: "visitIRBlockReturn:",
  2059. category: 'visiting',
  2060. fn: function (anIRBlockReturn){
  2061. var self=this;
  2062. return smalltalk.withContext(function($ctx1) { var $1;
  2063. $1=_st(self)._visitIRReturn_(anIRBlockReturn);
  2064. return $1;
  2065. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn},smalltalk.IRVisitor)})},
  2066. args: ["anIRBlockReturn"],
  2067. source: "visitIRBlockReturn: anIRBlockReturn\x0a\x09^ self visitIRReturn: anIRBlockReturn",
  2068. messageSends: ["visitIRReturn:"],
  2069. referencedClasses: []
  2070. }),
  2071. smalltalk.IRVisitor);
  2072. smalltalk.addMethod(
  2073. "_visitIRBlockSequence_",
  2074. smalltalk.method({
  2075. selector: "visitIRBlockSequence:",
  2076. category: 'visiting',
  2077. fn: function (anIRBlockSequence){
  2078. var self=this;
  2079. return smalltalk.withContext(function($ctx1) { var $1;
  2080. $1=_st(self)._visitIRSequence_(anIRBlockSequence);
  2081. return $1;
  2082. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence},smalltalk.IRVisitor)})},
  2083. args: ["anIRBlockSequence"],
  2084. source: "visitIRBlockSequence: anIRBlockSequence\x0a\x09^ self visitIRSequence: anIRBlockSequence",
  2085. messageSends: ["visitIRSequence:"],
  2086. referencedClasses: []
  2087. }),
  2088. smalltalk.IRVisitor);
  2089. smalltalk.addMethod(
  2090. "_visitIRClosure_",
  2091. smalltalk.method({
  2092. selector: "visitIRClosure:",
  2093. category: 'visiting',
  2094. fn: function (anIRClosure){
  2095. var self=this;
  2096. return smalltalk.withContext(function($ctx1) { var $1;
  2097. $1=_st(self)._visitIRInstruction_(anIRClosure);
  2098. return $1;
  2099. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRVisitor)})},
  2100. args: ["anIRClosure"],
  2101. source: "visitIRClosure: anIRClosure\x0a\x09^ self visitIRInstruction: anIRClosure",
  2102. messageSends: ["visitIRInstruction:"],
  2103. referencedClasses: []
  2104. }),
  2105. smalltalk.IRVisitor);
  2106. smalltalk.addMethod(
  2107. "_visitIRDynamicArray_",
  2108. smalltalk.method({
  2109. selector: "visitIRDynamicArray:",
  2110. category: 'visiting',
  2111. fn: function (anIRDynamicArray){
  2112. var self=this;
  2113. return smalltalk.withContext(function($ctx1) { var $1;
  2114. $1=_st(self)._visitIRInstruction_(anIRDynamicArray);
  2115. return $1;
  2116. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRVisitor)})},
  2117. args: ["anIRDynamicArray"],
  2118. source: "visitIRDynamicArray: anIRDynamicArray\x0a\x09^ self visitIRInstruction: anIRDynamicArray",
  2119. messageSends: ["visitIRInstruction:"],
  2120. referencedClasses: []
  2121. }),
  2122. smalltalk.IRVisitor);
  2123. smalltalk.addMethod(
  2124. "_visitIRDynamicDictionary_",
  2125. smalltalk.method({
  2126. selector: "visitIRDynamicDictionary:",
  2127. category: 'visiting',
  2128. fn: function (anIRDynamicDictionary){
  2129. var self=this;
  2130. return smalltalk.withContext(function($ctx1) { var $1;
  2131. $1=_st(self)._visitIRInstruction_(anIRDynamicDictionary);
  2132. return $1;
  2133. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRVisitor)})},
  2134. args: ["anIRDynamicDictionary"],
  2135. source: "visitIRDynamicDictionary: anIRDynamicDictionary\x0a\x09^ self visitIRInstruction: anIRDynamicDictionary",
  2136. messageSends: ["visitIRInstruction:"],
  2137. referencedClasses: []
  2138. }),
  2139. smalltalk.IRVisitor);
  2140. smalltalk.addMethod(
  2141. "_visitIRInlinedClosure_",
  2142. smalltalk.method({
  2143. selector: "visitIRInlinedClosure:",
  2144. category: 'visiting',
  2145. fn: function (anIRInlinedClosure){
  2146. var self=this;
  2147. return smalltalk.withContext(function($ctx1) { var $1;
  2148. $1=_st(self)._visitIRClosure_(anIRInlinedClosure);
  2149. return $1;
  2150. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},smalltalk.IRVisitor)})},
  2151. args: ["anIRInlinedClosure"],
  2152. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09^ self visitIRClosure: anIRInlinedClosure",
  2153. messageSends: ["visitIRClosure:"],
  2154. referencedClasses: []
  2155. }),
  2156. smalltalk.IRVisitor);
  2157. smalltalk.addMethod(
  2158. "_visitIRInlinedSequence_",
  2159. smalltalk.method({
  2160. selector: "visitIRInlinedSequence:",
  2161. category: 'visiting',
  2162. fn: function (anIRInlinedSequence){
  2163. var self=this;
  2164. return smalltalk.withContext(function($ctx1) { var $1;
  2165. $1=_st(self)._visitIRSequence_(anIRInlinedSequence);
  2166. return $1;
  2167. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence},smalltalk.IRVisitor)})},
  2168. args: ["anIRInlinedSequence"],
  2169. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09^ self visitIRSequence: anIRInlinedSequence",
  2170. messageSends: ["visitIRSequence:"],
  2171. referencedClasses: []
  2172. }),
  2173. smalltalk.IRVisitor);
  2174. smalltalk.addMethod(
  2175. "_visitIRInstruction_",
  2176. smalltalk.method({
  2177. selector: "visitIRInstruction:",
  2178. category: 'visiting',
  2179. fn: function (anIRInstruction){
  2180. var self=this;
  2181. return smalltalk.withContext(function($ctx1) { var $1;
  2182. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  2183. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2184. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2185. $1=anIRInstruction;
  2186. return $1;
  2187. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  2188. args: ["anIRInstruction"],
  2189. source: "visitIRInstruction: anIRInstruction\x0a\x09anIRInstruction instructions do: [ :each | self visit: each ].\x0a\x09^ anIRInstruction",
  2190. messageSends: ["do:", "visit:", "instructions"],
  2191. referencedClasses: []
  2192. }),
  2193. smalltalk.IRVisitor);
  2194. smalltalk.addMethod(
  2195. "_visitIRMethod_",
  2196. smalltalk.method({
  2197. selector: "visitIRMethod:",
  2198. category: 'visiting',
  2199. fn: function (anIRMethod){
  2200. var self=this;
  2201. return smalltalk.withContext(function($ctx1) { var $1;
  2202. $1=_st(self)._visitIRInstruction_(anIRMethod);
  2203. return $1;
  2204. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRVisitor)})},
  2205. args: ["anIRMethod"],
  2206. source: "visitIRMethod: anIRMethod\x0a\x09^ self visitIRInstruction: anIRMethod",
  2207. messageSends: ["visitIRInstruction:"],
  2208. referencedClasses: []
  2209. }),
  2210. smalltalk.IRVisitor);
  2211. smalltalk.addMethod(
  2212. "_visitIRNonLocalReturn_",
  2213. smalltalk.method({
  2214. selector: "visitIRNonLocalReturn:",
  2215. category: 'visiting',
  2216. fn: function (anIRNonLocalReturn){
  2217. var self=this;
  2218. return smalltalk.withContext(function($ctx1) { var $1;
  2219. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturn);
  2220. return $1;
  2221. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRVisitor)})},
  2222. args: ["anIRNonLocalReturn"],
  2223. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self visitIRInstruction: anIRNonLocalReturn",
  2224. messageSends: ["visitIRInstruction:"],
  2225. referencedClasses: []
  2226. }),
  2227. smalltalk.IRVisitor);
  2228. smalltalk.addMethod(
  2229. "_visitIRNonLocalReturnHandling_",
  2230. smalltalk.method({
  2231. selector: "visitIRNonLocalReturnHandling:",
  2232. category: 'visiting',
  2233. fn: function (anIRNonLocalReturnHandling){
  2234. var self=this;
  2235. return smalltalk.withContext(function($ctx1) { var $1;
  2236. $1=_st(self)._visitIRInstruction_(anIRNonLocalReturnHandling);
  2237. return $1;
  2238. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling},smalltalk.IRVisitor)})},
  2239. args: ["anIRNonLocalReturnHandling"],
  2240. source: "visitIRNonLocalReturnHandling: anIRNonLocalReturnHandling\x0a\x09^ self visitIRInstruction: anIRNonLocalReturnHandling",
  2241. messageSends: ["visitIRInstruction:"],
  2242. referencedClasses: []
  2243. }),
  2244. smalltalk.IRVisitor);
  2245. smalltalk.addMethod(
  2246. "_visitIRReturn_",
  2247. smalltalk.method({
  2248. selector: "visitIRReturn:",
  2249. category: 'visiting',
  2250. fn: function (anIRReturn){
  2251. var self=this;
  2252. return smalltalk.withContext(function($ctx1) { var $1;
  2253. $1=_st(self)._visitIRInstruction_(anIRReturn);
  2254. return $1;
  2255. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRVisitor)})},
  2256. args: ["anIRReturn"],
  2257. source: "visitIRReturn: anIRReturn\x0a\x09^ self visitIRInstruction: anIRReturn",
  2258. messageSends: ["visitIRInstruction:"],
  2259. referencedClasses: []
  2260. }),
  2261. smalltalk.IRVisitor);
  2262. smalltalk.addMethod(
  2263. "_visitIRSend_",
  2264. smalltalk.method({
  2265. selector: "visitIRSend:",
  2266. category: 'visiting',
  2267. fn: function (anIRSend){
  2268. var self=this;
  2269. return smalltalk.withContext(function($ctx1) { var $1;
  2270. $1=_st(self)._visitIRInstruction_(anIRSend);
  2271. return $1;
  2272. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRVisitor)})},
  2273. args: ["anIRSend"],
  2274. source: "visitIRSend: anIRSend\x0a\x09^ self visitIRInstruction: anIRSend",
  2275. messageSends: ["visitIRInstruction:"],
  2276. referencedClasses: []
  2277. }),
  2278. smalltalk.IRVisitor);
  2279. smalltalk.addMethod(
  2280. "_visitIRSequence_",
  2281. smalltalk.method({
  2282. selector: "visitIRSequence:",
  2283. category: 'visiting',
  2284. fn: function (anIRSequence){
  2285. var self=this;
  2286. return smalltalk.withContext(function($ctx1) { var $1;
  2287. $1=_st(self)._visitIRInstruction_(anIRSequence);
  2288. return $1;
  2289. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRVisitor)})},
  2290. args: ["anIRSequence"],
  2291. source: "visitIRSequence: anIRSequence\x0a\x09^ self visitIRInstruction: anIRSequence",
  2292. messageSends: ["visitIRInstruction:"],
  2293. referencedClasses: []
  2294. }),
  2295. smalltalk.IRVisitor);
  2296. smalltalk.addMethod(
  2297. "_visitIRTempDeclaration_",
  2298. smalltalk.method({
  2299. selector: "visitIRTempDeclaration:",
  2300. category: 'visiting',
  2301. fn: function (anIRTempDeclaration){
  2302. var self=this;
  2303. return smalltalk.withContext(function($ctx1) { var $1;
  2304. $1=_st(self)._visitIRInstruction_(anIRTempDeclaration);
  2305. return $1;
  2306. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRVisitor)})},
  2307. args: ["anIRTempDeclaration"],
  2308. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09^ self visitIRInstruction: anIRTempDeclaration",
  2309. messageSends: ["visitIRInstruction:"],
  2310. referencedClasses: []
  2311. }),
  2312. smalltalk.IRVisitor);
  2313. smalltalk.addMethod(
  2314. "_visitIRValue_",
  2315. smalltalk.method({
  2316. selector: "visitIRValue:",
  2317. category: 'visiting',
  2318. fn: function (anIRValue){
  2319. var self=this;
  2320. return smalltalk.withContext(function($ctx1) { var $1;
  2321. $1=_st(self)._visitIRInstruction_(anIRValue);
  2322. return $1;
  2323. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRVisitor)})},
  2324. args: ["anIRValue"],
  2325. source: "visitIRValue: anIRValue\x0a\x09^ self visitIRInstruction: anIRValue",
  2326. messageSends: ["visitIRInstruction:"],
  2327. referencedClasses: []
  2328. }),
  2329. smalltalk.IRVisitor);
  2330. smalltalk.addMethod(
  2331. "_visitIRVariable_",
  2332. smalltalk.method({
  2333. selector: "visitIRVariable:",
  2334. category: 'visiting',
  2335. fn: function (anIRVariable){
  2336. var self=this;
  2337. return smalltalk.withContext(function($ctx1) { var $1;
  2338. $1=_st(self)._visitIRInstruction_(anIRVariable);
  2339. return $1;
  2340. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRVisitor)})},
  2341. args: ["anIRVariable"],
  2342. source: "visitIRVariable: anIRVariable\x0a\x09^ self visitIRInstruction: anIRVariable",
  2343. messageSends: ["visitIRInstruction:"],
  2344. referencedClasses: []
  2345. }),
  2346. smalltalk.IRVisitor);
  2347. smalltalk.addMethod(
  2348. "_visitIRVerbatim_",
  2349. smalltalk.method({
  2350. selector: "visitIRVerbatim:",
  2351. category: 'visiting',
  2352. fn: function (anIRVerbatim){
  2353. var self=this;
  2354. return smalltalk.withContext(function($ctx1) { var $1;
  2355. $1=_st(self)._visitIRInstruction_(anIRVerbatim);
  2356. return $1;
  2357. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRVisitor)})},
  2358. args: ["anIRVerbatim"],
  2359. source: "visitIRVerbatim: anIRVerbatim\x0a\x09^ self visitIRInstruction: anIRVerbatim",
  2360. messageSends: ["visitIRInstruction:"],
  2361. referencedClasses: []
  2362. }),
  2363. smalltalk.IRVisitor);
  2364. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  2365. smalltalk.addMethod(
  2366. "_contents",
  2367. smalltalk.method({
  2368. selector: "contents",
  2369. category: 'accessing',
  2370. fn: function (){
  2371. var self=this;
  2372. return smalltalk.withContext(function($ctx1) { var $1;
  2373. $1=_st(_st(self)._stream())._contents();
  2374. return $1;
  2375. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.IRJSTranslator)})},
  2376. args: [],
  2377. source: "contents\x0a\x09^ self stream contents",
  2378. messageSends: ["contents", "stream"],
  2379. referencedClasses: []
  2380. }),
  2381. smalltalk.IRJSTranslator);
  2382. smalltalk.addMethod(
  2383. "_initialize",
  2384. smalltalk.method({
  2385. selector: "initialize",
  2386. category: 'initialization',
  2387. fn: function (){
  2388. var self=this;
  2389. return smalltalk.withContext(function($ctx1) { smalltalk.IRVisitor.fn.prototype._initialize.apply(_st(self), []);
  2390. self["@stream"]=_st((smalltalk.JSStream || JSStream))._new();
  2391. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.IRJSTranslator)})},
  2392. args: [],
  2393. source: "initialize\x0a\x09super initialize.\x0a\x09stream := JSStream new.",
  2394. messageSends: ["initialize", "new"],
  2395. referencedClasses: ["JSStream"]
  2396. }),
  2397. smalltalk.IRJSTranslator);
  2398. smalltalk.addMethod(
  2399. "_stream",
  2400. smalltalk.method({
  2401. selector: "stream",
  2402. category: 'accessing',
  2403. fn: function (){
  2404. var self=this;
  2405. return smalltalk.withContext(function($ctx1) { var $1;
  2406. $1=self["@stream"];
  2407. return $1;
  2408. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.IRJSTranslator)})},
  2409. args: [],
  2410. source: "stream\x0a\x09^ stream",
  2411. messageSends: [],
  2412. referencedClasses: []
  2413. }),
  2414. smalltalk.IRJSTranslator);
  2415. smalltalk.addMethod(
  2416. "_stream_",
  2417. smalltalk.method({
  2418. selector: "stream:",
  2419. category: 'accessing',
  2420. fn: function (aStream){
  2421. var self=this;
  2422. return smalltalk.withContext(function($ctx1) { self["@stream"]=aStream;
  2423. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.IRJSTranslator)})},
  2424. args: ["aStream"],
  2425. source: "stream: aStream\x0a\x09stream := aStream",
  2426. messageSends: [],
  2427. referencedClasses: []
  2428. }),
  2429. smalltalk.IRJSTranslator);
  2430. smalltalk.addMethod(
  2431. "_visitIRAssignment_",
  2432. smalltalk.method({
  2433. selector: "visitIRAssignment:",
  2434. category: 'visiting',
  2435. fn: function (anIRAssignment){
  2436. var self=this;
  2437. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._first());
  2438. _st(_st(self)._stream())._nextPutAssignment();
  2439. _st(self)._visit_(_st(_st(anIRAssignment)._instructions())._last());
  2440. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRJSTranslator)})},
  2441. args: ["anIRAssignment"],
  2442. source: "visitIRAssignment: anIRAssignment\x0a\x09self visit: anIRAssignment instructions first.\x0a\x09self stream nextPutAssignment.\x0a\x09self visit: anIRAssignment instructions last.",
  2443. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"],
  2444. referencedClasses: []
  2445. }),
  2446. smalltalk.IRJSTranslator);
  2447. smalltalk.addMethod(
  2448. "_visitIRClosure_",
  2449. smalltalk.method({
  2450. selector: "visitIRClosure:",
  2451. category: 'visiting',
  2452. fn: function (anIRClosure){
  2453. var self=this;
  2454. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutClosureWith_arguments_((function(){
  2455. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  2456. return smalltalk.withContext(function($ctx3) { return _st(_st(each)._name())._asVariableName();
  2457. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})})));
  2458. return _st(_st(self)._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  2459. return smalltalk.withContext(function($ctx3) { return smalltalk.IRVisitor.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  2460. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2461. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),_st(anIRClosure)._arguments());
  2462. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRJSTranslator)})},
  2463. args: ["anIRClosure"],
  2464. 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",
  2465. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"],
  2466. referencedClasses: []
  2467. }),
  2468. smalltalk.IRJSTranslator);
  2469. smalltalk.addMethod(
  2470. "_visitIRDynamicArray_",
  2471. smalltalk.method({
  2472. selector: "visitIRDynamicArray:",
  2473. category: 'visiting',
  2474. fn: function (anIRDynamicArray){
  2475. var self=this;
  2476. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("[");
  2477. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  2478. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2479. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2480. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2481. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2482. _st(self["@stream"])._nextPutAll_("]");
  2483. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRJSTranslator)})},
  2484. args: ["anIRDynamicArray"],
  2485. 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: ']'",
  2486. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2487. referencedClasses: []
  2488. }),
  2489. smalltalk.IRJSTranslator);
  2490. smalltalk.addMethod(
  2491. "_visitIRDynamicDictionary_",
  2492. smalltalk.method({
  2493. selector: "visitIRDynamicDictionary:",
  2494. category: 'visiting',
  2495. fn: function (anIRDynamicDictionary){
  2496. var self=this;
  2497. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_("smalltalk.HashedCollection._fromPairs_([");
  2498. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  2499. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2500. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2501. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2502. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2503. _st(_st(self)._stream())._nextPutAll_("])");
  2504. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRJSTranslator)})},
  2505. args: ["anIRDynamicDictionary"],
  2506. 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: '])'",
  2507. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"],
  2508. referencedClasses: []
  2509. }),
  2510. smalltalk.IRJSTranslator);
  2511. smalltalk.addMethod(
  2512. "_visitIRMethod_",
  2513. smalltalk.method({
  2514. selector: "visitIRMethod:",
  2515. category: 'visiting',
  2516. fn: function (anIRMethod){
  2517. var self=this;
  2518. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2519. _st(_st(self)._stream())._nextPutMethodDeclaration_with_(anIRMethod,(function(){
  2520. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutFunctionWith_arguments_((function(){
  2521. return smalltalk.withContext(function($ctx3) { _st(_st(self)._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  2522. return smalltalk.withContext(function($ctx4) { return _st(_st(each)._name())._asVariableName();
  2523. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})));
  2524. return _st(_st(self)._stream())._nextPutContextFor_during_(anIRMethod,(function(){
  2525. return smalltalk.withContext(function($ctx4) { $1=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  2526. if(smalltalk.assert($1)){
  2527. _st(_st(self)._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  2528. return smalltalk.withContext(function($ctx5) { return _st(_st(each)._variable())._alias();
  2529. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx1)})})));
  2530. };
  2531. $2=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  2532. if(smalltalk.assert($2)){
  2533. return _st(_st(self)._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  2534. return smalltalk.withContext(function($ctx5) { return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2535. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  2536. } else {
  2537. return smalltalk.IRVisitor.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  2538. };
  2539. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2540. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),_st(anIRMethod)._arguments());
  2541. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2542. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRJSTranslator)})},
  2543. args: ["anIRMethod"],
  2544. 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 ]",
  2545. 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"],
  2546. referencedClasses: []
  2547. }),
  2548. smalltalk.IRJSTranslator);
  2549. smalltalk.addMethod(
  2550. "_visitIRNonLocalReturn_",
  2551. smalltalk.method({
  2552. selector: "visitIRNonLocalReturn:",
  2553. category: 'visiting',
  2554. fn: function (anIRNonLocalReturn){
  2555. var self=this;
  2556. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  2557. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  2558. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2559. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRJSTranslator)})},
  2560. args: ["anIRNonLocalReturn"],
  2561. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09self stream nextPutNonLocalReturnWith: [\x0a\x09\x09super visitIRNonLocalReturn: anIRNonLocalReturn ]",
  2562. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"],
  2563. referencedClasses: []
  2564. }),
  2565. smalltalk.IRJSTranslator);
  2566. smalltalk.addMethod(
  2567. "_visitIRReturn_",
  2568. smalltalk.method({
  2569. selector: "visitIRReturn:",
  2570. category: 'visiting',
  2571. fn: function (anIRReturn){
  2572. var self=this;
  2573. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutReturnWith_((function(){
  2574. return smalltalk.withContext(function($ctx2) { return smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  2575. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2576. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRJSTranslator)})},
  2577. args: ["anIRReturn"],
  2578. source: "visitIRReturn: anIRReturn\x0a\x09self stream nextPutReturnWith: [\x0a\x09\x09super visitIRReturn: anIRReturn ]",
  2579. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"],
  2580. referencedClasses: []
  2581. }),
  2582. smalltalk.IRJSTranslator);
  2583. smalltalk.addMethod(
  2584. "_visitIRSend_",
  2585. smalltalk.method({
  2586. selector: "visitIRSend:",
  2587. category: 'visiting',
  2588. fn: function (anIRSend){
  2589. var self=this;
  2590. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  2591. $1=_st(anIRSend)._classSend();
  2592. if(($receiver = $1) == nil || $receiver == undefined){
  2593. _st(_st(self)._stream())._nextPutAll_("_st(");
  2594. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2595. _st(_st(self)._stream())._nextPutAll_(_st(_st(").").__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  2596. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2597. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2598. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2599. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2600. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2601. _st(_st(self)._stream())._nextPutAll_(")");
  2602. } else {
  2603. $2=_st(self)._stream();
  2604. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._classSend())._asJavascript()).__comma(".fn.prototype."));
  2605. _st($2)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  2606. $3=_st($2)._nextPutAll_("_st(");
  2607. $3;
  2608. _st(self)._visit_(_st(_st(anIRSend)._instructions())._first());
  2609. _st(_st(self)._stream())._nextPutAll_("), [");
  2610. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2611. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  2612. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2613. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(",");
  2614. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2615. _st(_st(self)._stream())._nextPutAll_("])");
  2616. };
  2617. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2618. args: ["anIRSend"],
  2619. 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: '])' ]",
  2620. messageSends: ["ifNil:ifNotNil:", "nextPutAll:", "stream", "visit:", "first", "instructions", ",", "asSelector", "selector", "do:separatedBy:", "allButFirst", "asJavascript", "classSend"],
  2621. referencedClasses: []
  2622. }),
  2623. smalltalk.IRJSTranslator);
  2624. smalltalk.addMethod(
  2625. "_visitIRSequence_",
  2626. smalltalk.method({
  2627. selector: "visitIRSequence:",
  2628. category: 'visiting',
  2629. fn: function (anIRSequence){
  2630. var self=this;
  2631. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutSequenceWith_((function(){
  2632. return smalltalk.withContext(function($ctx2) { return _st(_st(anIRSequence)._instructions())._do_((function(each){
  2633. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._stream())._nextPutStatementWith_(_st(self)._visit_(each));
  2634. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  2635. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2636. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRJSTranslator)})},
  2637. args: ["anIRSequence"],
  2638. source: "visitIRSequence: anIRSequence\x0a\x09self stream nextPutSequenceWith: [\x0a\x09\x09anIRSequence instructions do: [ :each |\x0a\x09\x09\x09self stream nextPutStatementWith: (self visit: each) ]]",
  2639. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
  2640. referencedClasses: []
  2641. }),
  2642. smalltalk.IRJSTranslator);
  2643. smalltalk.addMethod(
  2644. "_visitIRTempDeclaration_",
  2645. smalltalk.method({
  2646. selector: "visitIRTempDeclaration:",
  2647. category: 'visiting',
  2648. fn: function (anIRTempDeclaration){
  2649. var self=this;
  2650. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRJSTranslator)})},
  2651. args: ["anIRTempDeclaration"],
  2652. source: "visitIRTempDeclaration: anIRTempDeclaration\x0a\x09\x22self stream\x0a\x09\x09nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';';\x0a\x09\x09lf\x22",
  2653. messageSends: [],
  2654. referencedClasses: []
  2655. }),
  2656. smalltalk.IRJSTranslator);
  2657. smalltalk.addMethod(
  2658. "_visitIRValue_",
  2659. smalltalk.method({
  2660. selector: "visitIRValue:",
  2661. category: 'visiting',
  2662. fn: function (anIRValue){
  2663. var self=this;
  2664. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2665. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRJSTranslator)})},
  2666. args: ["anIRValue"],
  2667. source: "visitIRValue: anIRValue\x0a\x09self stream nextPutAll: anIRValue value asJavascript",
  2668. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"],
  2669. referencedClasses: []
  2670. }),
  2671. smalltalk.IRJSTranslator);
  2672. smalltalk.addMethod(
  2673. "_visitIRVariable_",
  2674. smalltalk.method({
  2675. selector: "visitIRVariable:",
  2676. category: 'visiting',
  2677. fn: function (anIRVariable){
  2678. var self=this;
  2679. return smalltalk.withContext(function($ctx1) { var $1;
  2680. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2681. if(smalltalk.assert($1)){
  2682. _st(_st(self)._stream())._nextPutAll_("smalltalk.getThisContext()");
  2683. } else {
  2684. _st(_st(self)._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2685. };
  2686. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRJSTranslator)})},
  2687. args: ["anIRVariable"],
  2688. 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 ]",
  2689. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"],
  2690. referencedClasses: []
  2691. }),
  2692. smalltalk.IRJSTranslator);
  2693. smalltalk.addMethod(
  2694. "_visitIRVerbatim_",
  2695. smalltalk.method({
  2696. selector: "visitIRVerbatim:",
  2697. category: 'visiting',
  2698. fn: function (anIRVerbatim){
  2699. var self=this;
  2700. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  2701. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2702. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2703. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRJSTranslator)})},
  2704. args: ["anIRVerbatim"],
  2705. source: "visitIRVerbatim: anIRVerbatim\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self stream nextPutAll: anIRVerbatim source ]",
  2706. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"],
  2707. referencedClasses: []
  2708. }),
  2709. smalltalk.IRJSTranslator);
  2710. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2711. smalltalk.addMethod(
  2712. "_contents",
  2713. smalltalk.method({
  2714. selector: "contents",
  2715. category: 'accessing',
  2716. fn: function (){
  2717. var self=this;
  2718. return smalltalk.withContext(function($ctx1) { var $1;
  2719. $1=_st(self["@stream"])._contents();
  2720. return $1;
  2721. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.JSStream)})},
  2722. args: [],
  2723. source: "contents\x0a\x09^ stream contents",
  2724. messageSends: ["contents"],
  2725. referencedClasses: []
  2726. }),
  2727. smalltalk.JSStream);
  2728. smalltalk.addMethod(
  2729. "_initialize",
  2730. smalltalk.method({
  2731. selector: "initialize",
  2732. category: 'initialization',
  2733. fn: function (){
  2734. var self=this;
  2735. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  2736. self["@stream"]=_st("")._writeStream();
  2737. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.JSStream)})},
  2738. args: [],
  2739. source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.",
  2740. messageSends: ["initialize", "writeStream"],
  2741. referencedClasses: []
  2742. }),
  2743. smalltalk.JSStream);
  2744. smalltalk.addMethod(
  2745. "_lf",
  2746. smalltalk.method({
  2747. selector: "lf",
  2748. category: 'streaming',
  2749. fn: function (){
  2750. var self=this;
  2751. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._lf();
  2752. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.JSStream)})},
  2753. args: [],
  2754. source: "lf\x0a\x09stream lf",
  2755. messageSends: ["lf"],
  2756. referencedClasses: []
  2757. }),
  2758. smalltalk.JSStream);
  2759. smalltalk.addMethod(
  2760. "_nextPut_",
  2761. smalltalk.method({
  2762. selector: "nextPut:",
  2763. category: 'streaming',
  2764. fn: function (aString){
  2765. var self=this;
  2766. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPut_(aString);
  2767. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.JSStream)})},
  2768. args: ["aString"],
  2769. source: "nextPut: aString\x0a\x09stream nextPut: aString",
  2770. messageSends: ["nextPut:"],
  2771. referencedClasses: []
  2772. }),
  2773. smalltalk.JSStream);
  2774. smalltalk.addMethod(
  2775. "_nextPutAll_",
  2776. smalltalk.method({
  2777. selector: "nextPutAll:",
  2778. category: 'streaming',
  2779. fn: function (aString){
  2780. var self=this;
  2781. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_(aString);
  2782. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString},smalltalk.JSStream)})},
  2783. args: ["aString"],
  2784. source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString",
  2785. messageSends: ["nextPutAll:"],
  2786. referencedClasses: []
  2787. }),
  2788. smalltalk.JSStream);
  2789. smalltalk.addMethod(
  2790. "_nextPutAssignment",
  2791. smalltalk.method({
  2792. selector: "nextPutAssignment",
  2793. category: 'streaming',
  2794. fn: function (){
  2795. var self=this;
  2796. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("=");
  2797. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{},smalltalk.JSStream)})},
  2798. args: [],
  2799. source: "nextPutAssignment\x0a\x09stream nextPutAll: '='",
  2800. messageSends: ["nextPutAll:"],
  2801. referencedClasses: []
  2802. }),
  2803. smalltalk.JSStream);
  2804. smalltalk.addMethod(
  2805. "_nextPutBlockContextFor_during_",
  2806. smalltalk.method({
  2807. selector: "nextPutBlockContextFor:during:",
  2808. category: 'streaming',
  2809. fn: function (anIRClosure,aBlock){
  2810. var self=this;
  2811. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2812. $1=self;
  2813. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2814. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2815. _st(aBlock)._value();
  2816. $3=self;
  2817. _st($3)._nextPutAll_(_st(_st("}, function(").__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2818. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  2819. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  2820. return smalltalk.withContext(function($ctx2) { $5=self;
  2821. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2822. _st($5)._nextPutAll_(":");
  2823. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2824. return $6;
  2825. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2826. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2827. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2828. $7=self;
  2829. _st($7)._nextPutAll_("},");
  2830. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._method())._scope())._alias()).__comma(")})"));
  2831. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock},smalltalk.JSStream)})},
  2832. args: ["anIRClosure", "aBlock"],
  2833. 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, ')})'",
  2834. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "do:separatedBy:", "asVariableName", "locals", "method"],
  2835. referencedClasses: ["String"]
  2836. }),
  2837. smalltalk.JSStream);
  2838. smalltalk.addMethod(
  2839. "_nextPutClosureWith_arguments_",
  2840. smalltalk.method({
  2841. selector: "nextPutClosureWith:arguments:",
  2842. category: 'streaming',
  2843. fn: function (aBlock,anArray){
  2844. var self=this;
  2845. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2846. _st(self["@stream"])._nextPutAll_("(function(");
  2847. _st(anArray)._do_separatedBy_((function(each){
  2848. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2849. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2850. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2851. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2852. $1=self["@stream"];
  2853. _st($1)._nextPutAll_("){");
  2854. $2=_st($1)._lf();
  2855. _st(aBlock)._value();
  2856. _st(self["@stream"])._nextPutAll_("})");
  2857. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2858. args: ["aBlock", "anArray"],
  2859. 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: '})'",
  2860. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  2861. referencedClasses: []
  2862. }),
  2863. smalltalk.JSStream);
  2864. smalltalk.addMethod(
  2865. "_nextPutContextFor_during_",
  2866. smalltalk.method({
  2867. selector: "nextPutContextFor:during:",
  2868. category: 'streaming',
  2869. fn: function (aMethod,aBlock){
  2870. var self=this;
  2871. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7,$8;
  2872. $1=self;
  2873. _st($1)._nextPutAll_(_st(_st("return smalltalk.withContext(function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  2874. $2=_st($1)._nextPutAll_(_st((smalltalk.String || String))._cr());
  2875. _st(aBlock)._value();
  2876. $3=self;
  2877. _st($3)._nextPutAll_(_st(_st(_st("}, function(").__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  2878. $4=_st($3)._nextPutAll_(_st(_st(".fill(self,").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  2879. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  2880. return smalltalk.withContext(function($ctx2) { $5=self;
  2881. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2882. _st($5)._nextPutAll_(":");
  2883. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2884. return $6;
  2885. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2886. return smalltalk.withContext(function($ctx2) { return _st(self)._nextPutAll_(",");
  2887. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2888. $7=self;
  2889. _st($7)._nextPutAll_("},");
  2890. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  2891. $8=_st($7)._nextPutAll_(")})");
  2892. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  2893. args: ["aMethod", "aBlock"],
  2894. 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: ')})'",
  2895. messageSends: ["nextPutAll:", ",", "alias", "scope", "cr", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "locals", "theClass"],
  2896. referencedClasses: ["String"]
  2897. }),
  2898. smalltalk.JSStream);
  2899. smalltalk.addMethod(
  2900. "_nextPutFunctionWith_arguments_",
  2901. smalltalk.method({
  2902. selector: "nextPutFunctionWith:arguments:",
  2903. category: 'streaming',
  2904. fn: function (aBlock,anArray){
  2905. var self=this;
  2906. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  2907. _st(self["@stream"])._nextPutAll_("fn: function(");
  2908. _st(anArray)._do_separatedBy_((function(each){
  2909. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2910. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2911. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPut_(",");
  2912. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2913. $1=self["@stream"];
  2914. _st($1)._nextPutAll_("){");
  2915. $2=_st($1)._lf();
  2916. $3=self["@stream"];
  2917. _st($3)._nextPutAll_("var self=this;");
  2918. $4=_st($3)._lf();
  2919. _st(aBlock)._value();
  2920. _st(self["@stream"])._nextPutAll_("}");
  2921. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2922. args: ["aBlock", "anArray"],
  2923. 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: '}'",
  2924. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"],
  2925. referencedClasses: []
  2926. }),
  2927. smalltalk.JSStream);
  2928. smalltalk.addMethod(
  2929. "_nextPutIf_with_",
  2930. smalltalk.method({
  2931. selector: "nextPutIf:with:",
  2932. category: 'streaming',
  2933. fn: function (aBlock,anotherBlock){
  2934. var self=this;
  2935. return smalltalk.withContext(function($ctx1) { var $1,$2;
  2936. _st(self["@stream"])._nextPutAll_("if(");
  2937. _st(aBlock)._value();
  2938. $1=self["@stream"];
  2939. _st($1)._nextPutAll_("){");
  2940. $2=_st($1)._lf();
  2941. _st(anotherBlock)._value();
  2942. _st(self["@stream"])._nextPutAll_("}");
  2943. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSStream)})},
  2944. args: ["aBlock", "anotherBlock"],
  2945. source: "nextPutIf: aBlock with: anotherBlock\x0a\x09stream nextPutAll: 'if('.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09anotherBlock value.\x0a\x09stream nextPutAll: '}'",
  2946. messageSends: ["nextPutAll:", "value", "lf"],
  2947. referencedClasses: []
  2948. }),
  2949. smalltalk.JSStream);
  2950. smalltalk.addMethod(
  2951. "_nextPutIfElse_with_with_",
  2952. smalltalk.method({
  2953. selector: "nextPutIfElse:with:with:",
  2954. category: 'streaming',
  2955. fn: function (aBlock,ifBlock,elseBlock){
  2956. var self=this;
  2957. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  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(ifBlock)._value();
  2964. $3=self["@stream"];
  2965. _st($3)._nextPutAll_("} else {");
  2966. $4=_st($3)._lf();
  2967. _st(elseBlock)._value();
  2968. _st(self["@stream"])._nextPutAll_("}");
  2969. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},smalltalk.JSStream)})},
  2970. args: ["aBlock", "ifBlock", "elseBlock"],
  2971. 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: '}'",
  2972. messageSends: ["nextPutAll:", "value", "lf"],
  2973. referencedClasses: []
  2974. }),
  2975. smalltalk.JSStream);
  2976. smalltalk.addMethod(
  2977. "_nextPutMethodDeclaration_with_",
  2978. smalltalk.method({
  2979. selector: "nextPutMethodDeclaration:with:",
  2980. category: 'streaming',
  2981. fn: function (aMethod,aBlock){
  2982. var self=this;
  2983. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6;
  2984. $1=self["@stream"];
  2985. _st($1)._nextPutAll_("smalltalk.method({");
  2986. _st($1)._lf();
  2987. _st($1)._nextPutAll_(_st(_st("selector: \x22").__comma(_st(aMethod)._selector())).__comma("\x22,"));
  2988. _st($1)._lf();
  2989. _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  2990. $2=_st($1)._lf();
  2991. _st(aBlock)._value();
  2992. $3=self["@stream"];
  2993. _st($3)._nextPutAll_(_st(_st(",").__comma(_st((smalltalk.String || String))._lf())).__comma("messageSends: "));
  2994. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  2995. _st($3)._lf();
  2996. _st($3)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  2997. return smalltalk.withContext(function($ctx2) { return _st(each)._value();
  2998. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asArray())._asJavascript())).__comma(","));
  2999. _st($3)._lf();
  3000. $4=_st($3)._nextPutAll_("referencedClasses: [");
  3001. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  3002. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  3003. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3004. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3005. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3006. $5=self["@stream"];
  3007. _st($5)._nextPutAll_("]");
  3008. $6=_st($5)._nextPutAll_("})");
  3009. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  3010. args: ["aMethod", "aBlock"],
  3011. 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: '})'",
  3012. messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"],
  3013. referencedClasses: ["String"]
  3014. }),
  3015. smalltalk.JSStream);
  3016. smalltalk.addMethod(
  3017. "_nextPutNonLocalReturnHandlingWith_",
  3018. smalltalk.method({
  3019. selector: "nextPutNonLocalReturnHandlingWith:",
  3020. category: 'streaming',
  3021. fn: function (aBlock){
  3022. var self=this;
  3023. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3024. $1=self["@stream"];
  3025. _st($1)._nextPutAll_("var $early={};");
  3026. _st($1)._lf();
  3027. _st($1)._nextPutAll_("try {");
  3028. $2=_st($1)._lf();
  3029. _st(aBlock)._value();
  3030. $3=self["@stream"];
  3031. _st($3)._nextPutAll_("}");
  3032. _st($3)._lf();
  3033. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  3034. $4=_st($3)._lf();
  3035. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3036. args: ["aBlock"],
  3037. 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",
  3038. messageSends: ["nextPutAll:", "lf", "value"],
  3039. referencedClasses: []
  3040. }),
  3041. smalltalk.JSStream);
  3042. smalltalk.addMethod(
  3043. "_nextPutNonLocalReturnWith_",
  3044. smalltalk.method({
  3045. selector: "nextPutNonLocalReturnWith:",
  3046. category: 'streaming',
  3047. fn: function (aBlock){
  3048. var self=this;
  3049. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("throw $early=[");
  3050. _st(aBlock)._value();
  3051. _st(self["@stream"])._nextPutAll_("]");
  3052. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3053. args: ["aBlock"],
  3054. source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: 'throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']'",
  3055. messageSends: ["nextPutAll:", "value"],
  3056. referencedClasses: []
  3057. }),
  3058. smalltalk.JSStream);
  3059. smalltalk.addMethod(
  3060. "_nextPutReturn",
  3061. smalltalk.method({
  3062. selector: "nextPutReturn",
  3063. category: 'streaming',
  3064. fn: function (){
  3065. var self=this;
  3066. return smalltalk.withContext(function($ctx1) { _st(self["@stream"])._nextPutAll_("return ");
  3067. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{},smalltalk.JSStream)})},
  3068. args: [],
  3069. source: "nextPutReturn\x0a\x09stream nextPutAll: 'return '",
  3070. messageSends: ["nextPutAll:"],
  3071. referencedClasses: []
  3072. }),
  3073. smalltalk.JSStream);
  3074. smalltalk.addMethod(
  3075. "_nextPutReturnWith_",
  3076. smalltalk.method({
  3077. selector: "nextPutReturnWith:",
  3078. category: 'streaming',
  3079. fn: function (aBlock){
  3080. var self=this;
  3081. return smalltalk.withContext(function($ctx1) { _st(self)._nextPutReturn();
  3082. _st(aBlock)._value();
  3083. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3084. args: ["aBlock"],
  3085. source: "nextPutReturnWith: aBlock\x0a\x09self nextPutReturn.\x0a\x09aBlock value",
  3086. messageSends: ["nextPutReturn", "value"],
  3087. referencedClasses: []
  3088. }),
  3089. smalltalk.JSStream);
  3090. smalltalk.addMethod(
  3091. "_nextPutSequenceWith_",
  3092. smalltalk.method({
  3093. selector: "nextPutSequenceWith:",
  3094. category: 'streaming',
  3095. fn: function (aBlock){
  3096. var self=this;
  3097. return smalltalk.withContext(function($ctx1) { _st(aBlock)._value();
  3098. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3099. args: ["aBlock"],
  3100. 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",
  3101. messageSends: ["value"],
  3102. referencedClasses: []
  3103. }),
  3104. smalltalk.JSStream);
  3105. smalltalk.addMethod(
  3106. "_nextPutStatement_with_",
  3107. smalltalk.method({
  3108. selector: "nextPutStatement:with:",
  3109. category: 'streaming',
  3110. fn: function (anInteger,aBlock){
  3111. var self=this;
  3112. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  3113. $1=self["@stream"];
  3114. _st($1)._nextPutAll_(_st(_st("case ").__comma(_st(anInteger)._asString())).__comma(":"));
  3115. $2=_st($1)._lf();
  3116. _st(self)._nextPutStatementWith_(aBlock);
  3117. $3=self["@stream"];
  3118. _st($3)._nextPutAll_(_st(_st("smalltalk.thisContext.pc=").__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  3119. $4=_st($3)._lf();
  3120. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:",{anInteger:anInteger,aBlock:aBlock},smalltalk.JSStream)})},
  3121. args: ["anInteger", "aBlock"],
  3122. 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",
  3123. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"],
  3124. referencedClasses: []
  3125. }),
  3126. smalltalk.JSStream);
  3127. smalltalk.addMethod(
  3128. "_nextPutStatementWith_",
  3129. smalltalk.method({
  3130. selector: "nextPutStatementWith:",
  3131. category: 'streaming',
  3132. fn: function (aBlock){
  3133. var self=this;
  3134. return smalltalk.withContext(function($ctx1) { var $1,$2;
  3135. _st(aBlock)._value();
  3136. $1=self["@stream"];
  3137. _st($1)._nextPutAll_(";");
  3138. $2=_st($1)._lf();
  3139. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  3140. args: ["aBlock"],
  3141. source: "nextPutStatementWith: aBlock\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ';'; lf",
  3142. messageSends: ["value", "nextPutAll:", "lf"],
  3143. referencedClasses: []
  3144. }),
  3145. smalltalk.JSStream);
  3146. smalltalk.addMethod(
  3147. "_nextPutVars_",
  3148. smalltalk.method({
  3149. selector: "nextPutVars:",
  3150. category: 'streaming',
  3151. fn: function (aCollection){
  3152. var self=this;
  3153. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  3154. var $early={};
  3155. try {
  3156. _st(aCollection)._ifEmpty_((function(){
  3157. return smalltalk.withContext(function($ctx2) { $1=self;
  3158. throw $early=[$1];
  3159. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3160. _st(self["@stream"])._nextPutAll_("var ");
  3161. _st(aCollection)._do_separatedBy_((function(each){
  3162. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(each);
  3163. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  3164. return smalltalk.withContext(function($ctx2) { return _st(self["@stream"])._nextPutAll_(",");
  3165. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3166. $2=self["@stream"];
  3167. _st($2)._nextPutAll_(";");
  3168. $3=_st($2)._lf();
  3169. return self}
  3170. catch(e) {if(e===$early)return e[0]; throw e}
  3171. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection},smalltalk.JSStream)})},
  3172. args: ["aCollection"],
  3173. 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",
  3174. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"],
  3175. referencedClasses: []
  3176. }),
  3177. smalltalk.JSStream);
  3178. smalltalk.addMethod(
  3179. "_appendToInstruction_",
  3180. smalltalk.method({
  3181. selector: "appendToInstruction:",
  3182. category: '*Compiler-IR',
  3183. fn: function (anIRInstruction){
  3184. var self=this;
  3185. return smalltalk.withContext(function($ctx1) { _st(anIRInstruction)._appendBlock_(self);
  3186. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction},smalltalk.BlockClosure)})},
  3187. args: ["anIRInstruction"],
  3188. source: "appendToInstruction: anIRInstruction\x0a\x09anIRInstruction appendBlock: self",
  3189. messageSends: ["appendBlock:"],
  3190. referencedClasses: []
  3191. }),
  3192. smalltalk.BlockClosure);
  3193. smalltalk.addMethod(
  3194. "_asVariableName",
  3195. smalltalk.method({
  3196. selector: "asVariableName",
  3197. category: '*Compiler-IR',
  3198. fn: function (){
  3199. var self=this;
  3200. return smalltalk.withContext(function($ctx1) { var $2,$1;
  3201. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(self);
  3202. if(smalltalk.assert($2)){
  3203. $1=_st(self).__comma("_");
  3204. } else {
  3205. $1=self;
  3206. };
  3207. return $1;
  3208. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{},smalltalk.String)})},
  3209. args: [],
  3210. source: "asVariableName\x0a\x09^ (Smalltalk current reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
  3211. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  3212. referencedClasses: ["Smalltalk"]
  3213. }),
  3214. smalltalk.String);