Compiler-Inlining.js 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  1. smalltalk.addPackage('Compiler-Inlining', {});
  2. smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler-Inlining');
  3. smalltalk.IRInlinedAssignment.comment="I represent an inlined assignment instruction."
  4. smalltalk.addMethod(
  5. "_accept_",
  6. smalltalk.method({
  7. selector: "accept:",
  8. category: 'visiting',
  9. fn: function (aVisitor){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) { var $1;
  12. $1=_st(aVisitor)._visitIRInlinedAssignment_(self);
  13. return $1;
  14. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedAssignment)})},
  15. args: ["aVisitor"],
  16. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedAssignment: self",
  17. messageSends: ["visitIRInlinedAssignment:"],
  18. referencedClasses: []
  19. }),
  20. smalltalk.IRInlinedAssignment);
  21. smalltalk.addMethod(
  22. "_isInlined",
  23. smalltalk.method({
  24. selector: "isInlined",
  25. category: 'testing',
  26. fn: function (){
  27. var self=this;
  28. return smalltalk.withContext(function($ctx1) { return true;
  29. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedAssignment)})},
  30. args: [],
  31. source: "isInlined\x0a\x09^ true",
  32. messageSends: [],
  33. referencedClasses: []
  34. }),
  35. smalltalk.IRInlinedAssignment);
  36. smalltalk.addClass('IRInlinedClosure', smalltalk.IRClosure, [], 'Compiler-Inlining');
  37. smalltalk.IRInlinedClosure.comment="I represent an inlined closure instruction."
  38. smalltalk.addMethod(
  39. "_accept_",
  40. smalltalk.method({
  41. selector: "accept:",
  42. category: 'visiting',
  43. fn: function (aVisitor){
  44. var self=this;
  45. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedClosure_(self);
  46. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedClosure)})},
  47. args: ["aVisitor"],
  48. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedClosure: self",
  49. messageSends: ["visitIRInlinedClosure:"],
  50. referencedClasses: []
  51. }),
  52. smalltalk.IRInlinedClosure);
  53. smalltalk.addMethod(
  54. "_isInlined",
  55. smalltalk.method({
  56. selector: "isInlined",
  57. category: 'testing',
  58. fn: function (){
  59. var self=this;
  60. return smalltalk.withContext(function($ctx1) { return true;
  61. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedClosure)})},
  62. args: [],
  63. source: "isInlined\x0a\x09^ true",
  64. messageSends: [],
  65. referencedClasses: []
  66. }),
  67. smalltalk.IRInlinedClosure);
  68. smalltalk.addClass('IRInlinedReturn', smalltalk.IRReturn, [], 'Compiler-Inlining');
  69. smalltalk.IRInlinedReturn.comment="I represent an inlined local return instruction."
  70. smalltalk.addMethod(
  71. "_accept_",
  72. smalltalk.method({
  73. selector: "accept:",
  74. category: 'visiting',
  75. fn: function (aVisitor){
  76. var self=this;
  77. return smalltalk.withContext(function($ctx1) { var $1;
  78. $1=_st(aVisitor)._visitIRInlinedReturn_(self);
  79. return $1;
  80. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedReturn)})},
  81. args: ["aVisitor"],
  82. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedReturn: self",
  83. messageSends: ["visitIRInlinedReturn:"],
  84. referencedClasses: []
  85. }),
  86. smalltalk.IRInlinedReturn);
  87. smalltalk.addMethod(
  88. "_isInlined",
  89. smalltalk.method({
  90. selector: "isInlined",
  91. category: 'testing',
  92. fn: function (){
  93. var self=this;
  94. return smalltalk.withContext(function($ctx1) { return true;
  95. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedReturn)})},
  96. args: [],
  97. source: "isInlined\x0a\x09^ true",
  98. messageSends: [],
  99. referencedClasses: []
  100. }),
  101. smalltalk.IRInlinedReturn);
  102. smalltalk.addClass('IRInlinedNonLocalReturn', smalltalk.IRInlinedReturn, [], 'Compiler-Inlining');
  103. smalltalk.IRInlinedNonLocalReturn.comment="I represent an inlined non local return instruction."
  104. smalltalk.addMethod(
  105. "_accept_",
  106. smalltalk.method({
  107. selector: "accept:",
  108. category: 'visiting',
  109. fn: function (aVisitor){
  110. var self=this;
  111. return smalltalk.withContext(function($ctx1) { var $1;
  112. $1=_st(aVisitor)._visitIRInlinedNonLocalReturn_(self);
  113. return $1;
  114. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedNonLocalReturn)})},
  115. args: ["aVisitor"],
  116. source: "accept: aVisitor\x0a\x09^ aVisitor visitIRInlinedNonLocalReturn: self",
  117. messageSends: ["visitIRInlinedNonLocalReturn:"],
  118. referencedClasses: []
  119. }),
  120. smalltalk.IRInlinedNonLocalReturn);
  121. smalltalk.addMethod(
  122. "_isInlined",
  123. smalltalk.method({
  124. selector: "isInlined",
  125. category: 'testing',
  126. fn: function (){
  127. var self=this;
  128. return smalltalk.withContext(function($ctx1) { return true;
  129. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedNonLocalReturn)})},
  130. args: [],
  131. source: "isInlined\x0a\x09^ true",
  132. messageSends: [],
  133. referencedClasses: []
  134. }),
  135. smalltalk.IRInlinedNonLocalReturn);
  136. smalltalk.addClass('IRInlinedSend', smalltalk.IRSend, [], 'Compiler-Inlining');
  137. smalltalk.IRInlinedSend.comment="I am the abstract super class of inlined message send instructions."
  138. smalltalk.addMethod(
  139. "_accept_",
  140. smalltalk.method({
  141. selector: "accept:",
  142. category: 'visiting',
  143. fn: function (aVisitor){
  144. var self=this;
  145. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitInlinedSend_(self);
  146. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedSend)})},
  147. args: ["aVisitor"],
  148. source: "accept: aVisitor\x0a\x09aVisitor visitInlinedSend: self",
  149. messageSends: ["visitInlinedSend:"],
  150. referencedClasses: []
  151. }),
  152. smalltalk.IRInlinedSend);
  153. smalltalk.addMethod(
  154. "_isInlined",
  155. smalltalk.method({
  156. selector: "isInlined",
  157. category: 'testing',
  158. fn: function (){
  159. var self=this;
  160. return smalltalk.withContext(function($ctx1) { return true;
  161. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedSend)})},
  162. args: [],
  163. source: "isInlined\x0a\x09^ true",
  164. messageSends: [],
  165. referencedClasses: []
  166. }),
  167. smalltalk.IRInlinedSend);
  168. smalltalk.addClass('IRInlinedIfFalse', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  169. smalltalk.addMethod(
  170. "_accept_",
  171. smalltalk.method({
  172. selector: "accept:",
  173. category: 'visiting',
  174. fn: function (aVisitor){
  175. var self=this;
  176. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfFalse_(self);
  177. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfFalse)})},
  178. args: ["aVisitor"],
  179. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfFalse: self",
  180. messageSends: ["visitIRInlinedIfFalse:"],
  181. referencedClasses: []
  182. }),
  183. smalltalk.IRInlinedIfFalse);
  184. smalltalk.addClass('IRInlinedIfNilIfNotNil', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  185. smalltalk.addMethod(
  186. "_accept_",
  187. smalltalk.method({
  188. selector: "accept:",
  189. category: 'visiting',
  190. fn: function (aVisitor){
  191. var self=this;
  192. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfNilIfNotNil_(self);
  193. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfNilIfNotNil)})},
  194. args: ["aVisitor"],
  195. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfNilIfNotNil: self",
  196. messageSends: ["visitIRInlinedIfNilIfNotNil:"],
  197. referencedClasses: []
  198. }),
  199. smalltalk.IRInlinedIfNilIfNotNil);
  200. smalltalk.addClass('IRInlinedIfTrue', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  201. smalltalk.addMethod(
  202. "_accept_",
  203. smalltalk.method({
  204. selector: "accept:",
  205. category: 'visiting',
  206. fn: function (aVisitor){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfTrue_(self);
  209. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfTrue)})},
  210. args: ["aVisitor"],
  211. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrue: self",
  212. messageSends: ["visitIRInlinedIfTrue:"],
  213. referencedClasses: []
  214. }),
  215. smalltalk.IRInlinedIfTrue);
  216. smalltalk.addClass('IRInlinedIfTrueIfFalse', smalltalk.IRInlinedSend, [], 'Compiler-Inlining');
  217. smalltalk.addMethod(
  218. "_accept_",
  219. smalltalk.method({
  220. selector: "accept:",
  221. category: 'visiting',
  222. fn: function (aVisitor){
  223. var self=this;
  224. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedIfTrueIfFalse_(self);
  225. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedIfTrueIfFalse)})},
  226. args: ["aVisitor"],
  227. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedIfTrueIfFalse: self",
  228. messageSends: ["visitIRInlinedIfTrueIfFalse:"],
  229. referencedClasses: []
  230. }),
  231. smalltalk.IRInlinedIfTrueIfFalse);
  232. smalltalk.addClass('IRInlinedSequence', smalltalk.IRBlockSequence, [], 'Compiler-Inlining');
  233. smalltalk.IRInlinedSequence.comment="I represent a (block) sequence inside an inlined closure instruction (instance of `IRInlinedClosure`)."
  234. smalltalk.addMethod(
  235. "_accept_",
  236. smalltalk.method({
  237. selector: "accept:",
  238. category: 'visiting',
  239. fn: function (aVisitor){
  240. var self=this;
  241. return smalltalk.withContext(function($ctx1) { _st(aVisitor)._visitIRInlinedSequence_(self);
  242. return self}, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor}, smalltalk.IRInlinedSequence)})},
  243. args: ["aVisitor"],
  244. source: "accept: aVisitor\x0a\x09aVisitor visitIRInlinedSequence: self",
  245. messageSends: ["visitIRInlinedSequence:"],
  246. referencedClasses: []
  247. }),
  248. smalltalk.IRInlinedSequence);
  249. smalltalk.addMethod(
  250. "_isInlined",
  251. smalltalk.method({
  252. selector: "isInlined",
  253. category: 'testing',
  254. fn: function (){
  255. var self=this;
  256. return smalltalk.withContext(function($ctx1) { return true;
  257. }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.IRInlinedSequence)})},
  258. args: [],
  259. source: "isInlined\x0a\x09^ true",
  260. messageSends: [],
  261. referencedClasses: []
  262. }),
  263. smalltalk.IRInlinedSequence);
  264. smalltalk.addClass('IRInliner', smalltalk.IRVisitor, [], 'Compiler-Inlining');
  265. smalltalk.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`"
  266. smalltalk.addMethod(
  267. "_assignmentInliner",
  268. smalltalk.method({
  269. selector: "assignmentInliner",
  270. category: 'factory',
  271. fn: function (){
  272. var self=this;
  273. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  274. $2=_st((smalltalk.IRAssignmentInliner || IRAssignmentInliner))._new();
  275. _st($2)._translator_(self);
  276. $3=_st($2)._yourself();
  277. $1=$3;
  278. return $1;
  279. }, function($ctx1) {$ctx1.fill(self,"assignmentInliner",{}, smalltalk.IRInliner)})},
  280. args: [],
  281. source: "assignmentInliner\x0a\x09^ IRAssignmentInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  282. messageSends: ["translator:", "new", "yourself"],
  283. referencedClasses: ["IRAssignmentInliner"]
  284. }),
  285. smalltalk.IRInliner);
  286. smalltalk.addMethod(
  287. "_nonLocalReturnInliner",
  288. smalltalk.method({
  289. selector: "nonLocalReturnInliner",
  290. category: 'factory',
  291. fn: function (){
  292. var self=this;
  293. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  294. $2=_st((smalltalk.IRNonLocalReturnInliner || IRNonLocalReturnInliner))._new();
  295. _st($2)._translator_(self);
  296. $3=_st($2)._yourself();
  297. $1=$3;
  298. return $1;
  299. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturnInliner",{}, smalltalk.IRInliner)})},
  300. args: [],
  301. source: "nonLocalReturnInliner\x0a\x09^ IRNonLocalReturnInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  302. messageSends: ["translator:", "new", "yourself"],
  303. referencedClasses: ["IRNonLocalReturnInliner"]
  304. }),
  305. smalltalk.IRInliner);
  306. smalltalk.addMethod(
  307. "_returnInliner",
  308. smalltalk.method({
  309. selector: "returnInliner",
  310. category: 'factory',
  311. fn: function (){
  312. var self=this;
  313. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  314. $2=_st((smalltalk.IRReturnInliner || IRReturnInliner))._new();
  315. _st($2)._translator_(self);
  316. $3=_st($2)._yourself();
  317. $1=$3;
  318. return $1;
  319. }, function($ctx1) {$ctx1.fill(self,"returnInliner",{}, smalltalk.IRInliner)})},
  320. args: [],
  321. source: "returnInliner\x0a\x09^ IRReturnInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  322. messageSends: ["translator:", "new", "yourself"],
  323. referencedClasses: ["IRReturnInliner"]
  324. }),
  325. smalltalk.IRInliner);
  326. smalltalk.addMethod(
  327. "_sendInliner",
  328. smalltalk.method({
  329. selector: "sendInliner",
  330. category: 'factory',
  331. fn: function (){
  332. var self=this;
  333. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  334. $2=_st((smalltalk.IRSendInliner || IRSendInliner))._new();
  335. _st($2)._translator_(self);
  336. $3=_st($2)._yourself();
  337. $1=$3;
  338. return $1;
  339. }, function($ctx1) {$ctx1.fill(self,"sendInliner",{}, smalltalk.IRInliner)})},
  340. args: [],
  341. source: "sendInliner\x0a\x09^ IRSendInliner new \x0a\x09\x09translator: self;\x0a\x09\x09yourself",
  342. messageSends: ["translator:", "new", "yourself"],
  343. referencedClasses: ["IRSendInliner"]
  344. }),
  345. smalltalk.IRInliner);
  346. smalltalk.addMethod(
  347. "_shouldInlineAssignment_",
  348. smalltalk.method({
  349. selector: "shouldInlineAssignment:",
  350. category: 'testing',
  351. fn: function (anIRAssignment){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) { var $1;
  354. $1=_st(_st(_st(anIRAssignment)._isInlined())._not())._and_((function(){
  355. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(_st(anIRAssignment)._instructions())._last())._isSend())._and_((function(){
  356. return smalltalk.withContext(function($ctx3) { return _st(self)._shouldInlineSend_(_st(_st(anIRAssignment)._instructions())._last());
  357. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  358. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  359. return $1;
  360. }, function($ctx1) {$ctx1.fill(self,"shouldInlineAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRInliner)})},
  361. args: ["anIRAssignment"],
  362. source: "shouldInlineAssignment: anIRAssignment\x0a\x09^ anIRAssignment isInlined not and: [ \x0a\x09\x09anIRAssignment instructions last isSend and: [\x09\x0a\x09\x09\x09self shouldInlineSend: (anIRAssignment instructions last) ]]",
  363. messageSends: ["and:", "shouldInlineSend:", "last", "instructions", "isSend", "not", "isInlined"],
  364. referencedClasses: []
  365. }),
  366. smalltalk.IRInliner);
  367. smalltalk.addMethod(
  368. "_shouldInlineReturn_",
  369. smalltalk.method({
  370. selector: "shouldInlineReturn:",
  371. category: 'testing',
  372. fn: function (anIRReturn){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) { var $1;
  375. $1=_st(_st(_st(anIRReturn)._isInlined())._not())._and_((function(){
  376. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(_st(anIRReturn)._instructions())._first())._isSend())._and_((function(){
  377. return smalltalk.withContext(function($ctx3) { return _st(self)._shouldInlineSend_(_st(_st(anIRReturn)._instructions())._first());
  378. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  379. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  380. return $1;
  381. }, function($ctx1) {$ctx1.fill(self,"shouldInlineReturn:",{anIRReturn:anIRReturn}, smalltalk.IRInliner)})},
  382. args: ["anIRReturn"],
  383. source: "shouldInlineReturn: anIRReturn\x0a\x09^ anIRReturn isInlined not and: [ \x0a\x09\x09anIRReturn instructions first isSend and: [\x09\x0a\x09\x09\x09self shouldInlineSend: (anIRReturn instructions first) ]]",
  384. messageSends: ["and:", "shouldInlineSend:", "first", "instructions", "isSend", "not", "isInlined"],
  385. referencedClasses: []
  386. }),
  387. smalltalk.IRInliner);
  388. smalltalk.addMethod(
  389. "_shouldInlineSend_",
  390. smalltalk.method({
  391. selector: "shouldInlineSend:",
  392. category: 'testing',
  393. fn: function (anIRSend){
  394. var self=this;
  395. return smalltalk.withContext(function($ctx1) { var $1;
  396. $1=_st(_st(_st(anIRSend)._isInlined())._not())._and_((function(){
  397. return smalltalk.withContext(function($ctx2) { return _st((smalltalk.IRSendInliner || IRSendInliner))._shouldInline_(anIRSend);
  398. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  399. return $1;
  400. }, function($ctx1) {$ctx1.fill(self,"shouldInlineSend:",{anIRSend:anIRSend}, smalltalk.IRInliner)})},
  401. args: ["anIRSend"],
  402. source: "shouldInlineSend: anIRSend\x0a\x09^ anIRSend isInlined not and: [\x0a\x09\x09IRSendInliner shouldInline: anIRSend ]",
  403. messageSends: ["and:", "shouldInline:", "not", "isInlined"],
  404. referencedClasses: ["IRSendInliner"]
  405. }),
  406. smalltalk.IRInliner);
  407. smalltalk.addMethod(
  408. "_transformNonLocalReturn_",
  409. smalltalk.method({
  410. selector: "transformNonLocalReturn:",
  411. category: 'visiting',
  412. fn: function (anIRNonLocalReturn){
  413. var self=this;
  414. var localReturn;
  415. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  416. $1=_st(_st(anIRNonLocalReturn)._scope())._canInlineNonLocalReturns();
  417. if(smalltalk.assert($1)){
  418. _st(_st(_st(anIRNonLocalReturn)._scope())._methodScope())._removeNonLocalReturn_(_st(anIRNonLocalReturn)._scope());
  419. $2=_st((smalltalk.IRReturn || IRReturn))._new();
  420. _st($2)._scope_(_st(anIRNonLocalReturn)._scope());
  421. $3=_st($2)._yourself();
  422. localReturn=$3;
  423. localReturn;
  424. _st(_st(anIRNonLocalReturn)._instructions())._do_((function(each){
  425. return smalltalk.withContext(function($ctx2) { return _st(localReturn)._add_(each);
  426. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  427. _st(anIRNonLocalReturn)._replaceWith_(localReturn);
  428. $4=localReturn;
  429. return $4;
  430. };
  431. $5=smalltalk.IRVisitor.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
  432. return $5;
  433. }, function($ctx1) {$ctx1.fill(self,"transformNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn,localReturn:localReturn}, smalltalk.IRInliner)})},
  434. args: ["anIRNonLocalReturn"],
  435. 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",
  436. messageSends: ["ifTrue:", "removeNonLocalReturn:", "scope", "methodScope", "scope:", "new", "yourself", "do:", "add:", "instructions", "replaceWith:", "canInlineNonLocalReturns", "visitIRNonLocalReturn:"],
  437. referencedClasses: ["IRReturn"]
  438. }),
  439. smalltalk.IRInliner);
  440. smalltalk.addMethod(
  441. "_visitIRAssignment_",
  442. smalltalk.method({
  443. selector: "visitIRAssignment:",
  444. category: 'visiting',
  445. fn: function (anIRAssignment){
  446. var self=this;
  447. return smalltalk.withContext(function($ctx1) { var $2,$1;
  448. $2=_st(self)._shouldInlineAssignment_(anIRAssignment);
  449. if(smalltalk.assert($2)){
  450. $1=_st(_st(self)._assignmentInliner())._inlineAssignment_(anIRAssignment);
  451. } else {
  452. $1=smalltalk.IRVisitor.fn.prototype._visitIRAssignment_.apply(_st(self), [anIRAssignment]);
  453. };
  454. return $1;
  455. }, function($ctx1) {$ctx1.fill(self,"visitIRAssignment:",{anIRAssignment:anIRAssignment}, smalltalk.IRInliner)})},
  456. args: ["anIRAssignment"],
  457. source: "visitIRAssignment: anIRAssignment\x0a\x09^ (self shouldInlineAssignment: anIRAssignment) \x0a\x09\x09ifTrue: [ self assignmentInliner inlineAssignment: anIRAssignment ]\x0a\x09\x09ifFalse: [ super visitIRAssignment: anIRAssignment ]",
  458. messageSends: ["ifTrue:ifFalse:", "inlineAssignment:", "assignmentInliner", "visitIRAssignment:", "shouldInlineAssignment:"],
  459. referencedClasses: []
  460. }),
  461. smalltalk.IRInliner);
  462. smalltalk.addMethod(
  463. "_visitIRNonLocalReturn_",
  464. smalltalk.method({
  465. selector: "visitIRNonLocalReturn:",
  466. category: 'visiting',
  467. fn: function (anIRNonLocalReturn){
  468. var self=this;
  469. return smalltalk.withContext(function($ctx1) { var $2,$1;
  470. $2=_st(self)._shouldInlineReturn_(anIRNonLocalReturn);
  471. if(smalltalk.assert($2)){
  472. $1=_st(_st(self)._nonLocalReturnInliner())._inlineReturn_(anIRNonLocalReturn);
  473. } else {
  474. $1=_st(self)._transformNonLocalReturn_(anIRNonLocalReturn);
  475. };
  476. return $1;
  477. }, function($ctx1) {$ctx1.fill(self,"visitIRNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn}, smalltalk.IRInliner)})},
  478. args: ["anIRNonLocalReturn"],
  479. source: "visitIRNonLocalReturn: anIRNonLocalReturn\x0a\x09^ (self shouldInlineReturn: anIRNonLocalReturn) \x0a\x09\x09ifTrue: [ self nonLocalReturnInliner inlineReturn: anIRNonLocalReturn ]\x0a\x09\x09ifFalse: [ self transformNonLocalReturn: anIRNonLocalReturn ]",
  480. messageSends: ["ifTrue:ifFalse:", "inlineReturn:", "nonLocalReturnInliner", "transformNonLocalReturn:", "shouldInlineReturn:"],
  481. referencedClasses: []
  482. }),
  483. smalltalk.IRInliner);
  484. smalltalk.addMethod(
  485. "_visitIRReturn_",
  486. smalltalk.method({
  487. selector: "visitIRReturn:",
  488. category: 'visiting',
  489. fn: function (anIRReturn){
  490. var self=this;
  491. return smalltalk.withContext(function($ctx1) { var $2,$1;
  492. $2=_st(self)._shouldInlineReturn_(anIRReturn);
  493. if(smalltalk.assert($2)){
  494. $1=_st(_st(self)._returnInliner())._inlineReturn_(anIRReturn);
  495. } else {
  496. $1=smalltalk.IRVisitor.fn.prototype._visitIRReturn_.apply(_st(self), [anIRReturn]);
  497. };
  498. return $1;
  499. }, function($ctx1) {$ctx1.fill(self,"visitIRReturn:",{anIRReturn:anIRReturn}, smalltalk.IRInliner)})},
  500. args: ["anIRReturn"],
  501. source: "visitIRReturn: anIRReturn\x0a\x09^ (self shouldInlineReturn: anIRReturn) \x0a\x09\x09ifTrue: [ self returnInliner inlineReturn: anIRReturn ]\x0a\x09\x09ifFalse: [ super visitIRReturn: anIRReturn ]",
  502. messageSends: ["ifTrue:ifFalse:", "inlineReturn:", "returnInliner", "visitIRReturn:", "shouldInlineReturn:"],
  503. referencedClasses: []
  504. }),
  505. smalltalk.IRInliner);
  506. smalltalk.addMethod(
  507. "_visitIRSend_",
  508. smalltalk.method({
  509. selector: "visitIRSend:",
  510. category: 'visiting',
  511. fn: function (anIRSend){
  512. var self=this;
  513. return smalltalk.withContext(function($ctx1) { var $2,$1;
  514. $2=_st(self)._shouldInlineSend_(anIRSend);
  515. if(smalltalk.assert($2)){
  516. $1=_st(_st(self)._sendInliner())._inlineSend_(anIRSend);
  517. } else {
  518. $1=smalltalk.IRVisitor.fn.prototype._visitIRSend_.apply(_st(self), [anIRSend]);
  519. };
  520. return $1;
  521. }, function($ctx1) {$ctx1.fill(self,"visitIRSend:",{anIRSend:anIRSend}, smalltalk.IRInliner)})},
  522. args: ["anIRSend"],
  523. source: "visitIRSend: anIRSend\x0a\x09^ (self shouldInlineSend: anIRSend)\x0a\x09\x09ifTrue: [ self sendInliner inlineSend: anIRSend ]\x0a\x09\x09ifFalse: [ super visitIRSend: anIRSend ]",
  524. messageSends: ["ifTrue:ifFalse:", "inlineSend:", "sendInliner", "visitIRSend:", "shouldInlineSend:"],
  525. referencedClasses: []
  526. }),
  527. smalltalk.IRInliner);
  528. smalltalk.addClass('IRInliningJSTranslator', smalltalk.IRJSTranslator, [], 'Compiler-Inlining');
  529. smalltalk.IRInliningJSTranslator.comment="I am a specialized JavaScript translator able to write inlined IR instructions to JavaScript stream (`JSStream` instance)."
  530. smalltalk.addMethod(
  531. "_visitIRInlinedAssignment_",
  532. smalltalk.method({
  533. selector: "visitIRInlinedAssignment:",
  534. category: 'visiting',
  535. fn: function (anIRInlinedAssignment){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRInlinedAssignment)._instructions())._last());
  538. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedAssignment:",{anIRInlinedAssignment:anIRInlinedAssignment}, smalltalk.IRInliningJSTranslator)})},
  539. args: ["anIRInlinedAssignment"],
  540. source: "visitIRInlinedAssignment: anIRInlinedAssignment\x0a\x09self visit: anIRInlinedAssignment instructions last",
  541. messageSends: ["visit:", "last", "instructions"],
  542. referencedClasses: []
  543. }),
  544. smalltalk.IRInliningJSTranslator);
  545. smalltalk.addMethod(
  546. "_visitIRInlinedClosure_",
  547. smalltalk.method({
  548. selector: "visitIRInlinedClosure:",
  549. category: 'visiting',
  550. fn: function (anIRInlinedClosure){
  551. var self=this;
  552. return smalltalk.withContext(function($ctx1) { _st(_st(anIRInlinedClosure)._instructions())._do_((function(each){
  553. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  554. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  555. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedClosure:",{anIRInlinedClosure:anIRInlinedClosure}, smalltalk.IRInliningJSTranslator)})},
  556. args: ["anIRInlinedClosure"],
  557. source: "visitIRInlinedClosure: anIRInlinedClosure\x0a\x09anIRInlinedClosure instructions do: [ :each |\x0a\x09\x09self visit: each ]",
  558. messageSends: ["do:", "visit:", "instructions"],
  559. referencedClasses: []
  560. }),
  561. smalltalk.IRInliningJSTranslator);
  562. smalltalk.addMethod(
  563. "_visitIRInlinedIfFalse_",
  564. smalltalk.method({
  565. selector: "visitIRInlinedIfFalse:",
  566. category: 'visiting',
  567. fn: function (anIRInlinedIfFalse){
  568. var self=this;
  569. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIf_with_((function(){
  570. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("! smalltalk.assert(");
  571. _st(self)._visit_(_st(_st(anIRInlinedIfFalse)._instructions())._first());
  572. return _st(_st(self)._stream())._nextPutAll_(")");
  573. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  574. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfFalse)._instructions())._last());
  575. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  576. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfFalse:",{anIRInlinedIfFalse:anIRInlinedIfFalse}, smalltalk.IRInliningJSTranslator)})},
  577. args: ["anIRInlinedIfFalse"],
  578. source: "visitIRInlinedIfFalse: anIRInlinedIfFalse\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: '! smalltalk.assert('.\x0a\x09\x09self visit: anIRInlinedIfFalse instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfFalse instructions last ]",
  579. messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
  580. referencedClasses: []
  581. }),
  582. smalltalk.IRInliningJSTranslator);
  583. smalltalk.addMethod(
  584. "_visitIRInlinedIfNil_",
  585. smalltalk.method({
  586. selector: "visitIRInlinedIfNil:",
  587. category: 'visiting',
  588. fn: function (anIRInlinedIfNil){
  589. var self=this;
  590. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIf_with_((function(){
  591. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("($receiver = ");
  592. _st(self)._visit_(_st(_st(anIRInlinedIfNil)._instructions())._first());
  593. return _st(_st(self)._stream())._nextPutAll_(") == nil || $receiver == undefined");
  594. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  595. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfNil)._instructions())._last());
  596. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  597. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfNil:",{anIRInlinedIfNil:anIRInlinedIfNil}, smalltalk.IRInliningJSTranslator)})},
  598. args: ["anIRInlinedIfNil"],
  599. source: "visitIRInlinedIfNil: anIRInlinedIfNil\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: '($receiver = '. \x0a\x09\x09self visit: anIRInlinedIfNil instructions first.\x0a\x09\x09self stream nextPutAll: ') == nil || $receiver == undefined' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNil instructions last ]",
  600. messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
  601. referencedClasses: []
  602. }),
  603. smalltalk.IRInliningJSTranslator);
  604. smalltalk.addMethod(
  605. "_visitIRInlinedIfNilIfNotNil_",
  606. smalltalk.method({
  607. selector: "visitIRInlinedIfNilIfNotNil:",
  608. category: 'visiting',
  609. fn: function (anIRInlinedIfNilIfNotNil){
  610. var self=this;
  611. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIfElse_with_with_((function(){
  612. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("($receiver = ");
  613. _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._first());
  614. return _st(_st(self)._stream())._nextPutAll_(") == nil || $receiver == undefined");
  615. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  616. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._second());
  617. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  618. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._third());
  619. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  620. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfNilIfNotNil:",{anIRInlinedIfNilIfNotNil:anIRInlinedIfNilIfNotNil}, smalltalk.IRInliningJSTranslator)})},
  621. args: ["anIRInlinedIfNilIfNotNil"],
  622. source: "visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil\x0a\x09self stream \x0a\x09\x09nextPutIfElse: [ \x0a\x09\x09\x09self stream nextPutAll: '($receiver = '. \x0a\x09\x09\x09self visit: anIRInlinedIfNilIfNotNil instructions first.\x0a\x09\x09\x09self stream nextPutAll: ') == nil || $receiver == undefined' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfNilIfNotNil instructions third ]",
  623. messageSends: ["nextPutIfElse:with:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "second", "third"],
  624. referencedClasses: []
  625. }),
  626. smalltalk.IRInliningJSTranslator);
  627. smalltalk.addMethod(
  628. "_visitIRInlinedIfTrue_",
  629. smalltalk.method({
  630. selector: "visitIRInlinedIfTrue:",
  631. category: 'visiting',
  632. fn: function (anIRInlinedIfTrue){
  633. var self=this;
  634. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIf_with_((function(){
  635. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("smalltalk.assert(");
  636. _st(self)._visit_(_st(_st(anIRInlinedIfTrue)._instructions())._first());
  637. return _st(_st(self)._stream())._nextPutAll_(")");
  638. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  639. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfTrue)._instructions())._last());
  640. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  641. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrue:",{anIRInlinedIfTrue:anIRInlinedIfTrue}, smalltalk.IRInliningJSTranslator)})},
  642. args: ["anIRInlinedIfTrue"],
  643. source: "visitIRInlinedIfTrue: anIRInlinedIfTrue\x0a\x09self stream nextPutIf: [ \x0a\x09\x09self stream nextPutAll: 'smalltalk.assert('. \x0a\x09\x09self visit: anIRInlinedIfTrue instructions first.\x0a\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrue instructions last ]",
  644. messageSends: ["nextPutIf:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "last"],
  645. referencedClasses: []
  646. }),
  647. smalltalk.IRInliningJSTranslator);
  648. smalltalk.addMethod(
  649. "_visitIRInlinedIfTrueIfFalse_",
  650. smalltalk.method({
  651. selector: "visitIRInlinedIfTrueIfFalse:",
  652. category: 'visiting',
  653. fn: function (anIRInlinedIfTrueIfFalse){
  654. var self=this;
  655. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutIfElse_with_with_((function(){
  656. return smalltalk.withContext(function($ctx2) { _st(_st(self)._stream())._nextPutAll_("smalltalk.assert(");
  657. _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._first());
  658. return _st(_st(self)._stream())._nextPutAll_(")");
  659. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  660. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._second());
  661. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(function(){
  662. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._third());
  663. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  664. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrueIfFalse:",{anIRInlinedIfTrueIfFalse:anIRInlinedIfTrueIfFalse}, smalltalk.IRInliningJSTranslator)})},
  665. args: ["anIRInlinedIfTrueIfFalse"],
  666. source: "visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse\x0a\x09self stream \x0a\x09\x09nextPutIfElse: [ \x0a\x09\x09\x09self stream nextPutAll: 'smalltalk.assert('. \x0a\x09\x09\x09self visit: anIRInlinedIfTrueIfFalse instructions first.\x0a\x09\x09\x09self stream nextPutAll: ')' ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]\x0a\x09\x09with: [ self visit: anIRInlinedIfTrueIfFalse instructions third ]",
  667. messageSends: ["nextPutIfElse:with:with:", "nextPutAll:", "stream", "visit:", "first", "instructions", "second", "third"],
  668. referencedClasses: []
  669. }),
  670. smalltalk.IRInliningJSTranslator);
  671. smalltalk.addMethod(
  672. "_visitIRInlinedNonLocalReturn_",
  673. smalltalk.method({
  674. selector: "visitIRInlinedNonLocalReturn:",
  675. category: 'visiting',
  676. fn: function (anIRInlinedReturn){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) { _st(_st(self)._stream())._nextPutStatementWith_((function(){
  679. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
  680. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  681. _st(_st(self)._stream())._nextPutNonLocalReturnWith_((function(){
  682. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  683. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedNonLocalReturn:",{anIRInlinedReturn:anIRInlinedReturn}, smalltalk.IRInliningJSTranslator)})},
  684. args: ["anIRInlinedReturn"],
  685. source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn instructions last ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",
  686. messageSends: ["nextPutStatementWith:", "visit:", "last", "instructions", "stream", "nextPutNonLocalReturnWith:"],
  687. referencedClasses: []
  688. }),
  689. smalltalk.IRInliningJSTranslator);
  690. smalltalk.addMethod(
  691. "_visitIRInlinedReturn_",
  692. smalltalk.method({
  693. selector: "visitIRInlinedReturn:",
  694. category: 'visiting',
  695. fn: function (anIRInlinedReturn){
  696. var self=this;
  697. return smalltalk.withContext(function($ctx1) { _st(self)._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
  698. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedReturn:",{anIRInlinedReturn:anIRInlinedReturn}, smalltalk.IRInliningJSTranslator)})},
  699. args: ["anIRInlinedReturn"],
  700. source: "visitIRInlinedReturn: anIRInlinedReturn\x0a\x09self visit: anIRInlinedReturn instructions last",
  701. messageSends: ["visit:", "last", "instructions"],
  702. referencedClasses: []
  703. }),
  704. smalltalk.IRInliningJSTranslator);
  705. smalltalk.addMethod(
  706. "_visitIRInlinedSequence_",
  707. smalltalk.method({
  708. selector: "visitIRInlinedSequence:",
  709. category: 'visiting',
  710. fn: function (anIRInlinedSequence){
  711. var self=this;
  712. return smalltalk.withContext(function($ctx1) { _st(_st(anIRInlinedSequence)._instructions())._do_((function(each){
  713. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._stream())._nextPutStatementWith_((function(){
  714. return smalltalk.withContext(function($ctx3) { return _st(self)._visit_(each);
  715. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  716. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  717. return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedSequence:",{anIRInlinedSequence:anIRInlinedSequence}, smalltalk.IRInliningJSTranslator)})},
  718. args: ["anIRInlinedSequence"],
  719. source: "visitIRInlinedSequence: anIRInlinedSequence\x0a\x09anIRInlinedSequence instructions do: [ :each | \x0a\x09\x09self stream nextPutStatementWith: [ self visit: each ]]",
  720. messageSends: ["do:", "nextPutStatementWith:", "visit:", "stream", "instructions"],
  721. referencedClasses: []
  722. }),
  723. smalltalk.IRInliningJSTranslator);
  724. smalltalk.addClass('IRSendInliner', smalltalk.Object, ['send', 'translator'], 'Compiler-Inlining');
  725. smalltalk.IRSendInliner.comment="I inline some message sends and block closure arguments. I heavily rely on #perform: to dispatch inlining methods."
  726. smalltalk.addMethod(
  727. "_ifFalse_",
  728. smalltalk.method({
  729. selector: "ifFalse:",
  730. category: 'inlining',
  731. fn: function (anIRInstruction){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx1) { var $1;
  734. $1=_st(self)._inlinedSend_with_(_st((smalltalk.IRInlinedIfFalse || IRInlinedIfFalse))._new(),anIRInstruction);
  735. return $1;
  736. }, function($ctx1) {$ctx1.fill(self,"ifFalse:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  737. args: ["anIRInstruction"],
  738. source: "ifFalse: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfFalse new with: anIRInstruction",
  739. messageSends: ["inlinedSend:with:", "new"],
  740. referencedClasses: ["IRInlinedIfFalse"]
  741. }),
  742. smalltalk.IRSendInliner);
  743. smalltalk.addMethod(
  744. "_ifFalse_ifTrue_",
  745. smalltalk.method({
  746. selector: "ifFalse:ifTrue:",
  747. category: 'inlining',
  748. fn: function (anIRInstruction,anotherIRInstruction){
  749. var self=this;
  750. return smalltalk.withContext(function($ctx1) { var $1;
  751. $1=_st(self)._perform_withArguments_(smalltalk.symbolFor("ifTrue:ifFalse:"),[anotherIRInstruction,anIRInstruction]);
  752. return $1;
  753. }, function($ctx1) {$ctx1.fill(self,"ifFalse:ifTrue:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  754. args: ["anIRInstruction", "anotherIRInstruction"],
  755. source: "ifFalse: anIRInstruction ifTrue: anotherIRInstruction\x0a\x09^ self perform: #ifTrue:ifFalse: withArguments: { anotherIRInstruction. anIRInstruction }",
  756. messageSends: ["perform:withArguments:"],
  757. referencedClasses: []
  758. }),
  759. smalltalk.IRSendInliner);
  760. smalltalk.addMethod(
  761. "_ifNil_",
  762. smalltalk.method({
  763. selector: "ifNil:",
  764. category: 'inlining',
  765. fn: function (anIRInstruction){
  766. var self=this;
  767. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$5,$1;
  768. $2=_st((smalltalk.IRClosure || IRClosure))._new();
  769. _st($2)._scope_(_st(_st(anIRInstruction)._scope())._copy());
  770. $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
  771. _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
  772. $4=_st($3)._yourself();
  773. _st($2)._add_($4);
  774. $5=_st($2)._yourself();
  775. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anIRInstruction,$5);
  776. return $1;
  777. }, function($ctx1) {$ctx1.fill(self,"ifNil:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  778. args: ["anIRInstruction"],
  779. source: "ifNil: anIRInstruction\x0a\x09^ self \x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new \x0a\x09\x09with: anIRInstruction\x0a\x09\x09with: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send instructions first;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)",
  780. messageSends: ["inlinedSend:with:with:", "new", "scope:", "copy", "scope", "add:", "first", "instructions", "send", "yourself"],
  781. referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"]
  782. }),
  783. smalltalk.IRSendInliner);
  784. smalltalk.addMethod(
  785. "_ifNil_ifNotNil_",
  786. smalltalk.method({
  787. selector: "ifNil:ifNotNil:",
  788. category: 'inlining',
  789. fn: function (anIRInstruction,anotherIRInstruction){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) { var $1;
  792. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anIRInstruction,anotherIRInstruction);
  793. return $1;
  794. }, function($ctx1) {$ctx1.fill(self,"ifNil:ifNotNil:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  795. args: ["anIRInstruction", "anotherIRInstruction"],
  796. source: "ifNil: anIRInstruction ifNotNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new with: anIRInstruction with: anotherIRInstruction",
  797. messageSends: ["inlinedSend:with:with:", "new"],
  798. referencedClasses: ["IRInlinedIfNilIfNotNil"]
  799. }),
  800. smalltalk.IRSendInliner);
  801. smalltalk.addMethod(
  802. "_ifNotNil_",
  803. smalltalk.method({
  804. selector: "ifNotNil:",
  805. category: 'inlining',
  806. fn: function (anIRInstruction){
  807. var self=this;
  808. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$5,$1;
  809. $2=_st((smalltalk.IRClosure || IRClosure))._new();
  810. _st($2)._scope_(_st(_st(anIRInstruction)._scope())._copy());
  811. $3=_st((smalltalk.IRBlockSequence || IRBlockSequence))._new();
  812. _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
  813. $4=_st($3)._yourself();
  814. _st($2)._add_($4);
  815. $5=_st($2)._yourself();
  816. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),$5,anIRInstruction);
  817. return $1;
  818. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  819. args: ["anIRInstruction"],
  820. source: "ifNotNil: anIRInstruction\x0a\x09^ self \x0a\x09\x09inlinedSend: IRInlinedIfNilIfNotNil new\x0a\x09\x09with: (IRClosure new\x0a\x09\x09\x09scope: anIRInstruction scope copy;\x0a\x09\x09\x09add: (IRBlockSequence new\x0a\x09\x09\x09\x09add: self send instructions first;\x0a\x09\x09\x09\x09yourself);\x0a\x09\x09\x09yourself)\x0a\x09\x09with: anIRInstruction",
  821. messageSends: ["inlinedSend:with:with:", "new", "scope:", "copy", "scope", "add:", "first", "instructions", "send", "yourself"],
  822. referencedClasses: ["IRInlinedIfNilIfNotNil", "IRClosure", "IRBlockSequence"]
  823. }),
  824. smalltalk.IRSendInliner);
  825. smalltalk.addMethod(
  826. "_ifNotNil_ifNil_",
  827. smalltalk.method({
  828. selector: "ifNotNil:ifNil:",
  829. category: 'inlining',
  830. fn: function (anIRInstruction,anotherIRInstruction){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) { var $1;
  833. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfNilIfNotNil || IRInlinedIfNilIfNotNil))._new(),anotherIRInstruction,anIRInstruction);
  834. return $1;
  835. }, function($ctx1) {$ctx1.fill(self,"ifNotNil:ifNil:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  836. args: ["anIRInstruction", "anotherIRInstruction"],
  837. source: "ifNotNil: anIRInstruction ifNil: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfNilIfNotNil new with: anotherIRInstruction with: anIRInstruction",
  838. messageSends: ["inlinedSend:with:with:", "new"],
  839. referencedClasses: ["IRInlinedIfNilIfNotNil"]
  840. }),
  841. smalltalk.IRSendInliner);
  842. smalltalk.addMethod(
  843. "_ifTrue_",
  844. smalltalk.method({
  845. selector: "ifTrue:",
  846. category: 'inlining',
  847. fn: function (anIRInstruction){
  848. var self=this;
  849. return smalltalk.withContext(function($ctx1) { var $1;
  850. $1=_st(self)._inlinedSend_with_(_st((smalltalk.IRInlinedIfTrue || IRInlinedIfTrue))._new(),anIRInstruction);
  851. return $1;
  852. }, function($ctx1) {$ctx1.fill(self,"ifTrue:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner)})},
  853. args: ["anIRInstruction"],
  854. source: "ifTrue: anIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrue new with: anIRInstruction",
  855. messageSends: ["inlinedSend:with:", "new"],
  856. referencedClasses: ["IRInlinedIfTrue"]
  857. }),
  858. smalltalk.IRSendInliner);
  859. smalltalk.addMethod(
  860. "_ifTrue_ifFalse_",
  861. smalltalk.method({
  862. selector: "ifTrue:ifFalse:",
  863. category: 'inlining',
  864. fn: function (anIRInstruction,anotherIRInstruction){
  865. var self=this;
  866. return smalltalk.withContext(function($ctx1) { var $1;
  867. $1=_st(self)._inlinedSend_with_with_(_st((smalltalk.IRInlinedIfTrueIfFalse || IRInlinedIfTrueIfFalse))._new(),anIRInstruction,anotherIRInstruction);
  868. return $1;
  869. }, function($ctx1) {$ctx1.fill(self,"ifTrue:ifFalse:",{anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction}, smalltalk.IRSendInliner)})},
  870. args: ["anIRInstruction", "anotherIRInstruction"],
  871. source: "ifTrue: anIRInstruction ifFalse: anotherIRInstruction\x0a\x09^ self inlinedSend: IRInlinedIfTrueIfFalse new with: anIRInstruction with: anotherIRInstruction",
  872. messageSends: ["inlinedSend:with:with:", "new"],
  873. referencedClasses: ["IRInlinedIfTrueIfFalse"]
  874. }),
  875. smalltalk.IRSendInliner);
  876. smalltalk.addMethod(
  877. "_inlineClosure_",
  878. smalltalk.method({
  879. selector: "inlineClosure:",
  880. category: 'inlining',
  881. fn: function (anIRClosure){
  882. var self=this;
  883. var inlinedClosure,sequence,statements;
  884. return smalltalk.withContext(function($ctx1) { var $1,$3,$2,$4,$6,$5,$7;
  885. inlinedClosure=_st(self)._inlinedClosure();
  886. _st(inlinedClosure)._scope_(_st(anIRClosure)._scope());
  887. $1=_st(anIRClosure)._instructions();
  888. $2=(function(each){
  889. return smalltalk.withContext(function($ctx2) { $3=_st(each)._isSequence();
  890. if(! smalltalk.assert($3)){
  891. return _st(inlinedClosure)._add_(each);
  892. };
  893. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
  894. _st($1)._do_($2);
  895. sequence=_st(self)._inlinedSequence();
  896. _st(inlinedClosure)._add_(sequence);
  897. statements=_st(_st(_st(anIRClosure)._instructions())._last())._instructions();
  898. $4=statements;
  899. $5=(function(){
  900. return smalltalk.withContext(function($ctx2) { _st(_st(statements)._allButLast())._do_((function(each){
  901. return smalltalk.withContext(function($ctx3) { return _st(sequence)._add_(each);
  902. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  903. $6=_st(_st(_st(statements)._last())._isReturn())._and_((function(){
  904. return smalltalk.withContext(function($ctx3) { return _st(_st(statements)._last())._isBlockReturn();
  905. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  906. if(smalltalk.assert($6)){
  907. return _st(sequence)._add_(_st(_st(_st(statements)._last())._instructions())._first());
  908. } else {
  909. return _st(sequence)._add_(_st(statements)._last());
  910. };
  911. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  912. _st($4)._ifNotEmpty_($5);
  913. $7=inlinedClosure;
  914. return $7;
  915. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,sequence:sequence,statements:statements}, smalltalk.IRSendInliner)})},
  916. args: ["anIRClosure"],
  917. source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure sequence statements |\x0a\x0a\x09inlinedClosure := self inlinedClosure.\x0a\x09inlinedClosure scope: anIRClosure scope.\x0a\x0a\x09\x22Add the possible temp declarations\x22\x0a\x09anIRClosure instructions do: [ :each | \x0a\x09\x09each isSequence ifFalse: [\x0a\x09\x09\x09inlinedClosure add: each ]].\x0a\x0a\x09\x22Add a block sequence\x22\x0a\x09sequence := self inlinedSequence.\x0a\x09inlinedClosure add: sequence.\x0a\x0a\x09\x22Get all the statements\x22\x0a\x09statements := anIRClosure instructions last 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 instructions first ]\x0a\x09\x09\x09ifFalse: [ sequence add: statements last ] ].\x0a\x0a\x09^ inlinedClosure",
  918. messageSends: ["inlinedClosure", "scope:", "scope", "do:", "ifFalse:", "add:", "isSequence", "instructions", "inlinedSequence", "last", "ifNotEmpty:", "allButLast", "ifTrue:ifFalse:", "first", "and:", "isBlockReturn", "isReturn"],
  919. referencedClasses: []
  920. }),
  921. smalltalk.IRSendInliner);
  922. smalltalk.addMethod(
  923. "_inlineSend_",
  924. smalltalk.method({
  925. selector: "inlineSend:",
  926. category: 'inlining',
  927. fn: function (anIRSend){
  928. var self=this;
  929. return smalltalk.withContext(function($ctx1) { var $1;
  930. _st(self)._send_(anIRSend);
  931. $1=_st(self)._perform_withArguments_(_st(_st(self)._send())._selector(),_st(_st(_st(self)._send())._instructions())._allButFirst());
  932. return $1;
  933. }, function($ctx1) {$ctx1.fill(self,"inlineSend:",{anIRSend:anIRSend}, smalltalk.IRSendInliner)})},
  934. args: ["anIRSend"],
  935. source: "inlineSend: anIRSend\x0a\x09self send: anIRSend.\x0a\x09^ self \x0a\x09\x09perform: self send selector \x0a\x09\x09withArguments: self send instructions allButFirst",
  936. messageSends: ["send:", "perform:withArguments:", "selector", "send", "allButFirst", "instructions"],
  937. referencedClasses: []
  938. }),
  939. smalltalk.IRSendInliner);
  940. smalltalk.addMethod(
  941. "_inlinedClosure",
  942. smalltalk.method({
  943. selector: "inlinedClosure",
  944. category: 'factory',
  945. fn: function (){
  946. var self=this;
  947. return smalltalk.withContext(function($ctx1) { var $1;
  948. $1=_st((smalltalk.IRInlinedClosure || IRInlinedClosure))._new();
  949. return $1;
  950. }, function($ctx1) {$ctx1.fill(self,"inlinedClosure",{}, smalltalk.IRSendInliner)})},
  951. args: [],
  952. source: "inlinedClosure\x0a\x09^ IRInlinedClosure new",
  953. messageSends: ["new"],
  954. referencedClasses: ["IRInlinedClosure"]
  955. }),
  956. smalltalk.IRSendInliner);
  957. smalltalk.addMethod(
  958. "_inlinedSend_with_",
  959. smalltalk.method({
  960. selector: "inlinedSend:with:",
  961. category: 'inlining',
  962. fn: function (inlinedSend,anIRInstruction){
  963. var self=this;
  964. var inlinedClosure;
  965. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5;
  966. $1=_st(anIRInstruction)._isClosure();
  967. if(! smalltalk.assert($1)){
  968. _st(self)._inliningError_("Message argument should be a block");
  969. };
  970. $2=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
  971. if(! smalltalk.assert($2)){
  972. _st(self)._inliningError_("Inlined block should have zero argument");
  973. };
  974. inlinedClosure=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anIRInstruction));
  975. $3=inlinedSend;
  976. _st($3)._add_(_st(_st(_st(self)._send())._instructions())._first());
  977. $4=_st($3)._add_(inlinedClosure);
  978. _st(_st(self)._send())._replaceWith_(inlinedSend);
  979. $5=inlinedSend;
  980. return $5;
  981. }, function($ctx1) {$ctx1.fill(self,"inlinedSend:with:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,inlinedClosure:inlinedClosure}, smalltalk.IRSendInliner)})},
  982. args: ["inlinedSend", "anIRInstruction"],
  983. source: "inlinedSend: inlinedSend with: 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 instructions first;\x0a\x09\x09add: inlinedClosure.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x0a\x09^ inlinedSend",
  984. messageSends: ["ifFalse:", "inliningError:", "isClosure", "=", "size", "arguments", "visit:", "inlineClosure:", "translator", "add:", "first", "instructions", "send", "replaceWith:"],
  985. referencedClasses: []
  986. }),
  987. smalltalk.IRSendInliner);
  988. smalltalk.addMethod(
  989. "_inlinedSend_with_with_",
  990. smalltalk.method({
  991. selector: "inlinedSend:with:with:",
  992. category: 'inlining',
  993. fn: function (inlinedSend,anIRInstruction,anotherIRInstruction){
  994. var self=this;
  995. var inlinedClosure1,inlinedClosure2;
  996. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4,$5,$6,$7;
  997. $1=_st(anIRInstruction)._isClosure();
  998. if(! smalltalk.assert($1)){
  999. _st(self)._inliningError_("Message argument should be a block");
  1000. };
  1001. $2=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
  1002. if(! smalltalk.assert($2)){
  1003. _st(self)._inliningError_("Inlined block should have zero argument");
  1004. };
  1005. $3=_st(anotherIRInstruction)._isClosure();
  1006. if(! smalltalk.assert($3)){
  1007. _st(self)._inliningError_("Message argument should be a block");
  1008. };
  1009. $4=_st(_st(_st(anotherIRInstruction)._arguments())._size()).__eq((0));
  1010. if(! smalltalk.assert($4)){
  1011. _st(self)._inliningError_("Inlined block should have zero argument");
  1012. };
  1013. inlinedClosure1=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anIRInstruction));
  1014. inlinedClosure2=_st(_st(self)._translator())._visit_(_st(self)._inlineClosure_(anotherIRInstruction));
  1015. $5=inlinedSend;
  1016. _st($5)._add_(_st(_st(_st(self)._send())._instructions())._first());
  1017. _st($5)._add_(inlinedClosure1);
  1018. $6=_st($5)._add_(inlinedClosure2);
  1019. _st(_st(self)._send())._replaceWith_(inlinedSend);
  1020. $7=inlinedSend;
  1021. return $7;
  1022. }, function($ctx1) {$ctx1.fill(self,"inlinedSend:with:with:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction,inlinedClosure1:inlinedClosure1,inlinedClosure2:inlinedClosure2}, smalltalk.IRSendInliner)})},
  1023. args: ["inlinedSend", "anIRInstruction", "anotherIRInstruction"],
  1024. source: "inlinedSend: inlinedSend with: anIRInstruction with: anotherIRInstruction\x0a\x09| inlinedClosure1 inlinedClosure2 |\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\x09anotherIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anotherIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09inlinedClosure1 := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x09inlinedClosure2 := self translator visit: (self inlineClosure: anotherIRInstruction).\x0a\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send instructions first;\x0a\x09\x09add: inlinedClosure1;\x0a\x09\x09add: inlinedClosure2.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x09^ inlinedSend",
  1025. messageSends: ["ifFalse:", "inliningError:", "isClosure", "=", "size", "arguments", "visit:", "inlineClosure:", "translator", "add:", "first", "instructions", "send", "replaceWith:"],
  1026. referencedClasses: []
  1027. }),
  1028. smalltalk.IRSendInliner);
  1029. smalltalk.addMethod(
  1030. "_inlinedSequence",
  1031. smalltalk.method({
  1032. selector: "inlinedSequence",
  1033. category: 'factory',
  1034. fn: function (){
  1035. var self=this;
  1036. return smalltalk.withContext(function($ctx1) { var $1;
  1037. $1=_st((smalltalk.IRInlinedSequence || IRInlinedSequence))._new();
  1038. return $1;
  1039. }, function($ctx1) {$ctx1.fill(self,"inlinedSequence",{}, smalltalk.IRSendInliner)})},
  1040. args: [],
  1041. source: "inlinedSequence\x0a\x09^ IRInlinedSequence new",
  1042. messageSends: ["new"],
  1043. referencedClasses: ["IRInlinedSequence"]
  1044. }),
  1045. smalltalk.IRSendInliner);
  1046. smalltalk.addMethod(
  1047. "_inliningError_",
  1048. smalltalk.method({
  1049. selector: "inliningError:",
  1050. category: 'error handling',
  1051. fn: function (aString){
  1052. var self=this;
  1053. return smalltalk.withContext(function($ctx1) { _st((smalltalk.InliningError || InliningError))._signal_(aString);
  1054. return self}, function($ctx1) {$ctx1.fill(self,"inliningError:",{aString:aString}, smalltalk.IRSendInliner)})},
  1055. args: ["aString"],
  1056. source: "inliningError: aString\x0a\x09InliningError signal: aString",
  1057. messageSends: ["signal:"],
  1058. referencedClasses: ["InliningError"]
  1059. }),
  1060. smalltalk.IRSendInliner);
  1061. smalltalk.addMethod(
  1062. "_send",
  1063. smalltalk.method({
  1064. selector: "send",
  1065. category: 'accessing',
  1066. fn: function (){
  1067. var self=this;
  1068. return smalltalk.withContext(function($ctx1) { var $1;
  1069. $1=self["@send"];
  1070. return $1;
  1071. }, function($ctx1) {$ctx1.fill(self,"send",{}, smalltalk.IRSendInliner)})},
  1072. args: [],
  1073. source: "send\x0a\x09^ send",
  1074. messageSends: [],
  1075. referencedClasses: []
  1076. }),
  1077. smalltalk.IRSendInliner);
  1078. smalltalk.addMethod(
  1079. "_send_",
  1080. smalltalk.method({
  1081. selector: "send:",
  1082. category: 'accessing',
  1083. fn: function (anIRSend){
  1084. var self=this;
  1085. return smalltalk.withContext(function($ctx1) { self["@send"]=anIRSend;
  1086. return self}, function($ctx1) {$ctx1.fill(self,"send:",{anIRSend:anIRSend}, smalltalk.IRSendInliner)})},
  1087. args: ["anIRSend"],
  1088. source: "send: anIRSend\x0a\x09send := anIRSend",
  1089. messageSends: [],
  1090. referencedClasses: []
  1091. }),
  1092. smalltalk.IRSendInliner);
  1093. smalltalk.addMethod(
  1094. "_translator",
  1095. smalltalk.method({
  1096. selector: "translator",
  1097. category: 'accessing',
  1098. fn: function (){
  1099. var self=this;
  1100. return smalltalk.withContext(function($ctx1) { var $1;
  1101. $1=self["@translator"];
  1102. return $1;
  1103. }, function($ctx1) {$ctx1.fill(self,"translator",{}, smalltalk.IRSendInliner)})},
  1104. args: [],
  1105. source: "translator\x0a\x09^ translator",
  1106. messageSends: [],
  1107. referencedClasses: []
  1108. }),
  1109. smalltalk.IRSendInliner);
  1110. smalltalk.addMethod(
  1111. "_translator_",
  1112. smalltalk.method({
  1113. selector: "translator:",
  1114. category: 'accessing',
  1115. fn: function (anASTTranslator){
  1116. var self=this;
  1117. return smalltalk.withContext(function($ctx1) { self["@translator"]=anASTTranslator;
  1118. return self}, function($ctx1) {$ctx1.fill(self,"translator:",{anASTTranslator:anASTTranslator}, smalltalk.IRSendInliner)})},
  1119. args: ["anASTTranslator"],
  1120. source: "translator: anASTTranslator\x0a\x09translator := anASTTranslator",
  1121. messageSends: [],
  1122. referencedClasses: []
  1123. }),
  1124. smalltalk.IRSendInliner);
  1125. smalltalk.addMethod(
  1126. "_inlinedSelectors",
  1127. smalltalk.method({
  1128. selector: "inlinedSelectors",
  1129. category: 'accessing',
  1130. fn: function (){
  1131. var self=this;
  1132. return smalltalk.withContext(function($ctx1) { return ["ifTrue:", "ifFalse:", "ifTrue:ifFalse:", "ifFalse:ifTrue:", "ifNil:", "ifNotNil:", "ifNil:ifNotNil:", "ifNotNil:ifNil"];
  1133. }, function($ctx1) {$ctx1.fill(self,"inlinedSelectors",{}, smalltalk.IRSendInliner.klass)})},
  1134. args: [],
  1135. source: "inlinedSelectors\x0a\x09^ #('ifTrue:' 'ifFalse:' 'ifTrue:ifFalse:' 'ifFalse:ifTrue:' 'ifNil:' 'ifNotNil:' 'ifNil:ifNotNil:' 'ifNotNil:ifNil')",
  1136. messageSends: [],
  1137. referencedClasses: []
  1138. }),
  1139. smalltalk.IRSendInliner.klass);
  1140. smalltalk.addMethod(
  1141. "_shouldInline_",
  1142. smalltalk.method({
  1143. selector: "shouldInline:",
  1144. category: 'accessing',
  1145. fn: function (anIRInstruction){
  1146. var self=this;
  1147. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$3;
  1148. var $early={};
  1149. try {
  1150. $1=_st(_st(self)._inlinedSelectors())._includes_(_st(anIRInstruction)._selector());
  1151. if(! smalltalk.assert($1)){
  1152. return false;
  1153. };
  1154. $2=_st(_st(anIRInstruction)._instructions())._allButFirst();
  1155. $3=(function(each){
  1156. return smalltalk.withContext(function($ctx2) { $4=_st(each)._isClosure();
  1157. if(! smalltalk.assert($4)){
  1158. throw $early=[false];
  1159. };
  1160. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
  1161. _st($2)._do_($3);
  1162. return true;
  1163. }
  1164. catch(e) {if(e===$early)return e[0]; throw e}
  1165. }, function($ctx1) {$ctx1.fill(self,"shouldInline:",{anIRInstruction:anIRInstruction}, smalltalk.IRSendInliner.klass)})},
  1166. args: ["anIRInstruction"],
  1167. source: "shouldInline: anIRInstruction\x0a\x09(self inlinedSelectors includes: anIRInstruction selector) ifFalse: [ ^ false ].\x0a\x09anIRInstruction instructions allButFirst do: [ :each |\x0a\x09\x09each isClosure ifFalse: [ ^ false ]].\x0a\x09^ true",
  1168. messageSends: ["ifFalse:", "includes:", "selector", "inlinedSelectors", "do:", "isClosure", "allButFirst", "instructions"],
  1169. referencedClasses: []
  1170. }),
  1171. smalltalk.IRSendInliner.klass);
  1172. smalltalk.addClass('IRAssignmentInliner', smalltalk.IRSendInliner, ['assignment'], 'Compiler-Inlining');
  1173. smalltalk.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(smalltalk.assert(true) {\x0a\x09\x09a = 1;\x0a\x09};"
  1174. smalltalk.addMethod(
  1175. "_assignment",
  1176. smalltalk.method({
  1177. selector: "assignment",
  1178. category: 'accessing',
  1179. fn: function (){
  1180. var self=this;
  1181. return smalltalk.withContext(function($ctx1) { var $1;
  1182. $1=self["@assignment"];
  1183. return $1;
  1184. }, function($ctx1) {$ctx1.fill(self,"assignment",{}, smalltalk.IRAssignmentInliner)})},
  1185. args: [],
  1186. source: "assignment\x0a\x09^ assignment",
  1187. messageSends: [],
  1188. referencedClasses: []
  1189. }),
  1190. smalltalk.IRAssignmentInliner);
  1191. smalltalk.addMethod(
  1192. "_assignment_",
  1193. smalltalk.method({
  1194. selector: "assignment:",
  1195. category: 'accessing',
  1196. fn: function (aNode){
  1197. var self=this;
  1198. return smalltalk.withContext(function($ctx1) { self["@assignment"]=aNode;
  1199. return self}, function($ctx1) {$ctx1.fill(self,"assignment:",{aNode:aNode}, smalltalk.IRAssignmentInliner)})},
  1200. args: ["aNode"],
  1201. source: "assignment: aNode\x0a\x09assignment := aNode",
  1202. messageSends: [],
  1203. referencedClasses: []
  1204. }),
  1205. smalltalk.IRAssignmentInliner);
  1206. smalltalk.addMethod(
  1207. "_inlineAssignment_",
  1208. smalltalk.method({
  1209. selector: "inlineAssignment:",
  1210. category: 'inlining',
  1211. fn: function (anIRAssignment){
  1212. var self=this;
  1213. var inlinedAssignment;
  1214. return smalltalk.withContext(function($ctx1) { var $1;
  1215. _st(self)._assignment_(anIRAssignment);
  1216. inlinedAssignment=_st((smalltalk.IRInlinedAssignment || IRInlinedAssignment))._new();
  1217. _st(_st(anIRAssignment)._instructions())._do_((function(each){
  1218. return smalltalk.withContext(function($ctx2) { return _st(inlinedAssignment)._add_(each);
  1219. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1220. _st(anIRAssignment)._replaceWith_(inlinedAssignment);
  1221. _st(self)._inlineSend_(_st(_st(inlinedAssignment)._instructions())._last());
  1222. $1=inlinedAssignment;
  1223. return $1;
  1224. }, function($ctx1) {$ctx1.fill(self,"inlineAssignment:",{anIRAssignment:anIRAssignment,inlinedAssignment:inlinedAssignment}, smalltalk.IRAssignmentInliner)})},
  1225. args: ["anIRAssignment"],
  1226. 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 instructions last.\x0a\x09^ inlinedAssignment",
  1227. messageSends: ["assignment:", "new", "do:", "add:", "instructions", "replaceWith:", "inlineSend:", "last"],
  1228. referencedClasses: ["IRInlinedAssignment"]
  1229. }),
  1230. smalltalk.IRAssignmentInliner);
  1231. smalltalk.addMethod(
  1232. "_inlineClosure_",
  1233. smalltalk.method({
  1234. selector: "inlineClosure:",
  1235. category: 'inlining',
  1236. fn: function (anIRClosure){
  1237. var self=this;
  1238. var inlinedClosure,statements;
  1239. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$2,$6;
  1240. inlinedClosure=smalltalk.IRSendInliner.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
  1241. statements=_st(_st(_st(inlinedClosure)._instructions())._last())._instructions();
  1242. $1=statements;
  1243. $2=(function(){
  1244. return smalltalk.withContext(function($ctx2) { $3=_st(_st(statements)._last())._canBeAssigned();
  1245. if(smalltalk.assert($3)){
  1246. $4=_st((smalltalk.IRAssignment || IRAssignment))._new();
  1247. _st($4)._add_(_st(_st(_st(self)._assignment())._instructions())._first());
  1248. _st($4)._add_(_st(_st(statements)._last())._copy());
  1249. $5=_st($4)._yourself();
  1250. return _st(_st(statements)._last())._replaceWith_($5);
  1251. };
  1252. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1253. _st($1)._ifNotEmpty_($2);
  1254. $6=inlinedClosure;
  1255. return $6;
  1256. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,statements:statements}, smalltalk.IRAssignmentInliner)})},
  1257. args: ["anIRClosure"],
  1258. source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure instructions last 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 instructions first;\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself) ] ].\x0a\x0a\x09^ inlinedClosure",
  1259. messageSends: ["inlineClosure:", "instructions", "last", "ifNotEmpty:", "ifTrue:", "replaceWith:", "add:", "first", "assignment", "new", "copy", "yourself", "canBeAssigned"],
  1260. referencedClasses: ["IRAssignment"]
  1261. }),
  1262. smalltalk.IRAssignmentInliner);
  1263. smalltalk.addClass('IRNonLocalReturnInliner', smalltalk.IRSendInliner, [], 'Compiler-Inlining');
  1264. smalltalk.addMethod(
  1265. "_inlineClosure_",
  1266. smalltalk.method({
  1267. selector: "inlineClosure:",
  1268. category: 'inlining',
  1269. fn: function (anIRClosure){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) { var $1;
  1272. $1=smalltalk.IRSendInliner.fn.prototype._inlineCLosure_.apply(_st(self), [anIRClosure]);
  1273. return $1;
  1274. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure}, smalltalk.IRNonLocalReturnInliner)})},
  1275. args: ["anIRClosure"],
  1276. source: "inlineClosure: anIRClosure\x0a\x09\x22| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last replaceWith: (IRNonLocalReturn new\x0a\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09yourself) ].\x0a\x0a\x09^ inlinedClosure\x22\x0a\x0a\x09^ super inlineCLosure: anIRClosure",
  1277. messageSends: ["inlineCLosure:"],
  1278. referencedClasses: []
  1279. }),
  1280. smalltalk.IRNonLocalReturnInliner);
  1281. smalltalk.addMethod(
  1282. "_inlinedReturn",
  1283. smalltalk.method({
  1284. selector: "inlinedReturn",
  1285. category: 'factory',
  1286. fn: function (){
  1287. var self=this;
  1288. return smalltalk.withContext(function($ctx1) { var $1;
  1289. $1=_st((smalltalk.IRInlinedNonLocalReturn || IRInlinedNonLocalReturn))._new();
  1290. return $1;
  1291. }, function($ctx1) {$ctx1.fill(self,"inlinedReturn",{}, smalltalk.IRNonLocalReturnInliner)})},
  1292. args: [],
  1293. source: "inlinedReturn\x0a\x09^ IRInlinedNonLocalReturn new",
  1294. messageSends: ["new"],
  1295. referencedClasses: ["IRInlinedNonLocalReturn"]
  1296. }),
  1297. smalltalk.IRNonLocalReturnInliner);
  1298. smalltalk.addClass('IRReturnInliner', smalltalk.IRSendInliner, [], 'Compiler-Inlining');
  1299. smalltalk.IRReturnInliner.comment="I inline message sends with inlined closure together with a return instruction."
  1300. smalltalk.addMethod(
  1301. "_inlineClosure_",
  1302. smalltalk.method({
  1303. selector: "inlineClosure:",
  1304. category: 'inlining',
  1305. fn: function (anIRClosure){
  1306. var self=this;
  1307. var closure,statements;
  1308. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$2,$6;
  1309. closure=smalltalk.IRSendInliner.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
  1310. statements=_st(_st(_st(closure)._instructions())._last())._instructions();
  1311. $1=statements;
  1312. $2=(function(){
  1313. return smalltalk.withContext(function($ctx2) { $3=_st(_st(statements)._last())._isReturn();
  1314. if(! smalltalk.assert($3)){
  1315. $4=_st((smalltalk.IRReturn || IRReturn))._new();
  1316. _st($4)._add_(_st(_st(statements)._last())._copy());
  1317. $5=_st($4)._yourself();
  1318. return _st(_st(statements)._last())._replaceWith_($5);
  1319. };
  1320. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1321. _st($1)._ifNotEmpty_($2);
  1322. $6=closure;
  1323. return $6;
  1324. }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,closure:closure,statements:statements}, smalltalk.IRReturnInliner)})},
  1325. args: ["anIRClosure"],
  1326. source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure instructions last 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",
  1327. messageSends: ["inlineClosure:", "instructions", "last", "ifNotEmpty:", "ifFalse:", "replaceWith:", "add:", "copy", "new", "yourself", "isReturn"],
  1328. referencedClasses: ["IRReturn"]
  1329. }),
  1330. smalltalk.IRReturnInliner);
  1331. smalltalk.addMethod(
  1332. "_inlineReturn_",
  1333. smalltalk.method({
  1334. selector: "inlineReturn:",
  1335. category: 'inlining',
  1336. fn: function (anIRReturn){
  1337. var self=this;
  1338. var return_;
  1339. return smalltalk.withContext(function($ctx1) { var $1;
  1340. return_=_st(self)._inlinedReturn();
  1341. _st(_st(anIRReturn)._instructions())._do_((function(each){
  1342. return smalltalk.withContext(function($ctx2) { return _st(return_)._add_(each);
  1343. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1344. _st(anIRReturn)._replaceWith_(return_);
  1345. _st(self)._inlineSend_(_st(_st(return_)._instructions())._last());
  1346. $1=return_;
  1347. return $1;
  1348. }, function($ctx1) {$ctx1.fill(self,"inlineReturn:",{anIRReturn:anIRReturn,return_:return_}, smalltalk.IRReturnInliner)})},
  1349. args: ["anIRReturn"],
  1350. 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 instructions last.\x0a\x09^ return",
  1351. messageSends: ["inlinedReturn", "do:", "add:", "instructions", "replaceWith:", "inlineSend:", "last"],
  1352. referencedClasses: []
  1353. }),
  1354. smalltalk.IRReturnInliner);
  1355. smalltalk.addMethod(
  1356. "_inlinedReturn",
  1357. smalltalk.method({
  1358. selector: "inlinedReturn",
  1359. category: 'factory',
  1360. fn: function (){
  1361. var self=this;
  1362. return smalltalk.withContext(function($ctx1) { var $1;
  1363. $1=_st((smalltalk.IRInlinedReturn || IRInlinedReturn))._new();
  1364. return $1;
  1365. }, function($ctx1) {$ctx1.fill(self,"inlinedReturn",{}, smalltalk.IRReturnInliner)})},
  1366. args: [],
  1367. source: "inlinedReturn\x0a\x09^ IRInlinedReturn new",
  1368. messageSends: ["new"],
  1369. referencedClasses: ["IRInlinedReturn"]
  1370. }),
  1371. smalltalk.IRReturnInliner);
  1372. smalltalk.addClass('InliningCodeGenerator', smalltalk.CodeGenerator, [], 'Compiler-Inlining');
  1373. smalltalk.InliningCodeGenerator.comment="I am a specialized code generator that uses inlining to produce more optimized JavaScript output"
  1374. smalltalk.addMethod(
  1375. "_compileNode_",
  1376. smalltalk.method({
  1377. selector: "compileNode:",
  1378. category: 'compiling',
  1379. fn: function (aNode){
  1380. var self=this;
  1381. var ir,stream;
  1382. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1383. _st(_st(self)._semanticAnalyzer())._visit_(aNode);
  1384. ir=_st(_st(self)._translator())._visit_(aNode);
  1385. _st(_st(self)._inliner())._visit_(ir);
  1386. $2=_st(self)._irTranslator();
  1387. _st($2)._visit_(ir);
  1388. $3=_st($2)._contents();
  1389. $1=$3;
  1390. return $1;
  1391. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream}, smalltalk.InliningCodeGenerator)})},
  1392. args: ["aNode"],
  1393. 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\x09visit: ir;\x0a\x09\x09contents",
  1394. messageSends: ["visit:", "semanticAnalyzer", "translator", "inliner", "irTranslator", "contents"],
  1395. referencedClasses: []
  1396. }),
  1397. smalltalk.InliningCodeGenerator);
  1398. smalltalk.addMethod(
  1399. "_inliner",
  1400. smalltalk.method({
  1401. selector: "inliner",
  1402. category: 'compiling',
  1403. fn: function (){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx1) { var $1;
  1406. $1=_st((smalltalk.IRInliner || IRInliner))._new();
  1407. return $1;
  1408. }, function($ctx1) {$ctx1.fill(self,"inliner",{}, smalltalk.InliningCodeGenerator)})},
  1409. args: [],
  1410. source: "inliner\x0a\x09^ IRInliner new",
  1411. messageSends: ["new"],
  1412. referencedClasses: ["IRInliner"]
  1413. }),
  1414. smalltalk.InliningCodeGenerator);
  1415. smalltalk.addMethod(
  1416. "_irTranslator",
  1417. smalltalk.method({
  1418. selector: "irTranslator",
  1419. category: 'compiling',
  1420. fn: function (){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) { var $1;
  1423. $1=_st((smalltalk.IRInliningJSTranslator || IRInliningJSTranslator))._new();
  1424. return $1;
  1425. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{}, smalltalk.InliningCodeGenerator)})},
  1426. args: [],
  1427. source: "irTranslator\x0a\x09^ IRInliningJSTranslator new",
  1428. messageSends: ["new"],
  1429. referencedClasses: ["IRInliningJSTranslator"]
  1430. }),
  1431. smalltalk.InliningCodeGenerator);