Compiler-IR.js 113 KB

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