Compiler-IR.js 110 KB

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