Compiler-Inlining.js 93 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475
  1. define(["amber/boot", "amber_core/Compiler-Core", "amber_core/Compiler-IR", "amber_core/Compiler-Semantic", "amber_core/Kernel-Objects"], function($boot){"use strict";
  2. if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
  3. var $core=$boot.api,nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  4. if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
  5. $core.addPackage('Compiler-Inlining');
  6. $core.packages["Compiler-Inlining"].innerEval = function (expr) { return eval(expr); };
  7. $core.packages["Compiler-Inlining"].transport = {"type":"amd","amdNamespace":"amber_core"};
  8. $core.addClass('IRInlinedAssignment', $globals.IRAssignment, [], 'Compiler-Inlining');
  9. //>>excludeStart("ide", pragmas.excludeIdeData);
  10. $globals.IRInlinedAssignment.comment="I represent an inlined assignment instruction.";
  11. //>>excludeEnd("ide");
  12. $core.addMethod(
  13. $core.method({
  14. selector: "accept:",
  15. protocol: 'visiting',
  16. fn: function (aVisitor){
  17. var self=this;
  18. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  19. return $core.withContext(function($ctx1) {
  20. //>>excludeEnd("ctx");
  21. return $recv(aVisitor)._visitIRInlinedAssignment_(self);
  22. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  23. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedAssignment)});
  24. //>>excludeEnd("ctx");
  25. },
  26. //>>excludeStart("ide", pragmas.excludeIdeData);
  27. args: ["aVisitor"],
  28. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
  29. referencedClasses: [],
  30. //>>excludeEnd("ide");
  31. messageSends: ["visitIRInlinedAssignment:"]
  32. }),
  33. $globals.IRInlinedAssignment);
  34. $core.addMethod(
  35. $core.method({
  36. selector: "isInlined",
  37. protocol: 'testing',
  38. fn: function (){
  39. var self=this;
  40. return true;
  41. },
  42. //>>excludeStart("ide", pragmas.excludeIdeData);
  43. args: [],
  44. source: "isInlined\x0a\x09^ true",
  45. referencedClasses: [],
  46. //>>excludeEnd("ide");
  47. messageSends: []
  48. }),
  49. $globals.IRInlinedAssignment);
  50. $core.addClass('IRInlinedClosure', $globals.IRClosure, [], 'Compiler-Inlining');
  51. //>>excludeStart("ide", pragmas.excludeIdeData);
  52. $globals.IRInlinedClosure.comment="I represent an inlined closure instruction.";
  53. //>>excludeEnd("ide");
  54. $core.addMethod(
  55. $core.method({
  56. selector: "accept:",
  57. protocol: 'visiting',
  58. fn: function (aVisitor){
  59. var self=this;
  60. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  61. return $core.withContext(function($ctx1) {
  62. //>>excludeEnd("ctx");
  63. $recv(aVisitor)._visitIRInlinedClosure_(self);
  64. return self;
  65. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  66. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedClosure)});
  67. //>>excludeEnd("ctx");
  68. },
  69. //>>excludeStart("ide", pragmas.excludeIdeData);
  70. args: ["aVisitor"],
  71. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
  72. referencedClasses: [],
  73. //>>excludeEnd("ide");
  74. messageSends: ["visitIRInlinedClosure:"]
  75. }),
  76. $globals.IRInlinedClosure);
  77. $core.addMethod(
  78. $core.method({
  79. selector: "isInlined",
  80. protocol: 'testing',
  81. fn: function (){
  82. var self=this;
  83. return true;
  84. },
  85. //>>excludeStart("ide", pragmas.excludeIdeData);
  86. args: [],
  87. source: "isInlined\x0a\x09^ true",
  88. referencedClasses: [],
  89. //>>excludeEnd("ide");
  90. messageSends: []
  91. }),
  92. $globals.IRInlinedClosure);
  93. $core.addClass('IRInlinedReturn', $globals.IRReturn, [], 'Compiler-Inlining');
  94. //>>excludeStart("ide", pragmas.excludeIdeData);
  95. $globals.IRInlinedReturn.comment="I represent an inlined local return instruction.";
  96. //>>excludeEnd("ide");
  97. $core.addMethod(
  98. $core.method({
  99. selector: "accept:",
  100. protocol: 'visiting',
  101. fn: function (aVisitor){
  102. var self=this;
  103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  104. return $core.withContext(function($ctx1) {
  105. //>>excludeEnd("ctx");
  106. return $recv(aVisitor)._visitIRInlinedReturn_(self);
  107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  108. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedReturn)});
  109. //>>excludeEnd("ctx");
  110. },
  111. //>>excludeStart("ide", pragmas.excludeIdeData);
  112. args: ["aVisitor"],
  113. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
  114. referencedClasses: [],
  115. //>>excludeEnd("ide");
  116. messageSends: ["visitIRInlinedReturn:"]
  117. }),
  118. $globals.IRInlinedReturn);
  119. $core.addMethod(
  120. $core.method({
  121. selector: "isInlined",
  122. protocol: 'testing',
  123. fn: function (){
  124. var self=this;
  125. return true;
  126. },
  127. //>>excludeStart("ide", pragmas.excludeIdeData);
  128. args: [],
  129. source: "isInlined\x0a\x09^ true",
  130. referencedClasses: [],
  131. //>>excludeEnd("ide");
  132. messageSends: []
  133. }),
  134. $globals.IRInlinedReturn);
  135. $core.addClass('IRInlinedSend', $globals.IRSend, [], 'Compiler-Inlining');
  136. //>>excludeStart("ide", pragmas.excludeIdeData);
  137. $globals.IRInlinedSend.comment="I am the abstract super class of inlined message send instructions.";
  138. //>>excludeEnd("ide");
  139. $core.addMethod(
  140. $core.method({
  141. selector: "accept:",
  142. protocol: 'visiting',
  143. fn: function (aVisitor){
  144. var self=this;
  145. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  146. return $core.withContext(function($ctx1) {
  147. //>>excludeEnd("ctx");
  148. $recv(aVisitor)._visitInlinedSend_(self);
  149. return self;
  150. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  151. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedSend)});
  152. //>>excludeEnd("ctx");
  153. },
  154. //>>excludeStart("ide", pragmas.excludeIdeData);
  155. args: ["aVisitor"],
  156. source: "accept: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
  157. referencedClasses: [],
  158. //>>excludeEnd("ide");
  159. messageSends: ["visitInlinedSend:"]
  160. }),
  161. $globals.IRInlinedSend);
  162. $core.addMethod(
  163. $core.method({
  164. selector: "internalVariables",
  165. protocol: 'accessing',
  166. fn: function (){
  167. var self=this;
  168. return [];
  169. },
  170. //>>excludeStart("ide", pragmas.excludeIdeData);
  171. args: [],
  172. source: "internalVariables\x0a\x09\x22Answer a collection of internal variables required \x0a\x09to perform the inlining\x22\x0a\x09\x0a\x09^ #()",
  173. referencedClasses: [],
  174. //>>excludeEnd("ide");
  175. messageSends: []
  176. }),
  177. $globals.IRInlinedSend);
  178. $core.addMethod(
  179. $core.method({
  180. selector: "isInlined",
  181. protocol: 'testing',
  182. fn: function (){
  183. var self=this;
  184. return true;
  185. },
  186. //>>excludeStart("ide", pragmas.excludeIdeData);
  187. args: [],
  188. source: "isInlined\x0a\x09^ true",
  189. referencedClasses: [],
  190. //>>excludeEnd("ide");
  191. messageSends: []
  192. }),
  193. $globals.IRInlinedSend);
  194. $core.addClass('IRInlinedIfFalse', $globals.IRInlinedSend, [], 'Compiler-Inlining');
  195. //>>excludeStart("ide", pragmas.excludeIdeData);
  196. $globals.IRInlinedIfFalse.comment="I represent an inlined `#ifFalse:` message send instruction.";
  197. //>>excludeEnd("ide");
  198. $core.addMethod(
  199. $core.method({
  200. selector: "accept:",
  201. protocol: 'visiting',
  202. fn: function (aVisitor){
  203. var self=this;
  204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  205. return $core.withContext(function($ctx1) {
  206. //>>excludeEnd("ctx");
  207. $recv(aVisitor)._visitIRInlinedIfFalse_(self);
  208. return self;
  209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  210. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfFalse)});
  211. //>>excludeEnd("ctx");
  212. },
  213. //>>excludeStart("ide", pragmas.excludeIdeData);
  214. args: ["aVisitor"],
  215. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
  216. referencedClasses: [],
  217. //>>excludeEnd("ide");
  218. messageSends: ["visitIRInlinedIfFalse:"]
  219. }),
  220. $globals.IRInlinedIfFalse);
  221. $core.addClass('IRInlinedIfNilIfNotNil', $globals.IRInlinedSend, [], 'Compiler-Inlining');
  222. //>>excludeStart("ide", pragmas.excludeIdeData);
  223. $globals.IRInlinedIfNilIfNotNil.comment="I represent an inlined `#ifNil:ifNotNil:` message send instruction.";
  224. //>>excludeEnd("ide");
  225. $core.addMethod(
  226. $core.method({
  227. selector: "accept:",
  228. protocol: 'visiting',
  229. fn: function (aVisitor){
  230. var self=this;
  231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  232. return $core.withContext(function($ctx1) {
  233. //>>excludeEnd("ctx");
  234. $recv(aVisitor)._visitIRInlinedIfNilIfNotNil_(self);
  235. return self;
  236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  237. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfNilIfNotNil)});
  238. //>>excludeEnd("ctx");
  239. },
  240. //>>excludeStart("ide", pragmas.excludeIdeData);
  241. args: ["aVisitor"],
  242. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
  243. referencedClasses: [],
  244. //>>excludeEnd("ide");
  245. messageSends: ["visitIRInlinedIfNilIfNotNil:"]
  246. }),
  247. $globals.IRInlinedIfNilIfNotNil);
  248. $core.addMethod(
  249. $core.method({
  250. selector: "internalVariables",
  251. protocol: 'accessing',
  252. fn: function (){
  253. var self=this;
  254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  255. return $core.withContext(function($ctx1) {
  256. //>>excludeEnd("ctx");
  257. return $recv($globals.Array)._with_(self._receiverInternalVariable());
  258. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  259. }, function($ctx1) {$ctx1.fill(self,"internalVariables",{},$globals.IRInlinedIfNilIfNotNil)});
  260. //>>excludeEnd("ctx");
  261. },
  262. //>>excludeStart("ide", pragmas.excludeIdeData);
  263. args: [],
  264. source: "internalVariables\x0a\x09^ Array with: self receiverInternalVariable",
  265. referencedClasses: ["Array"],
  266. //>>excludeEnd("ide");
  267. messageSends: ["with:", "receiverInternalVariable"]
  268. }),
  269. $globals.IRInlinedIfNilIfNotNil);
  270. $core.addMethod(
  271. $core.method({
  272. selector: "receiverInternalVariable",
  273. protocol: 'accessing',
  274. fn: function (){
  275. var self=this;
  276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  277. return $core.withContext(function($ctx1) {
  278. //>>excludeEnd("ctx");
  279. var $1;
  280. $1=$recv($globals.IRVariable)._new();
  281. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  282. $ctx1.sendIdx["new"]=1;
  283. //>>excludeEnd("ctx");
  284. $recv($1)._variable_($recv($recv($globals.AliasVar)._new())._name_(self._receiverInternalVariableName()));
  285. return $recv($1)._yourself();
  286. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  287. }, function($ctx1) {$ctx1.fill(self,"receiverInternalVariable",{},$globals.IRInlinedIfNilIfNotNil)});
  288. //>>excludeEnd("ctx");
  289. },
  290. //>>excludeStart("ide", pragmas.excludeIdeData);
  291. args: [],
  292. source: "receiverInternalVariable\x0a\x09^ IRVariable new\x0a\x09\x09variable: (AliasVar new name: self receiverInternalVariableName);\x0a\x09\x09yourself.",
  293. referencedClasses: ["IRVariable", "AliasVar"],
  294. //>>excludeEnd("ide");
  295. messageSends: ["variable:", "new", "name:", "receiverInternalVariableName", "yourself"]
  296. }),
  297. $globals.IRInlinedIfNilIfNotNil);
  298. $core.addMethod(
  299. $core.method({
  300. selector: "receiverInternalVariableName",
  301. protocol: 'accessing',
  302. fn: function (){
  303. var self=this;
  304. return "$receiver";
  305. },
  306. //>>excludeStart("ide", pragmas.excludeIdeData);
  307. args: [],
  308. source: "receiverInternalVariableName\x0a\x09^ '$receiver'",
  309. referencedClasses: [],
  310. //>>excludeEnd("ide");
  311. messageSends: []
  312. }),
  313. $globals.IRInlinedIfNilIfNotNil);
  314. $core.addClass('IRInlinedIfTrue', $globals.IRInlinedSend, [], 'Compiler-Inlining');
  315. //>>excludeStart("ide", pragmas.excludeIdeData);
  316. $globals.IRInlinedIfTrue.comment="I represent an inlined `#ifTrue:` message send instruction.";
  317. //>>excludeEnd("ide");
  318. $core.addMethod(
  319. $core.method({
  320. selector: "accept:",
  321. protocol: 'visiting',
  322. fn: function (aVisitor){
  323. var self=this;
  324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  325. return $core.withContext(function($ctx1) {
  326. //>>excludeEnd("ctx");
  327. $recv(aVisitor)._visitIRInlinedIfTrue_(self);
  328. return self;
  329. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  330. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfTrue)});
  331. //>>excludeEnd("ctx");
  332. },
  333. //>>excludeStart("ide", pragmas.excludeIdeData);
  334. args: ["aVisitor"],
  335. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
  336. referencedClasses: [],
  337. //>>excludeEnd("ide");
  338. messageSends: ["visitIRInlinedIfTrue:"]
  339. }),
  340. $globals.IRInlinedIfTrue);
  341. $core.addClass('IRInlinedIfTrueIfFalse', $globals.IRInlinedSend, [], 'Compiler-Inlining');
  342. //>>excludeStart("ide", pragmas.excludeIdeData);
  343. $globals.IRInlinedIfTrueIfFalse.comment="I represent an inlined `#ifTrue:ifFalse:` message send instruction.";
  344. //>>excludeEnd("ide");
  345. $core.addMethod(
  346. $core.method({
  347. selector: "accept:",
  348. protocol: 'visiting',
  349. fn: function (aVisitor){
  350. var self=this;
  351. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  352. return $core.withContext(function($ctx1) {
  353. //>>excludeEnd("ctx");
  354. $recv(aVisitor)._visitIRInlinedIfTrueIfFalse_(self);
  355. return self;
  356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  357. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedIfTrueIfFalse)});
  358. //>>excludeEnd("ctx");
  359. },
  360. //>>excludeStart("ide", pragmas.excludeIdeData);
  361. args: ["aVisitor"],
  362. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
  363. referencedClasses: [],
  364. //>>excludeEnd("ide");
  365. messageSends: ["visitIRInlinedIfTrueIfFalse:"]
  366. }),
  367. $globals.IRInlinedIfTrueIfFalse);
  368. $core.addClass('IRInlinedSequence', $globals.IRBlockSequence, [], 'Compiler-Inlining');
  369. //>>excludeStart("ide", pragmas.excludeIdeData);
  370. $globals.IRInlinedSequence.comment="I represent a (block) sequence inside an inlined closure instruction (instance of `IRInlinedClosure`).";
  371. //>>excludeEnd("ide");
  372. $core.addMethod(
  373. $core.method({
  374. selector: "accept:",
  375. protocol: 'visiting',
  376. fn: function (aVisitor){
  377. var self=this;
  378. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  379. return $core.withContext(function($ctx1) {
  380. //>>excludeEnd("ctx");
  381. $recv(aVisitor)._visitIRInlinedSequence_(self);
  382. return self;
  383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  384. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},$globals.IRInlinedSequence)});
  385. //>>excludeEnd("ctx");
  386. },
  387. //>>excludeStart("ide", pragmas.excludeIdeData);
  388. args: ["aVisitor"],
  389. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
  390. referencedClasses: [],
  391. //>>excludeEnd("ide");
  392. messageSends: ["visitIRInlinedSequence:"]
  393. }),
  394. $globals.IRInlinedSequence);
  395. $core.addMethod(
  396. $core.method({
  397. selector: "isInlined",
  398. protocol: 'testing',
  399. fn: function (){
  400. var self=this;
  401. return true;
  402. },
  403. //>>excludeStart("ide", pragmas.excludeIdeData);
  404. args: [],
  405. source: "isInlined\x0a\x09^ true",
  406. referencedClasses: [],
  407. //>>excludeEnd("ide");
  408. messageSends: []
  409. }),
  410. $globals.IRInlinedSequence);
  411. $core.addClass('IRInliner', $globals.IRVisitor, [], 'Compiler-Inlining');
  412. //>>excludeStart("ide", pragmas.excludeIdeData);
  413. $globals.IRInliner.comment="I visit an IR tree, inlining message sends and block closures.\x0a\x0aMessage selectors that can be inlined are answered by `IRSendInliner >> #inlinedSelectors`";
  414. //>>excludeEnd("ide");
  415. $core.addMethod(
  416. $core.method({
  417. selector: "assignmentInliner",
  418. protocol: 'factory',
  419. fn: function (){
  420. var self=this;
  421. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  422. return $core.withContext(function($ctx1) {
  423. //>>excludeEnd("ctx");
  424. var $1;
  425. $1=$recv($globals.IRAssignmentInliner)._new();
  426. $recv($1)._translator_(self);
  427. return $recv($1)._yourself();
  428. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  429. }, function($ctx1) {$ctx1.fill(self,"assignmentInliner",{},$globals.IRInliner)});
  430. //>>excludeEnd("ctx");
  431. },
  432. //>>excludeStart("ide", pragmas.excludeIdeData);
  433. args: [],
  434. source: "assignmentInliner\x0a\x09^ IRAssignmentInliner new\x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  435. referencedClasses: ["IRAssignmentInliner"],
  436. //>>excludeEnd("ide");
  437. messageSends: ["translator:", "new", "yourself"]
  438. }),
  439. $globals.IRInliner);
  440. $core.addMethod(
  441. $core.method({
  442. selector: "returnInliner",
  443. protocol: 'factory',
  444. fn: function (){
  445. var self=this;
  446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  447. return $core.withContext(function($ctx1) {
  448. //>>excludeEnd("ctx");
  449. var $1;
  450. $1=$recv($globals.IRReturnInliner)._new();
  451. $recv($1)._translator_(self);
  452. return $recv($1)._yourself();
  453. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  454. }, function($ctx1) {$ctx1.fill(self,"returnInliner",{},$globals.IRInliner)});
  455. //>>excludeEnd("ctx");
  456. },
  457. //>>excludeStart("ide", pragmas.excludeIdeData);
  458. args: [],
  459. source: "returnInliner\x0a\x09^ IRReturnInliner new\x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  460. referencedClasses: ["IRReturnInliner"],
  461. //>>excludeEnd("ide");
  462. messageSends: ["translator:", "new", "yourself"]
  463. }),
  464. $globals.IRInliner);
  465. $core.addMethod(
  466. $core.method({
  467. selector: "sendInliner",
  468. protocol: 'factory',
  469. fn: function (){
  470. var self=this;
  471. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  472. return $core.withContext(function($ctx1) {
  473. //>>excludeEnd("ctx");
  474. var $1;
  475. $1=$recv($globals.IRSendInliner)._new();
  476. $recv($1)._translator_(self);
  477. return $recv($1)._yourself();
  478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  479. }, function($ctx1) {$ctx1.fill(self,"sendInliner",{},$globals.IRInliner)});
  480. //>>excludeEnd("ctx");
  481. },
  482. //>>excludeStart("ide", pragmas.excludeIdeData);
  483. args: [],
  484. source: "sendInliner\x0a\x09^ IRSendInliner new\x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  485. referencedClasses: ["IRSendInliner"],
  486. //>>excludeEnd("ide");
  487. messageSends: ["translator:", "new", "yourself"]
  488. }),
  489. $globals.IRInliner);
  490. $core.addMethod(
  491. $core.method({
  492. selector: "shouldInlineAssignment:",
  493. protocol: 'testing',
  494. fn: function (anIRAssignment){
  495. var self=this;
  496. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  497. return $core.withContext(function($ctx1) {
  498. //>>excludeEnd("ctx");
  499. var $3,$2,$1;
  500. $1=$recv($recv($recv(anIRAssignment)._isInlined())._not())._and_((function(){
  501. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  502. return $core.withContext(function($ctx2) {
  503. //>>excludeEnd("ctx");
  504. $3=$recv(anIRAssignment)._right();
  505. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  506. $ctx2.sendIdx["right"]=1;
  507. //>>excludeEnd("ctx");
  508. $2=$recv($3)._isSend();
  509. return $recv($2)._and_((function(){
  510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  511. return $core.withContext(function($ctx3) {
  512. //>>excludeEnd("ctx");
  513. return self._shouldInlineSend_($recv(anIRAssignment)._right());
  514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  515. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  516. //>>excludeEnd("ctx");
  517. }));
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  520. //>>excludeEnd("ctx");
  521. }));
  522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  523. $ctx1.sendIdx["and:"]=1;
  524. //>>excludeEnd("ctx");
  525. return $1;
  526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  527. }, function($ctx1) {$ctx1.fill(self,"shouldInlineAssignment:",{anIRAssignment:anIRAssignment},$globals.IRInliner)});
  528. //>>excludeEnd("ctx");
  529. },
  530. //>>excludeStart("ide", pragmas.excludeIdeData);
  531. args: ["anIRAssignment"],
  532. source: "shouldInlineAssignment: anIRAssignment\x0a\x09^ anIRAssignment isInlined not and: [\x0a\x09\x09anIRAssignment right isSend and: [\x0a\x09\x09\x09self shouldInlineSend: anIRAssignment right ]]",
  533. referencedClasses: [],
  534. //>>excludeEnd("ide");
  535. messageSends: ["and:", "not", "isInlined", "isSend", "right", "shouldInlineSend:"]
  536. }),
  537. $globals.IRInliner);
  538. $core.addMethod(
  539. $core.method({
  540. selector: "shouldInlineReturn:",
  541. protocol: 'testing',
  542. fn: function (anIRReturn){
  543. var self=this;
  544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  545. return $core.withContext(function($ctx1) {
  546. //>>excludeEnd("ctx");
  547. var $1;
  548. $1=$recv($recv($recv(anIRReturn)._isInlined())._not())._and_((function(){
  549. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  550. return $core.withContext(function($ctx2) {
  551. //>>excludeEnd("ctx");
  552. return $recv($recv($recv($recv(anIRReturn)._instructions())._single())._isSend())._and_((function(){
  553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  554. return $core.withContext(function($ctx3) {
  555. //>>excludeEnd("ctx");
  556. return self._shouldInlineSend_($recv(anIRReturn)._expression());
  557. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  558. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  559. //>>excludeEnd("ctx");
  560. }));
  561. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  562. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  563. //>>excludeEnd("ctx");
  564. }));
  565. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  566. $ctx1.sendIdx["and:"]=1;
  567. //>>excludeEnd("ctx");
  568. return $1;
  569. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  570. }, function($ctx1) {$ctx1.fill(self,"shouldInlineReturn:",{anIRReturn:anIRReturn},$globals.IRInliner)});
  571. //>>excludeEnd("ctx");
  572. },
  573. //>>excludeStart("ide", pragmas.excludeIdeData);
  574. args: ["anIRReturn"],
  575. source: "shouldInlineReturn: anIRReturn\x0a\x09^ anIRReturn isInlined not and: [\x0a\x09\x09anIRReturn instructions single isSend and: [\x0a\x09\x09\x09self shouldInlineSend: anIRReturn expression ]]",
  576. referencedClasses: [],
  577. //>>excludeEnd("ide");
  578. messageSends: ["and:", "not", "isInlined", "isSend", "single", "instructions", "shouldInlineSend:", "expression"]
  579. }),
  580. $globals.IRInliner);
  581. $core.addMethod(
  582. $core.method({
  583. selector: "shouldInlineSend:",
  584. protocol: 'testing',
  585. fn: function (anIRSend){
  586. var self=this;
  587. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  588. return $core.withContext(function($ctx1) {
  589. //>>excludeEnd("ctx");
  590. return $recv($recv($recv(anIRSend)._isInlined())._not())._and_((function(){
  591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  592. return $core.withContext(function($ctx2) {
  593. //>>excludeEnd("ctx");
  594. return $recv($globals.IRSendInliner)._shouldInline_(anIRSend);
  595. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  596. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  597. //>>excludeEnd("ctx");
  598. }));
  599. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  600. }, function($ctx1) {$ctx1.fill(self,"shouldInlineSend:",{anIRSend:anIRSend},$globals.IRInliner)});
  601. //>>excludeEnd("ctx");
  602. },
  603. //>>excludeStart("ide", pragmas.excludeIdeData);
  604. args: ["anIRSend"],
  605. source: "shouldInlineSend: anIRSend\x0a\x09^ anIRSend isInlined not and: [\x0a\x09\x09IRSendInliner shouldInline: anIRSend ]",
  606. referencedClasses: ["IRSendInliner"],
  607. //>>excludeEnd("ide");
  608. messageSends: ["and:", "not", "isInlined", "shouldInline:"]
  609. }),
  610. $globals.IRInliner);
  611. $core.addMethod(
  612. $core.method({
  613. selector: "transformNonLocalReturn:",
  614. protocol: 'visiting',
  615. fn: function (anIRNonLocalReturn){
  616. var self=this;
  617. var localReturn;
  618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  619. return $core.withContext(function($ctx1) {
  620. //>>excludeEnd("ctx");
  621. var $2,$1,$4,$3,$5,$6,$7;
  622. $2=$recv(anIRNonLocalReturn)._scope();
  623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  624. $ctx1.sendIdx["scope"]=1;
  625. //>>excludeEnd("ctx");
  626. $1=$recv($2)._canInlineNonLocalReturns();
  627. if($core.assert($1)){
  628. $4=$recv(anIRNonLocalReturn)._scope();
  629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  630. $ctx1.sendIdx["scope"]=2;
  631. //>>excludeEnd("ctx");
  632. $3=$recv($4)._methodScope();
  633. $5=$recv(anIRNonLocalReturn)._scope();
  634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  635. $ctx1.sendIdx["scope"]=3;
  636. //>>excludeEnd("ctx");
  637. $recv($3)._removeNonLocalReturn_($5);
  638. $6=$recv($globals.IRReturn)._new();
  639. $recv($6)._scope_($recv(anIRNonLocalReturn)._scope());
  640. localReturn=$recv($6)._yourself();
  641. localReturn;
  642. $recv($recv(anIRNonLocalReturn)._instructions())._do_((function(each){
  643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  644. return $core.withContext(function($ctx2) {
  645. //>>excludeEnd("ctx");
  646. return $recv(localReturn)._add_(each);
  647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  648. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  649. //>>excludeEnd("ctx");
  650. }));
  651. $recv(anIRNonLocalReturn)._replaceWith_(localReturn);
  652. return localReturn;
  653. };
  654. $7=(
  655. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  656. $ctx1.supercall = true,
  657. //>>excludeEnd("ctx");
  658. ($globals.IRInliner.superclass||$boot.nilAsClass).fn.prototype._visitIRNonLocalReturn_.apply($recv(self), [anIRNonLocalReturn]));
  659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  660. $ctx1.supercall = false;
  661. //>>excludeEnd("ctx");;
  662. return $7;
  663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  664. }, function($ctx1) {$ctx1.fill(self,"transformNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn,localReturn:localReturn},$globals.IRInliner)});
  665. //>>excludeEnd("ctx");
  666. },
  667. //>>excludeStart("ide", pragmas.excludeIdeData);
  668. args: ["anIRNonLocalReturn"],
  669. source: "transformNonLocalReturn: anIRNonLocalReturn\x0a\x09\x22Replace a non local return into a local return\x22\x0a\x0a\x09| localReturn |\x0a\x09anIRNonLocalReturn scope canInlineNonLocalReturns ifTrue: [\x0a\x09\x09anIRNonLocalReturn scope methodScope removeNonLocalReturn: anIRNonLocalReturn scope.\x0a\x09\x09localReturn := IRReturn new\x0a\x09\x09\x09scope: anIRNonLocalReturn scope;\x0a\x09\x09\x09yourself.\x0a\x09\x09anIRNonLocalReturn instructions do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: anIRNonLocalReturn",
  670. referencedClasses: ["IRReturn"],
  671. //>>excludeEnd("ide");
  672. messageSends: ["ifTrue:", "canInlineNonLocalReturns", "scope", "removeNonLocalReturn:", "methodScope", "scope:", "new", "yourself", "do:", "instructions", "add:", "replaceWith:", "visitIRNonLocalReturn:"]
  673. }),
  674. $globals.IRInliner);
  675. $core.addMethod(
  676. $core.method({
  677. selector: "visitIRAssignment:",
  678. protocol: 'visiting',
  679. fn: function (anIRAssignment){
  680. var self=this;
  681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  682. return $core.withContext(function($ctx1) {
  683. //>>excludeEnd("ctx");
  684. var $1;
  685. $1=self._shouldInlineAssignment_(anIRAssignment);
  686. if($core.assert($1)){
  687. return $recv(self._assignmentInliner())._inlineAssignment_(anIRAssignment);
  688. } else {
  689. return (
  690. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  691. $ctx1.supercall = true,
  692. //>>excludeEnd("ctx");
  693. ($globals.IRInliner.superclass||$boot.nilAsClass).fn.prototype._visitIRAssignment_.apply($recv(self), [anIRAssignment]));
  694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  695. $ctx1.supercall = false;
  696. //>>excludeEnd("ctx");;
  697. };
  698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  699. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment},$globals.IRInliner)});
  700. //>>excludeEnd("ctx");
  701. },
  702. //>>excludeStart("ide", pragmas.excludeIdeData);
  703. args: ["anIRAssignment"],
  704. source: "visitIRAssignment: anIRAssignment\x0a\x09^ (self shouldInlineAssignment: anIRAssignment)\x0a\x09\x09ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]\x0a\x09\x09ifFalse: [ super visitIRAssignment: anIRAssignment ]",
  705. referencedClasses: [],
  706. //>>excludeEnd("ide");
  707. messageSends: ["ifTrue:ifFalse:", "shouldInlineAssignment:", "inlineAssignment:", "assignmentInliner", "visitIRAssignment:"]
  708. }),
  709. $globals.IRInliner);
  710. $core.addMethod(
  711. $core.method({
  712. selector: "visitIRNonLocalReturn:",
  713. protocol: 'visiting',
  714. fn: function (anIRNonLocalReturn){
  715. var self=this;
  716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  717. return $core.withContext(function($ctx1) {
  718. //>>excludeEnd("ctx");
  719. return self._transformNonLocalReturn_(anIRNonLocalReturn);
  720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  721. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn},$globals.IRInliner)});
  722. //>>excludeEnd("ctx");
  723. },
  724. //>>excludeStart("ide", pragmas.excludeIdeData);
  725. args: ["anIRNonLocalReturn"],
  726. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ self transformNonLocalReturn: anIRNonLocalReturn",
  727. referencedClasses: [],
  728. //>>excludeEnd("ide");
  729. messageSends: ["transformNonLocalReturn:"]
  730. }),
  731. $globals.IRInliner);
  732. $core.addMethod(
  733. $core.method({
  734. selector: "visitIRReturn:",
  735. protocol: 'visiting',
  736. fn: function (anIRReturn){
  737. var self=this;
  738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  739. return $core.withContext(function($ctx1) {
  740. //>>excludeEnd("ctx");
  741. var $1;
  742. $1=self._shouldInlineReturn_(anIRReturn);
  743. if($core.assert($1)){
  744. return $recv(self._returnInliner())._inlineReturn_(anIRReturn);
  745. } else {
  746. return (
  747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  748. $ctx1.supercall = true,
  749. //>>excludeEnd("ctx");
  750. ($globals.IRInliner.superclass||$boot.nilAsClass).fn.prototype._visitIRReturn_.apply($recv(self), [anIRReturn]));
  751. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  752. $ctx1.supercall = false;
  753. //>>excludeEnd("ctx");;
  754. };
  755. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  756. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn},$globals.IRInliner)});
  757. //>>excludeEnd("ctx");
  758. },
  759. //>>excludeStart("ide", pragmas.excludeIdeData);
  760. args: ["anIRReturn"],
  761. source: "visitIRReturn: anIRReturn\x0a\x09^ (self shouldInlineReturn: anIRReturn)\x0a\x09\x09ifTrue: [ self returnInliner inlineReturn: anIRReturn ]\x0a\x09\x09ifFalse: [ super visitIRReturn: anIRReturn ]",
  762. referencedClasses: [],
  763. //>>excludeEnd("ide");
  764. messageSends: ["ifTrue:ifFalse:", "shouldInlineReturn:", "inlineReturn:", "returnInliner", "visitIRReturn:"]
  765. }),
  766. $globals.IRInliner);
  767. $core.addMethod(
  768. $core.method({
  769. selector: "visitIRSend:",
  770. protocol: 'visiting',
  771. fn: function (anIRSend){
  772. var self=this;
  773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  774. return $core.withContext(function($ctx1) {
  775. //>>excludeEnd("ctx");
  776. var $1;
  777. $1=self._shouldInlineSend_(anIRSend);
  778. if($core.assert($1)){
  779. return $recv(self._sendInliner())._inlineSend_(anIRSend);
  780. } else {
  781. return (
  782. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  783. $ctx1.supercall = true,
  784. //>>excludeEnd("ctx");
  785. ($globals.IRInliner.superclass||$boot.nilAsClass).fn.prototype._visitIRSend_.apply($recv(self), [anIRSend]));
  786. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  787. $ctx1.supercall = false;
  788. //>>excludeEnd("ctx");;
  789. };
  790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  791. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend},$globals.IRInliner)});
  792. //>>excludeEnd("ctx");
  793. },
  794. //>>excludeStart("ide", pragmas.excludeIdeData);
  795. args: ["anIRSend"],
  796. source: "visitIRSend: anIRSend\x0a\x09^ (self shouldInlineSend: anIRSend)\x0a\x09\x09ifTrue: [ self sendInliner inlineSend: anIRSend ]\x0a\x09\x09ifFalse: [ super visitIRSend: anIRSend ]",
  797. referencedClasses: [],
  798. //>>excludeEnd("ide");
  799. messageSends: ["ifTrue:ifFalse:", "shouldInlineSend:", "inlineSend:", "sendInliner", "visitIRSend:"]
  800. }),
  801. $globals.IRInliner);
  802. $core.addClass('IRInliningJSTranslator', $globals.IRJSTranslator, [], 'Compiler-Inlining');
  803. //>>excludeStart("ide", pragmas.excludeIdeData);
  804. $globals.IRInliningJSTranslator.comment="I am a specialized JavaScript translator able to write inlined IR instructions to JavaScript stream (`JSStream` instance).";
  805. //>>excludeEnd("ide");
  806. $core.addMethod(
  807. $core.method({
  808. selector: "visitIRInlinedAssignment:",
  809. protocol: 'visiting',
  810. fn: function (anIRInlinedAssignment){
  811. var self=this;
  812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  813. return $core.withContext(function($ctx1) {
  814. //>>excludeEnd("ctx");
  815. self._visit_($recv(anIRInlinedAssignment)._right());
  816. return self;
  817. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  818. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedAssignment:",{anIRInlinedAssignment:anIRInlinedAssignment},$globals.IRInliningJSTranslator)});
  819. //>>excludeEnd("ctx");
  820. },
  821. //>>excludeStart("ide", pragmas.excludeIdeData);
  822. args: ["anIRInlinedAssignment"],
  823. source: "visitIRInlinedAssignment: anIRInlinedAssignment\x0a\x09self visit: anIRInlinedAssignment right",
  824. referencedClasses: [],
  825. //>>excludeEnd("ide");
  826. messageSends: ["visit:", "right"]
  827. }),
  828. $globals.IRInliningJSTranslator);
  829. $core.addMethod(
  830. $core.method({
  831. selector: "visitIRInlinedClosure:",
  832. protocol: 'visiting',
  833. fn: function (anIRInlinedClosure){
  834. var self=this;
  835. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  836. return $core.withContext(function($ctx1) {
  837. //>>excludeEnd("ctx");
  838. $recv(self._stream())._nextPutVars_($recv($recv(anIRInlinedClosure)._tempDeclarations())._collect_((function(each){
  839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  840. return $core.withContext(function($ctx2) {
  841. //>>excludeEnd("ctx");
  842. return $recv($recv(each)._name())._asVariableName();
  843. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  844. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  845. //>>excludeEnd("ctx");
  846. })));
  847. $recv($recv(anIRInlinedClosure)._instructions())._do_((function(each){
  848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  849. return $core.withContext(function($ctx2) {
  850. //>>excludeEnd("ctx");
  851. return self._visit_(each);
  852. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  853. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  854. //>>excludeEnd("ctx");
  855. }));
  856. return self;
  857. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  858. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure},$globals.IRInliningJSTranslator)});
  859. //>>excludeEnd("ctx");
  860. },
  861. //>>excludeStart("ide", pragmas.excludeIdeData);
  862. args: ["anIRInlinedClosure"],
  863. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09self stream nextPutVars: (anIRInlinedClosure tempDeclarations collect: [ :each |\x0a\x09\x09each name asVariableName ]).\x0a\x09anIRInlinedClosure instructions do: [ :each |\x0a\x09\x09self visit: each ]",
  864. referencedClasses: [],
  865. //>>excludeEnd("ide");
  866. messageSends: ["nextPutVars:", "stream", "collect:", "tempDeclarations", "asVariableName", "name", "do:", "instructions", "visit:"]
  867. }),
  868. $globals.IRInliningJSTranslator);
  869. $core.addMethod(
  870. $core.method({
  871. selector: "visitIRInlinedIfFalse:",
  872. protocol: 'visiting',
  873. fn: function (anIRInlinedIfFalse){
  874. var self=this;
  875. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  876. return $core.withContext(function($ctx1) {
  877. //>>excludeEnd("ctx");
  878. var $1,$2,$4,$3;
  879. $1=self._stream();
  880. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  881. $ctx1.sendIdx["stream"]=1;
  882. //>>excludeEnd("ctx");
  883. $recv($1)._nextPutIf_then_((function(){
  884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  885. return $core.withContext(function($ctx2) {
  886. //>>excludeEnd("ctx");
  887. $2=self._stream();
  888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  889. $ctx2.sendIdx["stream"]=2;
  890. //>>excludeEnd("ctx");
  891. $recv($2)._nextPutAll_("!$core.assert(");
  892. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  893. $ctx2.sendIdx["nextPutAll:"]=1;
  894. //>>excludeEnd("ctx");
  895. $4=$recv(anIRInlinedIfFalse)._instructions();
  896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  897. $ctx2.sendIdx["instructions"]=1;
  898. //>>excludeEnd("ctx");
  899. $3=$recv($4)._first();
  900. self._visit_($3);
  901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  902. $ctx2.sendIdx["visit:"]=1;
  903. //>>excludeEnd("ctx");
  904. return $recv(self._stream())._nextPutAll_(")");
  905. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  906. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  907. //>>excludeEnd("ctx");
  908. }),(function(){
  909. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  910. return $core.withContext(function($ctx2) {
  911. //>>excludeEnd("ctx");
  912. return self._visit_($recv($recv(anIRInlinedIfFalse)._instructions())._last());
  913. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  914. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  915. //>>excludeEnd("ctx");
  916. }));
  917. return self;
  918. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  919. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfFalse:",{anIRInlinedIfFalse:anIRInlinedIfFalse},$globals.IRInliningJSTranslator)});
  920. //>>excludeEnd("ctx");
  921. },
  922. //>>excludeStart("ide", pragmas.excludeIdeData);
  923. args: ["anIRInlinedIfFalse"],
  924. source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '!$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfFalse instructions last ]",
  925. referencedClasses: [],
  926. //>>excludeEnd("ide");
  927. messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
  928. }),
  929. $globals.IRInliningJSTranslator);
  930. $core.addMethod(
  931. $core.method({
  932. selector: "visitIRInlinedIfNilIfNotNil:",
  933. protocol: 'visiting',
  934. fn: function (anIRInlinedIfNilIfNotNil){
  935. var self=this;
  936. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  937. return $core.withContext(function($ctx1) {
  938. //>>excludeEnd("ctx");
  939. var $1,$2,$4,$3,$6,$5,$7,$8,$10,$9;
  940. $1=self._stream();
  941. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  942. $ctx1.sendIdx["stream"]=1;
  943. //>>excludeEnd("ctx");
  944. $recv($1)._nextPutIf_then_else_((function(){
  945. var recvVarName;
  946. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  947. return $core.withContext(function($ctx2) {
  948. //>>excludeEnd("ctx");
  949. recvVarName=$recv(anIRInlinedIfNilIfNotNil)._receiverInternalVariableName();
  950. recvVarName;
  951. $2=self._stream();
  952. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  953. $ctx2.sendIdx["stream"]=2;
  954. //>>excludeEnd("ctx");
  955. $4="(".__comma(recvVarName);
  956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  957. $ctx2.sendIdx[","]=2;
  958. //>>excludeEnd("ctx");
  959. $3=$recv($4).__comma(" = ");
  960. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  961. $ctx2.sendIdx[","]=1;
  962. //>>excludeEnd("ctx");
  963. $recv($2)._nextPutAll_($3);
  964. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  965. $ctx2.sendIdx["nextPutAll:"]=1;
  966. //>>excludeEnd("ctx");
  967. $6=$recv(anIRInlinedIfNilIfNotNil)._instructions();
  968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  969. $ctx2.sendIdx["instructions"]=1;
  970. //>>excludeEnd("ctx");
  971. $5=$recv($6)._first();
  972. self._visit_($5);
  973. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  974. $ctx2.sendIdx["visit:"]=1;
  975. //>>excludeEnd("ctx");
  976. $7=self._stream();
  977. $8=$recv(") == null || ".__comma(recvVarName)).__comma(".isNil");
  978. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  979. $ctx2.sendIdx[","]=3;
  980. //>>excludeEnd("ctx");
  981. return $recv($7)._nextPutAll_($8);
  982. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  983. }, function($ctx2) {$ctx2.fillBlock({recvVarName:recvVarName},$ctx1,1)});
  984. //>>excludeEnd("ctx");
  985. }),(function(){
  986. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  987. return $core.withContext(function($ctx2) {
  988. //>>excludeEnd("ctx");
  989. $10=$recv(anIRInlinedIfNilIfNotNil)._instructions();
  990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  991. $ctx2.sendIdx["instructions"]=2;
  992. //>>excludeEnd("ctx");
  993. $9=$recv($10)._second();
  994. return self._visit_($9);
  995. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  996. $ctx2.sendIdx["visit:"]=2;
  997. //>>excludeEnd("ctx");
  998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  999. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1000. //>>excludeEnd("ctx");
  1001. }),(function(){
  1002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1003. return $core.withContext(function($ctx2) {
  1004. //>>excludeEnd("ctx");
  1005. return self._visit_($recv($recv(anIRInlinedIfNilIfNotNil)._instructions())._third());
  1006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1007. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1008. //>>excludeEnd("ctx");
  1009. }));
  1010. return self;
  1011. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1012. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfNilIfNotNil:",{anIRInlinedIfNilIfNotNil:anIRInlinedIfNilIfNotNil},$globals.IRInliningJSTranslator)});
  1013. //>>excludeEnd("ctx");
  1014. },
  1015. //>>excludeStart("ide", pragmas.excludeIdeData);
  1016. args: ["anIRInlinedIfNilIfNotNil"],
  1017. source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09| recvVarName |\x0a\x09\x09\x09recvVarName := anIRInlinedIfNilIfNotNil receiverInternalVariableName.\x0a\x09\x09\x09self stream nextPutAll: '(', recvVarName, ' = '.\x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == null || ', recvVarName, '.isNil' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
  1018. referencedClasses: [],
  1019. //>>excludeEnd("ide");
  1020. messageSends: ["nextPutIf:then:else:", "stream", "receiverInternalVariableName", "nextPutAll:", ",", "visit:", "first", "instructions", "second", "third"]
  1021. }),
  1022. $globals.IRInliningJSTranslator);
  1023. $core.addMethod(
  1024. $core.method({
  1025. selector: "visitIRInlinedIfTrue:",
  1026. protocol: 'visiting',
  1027. fn: function (anIRInlinedIfTrue){
  1028. var self=this;
  1029. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1030. return $core.withContext(function($ctx1) {
  1031. //>>excludeEnd("ctx");
  1032. var $1,$2,$4,$3;
  1033. $1=self._stream();
  1034. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1035. $ctx1.sendIdx["stream"]=1;
  1036. //>>excludeEnd("ctx");
  1037. $recv($1)._nextPutIf_then_((function(){
  1038. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1039. return $core.withContext(function($ctx2) {
  1040. //>>excludeEnd("ctx");
  1041. $2=self._stream();
  1042. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1043. $ctx2.sendIdx["stream"]=2;
  1044. //>>excludeEnd("ctx");
  1045. $recv($2)._nextPutAll_("$core.assert(");
  1046. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1047. $ctx2.sendIdx["nextPutAll:"]=1;
  1048. //>>excludeEnd("ctx");
  1049. $4=$recv(anIRInlinedIfTrue)._instructions();
  1050. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1051. $ctx2.sendIdx["instructions"]=1;
  1052. //>>excludeEnd("ctx");
  1053. $3=$recv($4)._first();
  1054. self._visit_($3);
  1055. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1056. $ctx2.sendIdx["visit:"]=1;
  1057. //>>excludeEnd("ctx");
  1058. return $recv(self._stream())._nextPutAll_(")");
  1059. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1060. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1061. //>>excludeEnd("ctx");
  1062. }),(function(){
  1063. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1064. return $core.withContext(function($ctx2) {
  1065. //>>excludeEnd("ctx");
  1066. return self._visit_($recv($recv(anIRInlinedIfTrue)._instructions())._last());
  1067. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1068. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1069. //>>excludeEnd("ctx");
  1070. }));
  1071. return self;
  1072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1073. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrue:",{anIRInlinedIfTrue:anIRInlinedIfTrue},$globals.IRInliningJSTranslator)});
  1074. //>>excludeEnd("ctx");
  1075. },
  1076. //>>excludeStart("ide", pragmas.excludeIdeData);
  1077. args: ["anIRInlinedIfTrue"],
  1078. source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [\x0a\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrue instructions last ]",
  1079. referencedClasses: [],
  1080. //>>excludeEnd("ide");
  1081. messageSends: ["nextPutIf:then:", "stream", "nextPutAll:", "visit:", "first", "instructions", "last"]
  1082. }),
  1083. $globals.IRInliningJSTranslator);
  1084. $core.addMethod(
  1085. $core.method({
  1086. selector: "visitIRInlinedIfTrueIfFalse:",
  1087. protocol: 'visiting',
  1088. fn: function (anIRInlinedIfTrueIfFalse){
  1089. var self=this;
  1090. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1091. return $core.withContext(function($ctx1) {
  1092. //>>excludeEnd("ctx");
  1093. var $1,$2,$4,$3,$6,$5;
  1094. $1=self._stream();
  1095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1096. $ctx1.sendIdx["stream"]=1;
  1097. //>>excludeEnd("ctx");
  1098. $recv($1)._nextPutIf_then_else_((function(){
  1099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1100. return $core.withContext(function($ctx2) {
  1101. //>>excludeEnd("ctx");
  1102. $2=self._stream();
  1103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1104. $ctx2.sendIdx["stream"]=2;
  1105. //>>excludeEnd("ctx");
  1106. $recv($2)._nextPutAll_("$core.assert(");
  1107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1108. $ctx2.sendIdx["nextPutAll:"]=1;
  1109. //>>excludeEnd("ctx");
  1110. $4=$recv(anIRInlinedIfTrueIfFalse)._instructions();
  1111. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1112. $ctx2.sendIdx["instructions"]=1;
  1113. //>>excludeEnd("ctx");
  1114. $3=$recv($4)._first();
  1115. self._visit_($3);
  1116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1117. $ctx2.sendIdx["visit:"]=1;
  1118. //>>excludeEnd("ctx");
  1119. return $recv(self._stream())._nextPutAll_(")");
  1120. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1121. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1122. //>>excludeEnd("ctx");
  1123. }),(function(){
  1124. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1125. return $core.withContext(function($ctx2) {
  1126. //>>excludeEnd("ctx");
  1127. $6=$recv(anIRInlinedIfTrueIfFalse)._instructions();
  1128. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1129. $ctx2.sendIdx["instructions"]=2;
  1130. //>>excludeEnd("ctx");
  1131. $5=$recv($6)._second();
  1132. return self._visit_($5);
  1133. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1134. $ctx2.sendIdx["visit:"]=2;
  1135. //>>excludeEnd("ctx");
  1136. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1137. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
  1138. //>>excludeEnd("ctx");
  1139. }),(function(){
  1140. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1141. return $core.withContext(function($ctx2) {
  1142. //>>excludeEnd("ctx");
  1143. return self._visit_($recv($recv(anIRInlinedIfTrueIfFalse)._instructions())._third());
  1144. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1145. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1146. //>>excludeEnd("ctx");
  1147. }));
  1148. return self;
  1149. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1150. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrueIfFalse:",{anIRInlinedIfTrueIfFalse:anIRInlinedIfTrueIfFalse},$globals.IRInliningJSTranslator)});
  1151. //>>excludeEnd("ctx");
  1152. },
  1153. //>>excludeStart("ide", pragmas.excludeIdeData);
  1154. args: ["anIRInlinedIfTrueIfFalse"],
  1155. source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream\x0a\x09\x09nextPutIf: [\x0a\x09\x09\x09self stream nextPutAll: '$core.assert('.\x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09then: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09else: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
  1156. referencedClasses: [],
  1157. //>>excludeEnd("ide");
  1158. messageSends: ["nextPutIf:then:else:", "stream", "nextPutAll:", "visit:", "first", "instructions", "second", "third"]
  1159. }),
  1160. $globals.IRInliningJSTranslator);
  1161. $core.addMethod(
  1162. $core.method({
  1163. selector: "visitIRInlinedNonLocalReturn:",
  1164. protocol: 'visiting',
  1165. fn: function (anIRInlinedReturn){
  1166. var self=this;
  1167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1168. return $core.withContext(function($ctx1) {
  1169. //>>excludeEnd("ctx");
  1170. var $1;
  1171. $1=self._stream();
  1172. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1173. $ctx1.sendIdx["stream"]=1;
  1174. //>>excludeEnd("ctx");
  1175. $recv($1)._nextPutStatementWith_((function(){
  1176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1177. return $core.withContext(function($ctx2) {
  1178. //>>excludeEnd("ctx");
  1179. return self._visit_($recv(anIRInlinedReturn)._expression());
  1180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1181. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1182. //>>excludeEnd("ctx");
  1183. }));
  1184. $recv(self._stream())._nextPutNonLocalReturnWith_((function(){
  1185. }));
  1186. return self;
  1187. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1188. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedNonLocalReturn:",{anIRInlinedReturn:anIRInlinedReturn},$globals.IRInliningJSTranslator)});
  1189. //>>excludeEnd("ctx");
  1190. },
  1191. //>>excludeStart("ide", pragmas.excludeIdeData);
  1192. args: ["anIRInlinedReturn"],
  1193. source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn expression ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",
  1194. referencedClasses: [],
  1195. //>>excludeEnd("ide");
  1196. messageSends: ["nextPutStatementWith:", "stream", "visit:", "expression", "nextPutNonLocalReturnWith:"]
  1197. }),
  1198. $globals.IRInliningJSTranslator);
  1199. $core.addMethod(
  1200. $core.method({
  1201. selector: "visitIRInlinedReturn:",
  1202. protocol: 'visiting',
  1203. fn: function (anIRInlinedReturn){
  1204. var self=this;
  1205. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1206. return $core.withContext(function($ctx1) {
  1207. //>>excludeEnd("ctx");
  1208. self._visit_($recv(anIRInlinedReturn)._expression());
  1209. return self;
  1210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1211. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedReturn:",{anIRInlinedReturn:anIRInlinedReturn},$globals.IRInliningJSTranslator)});
  1212. //>>excludeEnd("ctx");
  1213. },
  1214. //>>excludeStart("ide", pragmas.excludeIdeData);
  1215. args: ["anIRInlinedReturn"],
  1216. source: "visitIRInlinedReturn: anIRInlinedReturn\x0a\x09self visit: anIRInlinedReturn expression",
  1217. referencedClasses: [],
  1218. //>>excludeEnd("ide");
  1219. messageSends: ["visit:", "expression"]
  1220. }),
  1221. $globals.IRInliningJSTranslator);
  1222. $core.addMethod(
  1223. $core.method({
  1224. selector: "visitIRInlinedSequence:",
  1225. protocol: 'visiting',
  1226. fn: function (anIRInlinedSequence){
  1227. var self=this;
  1228. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1229. return $core.withContext(function($ctx1) {
  1230. //>>excludeEnd("ctx");
  1231. $recv($recv(anIRInlinedSequence)._instructions())._do_((function(each){
  1232. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1233. return $core.withContext(function($ctx2) {
  1234. //>>excludeEnd("ctx");
  1235. return $recv(self._stream())._nextPutStatementWith_((function(){
  1236. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1237. return $core.withContext(function($ctx3) {
  1238. //>>excludeEnd("ctx");
  1239. return self._visit_(each);
  1240. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1241. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  1242. //>>excludeEnd("ctx");
  1243. }));
  1244. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1245. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1246. //>>excludeEnd("ctx");
  1247. }));
  1248. return self;
  1249. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1250. }, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence},$globals.IRInliningJSTranslator)});
  1251. //>>excludeEnd("ctx");
  1252. },
  1253. //>>excludeStart("ide", pragmas.excludeIdeData);
  1254. args: ["anIRInlinedSequence"],
  1255. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence instructions do: [ :each |\x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
  1256. referencedClasses: [],
  1257. //>>excludeEnd("ide");
  1258. messageSends: ["do:", "instructions", "nextPutStatementWith:", "stream", "visit:"]
  1259. }),
  1260. $globals.IRInliningJSTranslator);
  1261. $core.addClass('IRSendInliner', $globals.Object, ['send', 'translator'], 'Compiler-Inlining');
  1262. //>>excludeStart("ide", pragmas.excludeIdeData);
  1263. $globals.IRSendInliner.comment="I inline some message sends and block closure arguments. I heavily rely on #perform: to dispatch inlining methods.";
  1264. //>>excludeEnd("ide");
  1265. $core.addMethod(
  1266. $core.method({
  1267. selector: "ifFalse:",
  1268. protocol: 'inlining',
  1269. fn: function (anIRInstruction){
  1270. var self=this;
  1271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1272. return $core.withContext(function($ctx1) {
  1273. //>>excludeEnd("ctx");
  1274. return self._inlinedSend_withBlock_($recv($globals.IRInlinedIfFalse)._new(),anIRInstruction);
  1275. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1276. }, function($ctx1) {$ctx1.fill(self,"ifFalse:",{anIRInstruction:anIRInstruction},$globals.IRSendInliner)});
  1277. //>>excludeEnd("ctx");
  1278. },
  1279. //>>excludeStart("ide", pragmas.excludeIdeData);
  1280. args: ["anIRInstruction"],
  1281. source: "ifFalse: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfFalse new withBlock: anIRInstruction",
  1282. referencedClasses: ["IRInlinedIfFalse"],
  1283. //>>excludeEnd("ide");
  1284. messageSends: ["inlinedSend:withBlock:", "new"]
  1285. }),
  1286. $globals.IRSendInliner);
  1287. $core.addMethod(
  1288. $core.method({
  1289. selector: "ifFalse:ifTrue:",
  1290. protocol: 'inlining',
  1291. fn: function (anIRInstruction,anotherIRInstruction){
  1292. var self=this;
  1293. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1294. return $core.withContext(function($ctx1) {
  1295. //>>excludeEnd("ctx");
  1296. return self._perform_withArguments_("ifTrue:ifFalse:",[anotherIRInstruction,anIRInstruction]);
  1297. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1298. }, function($ctx1) {$ctx1.fill(self,"ifFalse:ifTrue:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction},$globals.IRSendInliner)});
  1299. //>>excludeEnd("ctx");
  1300. },
  1301. //>>excludeStart("ide", pragmas.excludeIdeData);
  1302. args: ["anIRInstruction", "anotherIRInstruction"],
  1303. source: "ifFalse: anIRInstruction ifTrue: anotherIRInstruction\x0a\x09^ self perform: #ifTrue:ifFalse: withArguments: { anotherIRInstruction. anIRInstruction }",
  1304. referencedClasses: [],
  1305. //>>excludeEnd("ide");
  1306. messageSends: ["perform:withArguments:"]
  1307. }),
  1308. $globals.IRSendInliner);
  1309. $core.addMethod(
  1310. $core.method({
  1311. selector: "ifNil:",
  1312. protocol: 'inlining',
  1313. fn: function (anIRInstruction){
  1314. var self=this;
  1315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1316. return $core.withContext(function($ctx1) {
  1317. //>>excludeEnd("ctx");
  1318. var $1,$3,$5,$6,$4,$2;
  1319. $1=$recv($globals.IRInlinedIfNilIfNotNil)._new();
  1320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1321. $ctx1.sendIdx["new"]=1;
  1322. //>>excludeEnd("ctx");
  1323. $3=$recv($globals.IRClosure)._new();
  1324. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1325. $ctx1.sendIdx["new"]=2;
  1326. //>>excludeEnd("ctx");
  1327. $recv($3)._scope_($recv($recv(anIRInstruction)._scope())._copy());
  1328. $5=$recv($globals.IRBlockSequence)._new();
  1329. $recv($5)._add_($recv(self._send())._receiver());
  1330. $6=$recv($5)._yourself();
  1331. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1332. $ctx1.sendIdx["yourself"]=1;
  1333. //>>excludeEnd("ctx");
  1334. $4=$6;
  1335. $recv($3)._add_($4);
  1336. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1337. $ctx1.sendIdx["add:"]=1;
  1338. //>>excludeEnd("ctx");
  1339. $2=$recv($3)._yourself();
  1340. return self._inlinedSend_withBlock_withBlock_($1,anIRInstruction,$2);
  1341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1342. }, function($ctx1) {$ctx1.fill(self,"ifNil:",{anIRInstruction:anIRInstruction},$globals.IRSendInliner)});
  1343. //>>excludeEnd("ctx");
  1344. },
  1345. //>>excludeStart("ide", pragmas.excludeIdeData);
  1346. args: ["anIRInstruction"],
  1347. source: "ifNil: anIRInstruction\x0a\x09^ self\x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new\x0a\x09\x09withBlock: anIRInstruction\x0a\x09\x09withBlock: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send receiver;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)",
  1348. referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"],
  1349. //>>excludeEnd("ide");
  1350. messageSends: ["inlinedSend:withBlock:withBlock:", "new", "scope:", "copy", "scope", "add:", "receiver", "send", "yourself"]
  1351. }),
  1352. $globals.IRSendInliner);
  1353. $core.addMethod(
  1354. $core.method({
  1355. selector: "ifNil:ifNotNil:",
  1356. protocol: 'inlining',
  1357. fn: function (anIRInstruction,anotherIRInstruction){
  1358. var self=this;
  1359. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1360. return $core.withContext(function($ctx1) {
  1361. //>>excludeEnd("ctx");
  1362. return self._inlinedSend_withBlock_withBlock_($recv($globals.IRInlinedIfNilIfNotNil)._new(),anIRInstruction,anotherIRInstruction);
  1363. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1364. }, function($ctx1) {$ctx1.fill(self,"ifNil:ifNotNil:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction},$globals.IRSendInliner)});
  1365. //>>excludeEnd("ctx");
  1366. },
  1367. //>>excludeStart("ide", pragmas.excludeIdeData);
  1368. args: ["anIRInstruction", "anotherIRInstruction"],
  1369. source: "ifNil: anIRInstruction ifNotNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new withBlock: anIRInstruction withBlock: anotherIRInstruction",
  1370. referencedClasses: ["IRInlinedIfNilIfNotNil"],
  1371. //>>excludeEnd("ide");
  1372. messageSends: ["inlinedSend:withBlock:withBlock:", "new"]
  1373. }),
  1374. $globals.IRSendInliner);
  1375. $core.addMethod(
  1376. $core.method({
  1377. selector: "ifNotNil:",
  1378. protocol: 'inlining',
  1379. fn: function (anIRInstruction){
  1380. var self=this;
  1381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1382. return $core.withContext(function($ctx1) {
  1383. //>>excludeEnd("ctx");
  1384. var $1,$3,$5,$6,$4,$2;
  1385. $1=$recv($globals.IRInlinedIfNilIfNotNil)._new();
  1386. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1387. $ctx1.sendIdx["new"]=1;
  1388. //>>excludeEnd("ctx");
  1389. $3=$recv($globals.IRClosure)._new();
  1390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1391. $ctx1.sendIdx["new"]=2;
  1392. //>>excludeEnd("ctx");
  1393. $recv($3)._scope_($recv($recv(anIRInstruction)._scope())._copy());
  1394. $5=$recv($globals.IRBlockSequence)._new();
  1395. $recv($5)._add_($recv(self._send())._receiver());
  1396. $6=$recv($5)._yourself();
  1397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1398. $ctx1.sendIdx["yourself"]=1;
  1399. //>>excludeEnd("ctx");
  1400. $4=$6;
  1401. $recv($3)._add_($4);
  1402. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1403. $ctx1.sendIdx["add:"]=1;
  1404. //>>excludeEnd("ctx");
  1405. $2=$recv($3)._yourself();
  1406. return self._inlinedSend_withBlock_withBlock_($1,$2,anIRInstruction);
  1407. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1408. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:",{anIRInstruction:anIRInstruction},$globals.IRSendInliner)});
  1409. //>>excludeEnd("ctx");
  1410. },
  1411. //>>excludeStart("ide", pragmas.excludeIdeData);
  1412. args: ["anIRInstruction"],
  1413. source: "ifNotNil: anIRInstruction\x0a\x09^ self\x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new\x0a\x09\x09withBlock: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send receiver;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)\x0a\x09\x09withBlock: anIRInstruction",
  1414. referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"],
  1415. //>>excludeEnd("ide");
  1416. messageSends: ["inlinedSend:withBlock:withBlock:", "new", "scope:", "copy", "scope", "add:", "receiver", "send", "yourself"]
  1417. }),
  1418. $globals.IRSendInliner);
  1419. $core.addMethod(
  1420. $core.method({
  1421. selector: "ifNotNil:ifNil:",
  1422. protocol: 'inlining',
  1423. fn: function (anIRInstruction,anotherIRInstruction){
  1424. var self=this;
  1425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1426. return $core.withContext(function($ctx1) {
  1427. //>>excludeEnd("ctx");
  1428. return self._inlinedSend_withBlock_withBlock_($recv($globals.IRInlinedIfNilIfNotNil)._new(),anotherIRInstruction,anIRInstruction);
  1429. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1430. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:ifNil:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction},$globals.IRSendInliner)});
  1431. //>>excludeEnd("ctx");
  1432. },
  1433. //>>excludeStart("ide", pragmas.excludeIdeData);
  1434. args: ["anIRInstruction", "anotherIRInstruction"],
  1435. source: "ifNotNil: anIRInstruction ifNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new withBlock: anotherIRInstruction withBlock: anIRInstruction",
  1436. referencedClasses: ["IRInlinedIfNilIfNotNil"],
  1437. //>>excludeEnd("ide");
  1438. messageSends: ["inlinedSend:withBlock:withBlock:", "new"]
  1439. }),
  1440. $globals.IRSendInliner);
  1441. $core.addMethod(
  1442. $core.method({
  1443. selector: "ifTrue:",
  1444. protocol: 'inlining',
  1445. fn: function (anIRInstruction){
  1446. var self=this;
  1447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1448. return $core.withContext(function($ctx1) {
  1449. //>>excludeEnd("ctx");
  1450. return self._inlinedSend_withBlock_($recv($globals.IRInlinedIfTrue)._new(),anIRInstruction);
  1451. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1452. }, function($ctx1) {$ctx1.fill(self,"ifTrue:",{anIRInstruction:anIRInstruction},$globals.IRSendInliner)});
  1453. //>>excludeEnd("ctx");
  1454. },
  1455. //>>excludeStart("ide", pragmas.excludeIdeData);
  1456. args: ["anIRInstruction"],
  1457. source: "ifTrue: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrue new withBlock: anIRInstruction",
  1458. referencedClasses: ["IRInlinedIfTrue"],
  1459. //>>excludeEnd("ide");
  1460. messageSends: ["inlinedSend:withBlock:", "new"]
  1461. }),
  1462. $globals.IRSendInliner);
  1463. $core.addMethod(
  1464. $core.method({
  1465. selector: "ifTrue:ifFalse:",
  1466. protocol: 'inlining',
  1467. fn: function (anIRInstruction,anotherIRInstruction){
  1468. var self=this;
  1469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1470. return $core.withContext(function($ctx1) {
  1471. //>>excludeEnd("ctx");
  1472. return self._inlinedSend_withBlock_withBlock_($recv($globals.IRInlinedIfTrueIfFalse)._new(),anIRInstruction,anotherIRInstruction);
  1473. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1474. }, function($ctx1) {$ctx1.fill(self,"ifTrue:ifFalse:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction},$globals.IRSendInliner)});
  1475. //>>excludeEnd("ctx");
  1476. },
  1477. //>>excludeStart("ide", pragmas.excludeIdeData);
  1478. args: ["anIRInstruction", "anotherIRInstruction"],
  1479. source: "ifTrue: anIRInstruction ifFalse: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrueIfFalse new withBlock: anIRInstruction withBlock: anotherIRInstruction",
  1480. referencedClasses: ["IRInlinedIfTrueIfFalse"],
  1481. //>>excludeEnd("ide");
  1482. messageSends: ["inlinedSend:withBlock:withBlock:", "new"]
  1483. }),
  1484. $globals.IRSendInliner);
  1485. $core.addMethod(
  1486. $core.method({
  1487. selector: "inlineClosure:",
  1488. protocol: 'inlining',
  1489. fn: function (anIRClosure){
  1490. var self=this;
  1491. var inlinedClosure,sequence,statements;
  1492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1493. return $core.withContext(function($ctx1) {
  1494. //>>excludeEnd("ctx");
  1495. var $1,$2,$3,$5,$6,$4,$7,$9,$11,$13,$14,$15,$12,$10,$17,$19,$20,$18,$16,$8,$23,$22,$24,$21,$25,$27,$26;
  1496. inlinedClosure=self._inlinedClosure();
  1497. $1=inlinedClosure;
  1498. $2=$recv(anIRClosure)._scope();
  1499. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1500. $ctx1.sendIdx["scope"]=1;
  1501. //>>excludeEnd("ctx");
  1502. $recv($1)._scope_($2);
  1503. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1504. $ctx1.sendIdx["scope:"]=1;
  1505. //>>excludeEnd("ctx");
  1506. $recv($1)._parent_($recv(anIRClosure)._parent());
  1507. $recv($recv(anIRClosure)._tempDeclarations())._do_((function(each){
  1508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1509. return $core.withContext(function($ctx2) {
  1510. //>>excludeEnd("ctx");
  1511. return $recv(inlinedClosure)._add_(each);
  1512. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1513. $ctx2.sendIdx["add:"]=1;
  1514. //>>excludeEnd("ctx");
  1515. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1516. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1517. //>>excludeEnd("ctx");
  1518. }));
  1519. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1520. $ctx1.sendIdx["do:"]=1;
  1521. //>>excludeEnd("ctx");
  1522. sequence=self._inlinedSequence();
  1523. $recv($recv(anIRClosure)._arguments())._do_((function(each){
  1524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1525. return $core.withContext(function($ctx2) {
  1526. //>>excludeEnd("ctx");
  1527. $3=inlinedClosure;
  1528. $5=$recv($globals.IRTempDeclaration)._new();
  1529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1530. $ctx2.sendIdx["new"]=1;
  1531. //>>excludeEnd("ctx");
  1532. $recv($5)._name_(each);
  1533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1534. $ctx2.sendIdx["name:"]=1;
  1535. //>>excludeEnd("ctx");
  1536. $6=$recv($5)._yourself();
  1537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1538. $ctx2.sendIdx["yourself"]=1;
  1539. //>>excludeEnd("ctx");
  1540. $4=$6;
  1541. $recv($3)._add_($4);
  1542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1543. $ctx2.sendIdx["add:"]=2;
  1544. //>>excludeEnd("ctx");
  1545. $7=sequence;
  1546. $9=$recv($globals.IRAssignment)._new();
  1547. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1548. $ctx2.sendIdx["new"]=2;
  1549. //>>excludeEnd("ctx");
  1550. $11=$recv($globals.IRVariable)._new();
  1551. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1552. $ctx2.sendIdx["new"]=3;
  1553. //>>excludeEnd("ctx");
  1554. $13=$recv($globals.AliasVar)._new();
  1555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1556. $ctx2.sendIdx["new"]=4;
  1557. //>>excludeEnd("ctx");
  1558. $14=$recv(inlinedClosure)._scope();
  1559. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1560. $ctx2.sendIdx["scope"]=2;
  1561. //>>excludeEnd("ctx");
  1562. $recv($13)._scope_($14);
  1563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1564. $ctx2.sendIdx["scope:"]=2;
  1565. //>>excludeEnd("ctx");
  1566. $recv($13)._name_(each);
  1567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1568. $ctx2.sendIdx["name:"]=2;
  1569. //>>excludeEnd("ctx");
  1570. $15=$recv($13)._yourself();
  1571. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1572. $ctx2.sendIdx["yourself"]=2;
  1573. //>>excludeEnd("ctx");
  1574. $12=$15;
  1575. $10=$recv($11)._variable_($12);
  1576. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1577. $ctx2.sendIdx["variable:"]=1;
  1578. //>>excludeEnd("ctx");
  1579. $recv($9)._add_($10);
  1580. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1581. $ctx2.sendIdx["add:"]=4;
  1582. //>>excludeEnd("ctx");
  1583. $17=$recv($globals.IRVariable)._new();
  1584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1585. $ctx2.sendIdx["new"]=5;
  1586. //>>excludeEnd("ctx");
  1587. $19=$recv($globals.AliasVar)._new();
  1588. $recv($19)._scope_($recv(inlinedClosure)._scope());
  1589. $recv($19)._name_("$receiver");
  1590. $20=$recv($19)._yourself();
  1591. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1592. $ctx2.sendIdx["yourself"]=3;
  1593. //>>excludeEnd("ctx");
  1594. $18=$20;
  1595. $16=$recv($17)._variable_($18);
  1596. $recv($9)._add_($16);
  1597. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1598. $ctx2.sendIdx["add:"]=5;
  1599. //>>excludeEnd("ctx");
  1600. $8=$recv($9)._yourself();
  1601. return $recv($7)._add_($8);
  1602. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1603. $ctx2.sendIdx["add:"]=3;
  1604. //>>excludeEnd("ctx");
  1605. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1606. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  1607. //>>excludeEnd("ctx");
  1608. }));
  1609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1610. $ctx1.sendIdx["do:"]=2;
  1611. //>>excludeEnd("ctx");
  1612. $recv(inlinedClosure)._add_(sequence);
  1613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1614. $ctx1.sendIdx["add:"]=6;
  1615. //>>excludeEnd("ctx");
  1616. statements=$recv($recv(anIRClosure)._sequence())._instructions();
  1617. $recv(statements)._ifNotEmpty_((function(){
  1618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1619. return $core.withContext(function($ctx2) {
  1620. //>>excludeEnd("ctx");
  1621. $recv($recv(statements)._allButLast())._do_((function(each){
  1622. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1623. return $core.withContext(function($ctx3) {
  1624. //>>excludeEnd("ctx");
  1625. return $recv(sequence)._add_(each);
  1626. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1627. $ctx3.sendIdx["add:"]=7;
  1628. //>>excludeEnd("ctx");
  1629. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1630. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,4)});
  1631. //>>excludeEnd("ctx");
  1632. }));
  1633. $23=$recv(statements)._last();
  1634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1635. $ctx2.sendIdx["last"]=1;
  1636. //>>excludeEnd("ctx");
  1637. $22=$recv($23)._isReturn();
  1638. $21=$recv($22)._and_((function(){
  1639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1640. return $core.withContext(function($ctx3) {
  1641. //>>excludeEnd("ctx");
  1642. $24=$recv(statements)._last();
  1643. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1644. $ctx3.sendIdx["last"]=2;
  1645. //>>excludeEnd("ctx");
  1646. return $recv($24)._isBlockReturn();
  1647. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1648. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)});
  1649. //>>excludeEnd("ctx");
  1650. }));
  1651. if($core.assert($21)){
  1652. $25=sequence;
  1653. $27=$recv(statements)._last();
  1654. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1655. $ctx2.sendIdx["last"]=3;
  1656. //>>excludeEnd("ctx");
  1657. $26=$recv($27)._expression();
  1658. return $recv($25)._add_($26);
  1659. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1660. $ctx2.sendIdx["add:"]=8;
  1661. //>>excludeEnd("ctx");
  1662. } else {
  1663. return $recv(sequence)._add_($recv(statements)._last());
  1664. };
  1665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1666. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  1667. //>>excludeEnd("ctx");
  1668. }));
  1669. return inlinedClosure;
  1670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1671. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,sequence:sequence,statements:statements},$globals.IRSendInliner)});
  1672. //>>excludeEnd("ctx");
  1673. },
  1674. //>>excludeStart("ide", pragmas.excludeIdeData);
  1675. args: ["anIRClosure"],
  1676. source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure sequence statements |\x0a\x0a\x09inlinedClosure := self inlinedClosure.\x0a\x09inlinedClosure \x0a\x09\x09scope: anIRClosure scope;\x0a\x09\x09parent: anIRClosure parent.\x0a\x0a\x09\x22Add the possible temp declarations\x22\x0a\x09anIRClosure tempDeclarations do: [ :each |\x0a\x09\x09\x09inlinedClosure add: each ].\x0a\x0a\x09\x22Add a block sequence\x22\x0a\x09sequence := self inlinedSequence.\x0a\x0a\x09\x22Map the closure arguments to the receiver of the message send\x22\x0a\x09anIRClosure arguments do: [ :each |\x0a\x09\x09inlinedClosure add: (IRTempDeclaration new name: each; yourself).\x0a\x09\x09sequence add: (IRAssignment new\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: each; yourself));\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: '$receiver'; yourself));\x0a\x09\x09\x09yourself) ].\x0a\x09\x09\x09\x0a\x09\x22To ensure the correct order of the closure instructions: first the temps then the sequence\x22\x0a\x09inlinedClosure add: sequence.\x0a\x0a\x09\x22Get all the statements\x22\x0a\x09statements := anIRClosure sequence instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements allButLast do: [ :each | sequence add: each ].\x0a\x0a\x09\x09\x22Inlined closures don't have implicit local returns\x22\x0a\x09\x09(statements last isReturn and: [ statements last isBlockReturn ])\x0a\x09\x09\x09ifTrue: [ sequence add: statements last expression ]\x0a\x09\x09\x09ifFalse: [ sequence add: statements last ] ].\x0a\x0a\x09^ inlinedClosure",
  1677. referencedClasses: ["IRTempDeclaration", "IRAssignment", "IRVariable", "AliasVar"],
  1678. //>>excludeEnd("ide");
  1679. messageSends: ["inlinedClosure", "scope:", "scope", "parent:", "parent", "do:", "tempDeclarations", "add:", "inlinedSequence", "arguments", "name:", "new", "yourself", "variable:", "instructions", "sequence", "ifNotEmpty:", "allButLast", "ifTrue:ifFalse:", "and:", "isReturn", "last", "isBlockReturn", "expression"]
  1680. }),
  1681. $globals.IRSendInliner);
  1682. $core.addMethod(
  1683. $core.method({
  1684. selector: "inlineSend:",
  1685. protocol: 'inlining',
  1686. fn: function (anIRSend){
  1687. var self=this;
  1688. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1689. return $core.withContext(function($ctx1) {
  1690. //>>excludeEnd("ctx");
  1691. var $2,$1;
  1692. self._send_(anIRSend);
  1693. $2=self._send();
  1694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1695. $ctx1.sendIdx["send"]=1;
  1696. //>>excludeEnd("ctx");
  1697. $1=$recv($2)._selector();
  1698. return self._perform_withArguments_($1,$recv(self._send())._arguments());
  1699. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1700. }, function($ctx1) {$ctx1.fill(self,"inlineSend:",{anIRSend:anIRSend},$globals.IRSendInliner)});
  1701. //>>excludeEnd("ctx");
  1702. },
  1703. //>>excludeStart("ide", pragmas.excludeIdeData);
  1704. args: ["anIRSend"],
  1705. source: "inlineSend: anIRSend\x0a\x09self send: anIRSend.\x0a\x09^ self\x0a\x09\x09perform: self send selector\x0a\x09\x09withArguments: self send arguments",
  1706. referencedClasses: [],
  1707. //>>excludeEnd("ide");
  1708. messageSends: ["send:", "perform:withArguments:", "selector", "send", "arguments"]
  1709. }),
  1710. $globals.IRSendInliner);
  1711. $core.addMethod(
  1712. $core.method({
  1713. selector: "inlinedClosure",
  1714. protocol: 'factory',
  1715. fn: function (){
  1716. var self=this;
  1717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1718. return $core.withContext(function($ctx1) {
  1719. //>>excludeEnd("ctx");
  1720. return $recv($globals.IRInlinedClosure)._new();
  1721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1722. }, function($ctx1) {$ctx1.fill(self,"inlinedClosure",{},$globals.IRSendInliner)});
  1723. //>>excludeEnd("ctx");
  1724. },
  1725. //>>excludeStart("ide", pragmas.excludeIdeData);
  1726. args: [],
  1727. source: "inlinedClosure\x0a\x09^ IRInlinedClosure new",
  1728. referencedClasses: ["IRInlinedClosure"],
  1729. //>>excludeEnd("ide");
  1730. messageSends: ["new"]
  1731. }),
  1732. $globals.IRSendInliner);
  1733. $core.addMethod(
  1734. $core.method({
  1735. selector: "inlinedSend:withBlock:",
  1736. protocol: 'inlining',
  1737. fn: function (inlinedSend,anIRInstruction){
  1738. var self=this;
  1739. var inlinedClosure;
  1740. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1741. return $core.withContext(function($ctx1) {
  1742. //>>excludeEnd("ctx");
  1743. var $1,$2,$4,$3,$5;
  1744. $1=$recv(anIRInstruction)._isClosure();
  1745. if(!$core.assert($1)){
  1746. self._inliningError_("Message argument should be a block");
  1747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1748. $ctx1.sendIdx["inliningError:"]=1;
  1749. //>>excludeEnd("ctx");
  1750. };
  1751. $2=$recv($recv($recv(anIRInstruction)._arguments())._size()).__eq((0));
  1752. if(!$core.assert($2)){
  1753. self._inliningError_("Inlined block should have zero argument");
  1754. };
  1755. inlinedClosure=$recv(self._translator())._visit_(self._inlineClosure_(anIRInstruction));
  1756. $4=self._send();
  1757. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1758. $ctx1.sendIdx["send"]=1;
  1759. //>>excludeEnd("ctx");
  1760. $3=$recv($4)._receiver();
  1761. $recv(inlinedSend)._add_($3);
  1762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1763. $ctx1.sendIdx["add:"]=1;
  1764. //>>excludeEnd("ctx");
  1765. $recv(inlinedSend)._add_(inlinedClosure);
  1766. $recv(self._send())._replaceWith_(inlinedSend);
  1767. $5=$recv($recv(inlinedSend)._method())._internalVariables();
  1768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1769. $ctx1.sendIdx["internalVariables"]=1;
  1770. //>>excludeEnd("ctx");
  1771. $recv($5)._addAll_($recv(inlinedSend)._internalVariables());
  1772. return inlinedSend;
  1773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1774. }, function($ctx1) {$ctx1.fill(self,"inlinedSend:withBlock:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,inlinedClosure:inlinedClosure},$globals.IRSendInliner)});
  1775. //>>excludeEnd("ctx");
  1776. },
  1777. //>>excludeStart("ide", pragmas.excludeIdeData);
  1778. args: ["inlinedSend", "anIRInstruction"],
  1779. source: "inlinedSend: inlinedSend withBlock: anIRInstruction\x0a\x09| inlinedClosure |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09inlinedClosure := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send receiver;\x0a\x09\x09add: inlinedClosure.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x09inlinedSend method internalVariables \x0a\x09\x09addAll: inlinedSend internalVariables.\x0a\x0a\x09^ inlinedSend",
  1780. referencedClasses: [],
  1781. //>>excludeEnd("ide");
  1782. messageSends: ["ifFalse:", "isClosure", "inliningError:", "=", "size", "arguments", "visit:", "translator", "inlineClosure:", "add:", "receiver", "send", "replaceWith:", "addAll:", "internalVariables", "method"]
  1783. }),
  1784. $globals.IRSendInliner);
  1785. $core.addMethod(
  1786. $core.method({
  1787. selector: "inlinedSend:withBlock:withBlock:",
  1788. protocol: 'inlining',
  1789. fn: function (inlinedSend,anIRInstruction,anotherIRInstruction){
  1790. var self=this;
  1791. var inlinedClosure1,inlinedClosure2;
  1792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1793. return $core.withContext(function($ctx1) {
  1794. //>>excludeEnd("ctx");
  1795. var $1,$2,$3,$4,$6,$5,$7;
  1796. $1=$recv(anIRInstruction)._isClosure();
  1797. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1798. $ctx1.sendIdx["isClosure"]=1;
  1799. //>>excludeEnd("ctx");
  1800. if(!$core.assert($1)){
  1801. self._inliningError_("Message argument should be a block");
  1802. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1803. $ctx1.sendIdx["inliningError:"]=1;
  1804. //>>excludeEnd("ctx");
  1805. };
  1806. $2=$recv(anotherIRInstruction)._isClosure();
  1807. if(!$core.assert($2)){
  1808. self._inliningError_("Message argument should be a block");
  1809. };
  1810. $3=self._translator();
  1811. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1812. $ctx1.sendIdx["translator"]=1;
  1813. //>>excludeEnd("ctx");
  1814. $4=self._inlineClosure_(anIRInstruction);
  1815. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1816. $ctx1.sendIdx["inlineClosure:"]=1;
  1817. //>>excludeEnd("ctx");
  1818. inlinedClosure1=$recv($3)._visit_($4);
  1819. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1820. $ctx1.sendIdx["visit:"]=1;
  1821. //>>excludeEnd("ctx");
  1822. inlinedClosure2=$recv(self._translator())._visit_(self._inlineClosure_(anotherIRInstruction));
  1823. $6=self._send();
  1824. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1825. $ctx1.sendIdx["send"]=1;
  1826. //>>excludeEnd("ctx");
  1827. $5=$recv($6)._receiver();
  1828. $recv(inlinedSend)._add_($5);
  1829. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1830. $ctx1.sendIdx["add:"]=1;
  1831. //>>excludeEnd("ctx");
  1832. $recv(inlinedSend)._add_(inlinedClosure1);
  1833. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1834. $ctx1.sendIdx["add:"]=2;
  1835. //>>excludeEnd("ctx");
  1836. $recv(inlinedSend)._add_(inlinedClosure2);
  1837. $recv(self._send())._replaceWith_(inlinedSend);
  1838. $7=$recv($recv(inlinedSend)._method())._internalVariables();
  1839. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1840. $ctx1.sendIdx["internalVariables"]=1;
  1841. //>>excludeEnd("ctx");
  1842. $recv($7)._addAll_($recv(inlinedSend)._internalVariables());
  1843. return inlinedSend;
  1844. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1845. }, function($ctx1) {$ctx1.fill(self,"inlinedSend:withBlock:withBlock:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction,inlinedClosure1:inlinedClosure1,inlinedClosure2:inlinedClosure2},$globals.IRSendInliner)});
  1846. //>>excludeEnd("ctx");
  1847. },
  1848. //>>excludeStart("ide", pragmas.excludeIdeData);
  1849. args: ["inlinedSend", "anIRInstruction", "anotherIRInstruction"],
  1850. source: "inlinedSend: inlinedSend withBlock: anIRInstruction withBlock: anotherIRInstruction\x0a\x09| inlinedClosure1 inlinedClosure2 |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anotherIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x0a\x09inlinedClosure1 := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x09inlinedClosure2 := self translator visit: (self inlineClosure: anotherIRInstruction).\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send receiver;\x0a\x09\x09add: inlinedClosure1;\x0a\x09\x09add: inlinedClosure2.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x09inlinedSend method internalVariables \x0a\x09\x09addAll: inlinedSend internalVariables.\x0a\x09\x09\x0a\x09^ inlinedSend",
  1851. referencedClasses: [],
  1852. //>>excludeEnd("ide");
  1853. messageSends: ["ifFalse:", "isClosure", "inliningError:", "visit:", "translator", "inlineClosure:", "add:", "receiver", "send", "replaceWith:", "addAll:", "internalVariables", "method"]
  1854. }),
  1855. $globals.IRSendInliner);
  1856. $core.addMethod(
  1857. $core.method({
  1858. selector: "inlinedSequence",
  1859. protocol: 'factory',
  1860. fn: function (){
  1861. var self=this;
  1862. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1863. return $core.withContext(function($ctx1) {
  1864. //>>excludeEnd("ctx");
  1865. return $recv($globals.IRInlinedSequence)._new();
  1866. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1867. }, function($ctx1) {$ctx1.fill(self,"inlinedSequence",{},$globals.IRSendInliner)});
  1868. //>>excludeEnd("ctx");
  1869. },
  1870. //>>excludeStart("ide", pragmas.excludeIdeData);
  1871. args: [],
  1872. source: "inlinedSequence\x0a\x09^ IRInlinedSequence new",
  1873. referencedClasses: ["IRInlinedSequence"],
  1874. //>>excludeEnd("ide");
  1875. messageSends: ["new"]
  1876. }),
  1877. $globals.IRSendInliner);
  1878. $core.addMethod(
  1879. $core.method({
  1880. selector: "inliningError:",
  1881. protocol: 'error handling',
  1882. fn: function (aString){
  1883. var self=this;
  1884. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1885. return $core.withContext(function($ctx1) {
  1886. //>>excludeEnd("ctx");
  1887. $recv($globals.InliningError)._signal_(aString);
  1888. return self;
  1889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1890. }, function($ctx1) {$ctx1.fill(self,"inliningError:",{aString:aString},$globals.IRSendInliner)});
  1891. //>>excludeEnd("ctx");
  1892. },
  1893. //>>excludeStart("ide", pragmas.excludeIdeData);
  1894. args: ["aString"],
  1895. source: "inliningError: aString\x0a\x09InliningError signal: aString",
  1896. referencedClasses: ["InliningError"],
  1897. //>>excludeEnd("ide");
  1898. messageSends: ["signal:"]
  1899. }),
  1900. $globals.IRSendInliner);
  1901. $core.addMethod(
  1902. $core.method({
  1903. selector: "send",
  1904. protocol: 'accessing',
  1905. fn: function (){
  1906. var self=this;
  1907. return self["@send"];
  1908. },
  1909. //>>excludeStart("ide", pragmas.excludeIdeData);
  1910. args: [],
  1911. source: "send\x0a\x09^ send",
  1912. referencedClasses: [],
  1913. //>>excludeEnd("ide");
  1914. messageSends: []
  1915. }),
  1916. $globals.IRSendInliner);
  1917. $core.addMethod(
  1918. $core.method({
  1919. selector: "send:",
  1920. protocol: 'accessing',
  1921. fn: function (anIRSend){
  1922. var self=this;
  1923. self["@send"]=anIRSend;
  1924. return self;
  1925. },
  1926. //>>excludeStart("ide", pragmas.excludeIdeData);
  1927. args: ["anIRSend"],
  1928. source: "send: anIRSend\x0a\x09send := anIRSend",
  1929. referencedClasses: [],
  1930. //>>excludeEnd("ide");
  1931. messageSends: []
  1932. }),
  1933. $globals.IRSendInliner);
  1934. $core.addMethod(
  1935. $core.method({
  1936. selector: "translator",
  1937. protocol: 'accessing',
  1938. fn: function (){
  1939. var self=this;
  1940. return self["@translator"];
  1941. },
  1942. //>>excludeStart("ide", pragmas.excludeIdeData);
  1943. args: [],
  1944. source: "translator\x0a\x09^ translator",
  1945. referencedClasses: [],
  1946. //>>excludeEnd("ide");
  1947. messageSends: []
  1948. }),
  1949. $globals.IRSendInliner);
  1950. $core.addMethod(
  1951. $core.method({
  1952. selector: "translator:",
  1953. protocol: 'accessing',
  1954. fn: function (anASTTranslator){
  1955. var self=this;
  1956. self["@translator"]=anASTTranslator;
  1957. return self;
  1958. },
  1959. //>>excludeStart("ide", pragmas.excludeIdeData);
  1960. args: ["anASTTranslator"],
  1961. source: "translator: anASTTranslator\x0a\x09translator := anASTTranslator",
  1962. referencedClasses: [],
  1963. //>>excludeEnd("ide");
  1964. messageSends: []
  1965. }),
  1966. $globals.IRSendInliner);
  1967. $core.addMethod(
  1968. $core.method({
  1969. selector: "inlinedSelectors",
  1970. protocol: 'accessing',
  1971. fn: function (){
  1972. var self=this;
  1973. return ["ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:", "ifNil:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil:"];
  1974. },
  1975. //>>excludeStart("ide", pragmas.excludeIdeData);
  1976. args: [],
  1977. source: "inlinedSelectors\x0a\x09^ #('ifTrue:' 'ifFalse:' 'ifTrue:ifFalse:' 'ifFalse:ifTrue:' 'ifNil:' 'ifNotNil:' 'ifNil:ifNotNil:' 'ifNotNil:ifNil:')",
  1978. referencedClasses: [],
  1979. //>>excludeEnd("ide");
  1980. messageSends: []
  1981. }),
  1982. $globals.IRSendInliner.klass);
  1983. $core.addMethod(
  1984. $core.method({
  1985. selector: "shouldInline:",
  1986. protocol: 'accessing',
  1987. fn: function (anIRSend){
  1988. var self=this;
  1989. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1990. return $core.withContext(function($ctx1) {
  1991. //>>excludeEnd("ctx");
  1992. var $1;
  1993. $1=$recv(self._inlinedSelectors())._includes_($recv(anIRSend)._selector());
  1994. if(!$core.assert($1)){
  1995. return false;
  1996. };
  1997. return $recv($recv(anIRSend)._arguments())._allSatisfy_((function(each){
  1998. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1999. return $core.withContext(function($ctx2) {
  2000. //>>excludeEnd("ctx");
  2001. return $recv(each)._isClosure();
  2002. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2003. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
  2004. //>>excludeEnd("ctx");
  2005. }));
  2006. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2007. }, function($ctx1) {$ctx1.fill(self,"shouldInline:",{anIRSend:anIRSend},$globals.IRSendInliner.klass)});
  2008. //>>excludeEnd("ctx");
  2009. },
  2010. //>>excludeStart("ide", pragmas.excludeIdeData);
  2011. args: ["anIRSend"],
  2012. source: "shouldInline: anIRSend\x0a\x09(self inlinedSelectors includes: anIRSend selector) ifFalse: [ ^ false ].\x0a\x09^ anIRSend arguments allSatisfy: [ :each | each isClosure ]",
  2013. referencedClasses: [],
  2014. //>>excludeEnd("ide");
  2015. messageSends: ["ifFalse:", "includes:", "inlinedSelectors", "selector", "allSatisfy:", "arguments", "isClosure"]
  2016. }),
  2017. $globals.IRSendInliner.klass);
  2018. $core.addClass('IRAssignmentInliner', $globals.IRSendInliner, ['assignment'], 'Compiler-Inlining');
  2019. //>>excludeStart("ide", pragmas.excludeIdeData);
  2020. $globals.IRAssignmentInliner.comment="I inline message sends together with assignments by moving them around into the inline closure instructions.\x0a\x0a##Example\x0a\x0a\x09foo\x0a\x09\x09| a |\x0a\x09\x09a := true ifTrue: [ 1 ]\x0a\x0aWill produce:\x0a\x0a\x09if($core.assert(true) {\x0a\x09\x09a = 1;\x0a\x09};";
  2021. //>>excludeEnd("ide");
  2022. $core.addMethod(
  2023. $core.method({
  2024. selector: "assignment",
  2025. protocol: 'accessing',
  2026. fn: function (){
  2027. var self=this;
  2028. return self["@assignment"];
  2029. },
  2030. //>>excludeStart("ide", pragmas.excludeIdeData);
  2031. args: [],
  2032. source: "assignment\x0a\x09^ assignment",
  2033. referencedClasses: [],
  2034. //>>excludeEnd("ide");
  2035. messageSends: []
  2036. }),
  2037. $globals.IRAssignmentInliner);
  2038. $core.addMethod(
  2039. $core.method({
  2040. selector: "assignment:",
  2041. protocol: 'accessing',
  2042. fn: function (aNode){
  2043. var self=this;
  2044. self["@assignment"]=aNode;
  2045. return self;
  2046. },
  2047. //>>excludeStart("ide", pragmas.excludeIdeData);
  2048. args: ["aNode"],
  2049. source: "assignment: aNode\x0a\x09assignment := aNode",
  2050. referencedClasses: [],
  2051. //>>excludeEnd("ide");
  2052. messageSends: []
  2053. }),
  2054. $globals.IRAssignmentInliner);
  2055. $core.addMethod(
  2056. $core.method({
  2057. selector: "inlineAssignment:",
  2058. protocol: 'inlining',
  2059. fn: function (anIRAssignment){
  2060. var self=this;
  2061. var inlinedAssignment;
  2062. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2063. return $core.withContext(function($ctx1) {
  2064. //>>excludeEnd("ctx");
  2065. self._assignment_(anIRAssignment);
  2066. inlinedAssignment=$recv($globals.IRInlinedAssignment)._new();
  2067. $recv($recv(anIRAssignment)._instructions())._do_((function(each){
  2068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2069. return $core.withContext(function($ctx2) {
  2070. //>>excludeEnd("ctx");
  2071. return $recv(inlinedAssignment)._add_(each);
  2072. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2073. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2074. //>>excludeEnd("ctx");
  2075. }));
  2076. $recv(anIRAssignment)._replaceWith_(inlinedAssignment);
  2077. self._inlineSend_($recv(inlinedAssignment)._right());
  2078. return inlinedAssignment;
  2079. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2080. }, function($ctx1) {$ctx1.fill(self,"inlineAssignment:",{anIRAssignment:anIRAssignment,inlinedAssignment:inlinedAssignment},$globals.IRAssignmentInliner)});
  2081. //>>excludeEnd("ctx");
  2082. },
  2083. //>>excludeStart("ide", pragmas.excludeIdeData);
  2084. args: ["anIRAssignment"],
  2085. source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment instructions do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment right.\x0a\x09^ inlinedAssignment",
  2086. referencedClasses: ["IRInlinedAssignment"],
  2087. //>>excludeEnd("ide");
  2088. messageSends: ["assignment:", "new", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "right"]
  2089. }),
  2090. $globals.IRAssignmentInliner);
  2091. $core.addMethod(
  2092. $core.method({
  2093. selector: "inlineClosure:",
  2094. protocol: 'inlining',
  2095. fn: function (anIRClosure){
  2096. var self=this;
  2097. var inlinedClosure,statements;
  2098. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2099. return $core.withContext(function($ctx1) {
  2100. //>>excludeEnd("ctx");
  2101. var $2,$1,$3,$5,$4;
  2102. inlinedClosure=(
  2103. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2104. $ctx1.supercall = true,
  2105. //>>excludeEnd("ctx");
  2106. ($globals.IRAssignmentInliner.superclass||$boot.nilAsClass).fn.prototype._inlineClosure_.apply($recv(self), [anIRClosure]));
  2107. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2108. $ctx1.supercall = false;
  2109. //>>excludeEnd("ctx");;
  2110. statements=$recv($recv(inlinedClosure)._sequence())._instructions();
  2111. $recv(statements)._ifNotEmpty_((function(){
  2112. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2113. return $core.withContext(function($ctx2) {
  2114. //>>excludeEnd("ctx");
  2115. $2=$recv(statements)._last();
  2116. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2117. $ctx2.sendIdx["last"]=1;
  2118. //>>excludeEnd("ctx");
  2119. $1=$recv($2)._canBeAssigned();
  2120. if($core.assert($1)){
  2121. $3=$recv(statements)._last();
  2122. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2123. $ctx2.sendIdx["last"]=2;
  2124. //>>excludeEnd("ctx");
  2125. $5=$recv($globals.IRAssignment)._new();
  2126. $recv($5)._add_($recv(self._assignment())._left());
  2127. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2128. $ctx2.sendIdx["add:"]=1;
  2129. //>>excludeEnd("ctx");
  2130. $recv($5)._add_($recv($recv(statements)._last())._copy());
  2131. $4=$recv($5)._yourself();
  2132. return $recv($3)._replaceWith_($4);
  2133. };
  2134. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2135. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2136. //>>excludeEnd("ctx");
  2137. }));
  2138. return inlinedClosure;
  2139. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2140. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,statements:statements},$globals.IRAssignmentInliner)});
  2141. //>>excludeEnd("ctx");
  2142. },
  2143. //>>excludeStart("ide", pragmas.excludeIdeData);
  2144. args: ["anIRClosure"],
  2145. source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure sequence instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last canBeAssigned ifTrue: [\x0a\x09\x09\x09statements last replaceWith: (IRAssignment new\x0a\x09\x09\x09\x09add: self assignment left;\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself) ] ].\x0a\x0a\x09^ inlinedClosure",
  2146. referencedClasses: ["IRAssignment"],
  2147. //>>excludeEnd("ide");
  2148. messageSends: ["inlineClosure:", "instructions", "sequence", "ifNotEmpty:", "ifTrue:", "canBeAssigned", "last", "replaceWith:", "add:", "new", "left", "assignment", "copy", "yourself"]
  2149. }),
  2150. $globals.IRAssignmentInliner);
  2151. $core.addClass('IRReturnInliner', $globals.IRSendInliner, [], 'Compiler-Inlining');
  2152. //>>excludeStart("ide", pragmas.excludeIdeData);
  2153. $globals.IRReturnInliner.comment="I inline message sends with inlined closure together with a return instruction.";
  2154. //>>excludeEnd("ide");
  2155. $core.addMethod(
  2156. $core.method({
  2157. selector: "inlineClosure:",
  2158. protocol: 'inlining',
  2159. fn: function (anIRClosure){
  2160. var self=this;
  2161. var closure,statements;
  2162. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2163. return $core.withContext(function($ctx1) {
  2164. //>>excludeEnd("ctx");
  2165. var $2,$1,$3,$5,$4;
  2166. closure=(
  2167. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2168. $ctx1.supercall = true,
  2169. //>>excludeEnd("ctx");
  2170. ($globals.IRReturnInliner.superclass||$boot.nilAsClass).fn.prototype._inlineClosure_.apply($recv(self), [anIRClosure]));
  2171. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2172. $ctx1.supercall = false;
  2173. //>>excludeEnd("ctx");;
  2174. statements=$recv($recv(closure)._sequence())._instructions();
  2175. $recv(statements)._ifNotEmpty_((function(){
  2176. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2177. return $core.withContext(function($ctx2) {
  2178. //>>excludeEnd("ctx");
  2179. $2=$recv(statements)._last();
  2180. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2181. $ctx2.sendIdx["last"]=1;
  2182. //>>excludeEnd("ctx");
  2183. $1=$recv($2)._isReturn();
  2184. if(!$core.assert($1)){
  2185. $3=$recv(statements)._last();
  2186. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2187. $ctx2.sendIdx["last"]=2;
  2188. //>>excludeEnd("ctx");
  2189. $5=$recv($globals.IRReturn)._new();
  2190. $recv($5)._add_($recv($recv(statements)._last())._copy());
  2191. $4=$recv($5)._yourself();
  2192. return $recv($3)._replaceWith_($4);
  2193. };
  2194. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2195. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2196. //>>excludeEnd("ctx");
  2197. }));
  2198. return closure;
  2199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2200. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,closure:closure,statements:statements},$globals.IRReturnInliner)});
  2201. //>>excludeEnd("ctx");
  2202. },
  2203. //>>excludeStart("ide", pragmas.excludeIdeData);
  2204. args: ["anIRClosure"],
  2205. source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure sequence instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last isReturn\x0a\x09\x09\x09ifFalse: [ statements last replaceWith: (IRReturn new\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself)] ].\x0a\x0a\x09^ closure",
  2206. referencedClasses: ["IRReturn"],
  2207. //>>excludeEnd("ide");
  2208. messageSends: ["inlineClosure:", "instructions", "sequence", "ifNotEmpty:", "ifFalse:", "isReturn", "last", "replaceWith:", "add:", "new", "copy", "yourself"]
  2209. }),
  2210. $globals.IRReturnInliner);
  2211. $core.addMethod(
  2212. $core.method({
  2213. selector: "inlineReturn:",
  2214. protocol: 'inlining',
  2215. fn: function (anIRReturn){
  2216. var self=this;
  2217. var return_;
  2218. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2219. return $core.withContext(function($ctx1) {
  2220. //>>excludeEnd("ctx");
  2221. return_=self._inlinedReturn();
  2222. $recv($recv(anIRReturn)._instructions())._do_((function(each){
  2223. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2224. return $core.withContext(function($ctx2) {
  2225. //>>excludeEnd("ctx");
  2226. return $recv(return_)._add_(each);
  2227. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2228. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  2229. //>>excludeEnd("ctx");
  2230. }));
  2231. $recv(anIRReturn)._replaceWith_(return_);
  2232. self._inlineSend_($recv(return_)._expression());
  2233. return return_;
  2234. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2235. }, function($ctx1) {$ctx1.fill(self,"inlineReturn:",{anIRReturn:anIRReturn,return_:return_},$globals.IRReturnInliner)});
  2236. //>>excludeEnd("ctx");
  2237. },
  2238. //>>excludeStart("ide", pragmas.excludeIdeData);
  2239. args: ["anIRReturn"],
  2240. source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn instructions do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return expression.\x0a\x09^ return",
  2241. referencedClasses: [],
  2242. //>>excludeEnd("ide");
  2243. messageSends: ["inlinedReturn", "do:", "instructions", "add:", "replaceWith:", "inlineSend:", "expression"]
  2244. }),
  2245. $globals.IRReturnInliner);
  2246. $core.addMethod(
  2247. $core.method({
  2248. selector: "inlinedReturn",
  2249. protocol: 'factory',
  2250. fn: function (){
  2251. var self=this;
  2252. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2253. return $core.withContext(function($ctx1) {
  2254. //>>excludeEnd("ctx");
  2255. return $recv($globals.IRInlinedReturn)._new();
  2256. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2257. }, function($ctx1) {$ctx1.fill(self,"inlinedReturn",{},$globals.IRReturnInliner)});
  2258. //>>excludeEnd("ctx");
  2259. },
  2260. //>>excludeStart("ide", pragmas.excludeIdeData);
  2261. args: [],
  2262. source: "inlinedReturn\x0a\x09^ IRInlinedReturn new",
  2263. referencedClasses: ["IRInlinedReturn"],
  2264. //>>excludeEnd("ide");
  2265. messageSends: ["new"]
  2266. }),
  2267. $globals.IRReturnInliner);
  2268. $core.addClass('InliningCodeGenerator', $globals.CodeGenerator, [], 'Compiler-Inlining');
  2269. //>>excludeStart("ide", pragmas.excludeIdeData);
  2270. $globals.InliningCodeGenerator.comment="I am a specialized code generator that uses inlining to produce more optimized JavaScript output";
  2271. //>>excludeEnd("ide");
  2272. $core.addMethod(
  2273. $core.method({
  2274. selector: "compileNode:",
  2275. protocol: 'compiling',
  2276. fn: function (aNode){
  2277. var self=this;
  2278. var ir,stream;
  2279. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2280. return $core.withContext(function($ctx1) {
  2281. //>>excludeEnd("ctx");
  2282. var $1;
  2283. $recv(self._semanticAnalyzer())._visit_(aNode);
  2284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2285. $ctx1.sendIdx["visit:"]=1;
  2286. //>>excludeEnd("ctx");
  2287. ir=$recv(self._translator())._visit_(aNode);
  2288. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2289. $ctx1.sendIdx["visit:"]=2;
  2290. //>>excludeEnd("ctx");
  2291. $recv(self._inliner())._visit_(ir);
  2292. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2293. $ctx1.sendIdx["visit:"]=3;
  2294. //>>excludeEnd("ctx");
  2295. $1=self._irTranslator();
  2296. $recv($1)._currentClass_(self._currentClass());
  2297. $recv($1)._visit_(ir);
  2298. return $recv($1)._contents();
  2299. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2300. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream},$globals.InliningCodeGenerator)});
  2301. //>>excludeEnd("ctx");
  2302. },
  2303. //>>excludeStart("ide", pragmas.excludeIdeData);
  2304. args: ["aNode"],
  2305. source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09self inliner visit: ir.\x0a\x0a\x09^ self irTranslator\x0a\x09\x09currentClass: self currentClass;\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
  2306. referencedClasses: [],
  2307. //>>excludeEnd("ide");
  2308. messageSends: ["visit:", "semanticAnalyzer", "translator", "inliner", "currentClass:", "irTranslator", "currentClass", "contents"]
  2309. }),
  2310. $globals.InliningCodeGenerator);
  2311. $core.addMethod(
  2312. $core.method({
  2313. selector: "inliner",
  2314. protocol: 'compiling',
  2315. fn: function (){
  2316. var self=this;
  2317. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2318. return $core.withContext(function($ctx1) {
  2319. //>>excludeEnd("ctx");
  2320. return $recv($globals.IRInliner)._new();
  2321. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2322. }, function($ctx1) {$ctx1.fill(self,"inliner",{},$globals.InliningCodeGenerator)});
  2323. //>>excludeEnd("ctx");
  2324. },
  2325. //>>excludeStart("ide", pragmas.excludeIdeData);
  2326. args: [],
  2327. source: "inliner\x0a\x09^ IRInliner new",
  2328. referencedClasses: ["IRInliner"],
  2329. //>>excludeEnd("ide");
  2330. messageSends: ["new"]
  2331. }),
  2332. $globals.InliningCodeGenerator);
  2333. $core.addMethod(
  2334. $core.method({
  2335. selector: "irTranslator",
  2336. protocol: 'compiling',
  2337. fn: function (){
  2338. var self=this;
  2339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2340. return $core.withContext(function($ctx1) {
  2341. //>>excludeEnd("ctx");
  2342. return $recv($globals.IRInliningJSTranslator)._new();
  2343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2344. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{},$globals.InliningCodeGenerator)});
  2345. //>>excludeEnd("ctx");
  2346. },
  2347. //>>excludeStart("ide", pragmas.excludeIdeData);
  2348. args: [],
  2349. source: "irTranslator\x0a\x09^ IRInliningJSTranslator new",
  2350. referencedClasses: ["IRInliningJSTranslator"],
  2351. //>>excludeEnd("ide");
  2352. messageSends: ["new"]
  2353. }),
  2354. $globals.InliningCodeGenerator);
  2355. $core.addClass('InliningError', $globals.SemanticError, [], 'Compiler-Inlining');
  2356. //>>excludeStart("ide", pragmas.excludeIdeData);
  2357. $globals.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`.";
  2358. //>>excludeEnd("ide");
  2359. });