2
0

Compiler-IR.deploy.js 92 KB

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