Compiler-IR.js 124 KB

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