1
0

Compiler-IR.js 111 KB

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