Compiler-IR.deploy.js 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779
  1. smalltalk.addPackage('Compiler-IR');
  2. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "alias:",
  6. fn: function (aNode){
  7. var self=this;
  8. var variable;
  9. function $AliasVar(){return smalltalk.AliasVar||(typeof AliasVar=="undefined"?nil:AliasVar)}
  10. function $IRVariable(){return smalltalk.IRVariable||(typeof IRVariable=="undefined"?nil:IRVariable)}
  11. function $IRAssignment(){return smalltalk.IRAssignment||(typeof IRAssignment=="undefined"?nil:IRAssignment)}
  12. return smalltalk.withContext(function($ctx1) {
  13. var $1,$2,$3,$4,$5,$6,$7;
  14. $1=_st(aNode)._isImmutable();
  15. if(smalltalk.assert($1)){
  16. $2=self._visit_(aNode);
  17. return $2;
  18. };
  19. $3=_st($IRVariable())._new();
  20. _st($3)._variable_(_st(_st($AliasVar())._new())._name_("$".__comma(self._nextAlias())));
  21. $4=_st($3)._yourself();
  22. variable=$4;
  23. $5=_st($IRAssignment())._new();
  24. _st($5)._add_(variable);
  25. _st($5)._add_(self._visit_(aNode));
  26. $6=_st($5)._yourself();
  27. _st(self._sequence())._add_($6);
  28. _st(_st(self._method())._internalVariables())._add_(variable);
  29. $7=variable;
  30. return $7;
  31. }, function($ctx1) {$ctx1.fill(self,"alias:",{aNode:aNode,variable:variable},smalltalk.IRASTTranslator)})},
  32. messageSends: ["ifTrue:", "visit:", "isImmutable", "variable:", "name:", ",", "nextAlias", "new", "yourself", "add:", "sequence", "internalVariables", "method"]}),
  33. smalltalk.IRASTTranslator);
  34. smalltalk.addMethod(
  35. smalltalk.method({
  36. selector: "aliasTemporally:",
  37. fn: function (aCollection){
  38. var self=this;
  39. var threshold,result;
  40. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  41. return smalltalk.withContext(function($ctx1) {
  42. var $1,$2,$4,$3,$5;
  43. threshold=(0);
  44. _st(aCollection)._withIndexDo_((function(each,i){
  45. return smalltalk.withContext(function($ctx2) {
  46. $1=_st(each)._subtreeNeedsAliasing();
  47. if(smalltalk.assert($1)){
  48. threshold=i;
  49. return threshold;
  50. };
  51. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  52. result=_st($OrderedCollection())._new();
  53. _st(aCollection)._withIndexDo_((function(each,i){
  54. return smalltalk.withContext(function($ctx2) {
  55. $2=result;
  56. $4=_st(i).__lt_eq(threshold);
  57. if(smalltalk.assert($4)){
  58. $3=self._alias_(each);
  59. } else {
  60. $3=self._visit_(each);
  61. };
  62. return _st($2)._add_($3);
  63. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1)})}));
  64. $5=result;
  65. return $5;
  66. }, function($ctx1) {$ctx1.fill(self,"aliasTemporally:",{aCollection:aCollection,threshold:threshold,result:result},smalltalk.IRASTTranslator)})},
  67. messageSends: ["withIndexDo:", "ifTrue:", "subtreeNeedsAliasing", "new", "add:", "ifTrue:ifFalse:", "alias:", "visit:", "<="]}),
  68. smalltalk.IRASTTranslator);
  69. smalltalk.addMethod(
  70. smalltalk.method({
  71. selector: "method",
  72. fn: function (){
  73. var self=this;
  74. return smalltalk.withContext(function($ctx1) {
  75. var $1;
  76. $1=self["@method"];
  77. return $1;
  78. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRASTTranslator)})},
  79. messageSends: []}),
  80. smalltalk.IRASTTranslator);
  81. smalltalk.addMethod(
  82. smalltalk.method({
  83. selector: "method:",
  84. fn: function (anIRMethod){
  85. var self=this;
  86. return smalltalk.withContext(function($ctx1) {
  87. self["@method"]=anIRMethod;
  88. return self}, function($ctx1) {$ctx1.fill(self,"method:",{anIRMethod:anIRMethod},smalltalk.IRASTTranslator)})},
  89. messageSends: []}),
  90. smalltalk.IRASTTranslator);
  91. smalltalk.addMethod(
  92. smalltalk.method({
  93. selector: "nextAlias",
  94. fn: function (){
  95. var self=this;
  96. return smalltalk.withContext(function($ctx1) {
  97. var $1,$2;
  98. $1=self["@nextAlias"];
  99. if(($receiver = $1) == nil || $receiver == undefined){
  100. self["@nextAlias"]=(0);
  101. self["@nextAlias"];
  102. } else {
  103. $1;
  104. };
  105. self["@nextAlias"]=_st(self["@nextAlias"]).__plus((1));
  106. $2=_st(self["@nextAlias"])._asString();
  107. return $2;
  108. }, function($ctx1) {$ctx1.fill(self,"nextAlias",{},smalltalk.IRASTTranslator)})},
  109. messageSends: ["ifNil:", "+", "asString"]}),
  110. smalltalk.IRASTTranslator);
  111. smalltalk.addMethod(
  112. smalltalk.method({
  113. selector: "sequence",
  114. fn: function (){
  115. var self=this;
  116. return smalltalk.withContext(function($ctx1) {
  117. var $1;
  118. $1=self["@sequence"];
  119. return $1;
  120. }, function($ctx1) {$ctx1.fill(self,"sequence",{},smalltalk.IRASTTranslator)})},
  121. messageSends: []}),
  122. smalltalk.IRASTTranslator);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "sequence:",
  126. fn: function (anIRSequence){
  127. var self=this;
  128. return smalltalk.withContext(function($ctx1) {
  129. self["@sequence"]=anIRSequence;
  130. return self}, function($ctx1) {$ctx1.fill(self,"sequence:",{anIRSequence:anIRSequence},smalltalk.IRASTTranslator)})},
  131. messageSends: []}),
  132. smalltalk.IRASTTranslator);
  133. smalltalk.addMethod(
  134. smalltalk.method({
  135. selector: "source",
  136. fn: function (){
  137. var self=this;
  138. return smalltalk.withContext(function($ctx1) {
  139. var $1;
  140. $1=self["@source"];
  141. return $1;
  142. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRASTTranslator)})},
  143. messageSends: []}),
  144. smalltalk.IRASTTranslator);
  145. smalltalk.addMethod(
  146. smalltalk.method({
  147. selector: "source:",
  148. fn: function (aString){
  149. var self=this;
  150. return smalltalk.withContext(function($ctx1) {
  151. self["@source"]=aString;
  152. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRASTTranslator)})},
  153. messageSends: []}),
  154. smalltalk.IRASTTranslator);
  155. smalltalk.addMethod(
  156. smalltalk.method({
  157. selector: "theClass",
  158. fn: function (){
  159. var self=this;
  160. return smalltalk.withContext(function($ctx1) {
  161. var $1;
  162. $1=self["@theClass"];
  163. return $1;
  164. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.IRASTTranslator)})},
  165. messageSends: []}),
  166. smalltalk.IRASTTranslator);
  167. smalltalk.addMethod(
  168. smalltalk.method({
  169. selector: "theClass:",
  170. fn: function (aClass){
  171. var self=this;
  172. return smalltalk.withContext(function($ctx1) {
  173. self["@theClass"]=aClass;
  174. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.IRASTTranslator)})},
  175. messageSends: []}),
  176. smalltalk.IRASTTranslator);
  177. smalltalk.addMethod(
  178. smalltalk.method({
  179. selector: "visitAssignmentNode:",
  180. fn: function (aNode){
  181. var self=this;
  182. var left,right,assignment;
  183. function $IRAssignment(){return smalltalk.IRAssignment||(typeof IRAssignment=="undefined"?nil:IRAssignment)}
  184. return smalltalk.withContext(function($ctx1) {
  185. var $1,$2,$3;
  186. right=self._visit_(_st(aNode)._right());
  187. left=self._visit_(_st(aNode)._left());
  188. $1=_st($IRAssignment())._new();
  189. _st($1)._add_(left);
  190. _st($1)._add_(right);
  191. $2=_st($1)._yourself();
  192. _st(self._sequence())._add_($2);
  193. $3=left;
  194. return $3;
  195. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,left:left,right:right,assignment:assignment},smalltalk.IRASTTranslator)})},
  196. messageSends: ["visit:", "right", "left", "add:", "new", "yourself", "sequence"]}),
  197. smalltalk.IRASTTranslator);
  198. smalltalk.addMethod(
  199. smalltalk.method({
  200. selector: "visitBlockNode:",
  201. fn: function (aNode){
  202. var self=this;
  203. var closure;
  204. function $IRClosure(){return smalltalk.IRClosure||(typeof IRClosure=="undefined"?nil:IRClosure)}
  205. function $IRTempDeclaration(){return smalltalk.IRTempDeclaration||(typeof IRTempDeclaration=="undefined"?nil:IRTempDeclaration)}
  206. return smalltalk.withContext(function($ctx1) {
  207. var $1,$2,$3,$4,$5;
  208. $1=_st($IRClosure())._new();
  209. _st($1)._arguments_(_st(aNode)._parameters());
  210. _st($1)._scope_(_st(aNode)._scope());
  211. $2=_st($1)._yourself();
  212. closure=$2;
  213. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  214. return smalltalk.withContext(function($ctx2) {
  215. $3=_st($IRTempDeclaration())._new();
  216. _st($3)._name_(_st(each)._name());
  217. _st($3)._scope_(_st(aNode)._scope());
  218. $4=_st($3)._yourself();
  219. return _st(closure)._add_($4);
  220. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  221. _st(_st(aNode)._nodes())._do_((function(each){
  222. return smalltalk.withContext(function($ctx2) {
  223. return _st(closure)._add_(self._visit_(each));
  224. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  225. $5=closure;
  226. return $5;
  227. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,closure:closure},smalltalk.IRASTTranslator)})},
  228. messageSends: ["arguments:", "parameters", "new", "scope:", "scope", "yourself", "do:", "add:", "name:", "name", "temps", "visit:", "nodes"]}),
  229. smalltalk.IRASTTranslator);
  230. smalltalk.addMethod(
  231. smalltalk.method({
  232. selector: "visitBlockSequenceNode:",
  233. fn: function (aNode){
  234. var self=this;
  235. function $IRBlockSequence(){return smalltalk.IRBlockSequence||(typeof IRBlockSequence=="undefined"?nil:IRBlockSequence)}
  236. function $IRBlockReturn(){return smalltalk.IRBlockReturn||(typeof IRBlockReturn=="undefined"?nil:IRBlockReturn)}
  237. return smalltalk.withContext(function($ctx1) {
  238. var $2,$3,$4,$1;
  239. $1=self._withSequence_do_(_st($IRBlockSequence())._new(),(function(){
  240. return smalltalk.withContext(function($ctx2) {
  241. return _st(_st(aNode)._nodes())._ifNotEmpty_((function(){
  242. return smalltalk.withContext(function($ctx3) {
  243. _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  244. return smalltalk.withContext(function($ctx4) {
  245. return _st(self._sequence())._add_(self._visit_(each));
  246. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
  247. $2=_st(_st(_st(aNode)._nodes())._last())._isReturnNode();
  248. if(smalltalk.assert($2)){
  249. return _st(self._sequence())._add_(self._visit_(_st(_st(aNode)._nodes())._last()));
  250. } else {
  251. $3=_st($IRBlockReturn())._new();
  252. _st($3)._add_(self._visit_(_st(_st(aNode)._nodes())._last()));
  253. $4=_st($3)._yourself();
  254. return _st(self._sequence())._add_($4);
  255. };
  256. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  257. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  258. return $1;
  259. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  260. messageSends: ["withSequence:do:", "new", "ifNotEmpty:", "do:", "add:", "visit:", "sequence", "allButLast", "nodes", "ifFalse:ifTrue:", "last", "yourself", "isReturnNode"]}),
  261. smalltalk.IRASTTranslator);
  262. smalltalk.addMethod(
  263. smalltalk.method({
  264. selector: "visitCascadeNode:",
  265. fn: function (aNode){
  266. var self=this;
  267. var alias;
  268. function $VariableNode(){return smalltalk.VariableNode||(typeof VariableNode=="undefined"?nil:VariableNode)}
  269. return smalltalk.withContext(function($ctx1) {
  270. var $1,$2;
  271. $1=_st(_st(aNode)._receiver())._isImmutable();
  272. if(! smalltalk.assert($1)){
  273. alias=self._alias_(_st(aNode)._receiver());
  274. alias;
  275. _st(_st(aNode)._nodes())._do_((function(each){
  276. return smalltalk.withContext(function($ctx2) {
  277. return _st(each)._receiver_(_st(_st($VariableNode())._new())._binding_(_st(alias)._variable()));
  278. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  279. };
  280. _st(_st(_st(aNode)._nodes())._allButLast())._do_((function(each){
  281. return smalltalk.withContext(function($ctx2) {
  282. return _st(self._sequence())._add_(self._visit_(each));
  283. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  284. $2=self._alias_(_st(_st(aNode)._nodes())._last());
  285. return $2;
  286. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode,alias:alias},smalltalk.IRASTTranslator)})},
  287. messageSends: ["ifFalse:", "alias:", "receiver", "do:", "receiver:", "binding:", "variable", "new", "nodes", "isImmutable", "add:", "visit:", "sequence", "allButLast", "last"]}),
  288. smalltalk.IRASTTranslator);
  289. smalltalk.addMethod(
  290. smalltalk.method({
  291. selector: "visitDynamicArrayNode:",
  292. fn: function (aNode){
  293. var self=this;
  294. var array;
  295. function $IRDynamicArray(){return smalltalk.IRDynamicArray||(typeof IRDynamicArray=="undefined"?nil:IRDynamicArray)}
  296. return smalltalk.withContext(function($ctx1) {
  297. var $1;
  298. array=_st($IRDynamicArray())._new();
  299. _st(self._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  300. return smalltalk.withContext(function($ctx2) {
  301. return _st(array)._add_(each);
  302. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  303. $1=array;
  304. return $1;
  305. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.IRASTTranslator)})},
  306. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"]}),
  307. smalltalk.IRASTTranslator);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "visitDynamicDictionaryNode:",
  311. fn: function (aNode){
  312. var self=this;
  313. var dictionary;
  314. function $IRDynamicDictionary(){return smalltalk.IRDynamicDictionary||(typeof IRDynamicDictionary=="undefined"?nil:IRDynamicDictionary)}
  315. return smalltalk.withContext(function($ctx1) {
  316. var $1;
  317. dictionary=_st($IRDynamicDictionary())._new();
  318. _st(self._aliasTemporally_(_st(aNode)._nodes()))._do_((function(each){
  319. return smalltalk.withContext(function($ctx2) {
  320. return _st(dictionary)._add_(each);
  321. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  322. $1=dictionary;
  323. return $1;
  324. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,dictionary:dictionary},smalltalk.IRASTTranslator)})},
  325. messageSends: ["new", "do:", "add:", "aliasTemporally:", "nodes"]}),
  326. smalltalk.IRASTTranslator);
  327. smalltalk.addMethod(
  328. smalltalk.method({
  329. selector: "visitJSStatementNode:",
  330. fn: function (aNode){
  331. var self=this;
  332. function $IRVerbatim(){return smalltalk.IRVerbatim||(typeof IRVerbatim=="undefined"?nil:IRVerbatim)}
  333. return smalltalk.withContext(function($ctx1) {
  334. var $2,$3,$1;
  335. $2=_st($IRVerbatim())._new();
  336. _st($2)._source_(_st(_st(aNode)._source())._crlfSanitized());
  337. $3=_st($2)._yourself();
  338. $1=$3;
  339. return $1;
  340. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  341. messageSends: ["source:", "crlfSanitized", "source", "new", "yourself"]}),
  342. smalltalk.IRASTTranslator);
  343. smalltalk.addMethod(
  344. smalltalk.method({
  345. selector: "visitMethodNode:",
  346. fn: function (aNode){
  347. var self=this;
  348. function $IRMethod(){return smalltalk.IRMethod||(typeof IRMethod=="undefined"?nil:IRMethod)}
  349. function $IRTempDeclaration(){return smalltalk.IRTempDeclaration||(typeof IRTempDeclaration=="undefined"?nil:IRTempDeclaration)}
  350. function $IRVariable(){return smalltalk.IRVariable||(typeof IRVariable=="undefined"?nil:IRVariable)}
  351. function $IRReturn(){return smalltalk.IRReturn||(typeof IRReturn=="undefined"?nil:IRReturn)}
  352. return smalltalk.withContext(function($ctx1) {
  353. var $1,$2,$3,$4,$5,$6,$7,$8;
  354. $1=_st($IRMethod())._new();
  355. _st($1)._source_(_st(self._source())._crlfSanitized());
  356. _st($1)._theClass_(self._theClass());
  357. _st($1)._arguments_(_st(aNode)._arguments());
  358. _st($1)._selector_(_st(aNode)._selector());
  359. _st($1)._messageSends_(_st(aNode)._messageSends());
  360. _st($1)._superSends_(_st(aNode)._superSends());
  361. _st($1)._classReferences_(_st(aNode)._classReferences());
  362. _st($1)._scope_(_st(aNode)._scope());
  363. $2=_st($1)._yourself();
  364. self._method_($2);
  365. _st(_st(_st(aNode)._scope())._temps())._do_((function(each){
  366. return smalltalk.withContext(function($ctx2) {
  367. $3=_st($IRTempDeclaration())._new();
  368. _st($3)._name_(_st(each)._name());
  369. _st($3)._scope_(_st(aNode)._scope());
  370. $4=_st($3)._yourself();
  371. return _st(self._method())._add_($4);
  372. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  373. _st(_st(aNode)._nodes())._do_((function(each){
  374. return smalltalk.withContext(function($ctx2) {
  375. return _st(self._method())._add_(self._visit_(each));
  376. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  377. $5=_st(_st(aNode)._scope())._hasLocalReturn();
  378. if(! smalltalk.assert($5)){
  379. $6=_st($IRVariable())._new();
  380. _st($6)._variable_(_st(_st(_st(aNode)._scope())._pseudoVars())._at_("self"));
  381. $7=_st($6)._yourself();
  382. _st(_st(self._method())._add_(_st($IRReturn())._new()))._add_($7);
  383. };
  384. $8=self._method();
  385. return $8;
  386. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  387. messageSends: ["method:", "source:", "crlfSanitized", "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"]}),
  388. smalltalk.IRASTTranslator);
  389. smalltalk.addMethod(
  390. smalltalk.method({
  391. selector: "visitReturnNode:",
  392. fn: function (aNode){
  393. var self=this;
  394. var return_;
  395. function $IRNonLocalReturn(){return smalltalk.IRNonLocalReturn||(typeof IRNonLocalReturn=="undefined"?nil:IRNonLocalReturn)}
  396. function $IRReturn(){return smalltalk.IRReturn||(typeof IRReturn=="undefined"?nil:IRReturn)}
  397. return smalltalk.withContext(function($ctx1) {
  398. var $1,$2;
  399. $1=_st(aNode)._nonLocalReturn();
  400. if(smalltalk.assert($1)){
  401. return_=_st($IRNonLocalReturn())._new();
  402. } else {
  403. return_=_st($IRReturn())._new();
  404. };
  405. _st(return_)._scope_(_st(aNode)._scope());
  406. _st(_st(aNode)._nodes())._do_((function(each){
  407. return smalltalk.withContext(function($ctx2) {
  408. return _st(return_)._add_(self._alias_(each));
  409. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  410. $2=return_;
  411. return $2;
  412. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode,return_:return_},smalltalk.IRASTTranslator)})},
  413. messageSends: ["ifTrue:ifFalse:", "new", "nonLocalReturn", "scope:", "scope", "do:", "add:", "alias:", "nodes"]}),
  414. smalltalk.IRASTTranslator);
  415. smalltalk.addMethod(
  416. smalltalk.method({
  417. selector: "visitSendNode:",
  418. fn: function (aNode){
  419. var self=this;
  420. var send,all,receiver,arguments;
  421. function $IRSend(){return smalltalk.IRSend||(typeof IRSend=="undefined"?nil:IRSend)}
  422. return smalltalk.withContext(function($ctx1) {
  423. var $1,$2,$3,$4;
  424. send=_st($IRSend())._new();
  425. $1=send;
  426. _st($1)._selector_(_st(aNode)._selector());
  427. $2=_st($1)._index_(_st(aNode)._index());
  428. $3=_st(aNode)._superSend();
  429. if(smalltalk.assert($3)){
  430. _st(send)._classSend_(_st(self._theClass())._superclass());
  431. };
  432. all=self._aliasTemporally_(_st([_st(aNode)._receiver()]).__comma(_st(aNode)._arguments()));
  433. receiver=_st(all)._first();
  434. arguments=_st(all)._allButFirst();
  435. _st(send)._add_(receiver);
  436. _st(arguments)._do_((function(each){
  437. return smalltalk.withContext(function($ctx2) {
  438. return _st(send)._add_(each);
  439. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  440. $4=send;
  441. return $4;
  442. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,send:send,all:all,receiver:receiver,arguments:arguments},smalltalk.IRASTTranslator)})},
  443. messageSends: ["new", "selector:", "selector", "index:", "index", "ifTrue:", "classSend:", "superclass", "theClass", "superSend", "aliasTemporally:", ",", "arguments", "receiver", "first", "allButFirst", "add:", "do:"]}),
  444. smalltalk.IRASTTranslator);
  445. smalltalk.addMethod(
  446. smalltalk.method({
  447. selector: "visitSequenceNode:",
  448. fn: function (aNode){
  449. var self=this;
  450. function $IRSequence(){return smalltalk.IRSequence||(typeof IRSequence=="undefined"?nil:IRSequence)}
  451. return smalltalk.withContext(function($ctx1) {
  452. var $2,$1;
  453. $1=self._withSequence_do_(_st($IRSequence())._new(),(function(){
  454. return smalltalk.withContext(function($ctx2) {
  455. return _st(_st(aNode)._nodes())._do_((function(each){
  456. var instruction;
  457. return smalltalk.withContext(function($ctx3) {
  458. instruction=self._visit_(each);
  459. instruction;
  460. $2=_st(instruction)._isVariable();
  461. if(! smalltalk.assert($2)){
  462. return _st(self._sequence())._add_(instruction);
  463. };
  464. }, function($ctx3) {$ctx3.fillBlock({each:each,instruction:instruction},$ctx2)})}));
  465. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  466. return $1;
  467. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  468. messageSends: ["withSequence:do:", "new", "do:", "visit:", "ifFalse:", "add:", "sequence", "isVariable", "nodes"]}),
  469. smalltalk.IRASTTranslator);
  470. smalltalk.addMethod(
  471. smalltalk.method({
  472. selector: "visitValueNode:",
  473. fn: function (aNode){
  474. var self=this;
  475. function $IRValue(){return smalltalk.IRValue||(typeof IRValue=="undefined"?nil:IRValue)}
  476. return smalltalk.withContext(function($ctx1) {
  477. var $2,$3,$1;
  478. $2=_st($IRValue())._new();
  479. _st($2)._value_(_st(aNode)._value());
  480. $3=_st($2)._yourself();
  481. $1=$3;
  482. return $1;
  483. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  484. messageSends: ["value:", "value", "new", "yourself"]}),
  485. smalltalk.IRASTTranslator);
  486. smalltalk.addMethod(
  487. smalltalk.method({
  488. selector: "visitVariableNode:",
  489. fn: function (aNode){
  490. var self=this;
  491. function $IRVariable(){return smalltalk.IRVariable||(typeof IRVariable=="undefined"?nil:IRVariable)}
  492. return smalltalk.withContext(function($ctx1) {
  493. var $2,$3,$1;
  494. $2=_st($IRVariable())._new();
  495. _st($2)._variable_(_st(aNode)._binding());
  496. $3=_st($2)._yourself();
  497. $1=$3;
  498. return $1;
  499. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.IRASTTranslator)})},
  500. messageSends: ["variable:", "binding", "new", "yourself"]}),
  501. smalltalk.IRASTTranslator);
  502. smalltalk.addMethod(
  503. smalltalk.method({
  504. selector: "withSequence:do:",
  505. fn: function (aSequence,aBlock){
  506. var self=this;
  507. var outerSequence;
  508. return smalltalk.withContext(function($ctx1) {
  509. var $1;
  510. outerSequence=self._sequence();
  511. self._sequence_(aSequence);
  512. _st(aBlock)._value();
  513. self._sequence_(outerSequence);
  514. $1=aSequence;
  515. return $1;
  516. }, function($ctx1) {$ctx1.fill(self,"withSequence:do:",{aSequence:aSequence,aBlock:aBlock,outerSequence:outerSequence},smalltalk.IRASTTranslator)})},
  517. messageSends: ["sequence", "sequence:", "value"]}),
  518. smalltalk.IRASTTranslator);
  519. smalltalk.addClass('IRInstruction', smalltalk.Object, ['parent', 'instructions'], 'Compiler-IR');
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "accept:",
  523. fn: function (aVisitor){
  524. var self=this;
  525. return smalltalk.withContext(function($ctx1) {
  526. var $1;
  527. $1=_st(aVisitor)._visitIRInstruction_(self);
  528. return $1;
  529. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRInstruction)})},
  530. messageSends: ["visitIRInstruction:"]}),
  531. smalltalk.IRInstruction);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "add:",
  535. fn: function (anObject){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) {
  538. var $1;
  539. _st(anObject)._parent_(self);
  540. $1=_st(self._instructions())._add_(anObject);
  541. return $1;
  542. }, function($ctx1) {$ctx1.fill(self,"add:",{anObject:anObject},smalltalk.IRInstruction)})},
  543. messageSends: ["parent:", "add:", "instructions"]}),
  544. smalltalk.IRInstruction);
  545. smalltalk.addMethod(
  546. smalltalk.method({
  547. selector: "canBeAssigned",
  548. fn: function (){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. return true;
  552. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{},smalltalk.IRInstruction)})},
  553. messageSends: []}),
  554. smalltalk.IRInstruction);
  555. smalltalk.addMethod(
  556. smalltalk.method({
  557. selector: "instructions",
  558. fn: function (){
  559. var self=this;
  560. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  561. return smalltalk.withContext(function($ctx1) {
  562. var $2,$1;
  563. $2=self["@instructions"];
  564. if(($receiver = $2) == nil || $receiver == undefined){
  565. self["@instructions"]=_st($OrderedCollection())._new();
  566. $1=self["@instructions"];
  567. } else {
  568. $1=$2;
  569. };
  570. return $1;
  571. }, function($ctx1) {$ctx1.fill(self,"instructions",{},smalltalk.IRInstruction)})},
  572. messageSends: ["ifNil:", "new"]}),
  573. smalltalk.IRInstruction);
  574. smalltalk.addMethod(
  575. smalltalk.method({
  576. selector: "isClosure",
  577. fn: function (){
  578. var self=this;
  579. return smalltalk.withContext(function($ctx1) {
  580. return false;
  581. }, function($ctx1) {$ctx1.fill(self,"isClosure",{},smalltalk.IRInstruction)})},
  582. messageSends: []}),
  583. smalltalk.IRInstruction);
  584. smalltalk.addMethod(
  585. smalltalk.method({
  586. selector: "isInlined",
  587. fn: function (){
  588. var self=this;
  589. return smalltalk.withContext(function($ctx1) {
  590. return false;
  591. }, function($ctx1) {$ctx1.fill(self,"isInlined",{},smalltalk.IRInstruction)})},
  592. messageSends: []}),
  593. smalltalk.IRInstruction);
  594. smalltalk.addMethod(
  595. smalltalk.method({
  596. selector: "isLocalReturn",
  597. fn: function (){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) {
  600. return false;
  601. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRInstruction)})},
  602. messageSends: []}),
  603. smalltalk.IRInstruction);
  604. smalltalk.addMethod(
  605. smalltalk.method({
  606. selector: "isMethod",
  607. fn: function (){
  608. var self=this;
  609. return smalltalk.withContext(function($ctx1) {
  610. return false;
  611. }, function($ctx1) {$ctx1.fill(self,"isMethod",{},smalltalk.IRInstruction)})},
  612. messageSends: []}),
  613. smalltalk.IRInstruction);
  614. smalltalk.addMethod(
  615. smalltalk.method({
  616. selector: "isReturn",
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) {
  620. return false;
  621. }, function($ctx1) {$ctx1.fill(self,"isReturn",{},smalltalk.IRInstruction)})},
  622. messageSends: []}),
  623. smalltalk.IRInstruction);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "isSend",
  627. fn: function (){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx1) {
  630. return false;
  631. }, function($ctx1) {$ctx1.fill(self,"isSend",{},smalltalk.IRInstruction)})},
  632. messageSends: []}),
  633. smalltalk.IRInstruction);
  634. smalltalk.addMethod(
  635. smalltalk.method({
  636. selector: "isSequence",
  637. fn: function (){
  638. var self=this;
  639. return smalltalk.withContext(function($ctx1) {
  640. return false;
  641. }, function($ctx1) {$ctx1.fill(self,"isSequence",{},smalltalk.IRInstruction)})},
  642. messageSends: []}),
  643. smalltalk.IRInstruction);
  644. smalltalk.addMethod(
  645. smalltalk.method({
  646. selector: "isTempDeclaration",
  647. fn: function (){
  648. var self=this;
  649. return smalltalk.withContext(function($ctx1) {
  650. return false;
  651. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{},smalltalk.IRInstruction)})},
  652. messageSends: []}),
  653. smalltalk.IRInstruction);
  654. smalltalk.addMethod(
  655. smalltalk.method({
  656. selector: "isVariable",
  657. fn: function (){
  658. var self=this;
  659. return smalltalk.withContext(function($ctx1) {
  660. return false;
  661. }, function($ctx1) {$ctx1.fill(self,"isVariable",{},smalltalk.IRInstruction)})},
  662. messageSends: []}),
  663. smalltalk.IRInstruction);
  664. smalltalk.addMethod(
  665. smalltalk.method({
  666. selector: "method",
  667. fn: function (){
  668. var self=this;
  669. return smalltalk.withContext(function($ctx1) {
  670. var $1;
  671. $1=_st(self._parent())._method();
  672. return $1;
  673. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRInstruction)})},
  674. messageSends: ["method", "parent"]}),
  675. smalltalk.IRInstruction);
  676. smalltalk.addMethod(
  677. smalltalk.method({
  678. selector: "needsBoxingAsReceiver",
  679. fn: function (){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) {
  682. return true;
  683. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRInstruction)})},
  684. messageSends: []}),
  685. smalltalk.IRInstruction);
  686. smalltalk.addMethod(
  687. smalltalk.method({
  688. selector: "parent",
  689. fn: function (){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx1) {
  692. var $1;
  693. $1=self["@parent"];
  694. return $1;
  695. }, function($ctx1) {$ctx1.fill(self,"parent",{},smalltalk.IRInstruction)})},
  696. messageSends: []}),
  697. smalltalk.IRInstruction);
  698. smalltalk.addMethod(
  699. smalltalk.method({
  700. selector: "parent:",
  701. fn: function (anIRInstruction){
  702. var self=this;
  703. return smalltalk.withContext(function($ctx1) {
  704. self["@parent"]=anIRInstruction;
  705. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  706. messageSends: []}),
  707. smalltalk.IRInstruction);
  708. smalltalk.addMethod(
  709. smalltalk.method({
  710. selector: "remove",
  711. fn: function (){
  712. var self=this;
  713. return smalltalk.withContext(function($ctx1) {
  714. _st(self._parent())._remove_(self);
  715. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.IRInstruction)})},
  716. messageSends: ["remove:", "parent"]}),
  717. smalltalk.IRInstruction);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "remove:",
  721. fn: function (anIRInstruction){
  722. var self=this;
  723. return smalltalk.withContext(function($ctx1) {
  724. _st(self._instructions())._remove_(anIRInstruction);
  725. return self}, function($ctx1) {$ctx1.fill(self,"remove:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  726. messageSends: ["remove:", "instructions"]}),
  727. smalltalk.IRInstruction);
  728. smalltalk.addMethod(
  729. smalltalk.method({
  730. selector: "replace:with:",
  731. fn: function (anIRInstruction,anotherIRInstruction){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx1) {
  734. _st(anotherIRInstruction)._parent_(self);
  735. _st(self._instructions())._at_put_(_st(self._instructions())._indexOf_(anIRInstruction),anotherIRInstruction);
  736. return self}, function($ctx1) {$ctx1.fill(self,"replace:with:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction},smalltalk.IRInstruction)})},
  737. messageSends: ["parent:", "at:put:", "indexOf:", "instructions"]}),
  738. smalltalk.IRInstruction);
  739. smalltalk.addMethod(
  740. smalltalk.method({
  741. selector: "replaceWith:",
  742. fn: function (anIRInstruction){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. _st(self._parent())._replace_with_(self,anIRInstruction);
  746. return self}, function($ctx1) {$ctx1.fill(self,"replaceWith:",{anIRInstruction:anIRInstruction},smalltalk.IRInstruction)})},
  747. messageSends: ["replace:with:", "parent"]}),
  748. smalltalk.IRInstruction);
  749. smalltalk.addMethod(
  750. smalltalk.method({
  751. selector: "on:",
  752. fn: function (aBuilder){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. var $2,$3,$1;
  756. $2=self._new();
  757. _st($2)._builder_(aBuilder);
  758. $3=_st($2)._yourself();
  759. $1=$3;
  760. return $1;
  761. }, function($ctx1) {$ctx1.fill(self,"on:",{aBuilder:aBuilder},smalltalk.IRInstruction.klass)})},
  762. messageSends: ["builder:", "new", "yourself"]}),
  763. smalltalk.IRInstruction.klass);
  764. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, [], 'Compiler-IR');
  765. smalltalk.addMethod(
  766. smalltalk.method({
  767. selector: "accept:",
  768. fn: function (aVisitor){
  769. var self=this;
  770. return smalltalk.withContext(function($ctx1) {
  771. var $1;
  772. $1=_st(aVisitor)._visitIRAssignment_(self);
  773. return $1;
  774. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRAssignment)})},
  775. messageSends: ["visitIRAssignment:"]}),
  776. smalltalk.IRAssignment);
  777. smalltalk.addClass('IRDynamicArray', smalltalk.IRInstruction, [], 'Compiler-IR');
  778. smalltalk.addMethod(
  779. smalltalk.method({
  780. selector: "accept:",
  781. fn: function (aVisitor){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) {
  784. var $1;
  785. $1=_st(aVisitor)._visitIRDynamicArray_(self);
  786. return $1;
  787. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicArray)})},
  788. messageSends: ["visitIRDynamicArray:"]}),
  789. smalltalk.IRDynamicArray);
  790. smalltalk.addClass('IRDynamicDictionary', smalltalk.IRInstruction, [], 'Compiler-IR');
  791. smalltalk.addMethod(
  792. smalltalk.method({
  793. selector: "accept:",
  794. fn: function (aVisitor){
  795. var self=this;
  796. return smalltalk.withContext(function($ctx1) {
  797. var $1;
  798. $1=_st(aVisitor)._visitIRDynamicDictionary_(self);
  799. return $1;
  800. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRDynamicDictionary)})},
  801. messageSends: ["visitIRDynamicDictionary:"]}),
  802. smalltalk.IRDynamicDictionary);
  803. smalltalk.addClass('IRScopedInstruction', smalltalk.IRInstruction, ['scope'], 'Compiler-IR');
  804. smalltalk.addMethod(
  805. smalltalk.method({
  806. selector: "scope",
  807. fn: function (){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) {
  810. var $1;
  811. $1=self["@scope"];
  812. return $1;
  813. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.IRScopedInstruction)})},
  814. messageSends: []}),
  815. smalltalk.IRScopedInstruction);
  816. smalltalk.addMethod(
  817. smalltalk.method({
  818. selector: "scope:",
  819. fn: function (aScope){
  820. var self=this;
  821. return smalltalk.withContext(function($ctx1) {
  822. self["@scope"]=aScope;
  823. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRScopedInstruction)})},
  824. messageSends: []}),
  825. smalltalk.IRScopedInstruction);
  826. smalltalk.addClass('IRClosureInstruction', smalltalk.IRScopedInstruction, ['arguments'], 'Compiler-IR');
  827. smalltalk.addMethod(
  828. smalltalk.method({
  829. selector: "arguments",
  830. fn: function (){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) {
  833. var $2,$1;
  834. $2=self["@arguments"];
  835. if(($receiver = $2) == nil || $receiver == undefined){
  836. $1=[];
  837. } else {
  838. $1=$2;
  839. };
  840. return $1;
  841. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.IRClosureInstruction)})},
  842. messageSends: ["ifNil:"]}),
  843. smalltalk.IRClosureInstruction);
  844. smalltalk.addMethod(
  845. smalltalk.method({
  846. selector: "arguments:",
  847. fn: function (aCollection){
  848. var self=this;
  849. return smalltalk.withContext(function($ctx1) {
  850. self["@arguments"]=aCollection;
  851. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.IRClosureInstruction)})},
  852. messageSends: []}),
  853. smalltalk.IRClosureInstruction);
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "locals",
  857. fn: function (){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) {
  860. var $2,$3,$1;
  861. $2=_st(self._arguments())._copy();
  862. _st($2)._addAll_(_st(self._tempDeclarations())._collect_((function(each){
  863. return smalltalk.withContext(function($ctx2) {
  864. return _st(each)._name();
  865. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  866. $3=_st($2)._yourself();
  867. $1=$3;
  868. return $1;
  869. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.IRClosureInstruction)})},
  870. messageSends: ["addAll:", "collect:", "name", "tempDeclarations", "copy", "arguments", "yourself"]}),
  871. smalltalk.IRClosureInstruction);
  872. smalltalk.addMethod(
  873. smalltalk.method({
  874. selector: "scope:",
  875. fn: function (aScope){
  876. var self=this;
  877. return smalltalk.withContext(function($ctx1) {
  878. smalltalk.IRClosureInstruction.superclass.fn.prototype._scope_.apply(_st(self), [aScope]);
  879. _st(aScope)._instruction_(self);
  880. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope},smalltalk.IRClosureInstruction)})},
  881. messageSends: ["scope:", "instruction:"]}),
  882. smalltalk.IRClosureInstruction);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "tempDeclarations",
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) {
  889. var $1;
  890. $1=_st(self._instructions())._select_((function(each){
  891. return smalltalk.withContext(function($ctx2) {
  892. return _st(each)._isTempDeclaration();
  893. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  894. return $1;
  895. }, function($ctx1) {$ctx1.fill(self,"tempDeclarations",{},smalltalk.IRClosureInstruction)})},
  896. messageSends: ["select:", "isTempDeclaration", "instructions"]}),
  897. smalltalk.IRClosureInstruction);
  898. smalltalk.addClass('IRClosure', smalltalk.IRClosureInstruction, [], 'Compiler-IR');
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "accept:",
  902. fn: function (aVisitor){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) {
  905. var $1;
  906. $1=_st(aVisitor)._visitIRClosure_(self);
  907. return $1;
  908. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRClosure)})},
  909. messageSends: ["visitIRClosure:"]}),
  910. smalltalk.IRClosure);
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "isClosure",
  914. fn: function (){
  915. var self=this;
  916. return smalltalk.withContext(function($ctx1) {
  917. return true;
  918. }, function($ctx1) {$ctx1.fill(self,"isClosure",{},smalltalk.IRClosure)})},
  919. messageSends: []}),
  920. smalltalk.IRClosure);
  921. smalltalk.addMethod(
  922. smalltalk.method({
  923. selector: "sequence",
  924. fn: function (){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) {
  927. var $1;
  928. $1=_st(self._instructions())._last();
  929. return $1;
  930. }, function($ctx1) {$ctx1.fill(self,"sequence",{},smalltalk.IRClosure)})},
  931. messageSends: ["last", "instructions"]}),
  932. smalltalk.IRClosure);
  933. smalltalk.addClass('IRMethod', smalltalk.IRClosureInstruction, ['theClass', 'source', 'selector', 'classReferences', 'messageSends', 'superSends', 'internalVariables'], 'Compiler-IR');
  934. smalltalk.addMethod(
  935. smalltalk.method({
  936. selector: "accept:",
  937. fn: function (aVisitor){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) {
  940. var $1;
  941. $1=_st(aVisitor)._visitIRMethod_(self);
  942. return $1;
  943. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRMethod)})},
  944. messageSends: ["visitIRMethod:"]}),
  945. smalltalk.IRMethod);
  946. smalltalk.addMethod(
  947. smalltalk.method({
  948. selector: "classReferences",
  949. fn: function (){
  950. var self=this;
  951. return smalltalk.withContext(function($ctx1) {
  952. var $1;
  953. $1=self["@classReferences"];
  954. return $1;
  955. }, function($ctx1) {$ctx1.fill(self,"classReferences",{},smalltalk.IRMethod)})},
  956. messageSends: []}),
  957. smalltalk.IRMethod);
  958. smalltalk.addMethod(
  959. smalltalk.method({
  960. selector: "classReferences:",
  961. fn: function (aCollection){
  962. var self=this;
  963. return smalltalk.withContext(function($ctx1) {
  964. self["@classReferences"]=aCollection;
  965. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection},smalltalk.IRMethod)})},
  966. messageSends: []}),
  967. smalltalk.IRMethod);
  968. smalltalk.addMethod(
  969. smalltalk.method({
  970. selector: "internalVariables",
  971. fn: function (){
  972. var self=this;
  973. function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
  974. return smalltalk.withContext(function($ctx1) {
  975. var $2,$1;
  976. $2=self["@internalVariables"];
  977. if(($receiver = $2) == nil || $receiver == undefined){
  978. self["@internalVariables"]=_st($Set())._new();
  979. $1=self["@internalVariables"];
  980. } else {
  981. $1=$2;
  982. };
  983. return $1;
  984. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{},smalltalk.IRMethod)})},
  985. messageSends: ["ifNil:", "new"]}),
  986. smalltalk.IRMethod);
  987. smalltalk.addMethod(
  988. smalltalk.method({
  989. selector: "isMethod",
  990. fn: function (){
  991. var self=this;
  992. return smalltalk.withContext(function($ctx1) {
  993. return true;
  994. }, function($ctx1) {$ctx1.fill(self,"isMethod",{},smalltalk.IRMethod)})},
  995. messageSends: []}),
  996. smalltalk.IRMethod);
  997. smalltalk.addMethod(
  998. smalltalk.method({
  999. selector: "messageSends",
  1000. fn: function (){
  1001. var self=this;
  1002. return smalltalk.withContext(function($ctx1) {
  1003. var $1;
  1004. $1=self["@messageSends"];
  1005. return $1;
  1006. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.IRMethod)})},
  1007. messageSends: []}),
  1008. smalltalk.IRMethod);
  1009. smalltalk.addMethod(
  1010. smalltalk.method({
  1011. selector: "messageSends:",
  1012. fn: function (aCollection){
  1013. var self=this;
  1014. return smalltalk.withContext(function($ctx1) {
  1015. self["@messageSends"]=aCollection;
  1016. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1017. messageSends: []}),
  1018. smalltalk.IRMethod);
  1019. smalltalk.addMethod(
  1020. smalltalk.method({
  1021. selector: "method",
  1022. fn: function (){
  1023. var self=this;
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1;
  1026. $1=self;
  1027. return $1;
  1028. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.IRMethod)})},
  1029. messageSends: []}),
  1030. smalltalk.IRMethod);
  1031. smalltalk.addMethod(
  1032. smalltalk.method({
  1033. selector: "selector",
  1034. fn: function (){
  1035. var self=this;
  1036. return smalltalk.withContext(function($ctx1) {
  1037. var $1;
  1038. $1=self["@selector"];
  1039. return $1;
  1040. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRMethod)})},
  1041. messageSends: []}),
  1042. smalltalk.IRMethod);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "selector:",
  1046. fn: function (aString){
  1047. var self=this;
  1048. return smalltalk.withContext(function($ctx1) {
  1049. self["@selector"]=aString;
  1050. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRMethod)})},
  1051. messageSends: []}),
  1052. smalltalk.IRMethod);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "source",
  1056. fn: function (){
  1057. var self=this;
  1058. return smalltalk.withContext(function($ctx1) {
  1059. var $1;
  1060. $1=self["@source"];
  1061. return $1;
  1062. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRMethod)})},
  1063. messageSends: []}),
  1064. smalltalk.IRMethod);
  1065. smalltalk.addMethod(
  1066. smalltalk.method({
  1067. selector: "source:",
  1068. fn: function (aString){
  1069. var self=this;
  1070. return smalltalk.withContext(function($ctx1) {
  1071. self["@source"]=aString;
  1072. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRMethod)})},
  1073. messageSends: []}),
  1074. smalltalk.IRMethod);
  1075. smalltalk.addMethod(
  1076. smalltalk.method({
  1077. selector: "superSends",
  1078. fn: function (){
  1079. var self=this;
  1080. return smalltalk.withContext(function($ctx1) {
  1081. var $1;
  1082. $1=self["@superSends"];
  1083. return $1;
  1084. }, function($ctx1) {$ctx1.fill(self,"superSends",{},smalltalk.IRMethod)})},
  1085. messageSends: []}),
  1086. smalltalk.IRMethod);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "superSends:",
  1090. fn: function (aCollection){
  1091. var self=this;
  1092. return smalltalk.withContext(function($ctx1) {
  1093. self["@superSends"]=aCollection;
  1094. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection},smalltalk.IRMethod)})},
  1095. messageSends: []}),
  1096. smalltalk.IRMethod);
  1097. smalltalk.addMethod(
  1098. smalltalk.method({
  1099. selector: "theClass",
  1100. fn: function (){
  1101. var self=this;
  1102. return smalltalk.withContext(function($ctx1) {
  1103. var $1;
  1104. $1=self["@theClass"];
  1105. return $1;
  1106. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.IRMethod)})},
  1107. messageSends: []}),
  1108. smalltalk.IRMethod);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "theClass:",
  1112. fn: function (aClass){
  1113. var self=this;
  1114. return smalltalk.withContext(function($ctx1) {
  1115. self["@theClass"]=aClass;
  1116. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.IRMethod)})},
  1117. messageSends: []}),
  1118. smalltalk.IRMethod);
  1119. smalltalk.addClass('IRReturn', smalltalk.IRScopedInstruction, [], 'Compiler-IR');
  1120. smalltalk.addMethod(
  1121. smalltalk.method({
  1122. selector: "accept:",
  1123. fn: function (aVisitor){
  1124. var self=this;
  1125. return smalltalk.withContext(function($ctx1) {
  1126. var $1;
  1127. $1=_st(aVisitor)._visitIRReturn_(self);
  1128. return $1;
  1129. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRReturn)})},
  1130. messageSends: ["visitIRReturn:"]}),
  1131. smalltalk.IRReturn);
  1132. smalltalk.addMethod(
  1133. smalltalk.method({
  1134. selector: "canBeAssigned",
  1135. fn: function (){
  1136. var self=this;
  1137. return smalltalk.withContext(function($ctx1) {
  1138. return false;
  1139. }, function($ctx1) {$ctx1.fill(self,"canBeAssigned",{},smalltalk.IRReturn)})},
  1140. messageSends: []}),
  1141. smalltalk.IRReturn);
  1142. smalltalk.addMethod(
  1143. smalltalk.method({
  1144. selector: "isBlockReturn",
  1145. fn: function (){
  1146. var self=this;
  1147. return smalltalk.withContext(function($ctx1) {
  1148. return false;
  1149. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRReturn)})},
  1150. messageSends: []}),
  1151. smalltalk.IRReturn);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "isLocalReturn",
  1155. fn: function (){
  1156. var self=this;
  1157. return smalltalk.withContext(function($ctx1) {
  1158. return true;
  1159. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRReturn)})},
  1160. messageSends: []}),
  1161. smalltalk.IRReturn);
  1162. smalltalk.addMethod(
  1163. smalltalk.method({
  1164. selector: "isNonLocalReturn",
  1165. fn: function (){
  1166. var self=this;
  1167. return smalltalk.withContext(function($ctx1) {
  1168. var $1;
  1169. $1=_st(self._isLocalReturn())._not();
  1170. return $1;
  1171. }, function($ctx1) {$ctx1.fill(self,"isNonLocalReturn",{},smalltalk.IRReturn)})},
  1172. messageSends: ["not", "isLocalReturn"]}),
  1173. smalltalk.IRReturn);
  1174. smalltalk.addMethod(
  1175. smalltalk.method({
  1176. selector: "isReturn",
  1177. fn: function (){
  1178. var self=this;
  1179. return smalltalk.withContext(function($ctx1) {
  1180. return true;
  1181. }, function($ctx1) {$ctx1.fill(self,"isReturn",{},smalltalk.IRReturn)})},
  1182. messageSends: []}),
  1183. smalltalk.IRReturn);
  1184. smalltalk.addClass('IRBlockReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1185. smalltalk.addMethod(
  1186. smalltalk.method({
  1187. selector: "accept:",
  1188. fn: function (aVisitor){
  1189. var self=this;
  1190. return smalltalk.withContext(function($ctx1) {
  1191. var $1;
  1192. $1=_st(aVisitor)._visitIRBlockReturn_(self);
  1193. return $1;
  1194. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockReturn)})},
  1195. messageSends: ["visitIRBlockReturn:"]}),
  1196. smalltalk.IRBlockReturn);
  1197. smalltalk.addMethod(
  1198. smalltalk.method({
  1199. selector: "isBlockReturn",
  1200. fn: function (){
  1201. var self=this;
  1202. return smalltalk.withContext(function($ctx1) {
  1203. return true;
  1204. }, function($ctx1) {$ctx1.fill(self,"isBlockReturn",{},smalltalk.IRBlockReturn)})},
  1205. messageSends: []}),
  1206. smalltalk.IRBlockReturn);
  1207. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRReturn, [], 'Compiler-IR');
  1208. smalltalk.addMethod(
  1209. smalltalk.method({
  1210. selector: "accept:",
  1211. fn: function (aVisitor){
  1212. var self=this;
  1213. return smalltalk.withContext(function($ctx1) {
  1214. var $1;
  1215. $1=_st(aVisitor)._visitIRNonLocalReturn_(self);
  1216. return $1;
  1217. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRNonLocalReturn)})},
  1218. messageSends: ["visitIRNonLocalReturn:"]}),
  1219. smalltalk.IRNonLocalReturn);
  1220. smalltalk.addMethod(
  1221. smalltalk.method({
  1222. selector: "isLocalReturn",
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) {
  1226. return false;
  1227. }, function($ctx1) {$ctx1.fill(self,"isLocalReturn",{},smalltalk.IRNonLocalReturn)})},
  1228. messageSends: []}),
  1229. smalltalk.IRNonLocalReturn);
  1230. smalltalk.addClass('IRTempDeclaration', smalltalk.IRScopedInstruction, ['name'], 'Compiler-IR');
  1231. smalltalk.addMethod(
  1232. smalltalk.method({
  1233. selector: "accept:",
  1234. fn: function (aVisitor){
  1235. var self=this;
  1236. return smalltalk.withContext(function($ctx1) {
  1237. var $1;
  1238. $1=_st(aVisitor)._visitIRTempDeclaration_(self);
  1239. return $1;
  1240. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRTempDeclaration)})},
  1241. messageSends: ["visitIRTempDeclaration:"]}),
  1242. smalltalk.IRTempDeclaration);
  1243. smalltalk.addMethod(
  1244. smalltalk.method({
  1245. selector: "isTempDeclaration",
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. return true;
  1250. }, function($ctx1) {$ctx1.fill(self,"isTempDeclaration",{},smalltalk.IRTempDeclaration)})},
  1251. messageSends: []}),
  1252. smalltalk.IRTempDeclaration);
  1253. smalltalk.addMethod(
  1254. smalltalk.method({
  1255. selector: "name",
  1256. fn: function (){
  1257. var self=this;
  1258. return smalltalk.withContext(function($ctx1) {
  1259. var $1;
  1260. $1=self["@name"];
  1261. return $1;
  1262. }, function($ctx1) {$ctx1.fill(self,"name",{},smalltalk.IRTempDeclaration)})},
  1263. messageSends: []}),
  1264. smalltalk.IRTempDeclaration);
  1265. smalltalk.addMethod(
  1266. smalltalk.method({
  1267. selector: "name:",
  1268. fn: function (aString){
  1269. var self=this;
  1270. return smalltalk.withContext(function($ctx1) {
  1271. self["@name"]=aString;
  1272. return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString},smalltalk.IRTempDeclaration)})},
  1273. messageSends: []}),
  1274. smalltalk.IRTempDeclaration);
  1275. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'classSend', 'index'], 'Compiler-IR');
  1276. smalltalk.addMethod(
  1277. smalltalk.method({
  1278. selector: "accept:",
  1279. fn: function (aVisitor){
  1280. var self=this;
  1281. return smalltalk.withContext(function($ctx1) {
  1282. var $1;
  1283. $1=_st(aVisitor)._visitIRSend_(self);
  1284. return $1;
  1285. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSend)})},
  1286. messageSends: ["visitIRSend:"]}),
  1287. smalltalk.IRSend);
  1288. smalltalk.addMethod(
  1289. smalltalk.method({
  1290. selector: "classSend",
  1291. fn: function (){
  1292. var self=this;
  1293. return smalltalk.withContext(function($ctx1) {
  1294. var $1;
  1295. $1=self["@classSend"];
  1296. return $1;
  1297. }, function($ctx1) {$ctx1.fill(self,"classSend",{},smalltalk.IRSend)})},
  1298. messageSends: []}),
  1299. smalltalk.IRSend);
  1300. smalltalk.addMethod(
  1301. smalltalk.method({
  1302. selector: "classSend:",
  1303. fn: function (aClass){
  1304. var self=this;
  1305. return smalltalk.withContext(function($ctx1) {
  1306. self["@classSend"]=aClass;
  1307. return self}, function($ctx1) {$ctx1.fill(self,"classSend:",{aClass:aClass},smalltalk.IRSend)})},
  1308. messageSends: []}),
  1309. smalltalk.IRSend);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "index",
  1313. fn: function (){
  1314. var self=this;
  1315. return smalltalk.withContext(function($ctx1) {
  1316. var $1;
  1317. $1=self["@index"];
  1318. return $1;
  1319. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.IRSend)})},
  1320. messageSends: []}),
  1321. smalltalk.IRSend);
  1322. smalltalk.addMethod(
  1323. smalltalk.method({
  1324. selector: "index:",
  1325. fn: function (anInteger){
  1326. var self=this;
  1327. return smalltalk.withContext(function($ctx1) {
  1328. self["@index"]=anInteger;
  1329. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.IRSend)})},
  1330. messageSends: []}),
  1331. smalltalk.IRSend);
  1332. smalltalk.addMethod(
  1333. smalltalk.method({
  1334. selector: "isSend",
  1335. fn: function (){
  1336. var self=this;
  1337. return smalltalk.withContext(function($ctx1) {
  1338. return true;
  1339. }, function($ctx1) {$ctx1.fill(self,"isSend",{},smalltalk.IRSend)})},
  1340. messageSends: []}),
  1341. smalltalk.IRSend);
  1342. smalltalk.addMethod(
  1343. smalltalk.method({
  1344. selector: "selector",
  1345. fn: function (){
  1346. var self=this;
  1347. return smalltalk.withContext(function($ctx1) {
  1348. var $1;
  1349. $1=self["@selector"];
  1350. return $1;
  1351. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.IRSend)})},
  1352. messageSends: []}),
  1353. smalltalk.IRSend);
  1354. smalltalk.addMethod(
  1355. smalltalk.method({
  1356. selector: "selector:",
  1357. fn: function (aString){
  1358. var self=this;
  1359. return smalltalk.withContext(function($ctx1) {
  1360. self["@selector"]=aString;
  1361. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.IRSend)})},
  1362. messageSends: []}),
  1363. smalltalk.IRSend);
  1364. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  1365. smalltalk.addMethod(
  1366. smalltalk.method({
  1367. selector: "accept:",
  1368. fn: function (aVisitor){
  1369. var self=this;
  1370. return smalltalk.withContext(function($ctx1) {
  1371. var $1;
  1372. $1=_st(aVisitor)._visitIRSequence_(self);
  1373. return $1;
  1374. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRSequence)})},
  1375. messageSends: ["visitIRSequence:"]}),
  1376. smalltalk.IRSequence);
  1377. smalltalk.addMethod(
  1378. smalltalk.method({
  1379. selector: "isSequence",
  1380. fn: function (){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. return true;
  1384. }, function($ctx1) {$ctx1.fill(self,"isSequence",{},smalltalk.IRSequence)})},
  1385. messageSends: []}),
  1386. smalltalk.IRSequence);
  1387. smalltalk.addClass('IRBlockSequence', smalltalk.IRSequence, [], 'Compiler-IR');
  1388. smalltalk.addMethod(
  1389. smalltalk.method({
  1390. selector: "accept:",
  1391. fn: function (aVisitor){
  1392. var self=this;
  1393. return smalltalk.withContext(function($ctx1) {
  1394. var $1;
  1395. $1=_st(aVisitor)._visitIRBlockSequence_(self);
  1396. return $1;
  1397. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRBlockSequence)})},
  1398. messageSends: ["visitIRBlockSequence:"]}),
  1399. smalltalk.IRBlockSequence);
  1400. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  1401. smalltalk.addMethod(
  1402. smalltalk.method({
  1403. selector: "accept:",
  1404. fn: function (aVisitor){
  1405. var self=this;
  1406. return smalltalk.withContext(function($ctx1) {
  1407. var $1;
  1408. $1=_st(aVisitor)._visitIRValue_(self);
  1409. return $1;
  1410. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRValue)})},
  1411. messageSends: ["visitIRValue:"]}),
  1412. smalltalk.IRValue);
  1413. smalltalk.addMethod(
  1414. smalltalk.method({
  1415. selector: "needsBoxingAsReceiver",
  1416. fn: function (){
  1417. var self=this;
  1418. return smalltalk.withContext(function($ctx1) {
  1419. return false;
  1420. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRValue)})},
  1421. messageSends: []}),
  1422. smalltalk.IRValue);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "value",
  1426. fn: function (){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. var $1;
  1430. $1=self["@value"];
  1431. return $1;
  1432. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.IRValue)})},
  1433. messageSends: []}),
  1434. smalltalk.IRValue);
  1435. smalltalk.addMethod(
  1436. smalltalk.method({
  1437. selector: "value:",
  1438. fn: function (aString){
  1439. var self=this;
  1440. return smalltalk.withContext(function($ctx1) {
  1441. self["@value"]=aString;
  1442. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.IRValue)})},
  1443. messageSends: []}),
  1444. smalltalk.IRValue);
  1445. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1446. smalltalk.addMethod(
  1447. smalltalk.method({
  1448. selector: "accept:",
  1449. fn: function (aVisitor){
  1450. var self=this;
  1451. return smalltalk.withContext(function($ctx1) {
  1452. var $1;
  1453. $1=_st(aVisitor)._visitIRVariable_(self);
  1454. return $1;
  1455. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVariable)})},
  1456. messageSends: ["visitIRVariable:"]}),
  1457. smalltalk.IRVariable);
  1458. smalltalk.addMethod(
  1459. smalltalk.method({
  1460. selector: "isVariable",
  1461. fn: function (){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) {
  1464. return true;
  1465. }, function($ctx1) {$ctx1.fill(self,"isVariable",{},smalltalk.IRVariable)})},
  1466. messageSends: []}),
  1467. smalltalk.IRVariable);
  1468. smalltalk.addMethod(
  1469. smalltalk.method({
  1470. selector: "needsBoxingAsReceiver",
  1471. fn: function (){
  1472. var self=this;
  1473. return smalltalk.withContext(function($ctx1) {
  1474. var $1;
  1475. $1=_st(_st(self._variable())._isPseudoVar())._not();
  1476. return $1;
  1477. }, function($ctx1) {$ctx1.fill(self,"needsBoxingAsReceiver",{},smalltalk.IRVariable)})},
  1478. messageSends: ["not", "isPseudoVar", "variable"]}),
  1479. smalltalk.IRVariable);
  1480. smalltalk.addMethod(
  1481. smalltalk.method({
  1482. selector: "variable",
  1483. fn: function (){
  1484. var self=this;
  1485. return smalltalk.withContext(function($ctx1) {
  1486. var $1;
  1487. $1=self["@variable"];
  1488. return $1;
  1489. }, function($ctx1) {$ctx1.fill(self,"variable",{},smalltalk.IRVariable)})},
  1490. messageSends: []}),
  1491. smalltalk.IRVariable);
  1492. smalltalk.addMethod(
  1493. smalltalk.method({
  1494. selector: "variable:",
  1495. fn: function (aScopeVariable){
  1496. var self=this;
  1497. return smalltalk.withContext(function($ctx1) {
  1498. self["@variable"]=aScopeVariable;
  1499. return self}, function($ctx1) {$ctx1.fill(self,"variable:",{aScopeVariable:aScopeVariable},smalltalk.IRVariable)})},
  1500. messageSends: []}),
  1501. smalltalk.IRVariable);
  1502. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1503. smalltalk.addMethod(
  1504. smalltalk.method({
  1505. selector: "accept:",
  1506. fn: function (aVisitor){
  1507. var self=this;
  1508. return smalltalk.withContext(function($ctx1) {
  1509. var $1;
  1510. $1=_st(aVisitor)._visitIRVerbatim_(self);
  1511. return $1;
  1512. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.IRVerbatim)})},
  1513. messageSends: ["visitIRVerbatim:"]}),
  1514. smalltalk.IRVerbatim);
  1515. smalltalk.addMethod(
  1516. smalltalk.method({
  1517. selector: "source",
  1518. fn: function (){
  1519. var self=this;
  1520. return smalltalk.withContext(function($ctx1) {
  1521. var $1;
  1522. $1=self["@source"];
  1523. return $1;
  1524. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.IRVerbatim)})},
  1525. messageSends: []}),
  1526. smalltalk.IRVerbatim);
  1527. smalltalk.addMethod(
  1528. smalltalk.method({
  1529. selector: "source:",
  1530. fn: function (aString){
  1531. var self=this;
  1532. return smalltalk.withContext(function($ctx1) {
  1533. self["@source"]=aString;
  1534. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.IRVerbatim)})},
  1535. messageSends: []}),
  1536. smalltalk.IRVerbatim);
  1537. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  1538. smalltalk.addMethod(
  1539. smalltalk.method({
  1540. selector: "visit:",
  1541. fn: function (anIRInstruction){
  1542. var self=this;
  1543. return smalltalk.withContext(function($ctx1) {
  1544. var $1;
  1545. $1=_st(anIRInstruction)._accept_(self);
  1546. return $1;
  1547. }, function($ctx1) {$ctx1.fill(self,"visit:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  1548. messageSends: ["accept:"]}),
  1549. smalltalk.IRVisitor);
  1550. smalltalk.addMethod(
  1551. smalltalk.method({
  1552. selector: "visitIRAssignment:",
  1553. fn: function (anIRAssignment){
  1554. var self=this;
  1555. return smalltalk.withContext(function($ctx1) {
  1556. var $1;
  1557. $1=self._visitIRInstruction_(anIRAssignment);
  1558. return $1;
  1559. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRVisitor)})},
  1560. messageSends: ["visitIRInstruction:"]}),
  1561. smalltalk.IRVisitor);
  1562. smalltalk.addMethod(
  1563. smalltalk.method({
  1564. selector: "visitIRBlockReturn:",
  1565. fn: function (anIRBlockReturn){
  1566. var self=this;
  1567. return smalltalk.withContext(function($ctx1) {
  1568. var $1;
  1569. $1=self._visitIRReturn_(anIRBlockReturn);
  1570. return $1;
  1571. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockReturn:",{anIRBlockReturn:anIRBlockReturn},smalltalk.IRVisitor)})},
  1572. messageSends: ["visitIRReturn:"]}),
  1573. smalltalk.IRVisitor);
  1574. smalltalk.addMethod(
  1575. smalltalk.method({
  1576. selector: "visitIRBlockSequence:",
  1577. fn: function (anIRBlockSequence){
  1578. var self=this;
  1579. return smalltalk.withContext(function($ctx1) {
  1580. var $1;
  1581. $1=self._visitIRSequence_(anIRBlockSequence);
  1582. return $1;
  1583. }, function($ctx1) {$ctx1.fill(self,"visitIRBlockSequence:",{anIRBlockSequence:anIRBlockSequence},smalltalk.IRVisitor)})},
  1584. messageSends: ["visitIRSequence:"]}),
  1585. smalltalk.IRVisitor);
  1586. smalltalk.addMethod(
  1587. smalltalk.method({
  1588. selector: "visitIRClosure:",
  1589. fn: function (anIRClosure){
  1590. var self=this;
  1591. return smalltalk.withContext(function($ctx1) {
  1592. var $1;
  1593. $1=self._visitIRInstruction_(anIRClosure);
  1594. return $1;
  1595. }, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRVisitor)})},
  1596. messageSends: ["visitIRInstruction:"]}),
  1597. smalltalk.IRVisitor);
  1598. smalltalk.addMethod(
  1599. smalltalk.method({
  1600. selector: "visitIRDynamicArray:",
  1601. fn: function (anIRDynamicArray){
  1602. var self=this;
  1603. return smalltalk.withContext(function($ctx1) {
  1604. var $1;
  1605. $1=self._visitIRInstruction_(anIRDynamicArray);
  1606. return $1;
  1607. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRVisitor)})},
  1608. messageSends: ["visitIRInstruction:"]}),
  1609. smalltalk.IRVisitor);
  1610. smalltalk.addMethod(
  1611. smalltalk.method({
  1612. selector: "visitIRDynamicDictionary:",
  1613. fn: function (anIRDynamicDictionary){
  1614. var self=this;
  1615. return smalltalk.withContext(function($ctx1) {
  1616. var $1;
  1617. $1=self._visitIRInstruction_(anIRDynamicDictionary);
  1618. return $1;
  1619. }, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRVisitor)})},
  1620. messageSends: ["visitIRInstruction:"]}),
  1621. smalltalk.IRVisitor);
  1622. smalltalk.addMethod(
  1623. smalltalk.method({
  1624. selector: "visitIRInlinedClosure:",
  1625. fn: function (anIRInlinedClosure){
  1626. var self=this;
  1627. return smalltalk.withContext(function($ctx1) {
  1628. var $1;
  1629. $1=self._visitIRClosure_(anIRInlinedClosure);
  1630. return $1;
  1631. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},smalltalk.IRVisitor)})},
  1632. messageSends: ["visitIRClosure:"]}),
  1633. smalltalk.IRVisitor);
  1634. smalltalk.addMethod(
  1635. smalltalk.method({
  1636. selector: "visitIRInlinedSequence:",
  1637. fn: function (anIRInlinedSequence){
  1638. var self=this;
  1639. return smalltalk.withContext(function($ctx1) {
  1640. var $1;
  1641. $1=self._visitIRSequence_(anIRInlinedSequence);
  1642. return $1;
  1643. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence},smalltalk.IRVisitor)})},
  1644. messageSends: ["visitIRSequence:"]}),
  1645. smalltalk.IRVisitor);
  1646. smalltalk.addMethod(
  1647. smalltalk.method({
  1648. selector: "visitIRInstruction:",
  1649. fn: function (anIRInstruction){
  1650. var self=this;
  1651. return smalltalk.withContext(function($ctx1) {
  1652. var $1;
  1653. _st(_st(anIRInstruction)._instructions())._do_((function(each){
  1654. return smalltalk.withContext(function($ctx2) {
  1655. return self._visit_(each);
  1656. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1657. $1=anIRInstruction;
  1658. return $1;
  1659. }, function($ctx1) {$ctx1.fill(self,"visitIRInstruction:",{anIRInstruction:anIRInstruction},smalltalk.IRVisitor)})},
  1660. messageSends: ["do:", "visit:", "instructions"]}),
  1661. smalltalk.IRVisitor);
  1662. smalltalk.addMethod(
  1663. smalltalk.method({
  1664. selector: "visitIRMethod:",
  1665. fn: function (anIRMethod){
  1666. var self=this;
  1667. return smalltalk.withContext(function($ctx1) {
  1668. var $1;
  1669. $1=self._visitIRInstruction_(anIRMethod);
  1670. return $1;
  1671. }, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRVisitor)})},
  1672. messageSends: ["visitIRInstruction:"]}),
  1673. smalltalk.IRVisitor);
  1674. smalltalk.addMethod(
  1675. smalltalk.method({
  1676. selector: "visitIRNonLocalReturn:",
  1677. fn: function (anIRNonLocalReturn){
  1678. var self=this;
  1679. return smalltalk.withContext(function($ctx1) {
  1680. var $1;
  1681. $1=self._visitIRInstruction_(anIRNonLocalReturn);
  1682. return $1;
  1683. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRVisitor)})},
  1684. messageSends: ["visitIRInstruction:"]}),
  1685. smalltalk.IRVisitor);
  1686. smalltalk.addMethod(
  1687. smalltalk.method({
  1688. selector: "visitIRNonLocalReturnHandling:",
  1689. fn: function (anIRNonLocalReturnHandling){
  1690. var self=this;
  1691. return smalltalk.withContext(function($ctx1) {
  1692. var $1;
  1693. $1=self._visitIRInstruction_(anIRNonLocalReturnHandling);
  1694. return $1;
  1695. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturnHandling:",{anIRNonLocalReturnHandling:anIRNonLocalReturnHandling},smalltalk.IRVisitor)})},
  1696. messageSends: ["visitIRInstruction:"]}),
  1697. smalltalk.IRVisitor);
  1698. smalltalk.addMethod(
  1699. smalltalk.method({
  1700. selector: "visitIRReturn:",
  1701. fn: function (anIRReturn){
  1702. var self=this;
  1703. return smalltalk.withContext(function($ctx1) {
  1704. var $1;
  1705. $1=self._visitIRInstruction_(anIRReturn);
  1706. return $1;
  1707. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRVisitor)})},
  1708. messageSends: ["visitIRInstruction:"]}),
  1709. smalltalk.IRVisitor);
  1710. smalltalk.addMethod(
  1711. smalltalk.method({
  1712. selector: "visitIRSend:",
  1713. fn: function (anIRSend){
  1714. var self=this;
  1715. return smalltalk.withContext(function($ctx1) {
  1716. var $1;
  1717. $1=self._visitIRInstruction_(anIRSend);
  1718. return $1;
  1719. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRVisitor)})},
  1720. messageSends: ["visitIRInstruction:"]}),
  1721. smalltalk.IRVisitor);
  1722. smalltalk.addMethod(
  1723. smalltalk.method({
  1724. selector: "visitIRSequence:",
  1725. fn: function (anIRSequence){
  1726. var self=this;
  1727. return smalltalk.withContext(function($ctx1) {
  1728. var $1;
  1729. $1=self._visitIRInstruction_(anIRSequence);
  1730. return $1;
  1731. }, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRVisitor)})},
  1732. messageSends: ["visitIRInstruction:"]}),
  1733. smalltalk.IRVisitor);
  1734. smalltalk.addMethod(
  1735. smalltalk.method({
  1736. selector: "visitIRTempDeclaration:",
  1737. fn: function (anIRTempDeclaration){
  1738. var self=this;
  1739. return smalltalk.withContext(function($ctx1) {
  1740. var $1;
  1741. $1=self._visitIRInstruction_(anIRTempDeclaration);
  1742. return $1;
  1743. }, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRVisitor)})},
  1744. messageSends: ["visitIRInstruction:"]}),
  1745. smalltalk.IRVisitor);
  1746. smalltalk.addMethod(
  1747. smalltalk.method({
  1748. selector: "visitIRValue:",
  1749. fn: function (anIRValue){
  1750. var self=this;
  1751. return smalltalk.withContext(function($ctx1) {
  1752. var $1;
  1753. $1=self._visitIRInstruction_(anIRValue);
  1754. return $1;
  1755. }, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRVisitor)})},
  1756. messageSends: ["visitIRInstruction:"]}),
  1757. smalltalk.IRVisitor);
  1758. smalltalk.addMethod(
  1759. smalltalk.method({
  1760. selector: "visitIRVariable:",
  1761. fn: function (anIRVariable){
  1762. var self=this;
  1763. return smalltalk.withContext(function($ctx1) {
  1764. var $1;
  1765. $1=self._visitIRInstruction_(anIRVariable);
  1766. return $1;
  1767. }, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRVisitor)})},
  1768. messageSends: ["visitIRInstruction:"]}),
  1769. smalltalk.IRVisitor);
  1770. smalltalk.addMethod(
  1771. smalltalk.method({
  1772. selector: "visitIRVerbatim:",
  1773. fn: function (anIRVerbatim){
  1774. var self=this;
  1775. return smalltalk.withContext(function($ctx1) {
  1776. var $1;
  1777. $1=self._visitIRInstruction_(anIRVerbatim);
  1778. return $1;
  1779. }, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRVisitor)})},
  1780. messageSends: ["visitIRInstruction:"]}),
  1781. smalltalk.IRVisitor);
  1782. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream', 'currentClass'], 'Compiler-IR');
  1783. smalltalk.addMethod(
  1784. smalltalk.method({
  1785. selector: "contents",
  1786. fn: function (){
  1787. var self=this;
  1788. return smalltalk.withContext(function($ctx1) {
  1789. var $1;
  1790. $1=_st(self._stream())._contents();
  1791. return $1;
  1792. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.IRJSTranslator)})},
  1793. messageSends: ["contents", "stream"]}),
  1794. smalltalk.IRJSTranslator);
  1795. smalltalk.addMethod(
  1796. smalltalk.method({
  1797. selector: "currentClass",
  1798. fn: function (){
  1799. var self=this;
  1800. return smalltalk.withContext(function($ctx1) {
  1801. var $1;
  1802. $1=self["@currentClass"];
  1803. return $1;
  1804. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.IRJSTranslator)})},
  1805. messageSends: []}),
  1806. smalltalk.IRJSTranslator);
  1807. smalltalk.addMethod(
  1808. smalltalk.method({
  1809. selector: "currentClass:",
  1810. fn: function (aClass){
  1811. var self=this;
  1812. return smalltalk.withContext(function($ctx1) {
  1813. self["@currentClass"]=aClass;
  1814. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.IRJSTranslator)})},
  1815. messageSends: []}),
  1816. smalltalk.IRJSTranslator);
  1817. smalltalk.addMethod(
  1818. smalltalk.method({
  1819. selector: "initialize",
  1820. fn: function (){
  1821. var self=this;
  1822. function $JSStream(){return smalltalk.JSStream||(typeof JSStream=="undefined"?nil:JSStream)}
  1823. return smalltalk.withContext(function($ctx1) {
  1824. smalltalk.IRJSTranslator.superclass.fn.prototype._initialize.apply(_st(self), []);
  1825. self["@stream"]=_st($JSStream())._new();
  1826. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.IRJSTranslator)})},
  1827. messageSends: ["initialize", "new"]}),
  1828. smalltalk.IRJSTranslator);
  1829. smalltalk.addMethod(
  1830. smalltalk.method({
  1831. selector: "stream",
  1832. fn: function (){
  1833. var self=this;
  1834. return smalltalk.withContext(function($ctx1) {
  1835. var $1;
  1836. $1=self["@stream"];
  1837. return $1;
  1838. }, function($ctx1) {$ctx1.fill(self,"stream",{},smalltalk.IRJSTranslator)})},
  1839. messageSends: []}),
  1840. smalltalk.IRJSTranslator);
  1841. smalltalk.addMethod(
  1842. smalltalk.method({
  1843. selector: "stream:",
  1844. fn: function (aStream){
  1845. var self=this;
  1846. return smalltalk.withContext(function($ctx1) {
  1847. self["@stream"]=aStream;
  1848. return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream},smalltalk.IRJSTranslator)})},
  1849. messageSends: []}),
  1850. smalltalk.IRJSTranslator);
  1851. smalltalk.addMethod(
  1852. smalltalk.method({
  1853. selector: "visitIRAssignment:",
  1854. fn: function (anIRAssignment){
  1855. var self=this;
  1856. return smalltalk.withContext(function($ctx1) {
  1857. self._visit_(_st(_st(anIRAssignment)._instructions())._first());
  1858. _st(self._stream())._nextPutAssignment();
  1859. self._visit_(_st(_st(anIRAssignment)._instructions())._last());
  1860. return self}, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},smalltalk.IRJSTranslator)})},
  1861. messageSends: ["visit:", "first", "instructions", "nextPutAssignment", "stream", "last"]}),
  1862. smalltalk.IRJSTranslator);
  1863. smalltalk.addMethod(
  1864. smalltalk.method({
  1865. selector: "visitIRClosure:",
  1866. fn: function (anIRClosure){
  1867. var self=this;
  1868. return smalltalk.withContext(function($ctx1) {
  1869. _st(self._stream())._nextPutClosureWith_arguments_((function(){
  1870. return smalltalk.withContext(function($ctx2) {
  1871. _st(self._stream())._nextPutVars_(_st(_st(anIRClosure)._tempDeclarations())._collect_((function(each){
  1872. return smalltalk.withContext(function($ctx3) {
  1873. return _st(_st(each)._name())._asVariableName();
  1874. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})})));
  1875. return _st(self._stream())._nextPutBlockContextFor_during_(anIRClosure,(function(){
  1876. return smalltalk.withContext(function($ctx3) {
  1877. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRClosure_.apply(_st(self), [anIRClosure]);
  1878. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  1879. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),_st(anIRClosure)._arguments());
  1880. return self}, function($ctx1) {$ctx1.fill(self,"visitIRClosure:",{anIRClosure:anIRClosure},smalltalk.IRJSTranslator)})},
  1881. messageSends: ["nextPutClosureWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "nextPutBlockContextFor:during:", "visitIRClosure:", "arguments"]}),
  1882. smalltalk.IRJSTranslator);
  1883. smalltalk.addMethod(
  1884. smalltalk.method({
  1885. selector: "visitIRDynamicArray:",
  1886. fn: function (anIRDynamicArray){
  1887. var self=this;
  1888. return smalltalk.withContext(function($ctx1) {
  1889. _st(self._stream())._nextPutAll_("[");
  1890. _st(_st(anIRDynamicArray)._instructions())._do_separatedBy_((function(each){
  1891. return smalltalk.withContext(function($ctx2) {
  1892. return self._visit_(each);
  1893. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1894. return smalltalk.withContext(function($ctx2) {
  1895. return _st(self._stream())._nextPutAll_(",");
  1896. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1897. _st(self["@stream"])._nextPutAll_("]");
  1898. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicArray:",{anIRDynamicArray:anIRDynamicArray},smalltalk.IRJSTranslator)})},
  1899. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"]}),
  1900. smalltalk.IRJSTranslator);
  1901. smalltalk.addMethod(
  1902. smalltalk.method({
  1903. selector: "visitIRDynamicDictionary:",
  1904. fn: function (anIRDynamicDictionary){
  1905. var self=this;
  1906. return smalltalk.withContext(function($ctx1) {
  1907. _st(self._stream())._nextPutAll_("smalltalk.HashedCollection._from_([");
  1908. _st(_st(anIRDynamicDictionary)._instructions())._do_separatedBy_((function(each){
  1909. return smalltalk.withContext(function($ctx2) {
  1910. return self._visit_(each);
  1911. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  1912. return smalltalk.withContext(function($ctx2) {
  1913. return _st(self._stream())._nextPutAll_(",");
  1914. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1915. _st(self._stream())._nextPutAll_("])");
  1916. return self}, function($ctx1) {$ctx1.fill(self,"visitIRDynamicDictionary:",{anIRDynamicDictionary:anIRDynamicDictionary},smalltalk.IRJSTranslator)})},
  1917. messageSends: ["nextPutAll:", "stream", "do:separatedBy:", "visit:", "instructions"]}),
  1918. smalltalk.IRJSTranslator);
  1919. smalltalk.addMethod(
  1920. smalltalk.method({
  1921. selector: "visitIRMethod:",
  1922. fn: function (anIRMethod){
  1923. var self=this;
  1924. return smalltalk.withContext(function($ctx1) {
  1925. var $1,$2;
  1926. _st(self._stream())._nextPutMethodDeclaration_with_(anIRMethod,(function(){
  1927. return smalltalk.withContext(function($ctx2) {
  1928. return _st(self._stream())._nextPutFunctionWith_arguments_((function(){
  1929. return smalltalk.withContext(function($ctx3) {
  1930. _st(self._stream())._nextPutVars_(_st(_st(anIRMethod)._tempDeclarations())._collect_((function(each){
  1931. return smalltalk.withContext(function($ctx4) {
  1932. return _st(_st(each)._name())._asVariableName();
  1933. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})})));
  1934. _st(_st(anIRMethod)._classReferences())._do_((function(each){
  1935. return smalltalk.withContext(function($ctx4) {
  1936. return _st(self._stream())._nextPutClassRefFunction_(each);
  1937. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
  1938. return _st(self._stream())._nextPutContextFor_during_(anIRMethod,(function(){
  1939. return smalltalk.withContext(function($ctx4) {
  1940. $1=_st(_st(anIRMethod)._internalVariables())._notEmpty();
  1941. if(smalltalk.assert($1)){
  1942. _st(self._stream())._nextPutVars_(_st(_st(_st(anIRMethod)._internalVariables())._asArray())._collect_((function(each){
  1943. return smalltalk.withContext(function($ctx5) {
  1944. return _st(_st(each)._variable())._alias();
  1945. }, function($ctx5) {$ctx5.fillBlock({each:each},$ctx4)})})));
  1946. };
  1947. $2=_st(_st(anIRMethod)._scope())._hasNonLocalReturn();
  1948. if(smalltalk.assert($2)){
  1949. return _st(self._stream())._nextPutNonLocalReturnHandlingWith_((function(){
  1950. return smalltalk.withContext(function($ctx5) {
  1951. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1952. }, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
  1953. } else {
  1954. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRMethod_.apply(_st(self), [anIRMethod]);
  1955. };
  1956. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  1957. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}),_st(anIRMethod)._arguments());
  1958. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1959. return self}, function($ctx1) {$ctx1.fill(self,"visitIRMethod:",{anIRMethod:anIRMethod},smalltalk.IRJSTranslator)})},
  1960. messageSends: ["nextPutMethodDeclaration:with:", "nextPutFunctionWith:arguments:", "nextPutVars:", "collect:", "asVariableName", "name", "tempDeclarations", "stream", "do:", "nextPutClassRefFunction:", "classReferences", "nextPutContextFor:during:", "ifTrue:", "alias", "variable", "asArray", "internalVariables", "notEmpty", "ifTrue:ifFalse:", "nextPutNonLocalReturnHandlingWith:", "visitIRMethod:", "hasNonLocalReturn", "scope", "arguments"]}),
  1961. smalltalk.IRJSTranslator);
  1962. smalltalk.addMethod(
  1963. smalltalk.method({
  1964. selector: "visitIRNonLocalReturn:",
  1965. fn: function (anIRNonLocalReturn){
  1966. var self=this;
  1967. return smalltalk.withContext(function($ctx1) {
  1968. _st(self._stream())._nextPutNonLocalReturnWith_((function(){
  1969. return smalltalk.withContext(function($ctx2) {
  1970. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  1971. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1972. return self}, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},smalltalk.IRJSTranslator)})},
  1973. messageSends: ["nextPutNonLocalReturnWith:", "visitIRNonLocalReturn:", "stream"]}),
  1974. smalltalk.IRJSTranslator);
  1975. smalltalk.addMethod(
  1976. smalltalk.method({
  1977. selector: "visitIRReturn:",
  1978. fn: function (anIRReturn){
  1979. var self=this;
  1980. return smalltalk.withContext(function($ctx1) {
  1981. _st(self._stream())._nextPutReturnWith_((function(){
  1982. return smalltalk.withContext(function($ctx2) {
  1983. return smalltalk.IRJSTranslator.superclass.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  1984. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1985. return self}, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},smalltalk.IRJSTranslator)})},
  1986. messageSends: ["nextPutReturnWith:", "visitIRReturn:", "stream"]}),
  1987. smalltalk.IRJSTranslator);
  1988. smalltalk.addMethod(
  1989. smalltalk.method({
  1990. selector: "visitIRSend:",
  1991. fn: function (anIRSend){
  1992. var self=this;
  1993. return smalltalk.withContext(function($ctx1) {
  1994. var $1;
  1995. $1=_st(anIRSend)._classSend();
  1996. if(($receiver = $1) == nil || $receiver == undefined){
  1997. self._visitSend_(anIRSend);
  1998. } else {
  1999. self._visitSuperSend_(anIRSend);
  2000. };
  2001. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2002. messageSends: ["ifNil:ifNotNil:", "visitSend:", "visitSuperSend:", "classSend"]}),
  2003. smalltalk.IRJSTranslator);
  2004. smalltalk.addMethod(
  2005. smalltalk.method({
  2006. selector: "visitIRSequence:",
  2007. fn: function (anIRSequence){
  2008. var self=this;
  2009. return smalltalk.withContext(function($ctx1) {
  2010. _st(self._stream())._nextPutSequenceWith_((function(){
  2011. return smalltalk.withContext(function($ctx2) {
  2012. return _st(_st(anIRSequence)._instructions())._do_((function(each){
  2013. return smalltalk.withContext(function($ctx3) {
  2014. return _st(self._stream())._nextPutStatementWith_(self._visit_(each));
  2015. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  2016. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2017. return self}, function($ctx1) {$ctx1.fill(self,"visitIRSequence:",{anIRSequence:anIRSequence},smalltalk.IRJSTranslator)})},
  2018. messageSends: ["nextPutSequenceWith:", "do:", "nextPutStatementWith:", "visit:", "stream", "instructions"]}),
  2019. smalltalk.IRJSTranslator);
  2020. smalltalk.addMethod(
  2021. smalltalk.method({
  2022. selector: "visitIRTempDeclaration:",
  2023. fn: function (anIRTempDeclaration){
  2024. var self=this;
  2025. return smalltalk.withContext(function($ctx1) {
  2026. return self}, function($ctx1) {$ctx1.fill(self,"visitIRTempDeclaration:",{anIRTempDeclaration:anIRTempDeclaration},smalltalk.IRJSTranslator)})},
  2027. messageSends: []}),
  2028. smalltalk.IRJSTranslator);
  2029. smalltalk.addMethod(
  2030. smalltalk.method({
  2031. selector: "visitIRValue:",
  2032. fn: function (anIRValue){
  2033. var self=this;
  2034. return smalltalk.withContext(function($ctx1) {
  2035. _st(self._stream())._nextPutAll_(_st(_st(anIRValue)._value())._asJavascript());
  2036. return self}, function($ctx1) {$ctx1.fill(self,"visitIRValue:",{anIRValue:anIRValue},smalltalk.IRJSTranslator)})},
  2037. messageSends: ["nextPutAll:", "asJavascript", "value", "stream"]}),
  2038. smalltalk.IRJSTranslator);
  2039. smalltalk.addMethod(
  2040. smalltalk.method({
  2041. selector: "visitIRVariable:",
  2042. fn: function (anIRVariable){
  2043. var self=this;
  2044. return smalltalk.withContext(function($ctx1) {
  2045. var $1;
  2046. $1=_st(_st(_st(anIRVariable)._variable())._name()).__eq("thisContext");
  2047. if(smalltalk.assert($1)){
  2048. _st(self._stream())._nextPutAll_("smalltalk.getThisContext()");
  2049. } else {
  2050. _st(self._stream())._nextPutAll_(_st(_st(anIRVariable)._variable())._alias());
  2051. };
  2052. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVariable:",{anIRVariable:anIRVariable},smalltalk.IRJSTranslator)})},
  2053. messageSends: ["ifTrue:ifFalse:", "nextPutAll:", "stream", "alias", "variable", "=", "name"]}),
  2054. smalltalk.IRJSTranslator);
  2055. smalltalk.addMethod(
  2056. smalltalk.method({
  2057. selector: "visitIRVerbatim:",
  2058. fn: function (anIRVerbatim){
  2059. var self=this;
  2060. return smalltalk.withContext(function($ctx1) {
  2061. _st(self._stream())._nextPutStatementWith_((function(){
  2062. return smalltalk.withContext(function($ctx2) {
  2063. return _st(self._stream())._nextPutAll_(_st(anIRVerbatim)._source());
  2064. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2065. return self}, function($ctx1) {$ctx1.fill(self,"visitIRVerbatim:",{anIRVerbatim:anIRVerbatim},smalltalk.IRJSTranslator)})},
  2066. messageSends: ["nextPutStatementWith:", "nextPutAll:", "source", "stream"]}),
  2067. smalltalk.IRJSTranslator);
  2068. smalltalk.addMethod(
  2069. smalltalk.method({
  2070. selector: "visitReceiver:",
  2071. fn: function (anIRInstruction){
  2072. var self=this;
  2073. return smalltalk.withContext(function($ctx1) {
  2074. var $1,$2;
  2075. $1=_st(anIRInstruction)._needsBoxingAsReceiver();
  2076. if(! smalltalk.assert($1)){
  2077. $2=self._visit_(anIRInstruction);
  2078. return $2;
  2079. };
  2080. _st(self._stream())._nextPutAll_("_st(");
  2081. self._visit_(anIRInstruction);
  2082. _st(self._stream())._nextPutAll_(")");
  2083. return self}, function($ctx1) {$ctx1.fill(self,"visitReceiver:",{anIRInstruction:anIRInstruction},smalltalk.IRJSTranslator)})},
  2084. messageSends: ["ifFalse:", "visit:", "needsBoxingAsReceiver", "nextPutAll:", "stream"]}),
  2085. smalltalk.IRJSTranslator);
  2086. smalltalk.addMethod(
  2087. smalltalk.method({
  2088. selector: "visitSend:",
  2089. fn: function (anIRSend){
  2090. var self=this;
  2091. return smalltalk.withContext(function($ctx1) {
  2092. self._visitReceiver_(_st(_st(anIRSend)._instructions())._first());
  2093. _st(self._stream())._nextPutAll_(_st(".".__comma(_st(_st(anIRSend)._selector())._asSelector())).__comma("("));
  2094. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2095. return smalltalk.withContext(function($ctx2) {
  2096. return self._visit_(each);
  2097. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2098. return smalltalk.withContext(function($ctx2) {
  2099. return _st(self._stream())._nextPutAll_(",");
  2100. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2101. _st(self._stream())._nextPutAll_(")");
  2102. return self}, function($ctx1) {$ctx1.fill(self,"visitSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2103. messageSends: ["visitReceiver:", "first", "instructions", "nextPutAll:", ",", "asSelector", "selector", "stream", "do:separatedBy:", "visit:", "allButFirst"]}),
  2104. smalltalk.IRJSTranslator);
  2105. smalltalk.addMethod(
  2106. smalltalk.method({
  2107. selector: "visitSuperSend:",
  2108. fn: function (anIRSend){
  2109. var self=this;
  2110. return smalltalk.withContext(function($ctx1) {
  2111. var $1,$2;
  2112. $1=self._stream();
  2113. _st($1)._nextPutAll_(_st(self._currentClass())._asJavascript());
  2114. _st($1)._nextPutAll_(".superclass.fn.prototype.");
  2115. _st($1)._nextPutAll_(_st(_st(_st(anIRSend)._selector())._asSelector()).__comma(".apply("));
  2116. $2=_st($1)._nextPutAll_("_st(");
  2117. self._visit_(_st(_st(anIRSend)._instructions())._first());
  2118. _st(self._stream())._nextPutAll_("), [");
  2119. _st(_st(_st(anIRSend)._instructions())._allButFirst())._do_separatedBy_((function(each){
  2120. return smalltalk.withContext(function($ctx2) {
  2121. return self._visit_(each);
  2122. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2123. return smalltalk.withContext(function($ctx2) {
  2124. return _st(self._stream())._nextPutAll_(",");
  2125. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2126. _st(self._stream())._nextPutAll_("])");
  2127. return self}, function($ctx1) {$ctx1.fill(self,"visitSuperSend:",{anIRSend:anIRSend},smalltalk.IRJSTranslator)})},
  2128. messageSends: ["nextPutAll:", "asJavascript", "currentClass", "stream", ",", "asSelector", "selector", "visit:", "first", "instructions", "do:separatedBy:", "allButFirst"]}),
  2129. smalltalk.IRJSTranslator);
  2130. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  2131. smalltalk.addMethod(
  2132. smalltalk.method({
  2133. selector: "contents",
  2134. fn: function (){
  2135. var self=this;
  2136. return smalltalk.withContext(function($ctx1) {
  2137. var $1;
  2138. $1=_st(self["@stream"])._contents();
  2139. return $1;
  2140. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.JSStream)})},
  2141. messageSends: ["contents"]}),
  2142. smalltalk.JSStream);
  2143. smalltalk.addMethod(
  2144. smalltalk.method({
  2145. selector: "initialize",
  2146. fn: function (){
  2147. var self=this;
  2148. return smalltalk.withContext(function($ctx1) {
  2149. smalltalk.JSStream.superclass.fn.prototype._initialize.apply(_st(self), []);
  2150. self["@stream"]=""._writeStream();
  2151. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.JSStream)})},
  2152. messageSends: ["initialize", "writeStream"]}),
  2153. smalltalk.JSStream);
  2154. smalltalk.addMethod(
  2155. smalltalk.method({
  2156. selector: "lf",
  2157. fn: function (){
  2158. var self=this;
  2159. return smalltalk.withContext(function($ctx1) {
  2160. _st(self["@stream"])._lf();
  2161. return self}, function($ctx1) {$ctx1.fill(self,"lf",{},smalltalk.JSStream)})},
  2162. messageSends: ["lf"]}),
  2163. smalltalk.JSStream);
  2164. smalltalk.addMethod(
  2165. smalltalk.method({
  2166. selector: "nextPut:",
  2167. fn: function (aString){
  2168. var self=this;
  2169. return smalltalk.withContext(function($ctx1) {
  2170. _st(self["@stream"])._nextPut_(aString);
  2171. return self}, function($ctx1) {$ctx1.fill(self,"nextPut:",{aString:aString},smalltalk.JSStream)})},
  2172. messageSends: ["nextPut:"]}),
  2173. smalltalk.JSStream);
  2174. smalltalk.addMethod(
  2175. smalltalk.method({
  2176. selector: "nextPutAll:",
  2177. fn: function (aString){
  2178. var self=this;
  2179. return smalltalk.withContext(function($ctx1) {
  2180. _st(self["@stream"])._nextPutAll_(aString);
  2181. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAll:",{aString:aString},smalltalk.JSStream)})},
  2182. messageSends: ["nextPutAll:"]}),
  2183. smalltalk.JSStream);
  2184. smalltalk.addMethod(
  2185. smalltalk.method({
  2186. selector: "nextPutAssignment",
  2187. fn: function (){
  2188. var self=this;
  2189. return smalltalk.withContext(function($ctx1) {
  2190. _st(self["@stream"])._nextPutAll_("=");
  2191. return self}, function($ctx1) {$ctx1.fill(self,"nextPutAssignment",{},smalltalk.JSStream)})},
  2192. messageSends: ["nextPutAll:"]}),
  2193. smalltalk.JSStream);
  2194. smalltalk.addMethod(
  2195. smalltalk.method({
  2196. selector: "nextPutBlockContextFor:during:",
  2197. fn: function (anIRClosure,aBlock){
  2198. var self=this;
  2199. return smalltalk.withContext(function($ctx1) {
  2200. var $1,$2,$3,$4,$5,$6,$7,$8;
  2201. $1=self;
  2202. _st($1)._nextPutAll_(_st("return smalltalk.withContext(function(".__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2203. $2=_st($1)._lf();
  2204. _st(aBlock)._value();
  2205. $3=self;
  2206. _st($3)._nextPutAll_(_st("}, function(".__comma(_st(_st(anIRClosure)._scope())._alias())).__comma(") {"));
  2207. $4=_st($3)._nextPutAll_(_st(_st(_st(anIRClosure)._scope())._alias()).__comma(".fillBlock({"));
  2208. _st(_st(anIRClosure)._locals())._do_separatedBy_((function(each){
  2209. return smalltalk.withContext(function($ctx2) {
  2210. $5=self;
  2211. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2212. _st($5)._nextPutAll_(":");
  2213. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2214. return $6;
  2215. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2216. return smalltalk.withContext(function($ctx2) {
  2217. return self._nextPutAll_(",");
  2218. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2219. $7=self;
  2220. _st($7)._nextPutAll_("},");
  2221. $8=_st($7)._nextPutAll_(_st(_st(_st(_st(anIRClosure)._scope())._outerScope())._alias()).__comma(")})"));
  2222. return self}, function($ctx1) {$ctx1.fill(self,"nextPutBlockContextFor:during:",{anIRClosure:anIRClosure,aBlock:aBlock},smalltalk.JSStream)})},
  2223. messageSends: ["nextPutAll:", ",", "alias", "scope", "lf", "value", "do:separatedBy:", "asVariableName", "locals", "outerScope"]}),
  2224. smalltalk.JSStream);
  2225. smalltalk.addMethod(
  2226. smalltalk.method({
  2227. selector: "nextPutClassRefFunction:",
  2228. fn: function (aString){
  2229. var self=this;
  2230. return smalltalk.withContext(function($ctx1) {
  2231. var $1,$2;
  2232. $1=self["@stream"];
  2233. _st($1)._nextPutAll_("function $");
  2234. _st($1)._nextPutAll_(aString);
  2235. _st($1)._nextPutAll_("(){return smalltalk.");
  2236. _st($1)._nextPutAll_(aString);
  2237. _st($1)._nextPutAll_("||(typeof ");
  2238. _st($1)._nextPutAll_(aString);
  2239. _st($1)._nextPutAll_("==\x22undefined\x22?nil:");
  2240. _st($1)._nextPutAll_(aString);
  2241. _st($1)._nextPutAll_(")}");
  2242. $2=_st($1)._lf();
  2243. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClassRefFunction:",{aString:aString},smalltalk.JSStream)})},
  2244. messageSends: ["nextPutAll:", "lf"]}),
  2245. smalltalk.JSStream);
  2246. smalltalk.addMethod(
  2247. smalltalk.method({
  2248. selector: "nextPutClosureWith:arguments:",
  2249. fn: function (aBlock,anArray){
  2250. var self=this;
  2251. return smalltalk.withContext(function($ctx1) {
  2252. var $1,$2;
  2253. _st(self["@stream"])._nextPutAll_("(function(");
  2254. _st(anArray)._do_separatedBy_((function(each){
  2255. return smalltalk.withContext(function($ctx2) {
  2256. return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2257. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2258. return smalltalk.withContext(function($ctx2) {
  2259. return _st(self["@stream"])._nextPut_(",");
  2260. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2261. $1=self["@stream"];
  2262. _st($1)._nextPutAll_("){");
  2263. $2=_st($1)._lf();
  2264. _st(aBlock)._value();
  2265. _st(self["@stream"])._nextPutAll_("})");
  2266. return self}, function($ctx1) {$ctx1.fill(self,"nextPutClosureWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2267. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"]}),
  2268. smalltalk.JSStream);
  2269. smalltalk.addMethod(
  2270. smalltalk.method({
  2271. selector: "nextPutContextFor:during:",
  2272. fn: function (aMethod,aBlock){
  2273. var self=this;
  2274. return smalltalk.withContext(function($ctx1) {
  2275. var $1,$2,$3,$4,$5,$6,$7,$8;
  2276. $1=self;
  2277. _st($1)._nextPutAll_(_st("return smalltalk.withContext(function(".__comma(_st(_st(aMethod)._scope())._alias())).__comma(") { "));
  2278. $2=_st($1)._lf();
  2279. _st(aBlock)._value();
  2280. $3=self;
  2281. _st($3)._nextPutAll_(_st(_st("}, function(".__comma(_st(_st(aMethod)._scope())._alias())).__comma(") {")).__comma(_st(_st(aMethod)._scope())._alias()));
  2282. $4=_st($3)._nextPutAll_(_st(".fill(self,".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(",{"));
  2283. _st(_st(aMethod)._locals())._do_separatedBy_((function(each){
  2284. return smalltalk.withContext(function($ctx2) {
  2285. $5=self;
  2286. _st($5)._nextPutAll_(_st(each)._asVariableName());
  2287. _st($5)._nextPutAll_(":");
  2288. $6=_st($5)._nextPutAll_(_st(each)._asVariableName());
  2289. return $6;
  2290. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2291. return smalltalk.withContext(function($ctx2) {
  2292. return self._nextPutAll_(",");
  2293. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2294. $7=self;
  2295. _st($7)._nextPutAll_("},");
  2296. _st($7)._nextPutAll_(_st(_st(aMethod)._theClass())._asJavascript());
  2297. $8=_st($7)._nextPutAll_(")})");
  2298. return self}, function($ctx1) {$ctx1.fill(self,"nextPutContextFor:during:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  2299. messageSends: ["nextPutAll:", ",", "alias", "scope", "lf", "value", "asJavascript", "selector", "do:separatedBy:", "asVariableName", "locals", "theClass"]}),
  2300. smalltalk.JSStream);
  2301. smalltalk.addMethod(
  2302. smalltalk.method({
  2303. selector: "nextPutFunctionWith:arguments:",
  2304. fn: function (aBlock,anArray){
  2305. var self=this;
  2306. return smalltalk.withContext(function($ctx1) {
  2307. var $1,$2,$3,$4;
  2308. _st(self["@stream"])._nextPutAll_("fn: function(");
  2309. _st(anArray)._do_separatedBy_((function(each){
  2310. return smalltalk.withContext(function($ctx2) {
  2311. return _st(self["@stream"])._nextPutAll_(_st(each)._asVariableName());
  2312. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2313. return smalltalk.withContext(function($ctx2) {
  2314. return _st(self["@stream"])._nextPut_(",");
  2315. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2316. $1=self["@stream"];
  2317. _st($1)._nextPutAll_("){");
  2318. $2=_st($1)._lf();
  2319. $3=self["@stream"];
  2320. _st($3)._nextPutAll_("var self=this;");
  2321. $4=_st($3)._lf();
  2322. _st(aBlock)._value();
  2323. _st(self["@stream"])._nextPutAll_("}");
  2324. return self}, function($ctx1) {$ctx1.fill(self,"nextPutFunctionWith:arguments:",{aBlock:aBlock,anArray:anArray},smalltalk.JSStream)})},
  2325. messageSends: ["nextPutAll:", "do:separatedBy:", "asVariableName", "nextPut:", "lf", "value"]}),
  2326. smalltalk.JSStream);
  2327. smalltalk.addMethod(
  2328. smalltalk.method({
  2329. selector: "nextPutIf:with:",
  2330. fn: function (aBlock,anotherBlock){
  2331. var self=this;
  2332. return smalltalk.withContext(function($ctx1) {
  2333. var $1,$2;
  2334. _st(self["@stream"])._nextPutAll_("if(");
  2335. _st(aBlock)._value();
  2336. $1=self["@stream"];
  2337. _st($1)._nextPutAll_("){");
  2338. $2=_st($1)._lf();
  2339. _st(anotherBlock)._value();
  2340. _st(self["@stream"])._nextPutAll_("}");
  2341. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIf:with:",{aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSStream)})},
  2342. messageSends: ["nextPutAll:", "value", "lf"]}),
  2343. smalltalk.JSStream);
  2344. smalltalk.addMethod(
  2345. smalltalk.method({
  2346. selector: "nextPutIfElse:with:with:",
  2347. fn: function (aBlock,ifBlock,elseBlock){
  2348. var self=this;
  2349. return smalltalk.withContext(function($ctx1) {
  2350. var $1,$2,$3,$4;
  2351. _st(self["@stream"])._nextPutAll_("if(");
  2352. _st(aBlock)._value();
  2353. $1=self["@stream"];
  2354. _st($1)._nextPutAll_("){");
  2355. $2=_st($1)._lf();
  2356. _st(ifBlock)._value();
  2357. $3=self["@stream"];
  2358. _st($3)._nextPutAll_("} else {");
  2359. $4=_st($3)._lf();
  2360. _st(elseBlock)._value();
  2361. _st(self["@stream"])._nextPutAll_("}");
  2362. return self}, function($ctx1) {$ctx1.fill(self,"nextPutIfElse:with:with:",{aBlock:aBlock,ifBlock:ifBlock,elseBlock:elseBlock},smalltalk.JSStream)})},
  2363. messageSends: ["nextPutAll:", "value", "lf"]}),
  2364. smalltalk.JSStream);
  2365. smalltalk.addMethod(
  2366. smalltalk.method({
  2367. selector: "nextPutMethodDeclaration:with:",
  2368. fn: function (aMethod,aBlock){
  2369. var self=this;
  2370. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2371. return smalltalk.withContext(function($ctx1) {
  2372. var $1,$2,$3,$4,$5,$6;
  2373. $1=self["@stream"];
  2374. _st($1)._nextPutAll_("smalltalk.method({");
  2375. _st($1)._lf();
  2376. _st($1)._nextPutAll_(_st("selector: ".__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
  2377. _st($1)._lf();
  2378. _st($1)._nextPutAll_(_st("source: ".__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
  2379. $2=_st($1)._lf();
  2380. _st(aBlock)._value();
  2381. $3=self["@stream"];
  2382. _st($3)._nextPutAll_(_st(",".__comma(_st($String())._lf())).__comma("messageSends: "));
  2383. _st($3)._nextPutAll_(_st(_st(_st(_st(aMethod)._messageSends())._asArray())._asJavascript()).__comma(","));
  2384. _st($3)._lf();
  2385. _st($3)._nextPutAll_(_st("args: ".__comma(_st(_st(_st(_st(aMethod)._arguments())._collect_((function(each){
  2386. return smalltalk.withContext(function($ctx2) {
  2387. return _st(each)._value();
  2388. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._asArray())._asJavascript())).__comma(","));
  2389. _st($3)._lf();
  2390. $4=_st($3)._nextPutAll_("referencedClasses: [");
  2391. _st(_st(aMethod)._classReferences())._do_separatedBy_((function(each){
  2392. return smalltalk.withContext(function($ctx2) {
  2393. return _st(self["@stream"])._nextPutAll_(_st(each)._asJavascript());
  2394. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2395. return smalltalk.withContext(function($ctx2) {
  2396. return _st(self["@stream"])._nextPutAll_(",");
  2397. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2398. $5=self["@stream"];
  2399. _st($5)._nextPutAll_("]");
  2400. $6=_st($5)._nextPutAll_("})");
  2401. return self}, function($ctx1) {$ctx1.fill(self,"nextPutMethodDeclaration:with:",{aMethod:aMethod,aBlock:aBlock},smalltalk.JSStream)})},
  2402. messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"]}),
  2403. smalltalk.JSStream);
  2404. smalltalk.addMethod(
  2405. smalltalk.method({
  2406. selector: "nextPutNonLocalReturnHandlingWith:",
  2407. fn: function (aBlock){
  2408. var self=this;
  2409. return smalltalk.withContext(function($ctx1) {
  2410. var $1,$2,$3,$4;
  2411. $1=self["@stream"];
  2412. _st($1)._nextPutAll_("var $early={};");
  2413. _st($1)._lf();
  2414. _st($1)._nextPutAll_("try {");
  2415. $2=_st($1)._lf();
  2416. _st(aBlock)._value();
  2417. $3=self["@stream"];
  2418. _st($3)._nextPutAll_("}");
  2419. _st($3)._lf();
  2420. _st($3)._nextPutAll_("catch(e) {if(e===$early)return e[0]; throw e}");
  2421. $4=_st($3)._lf();
  2422. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnHandlingWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2423. messageSends: ["nextPutAll:", "lf", "value"]}),
  2424. smalltalk.JSStream);
  2425. smalltalk.addMethod(
  2426. smalltalk.method({
  2427. selector: "nextPutNonLocalReturnWith:",
  2428. fn: function (aBlock){
  2429. var self=this;
  2430. return smalltalk.withContext(function($ctx1) {
  2431. _st(self["@stream"])._nextPutAll_("throw $early=[");
  2432. _st(aBlock)._value();
  2433. _st(self["@stream"])._nextPutAll_("]");
  2434. return self}, function($ctx1) {$ctx1.fill(self,"nextPutNonLocalReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2435. messageSends: ["nextPutAll:", "value"]}),
  2436. smalltalk.JSStream);
  2437. smalltalk.addMethod(
  2438. smalltalk.method({
  2439. selector: "nextPutReturn",
  2440. fn: function (){
  2441. var self=this;
  2442. return smalltalk.withContext(function($ctx1) {
  2443. _st(self["@stream"])._nextPutAll_("return ");
  2444. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturn",{},smalltalk.JSStream)})},
  2445. messageSends: ["nextPutAll:"]}),
  2446. smalltalk.JSStream);
  2447. smalltalk.addMethod(
  2448. smalltalk.method({
  2449. selector: "nextPutReturnWith:",
  2450. fn: function (aBlock){
  2451. var self=this;
  2452. return smalltalk.withContext(function($ctx1) {
  2453. self._nextPutReturn();
  2454. _st(aBlock)._value();
  2455. return self}, function($ctx1) {$ctx1.fill(self,"nextPutReturnWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2456. messageSends: ["nextPutReturn", "value"]}),
  2457. smalltalk.JSStream);
  2458. smalltalk.addMethod(
  2459. smalltalk.method({
  2460. selector: "nextPutSequenceWith:",
  2461. fn: function (aBlock){
  2462. var self=this;
  2463. return smalltalk.withContext(function($ctx1) {
  2464. _st(aBlock)._value();
  2465. return self}, function($ctx1) {$ctx1.fill(self,"nextPutSequenceWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2466. messageSends: ["value"]}),
  2467. smalltalk.JSStream);
  2468. smalltalk.addMethod(
  2469. smalltalk.method({
  2470. selector: "nextPutStatement:with:",
  2471. fn: function (anInteger,aBlock){
  2472. var self=this;
  2473. return smalltalk.withContext(function($ctx1) {
  2474. var $1,$2,$3,$4;
  2475. $1=self["@stream"];
  2476. _st($1)._nextPutAll_(_st("case ".__comma(_st(anInteger)._asString())).__comma(":"));
  2477. $2=_st($1)._lf();
  2478. self._nextPutStatementWith_(aBlock);
  2479. $3=self["@stream"];
  2480. _st($3)._nextPutAll_(_st("smalltalk.thisContext.pc=".__comma(_st(_st(anInteger).__plus((1)))._asString())).__comma(";"));
  2481. $4=_st($3)._lf();
  2482. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatement:with:",{anInteger:anInteger,aBlock:aBlock},smalltalk.JSStream)})},
  2483. messageSends: ["nextPutAll:", ",", "asString", "lf", "nextPutStatementWith:", "+"]}),
  2484. smalltalk.JSStream);
  2485. smalltalk.addMethod(
  2486. smalltalk.method({
  2487. selector: "nextPutStatementWith:",
  2488. fn: function (aBlock){
  2489. var self=this;
  2490. return smalltalk.withContext(function($ctx1) {
  2491. var $1,$2;
  2492. _st(aBlock)._value();
  2493. $1=self["@stream"];
  2494. _st($1)._nextPutAll_(";");
  2495. $2=_st($1)._lf();
  2496. return self}, function($ctx1) {$ctx1.fill(self,"nextPutStatementWith:",{aBlock:aBlock},smalltalk.JSStream)})},
  2497. messageSends: ["value", "nextPutAll:", "lf"]}),
  2498. smalltalk.JSStream);
  2499. smalltalk.addMethod(
  2500. smalltalk.method({
  2501. selector: "nextPutVars:",
  2502. fn: function (aCollection){
  2503. var self=this;
  2504. return smalltalk.withContext(function($ctx1) {
  2505. var $1,$2,$3;
  2506. var $early={};
  2507. try {
  2508. _st(aCollection)._ifEmpty_((function(){
  2509. return smalltalk.withContext(function($ctx2) {
  2510. $1=self;
  2511. throw $early=[$1];
  2512. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2513. _st(self["@stream"])._nextPutAll_("var ");
  2514. _st(aCollection)._do_separatedBy_((function(each){
  2515. return smalltalk.withContext(function($ctx2) {
  2516. return _st(self["@stream"])._nextPutAll_(each);
  2517. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  2518. return smalltalk.withContext(function($ctx2) {
  2519. return _st(self["@stream"])._nextPutAll_(",");
  2520. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2521. $2=self["@stream"];
  2522. _st($2)._nextPutAll_(";");
  2523. $3=_st($2)._lf();
  2524. return self}
  2525. catch(e) {if(e===$early)return e[0]; throw e}
  2526. }, function($ctx1) {$ctx1.fill(self,"nextPutVars:",{aCollection:aCollection},smalltalk.JSStream)})},
  2527. messageSends: ["ifEmpty:", "nextPutAll:", "do:separatedBy:", "lf"]}),
  2528. smalltalk.JSStream);
  2529. smalltalk.addMethod(
  2530. smalltalk.method({
  2531. selector: "appendToInstruction:",
  2532. fn: function (anIRInstruction){
  2533. var self=this;
  2534. return smalltalk.withContext(function($ctx1) {
  2535. _st(anIRInstruction)._appendBlock_(self);
  2536. return self}, function($ctx1) {$ctx1.fill(self,"appendToInstruction:",{anIRInstruction:anIRInstruction},smalltalk.BlockClosure)})},
  2537. messageSends: ["appendBlock:"]}),
  2538. smalltalk.BlockClosure);
  2539. smalltalk.addMethod(
  2540. smalltalk.method({
  2541. selector: "asVariableName",
  2542. fn: function (){
  2543. var self=this;
  2544. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2545. return smalltalk.withContext(function($ctx1) {
  2546. var $2,$1;
  2547. $2=_st(_st(_st($Smalltalk())._current())._reservedWords())._includes_(self);
  2548. if(smalltalk.assert($2)){
  2549. $1=self.__comma("_");
  2550. } else {
  2551. $1=self;
  2552. };
  2553. return $1;
  2554. }, function($ctx1) {$ctx1.fill(self,"asVariableName",{},smalltalk.String)})},
  2555. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"]}),
  2556. smalltalk.String);