Compiler-IR.js 113 KB

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