Compiler-IR.deploy.js 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686
  1. smalltalk.addPackage('Compiler-IR', {});
  2. smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['builder', 'source'], 'Compiler-IR');
  3. smalltalk.addMethod(
  4. "_builder",
  5. smalltalk.method({
  6. selector: "builder",
  7. fn: function () {
  8. var self=this;
  9. return (($receiver = self['@builder']) == nil || $receiver == undefined) ? (function(){return (self['@builder']=smalltalk.send((smalltalk.IRBuilder || IRBuilder), "_new", []));})() : $receiver;
  10. return self;}
  11. }),
  12. smalltalk.IRASTTranslator);
  13. smalltalk.addMethod(
  14. "_builder_",
  15. smalltalk.method({
  16. selector: "builder:",
  17. fn: function (aBuilder) {
  18. var self=this;
  19. (self['@builder']=aBuilder);
  20. return self;}
  21. }),
  22. smalltalk.IRASTTranslator);
  23. smalltalk.addMethod(
  24. "_source",
  25. smalltalk.method({
  26. selector: "source",
  27. fn: function () {
  28. var self=this;
  29. return self['@source'];
  30. return self;}
  31. }),
  32. smalltalk.IRASTTranslator);
  33. smalltalk.addMethod(
  34. "_source_",
  35. smalltalk.method({
  36. selector: "source:",
  37. fn: function (aString) {
  38. var self=this;
  39. (self['@source']=aString);
  40. return self;}
  41. }),
  42. smalltalk.IRASTTranslator);
  43. smalltalk.addMethod(
  44. "_visitAssignmentNode_",
  45. smalltalk.method({
  46. selector: "visitAssignmentNode:",
  47. fn: function (aNode) {
  48. var self=this;
  49. (function($rec){smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_left", [])]);})]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_right", [])]);})]);})(smalltalk.send(smalltalk.send(self, "_builder", []), "_assignment", []));
  50. return self;}
  51. }),
  52. smalltalk.IRASTTranslator);
  53. smalltalk.addMethod(
  54. "_visitBlockNode_",
  55. smalltalk.method({
  56. selector: "visitBlockNode:",
  57. fn: function (aNode) {
  58. var self=this;
  59. (function($rec){smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_visitBlockNode_", [aNode], smalltalk.IRASTTranslator.superclass || nil);})]);return smalltalk.send($rec, "_arguments_", [smalltalk.send(aNode, "_parameters", [])]);})(smalltalk.send(smalltalk.send(self, "_builder", []), "_closure", []));
  60. return self;}
  61. }),
  62. smalltalk.IRASTTranslator);
  63. smalltalk.addMethod(
  64. "_visitJSStatementNode_",
  65. smalltalk.method({
  66. selector: "visitJSStatementNode:",
  67. fn: function (aNode) {
  68. var self=this;
  69. smalltalk.send(smalltalk.send(self, "_builder", []), "_verbatim_", [smalltalk.send(aNode, "_source", [])]);
  70. return self;}
  71. }),
  72. smalltalk.IRASTTranslator);
  73. smalltalk.addMethod(
  74. "_visitMethodNode_",
  75. smalltalk.method({
  76. selector: "visitMethodNode:",
  77. fn: function (aNode) {
  78. var self=this;
  79. (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(self, "_source", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(aNode, "_arguments", [])]);smalltalk.send($rec, "_selector_", [smalltalk.send(aNode, "_selector", [])]);smalltalk.send($rec, "_messageSends_", [smalltalk.send(aNode, "_messageSends", [])]);return smalltalk.send($rec, "_classReferences_", [smalltalk.send(aNode, "_classReferences", [])]);})(smalltalk.send(smalltalk.send(self, "_builder", []), "_method", []));
  80. smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_scope", []), "_temps", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_builder", []), "_tempDeclaration", []), "_name_", [smalltalk.send(each, "_name", [])]);})]);
  81. ((($receiver = smalltalk.send(aNode, "_hasNonLocalReturn", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_builder", []), "_nonLocalReturnHandling", []), "_with_", [(function(){return smalltalk.send(self, "_visitMethodNode_", [aNode], smalltalk.IRASTTranslator.superclass || nil);})]);})() : (function(){return smalltalk.send(self, "_visitMethodNode_", [aNode], smalltalk.IRASTTranslator.superclass || nil);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_builder", []), "_nonLocalReturnHandling", []), "_with_", [(function(){return smalltalk.send(self, "_visitMethodNode_", [aNode], smalltalk.IRASTTranslator.superclass || nil);})]);}), (function(){return smalltalk.send(self, "_visitMethodNode_", [aNode], smalltalk.IRASTTranslator.superclass || nil);})]));
  82. return self;}
  83. }),
  84. smalltalk.IRASTTranslator);
  85. smalltalk.addMethod(
  86. "_visitReturnNode_",
  87. smalltalk.method({
  88. selector: "visitReturnNode:",
  89. fn: function (aNode) {
  90. var self=this;
  91. smalltalk.send(((($receiver = smalltalk.send(aNode, "_nonLocalReturn", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_builder", []), "_nonLocalReturn", []);})() : (function(){return smalltalk.send(smalltalk.send(self, "_builder", []), "_return", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_builder", []), "_nonLocalReturn", []);}), (function(){return smalltalk.send(smalltalk.send(self, "_builder", []), "_return", []);})])), "_with_", [(function(){return smalltalk.send(self, "_visitReturnNode_", [aNode], smalltalk.IRASTTranslator.superclass || nil);})]);
  92. return self;}
  93. }),
  94. smalltalk.IRASTTranslator);
  95. smalltalk.addMethod(
  96. "_visitSendNode_",
  97. smalltalk.method({
  98. selector: "visitSendNode:",
  99. fn: function (aNode) {
  100. var self=this;
  101. (function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(aNode, "_selector", [])]);smalltalk.send($rec, "_superSend_", [smalltalk.send(aNode, "_superSend", [])]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(self, "_visit_", [smalltalk.send(aNode, "_receiver", [])]);return smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);})]);})(smalltalk.send(smalltalk.send(self, "_builder", []), "_send", []));
  102. return self;}
  103. }),
  104. smalltalk.IRASTTranslator);
  105. smalltalk.addMethod(
  106. "_visitSequenceNode_",
  107. smalltalk.method({
  108. selector: "visitSequenceNode:",
  109. fn: function (aNode) {
  110. var self=this;
  111. smalltalk.send(smalltalk.send(smalltalk.send(self, "_builder", []), "_sequence", []), "_with_", [(function(){return smalltalk.send(self, "_visitSequenceNode_", [aNode], smalltalk.IRASTTranslator.superclass || nil);})]);
  112. return self;}
  113. }),
  114. smalltalk.IRASTTranslator);
  115. smalltalk.addMethod(
  116. "_visitValueNode_",
  117. smalltalk.method({
  118. selector: "visitValueNode:",
  119. fn: function (aNode) {
  120. var self=this;
  121. smalltalk.send(smalltalk.send(self, "_builder", []), "_value_", [smalltalk.send(aNode, "_value", [])]);
  122. return self;}
  123. }),
  124. smalltalk.IRASTTranslator);
  125. smalltalk.addMethod(
  126. "_visitVariableNode_",
  127. smalltalk.method({
  128. selector: "visitVariableNode:",
  129. fn: function (aNode) {
  130. var self=this;
  131. smalltalk.send(smalltalk.send(self, "_builder", []), "_variable_", [smalltalk.send(aNode, "_binding", [])]);
  132. return self;}
  133. }),
  134. smalltalk.IRASTTranslator);
  135. smalltalk.addClass('IRASTResolver', smalltalk.IRASTTranslator, ['nextAlias'], 'Compiler-IR');
  136. smalltalk.addMethod(
  137. "_nextAlias",
  138. smalltalk.method({
  139. selector: "nextAlias",
  140. fn: function () {
  141. var self=this;
  142. (($receiver = self['@nextAlias']) == nil || $receiver == undefined) ? (function(){return (self['@nextAlias']=(0));})() : $receiver;
  143. (self['@nextAlias']=((($receiver = self['@nextAlias']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
  144. return smalltalk.send("$", "__comma", [smalltalk.send(self['@nextAlias'], "_asString", [])]);
  145. return self;}
  146. }),
  147. smalltalk.IRASTResolver);
  148. smalltalk.addMethod(
  149. "_resolve_",
  150. smalltalk.method({
  151. selector: "resolve:",
  152. fn: function (aNode) {
  153. var self=this;
  154. ((($receiver = smalltalk.send(aNode, "_isBlockSequenceNode", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_resolve_", [each]);})]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_resolve_", [each]);})]);})]));
  155. ((($receiver = smalltalk.send(aNode, "_shouldBeAliased", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){var alias=nil;
  156. (alias=smalltalk.send(self, "_nextAlias", []));smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_builder", []), "_method", []), "_internalVariables", []), "_add_", [alias]);(function($rec){smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_builder", []), "_variable_", [(function($rec){smalltalk.send($rec, "_name_", [alias]);smalltalk.send($rec, "_node_", [aNode]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.AliasVar || AliasVar), "_new", []))]);})]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_visit_resolving_", [aNode, false]);})]);})(smalltalk.send(smalltalk.send(self, "_builder", []), "_assignment", []));return smalltalk.send(aNode, "_alias_", [alias]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){var alias=nil;
  157. (alias=smalltalk.send(self, "_nextAlias", []));smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_builder", []), "_method", []), "_internalVariables", []), "_add_", [alias]);(function($rec){smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_builder", []), "_variable_", [(function($rec){smalltalk.send($rec, "_name_", [alias]);smalltalk.send($rec, "_node_", [aNode]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.AliasVar || AliasVar), "_new", []))]);})]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(self, "_visit_resolving_", [aNode, false]);})]);})(smalltalk.send(smalltalk.send(self, "_builder", []), "_assignment", []));return smalltalk.send(aNode, "_alias_", [alias]);})]));
  158. return self;}
  159. }),
  160. smalltalk.IRASTResolver);
  161. smalltalk.addMethod(
  162. "_visit_",
  163. smalltalk.method({
  164. selector: "visit:",
  165. fn: function (aNode) {
  166. var self=this;
  167. smalltalk.send(self, "_visit_resolving_", [aNode, smalltalk.send(aNode, "_canAliasChildren", [])]);
  168. return self;}
  169. }),
  170. smalltalk.IRASTResolver);
  171. smalltalk.addMethod(
  172. "_visit_resolving_",
  173. smalltalk.method({
  174. selector: "visit:resolving:",
  175. fn: function (aNode, aBoolean) {
  176. var self=this;
  177. ((($receiver = aBoolean).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_resolve_", [aNode]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_resolve_", [aNode]);})]));
  178. ((($receiver = smalltalk.send(aNode, "_isAliased", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_visitAliased_", [aNode]);})() : (function(){return smalltalk.send(self, "_visit_", [aNode], smalltalk.IRASTResolver.superclass || nil);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_visitAliased_", [aNode]);}), (function(){return smalltalk.send(self, "_visit_", [aNode], smalltalk.IRASTResolver.superclass || nil);})]));
  179. return self;}
  180. }),
  181. smalltalk.IRASTResolver);
  182. smalltalk.addMethod(
  183. "_visitAliased_",
  184. smalltalk.method({
  185. selector: "visitAliased:",
  186. fn: function (aNode) {
  187. var self=this;
  188. return smalltalk.send(smalltalk.send(self, "_builder", []), "_variable_", [(function($rec){smalltalk.send($rec, "_name_", [smalltalk.send(aNode, "_alias", [])]);smalltalk.send($rec, "_node_", [aNode]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.AliasVar || AliasVar), "_new", []))]);
  189. return self;}
  190. }),
  191. smalltalk.IRASTResolver);
  192. smalltalk.addClass('IRBuilder', smalltalk.Object, ['method', 'root', 'nextPc'], 'Compiler-IR');
  193. smalltalk.addMethod(
  194. "_add_",
  195. smalltalk.method({
  196. selector: "add:",
  197. fn: function (aClass) {
  198. var self=this;
  199. return smalltalk.send(smalltalk.send(self, "_root", []), "_append_", [smalltalk.send(aClass, "_on_", [self])]);
  200. return self;}
  201. }),
  202. smalltalk.IRBuilder);
  203. smalltalk.addMethod(
  204. "_append_",
  205. smalltalk.method({
  206. selector: "append:",
  207. fn: function (anObject) {
  208. var self=this;
  209. return smalltalk.send(self['@root'], "_append_", [anObject]);
  210. return self;}
  211. }),
  212. smalltalk.IRBuilder);
  213. smalltalk.addMethod(
  214. "_assignment",
  215. smalltalk.method({
  216. selector: "assignment",
  217. fn: function () {
  218. var self=this;
  219. return smalltalk.send(self, "_add_", [(smalltalk.IRAssignment || IRAssignment)]);
  220. return self;}
  221. }),
  222. smalltalk.IRBuilder);
  223. smalltalk.addMethod(
  224. "_closure",
  225. smalltalk.method({
  226. selector: "closure",
  227. fn: function () {
  228. var self=this;
  229. return smalltalk.send(self, "_add_", [(smalltalk.IRClosure || IRClosure)]);
  230. return self;}
  231. }),
  232. smalltalk.IRBuilder);
  233. smalltalk.addMethod(
  234. "_emitOn_",
  235. smalltalk.method({
  236. selector: "emitOn:",
  237. fn: function (aStream) {
  238. var self=this;
  239. smalltalk.send(self['@method'], "_emitOn_", [aStream]);
  240. return self;}
  241. }),
  242. smalltalk.IRBuilder);
  243. smalltalk.addMethod(
  244. "_initialize",
  245. smalltalk.method({
  246. selector: "initialize",
  247. fn: function () {
  248. var self=this;
  249. smalltalk.send(self, "_initialize", [], smalltalk.IRBuilder.superclass || nil);
  250. (self['@root']=(self['@method']=smalltalk.send((smalltalk.IRMethod || IRMethod), "_on_", [self])));
  251. return self;}
  252. }),
  253. smalltalk.IRBuilder);
  254. smalltalk.addMethod(
  255. "_method",
  256. smalltalk.method({
  257. selector: "method",
  258. fn: function () {
  259. var self=this;
  260. return self['@method'];
  261. return self;}
  262. }),
  263. smalltalk.IRBuilder);
  264. smalltalk.addMethod(
  265. "_nextPc",
  266. smalltalk.method({
  267. selector: "nextPc",
  268. fn: function () {
  269. var self=this;
  270. (($receiver = self['@nextPc']) == nil || $receiver == undefined) ? (function(){return (self['@nextPc']=(0));})() : $receiver;
  271. (self['@nextPc']=((($receiver = self['@nextPc']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
  272. return self['@nextPc'];
  273. return self;}
  274. }),
  275. smalltalk.IRBuilder);
  276. smalltalk.addMethod(
  277. "_nonLocalReturn",
  278. smalltalk.method({
  279. selector: "nonLocalReturn",
  280. fn: function () {
  281. var self=this;
  282. return smalltalk.send(self, "_add_", [(smalltalk.IRNonLocalReturn || IRNonLocalReturn)]);
  283. return self;}
  284. }),
  285. smalltalk.IRBuilder);
  286. smalltalk.addMethod(
  287. "_nonLocalReturnHandling",
  288. smalltalk.method({
  289. selector: "nonLocalReturnHandling",
  290. fn: function () {
  291. var self=this;
  292. return smalltalk.send(self, "_add_", [(smalltalk.IRNonLocalReturnHandling || IRNonLocalReturnHandling)]);
  293. return self;}
  294. }),
  295. smalltalk.IRBuilder);
  296. smalltalk.addMethod(
  297. "_return",
  298. smalltalk.method({
  299. selector: "return",
  300. fn: function () {
  301. var self=this;
  302. return smalltalk.send(self, "_add_", [(smalltalk.IRReturn || IRReturn)]);
  303. return self;}
  304. }),
  305. smalltalk.IRBuilder);
  306. smalltalk.addMethod(
  307. "_root",
  308. smalltalk.method({
  309. selector: "root",
  310. fn: function () {
  311. var self=this;
  312. return self['@root'];
  313. return self;}
  314. }),
  315. smalltalk.IRBuilder);
  316. smalltalk.addMethod(
  317. "_root_",
  318. smalltalk.method({
  319. selector: "root:",
  320. fn: function (anIRInstruction) {
  321. var self=this;
  322. (self['@root']=anIRInstruction);
  323. return self;}
  324. }),
  325. smalltalk.IRBuilder);
  326. smalltalk.addMethod(
  327. "_send",
  328. smalltalk.method({
  329. selector: "send",
  330. fn: function () {
  331. var self=this;
  332. return smalltalk.send(self, "_add_", [(smalltalk.IRSend || IRSend)]);
  333. return self;}
  334. }),
  335. smalltalk.IRBuilder);
  336. smalltalk.addMethod(
  337. "_sequence",
  338. smalltalk.method({
  339. selector: "sequence",
  340. fn: function () {
  341. var self=this;
  342. return smalltalk.send(self, "_add_", [(smalltalk.IRSequence || IRSequence)]);
  343. return self;}
  344. }),
  345. smalltalk.IRBuilder);
  346. smalltalk.addMethod(
  347. "_statement",
  348. smalltalk.method({
  349. selector: "statement",
  350. fn: function () {
  351. var self=this;
  352. return smalltalk.send(self, "_add_", [(smalltalk.IRStatement || IRStatement)]);
  353. return self;}
  354. }),
  355. smalltalk.IRBuilder);
  356. smalltalk.addMethod(
  357. "_tempDeclaration",
  358. smalltalk.method({
  359. selector: "tempDeclaration",
  360. fn: function () {
  361. var self=this;
  362. return smalltalk.send(self, "_add_", [(smalltalk.IRTempDeclaration || IRTempDeclaration)]);
  363. return self;}
  364. }),
  365. smalltalk.IRBuilder);
  366. smalltalk.addMethod(
  367. "_value",
  368. smalltalk.method({
  369. selector: "value",
  370. fn: function () {
  371. var self=this;
  372. return smalltalk.send(self, "_add_", [(smalltalk.IRValue || IRValue)]);
  373. return self;}
  374. }),
  375. smalltalk.IRBuilder);
  376. smalltalk.addMethod(
  377. "_value_",
  378. smalltalk.method({
  379. selector: "value:",
  380. fn: function (aString) {
  381. var self=this;
  382. return (function($rec){smalltalk.send($rec, "_value_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_value", []));
  383. return self;}
  384. }),
  385. smalltalk.IRBuilder);
  386. smalltalk.addMethod(
  387. "_variable",
  388. smalltalk.method({
  389. selector: "variable",
  390. fn: function () {
  391. var self=this;
  392. return smalltalk.send(self, "_add_", [(smalltalk.IRVariable || IRVariable)]);
  393. return self;}
  394. }),
  395. smalltalk.IRBuilder);
  396. smalltalk.addMethod(
  397. "_variable_",
  398. smalltalk.method({
  399. selector: "variable:",
  400. fn: function (aScopeVariable) {
  401. var self=this;
  402. return (function($rec){smalltalk.send($rec, "_variable_", [aScopeVariable]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_variable", []));
  403. return self;}
  404. }),
  405. smalltalk.IRBuilder);
  406. smalltalk.addMethod(
  407. "_verbatim_",
  408. smalltalk.method({
  409. selector: "verbatim:",
  410. fn: function (aString) {
  411. var self=this;
  412. return (function($rec){smalltalk.send($rec, "_source_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_add_", [(smalltalk.IRVerbatim || IRVerbatim)]));
  413. return self;}
  414. }),
  415. smalltalk.IRBuilder);
  416. smalltalk.addMethod(
  417. "_with_",
  418. smalltalk.method({
  419. selector: "with:",
  420. fn: function (anObject) {
  421. var self=this;
  422. smalltalk.send(smalltalk.send(self, "_root", []), "_with_", [anObject]);
  423. return self;}
  424. }),
  425. smalltalk.IRBuilder);
  426. smalltalk.addClass('IRInliner', smalltalk.Object, [], 'Compiler-IR');
  427. smalltalk.addClass('IRInstruction', smalltalk.Object, ['builder', 'instructions'], 'Compiler-IR');
  428. smalltalk.addMethod(
  429. "_accept_",
  430. smalltalk.method({
  431. selector: "accept:",
  432. fn: function (aVisitor) {
  433. var self=this;
  434. smalltalk.send(aVisitor, "_visitIRInstruction_", [self]);
  435. return self;}
  436. }),
  437. smalltalk.IRInstruction);
  438. smalltalk.addMethod(
  439. "_append_",
  440. smalltalk.method({
  441. selector: "append:",
  442. fn: function (anObject) {
  443. var self=this;
  444. smalltalk.send(anObject, "_appendToInstruction_", [self]);
  445. return anObject;
  446. return self;}
  447. }),
  448. smalltalk.IRInstruction);
  449. smalltalk.addMethod(
  450. "_appendBlock_",
  451. smalltalk.method({
  452. selector: "appendBlock:",
  453. fn: function (aBlock) {
  454. var self=this;
  455. var root=nil;
  456. (root=smalltalk.send(smalltalk.send(self, "_builder", []), "_root", []));
  457. smalltalk.send(smalltalk.send(self, "_builder", []), "_root_", [self]);
  458. smalltalk.send(aBlock, "_value", []);
  459. smalltalk.send(smalltalk.send(self, "_builder", []), "_root_", [root]);
  460. return self;}
  461. }),
  462. smalltalk.IRInstruction);
  463. smalltalk.addMethod(
  464. "_appendInstruction_",
  465. smalltalk.method({
  466. selector: "appendInstruction:",
  467. fn: function (anIRInstruction) {
  468. var self=this;
  469. smalltalk.send(smalltalk.send(self, "_instructions", []), "_add_", [anIRInstruction]);
  470. return self;}
  471. }),
  472. smalltalk.IRInstruction);
  473. smalltalk.addMethod(
  474. "_appendString_",
  475. smalltalk.method({
  476. selector: "appendString:",
  477. fn: function (aString) {
  478. var self=this;
  479. smalltalk.send(self, "_append_", [smalltalk.send(smalltalk.send(self, "_builder", []), "_value_", [aString])]);
  480. return self;}
  481. }),
  482. smalltalk.IRInstruction);
  483. smalltalk.addMethod(
  484. "_appendToInstruction_",
  485. smalltalk.method({
  486. selector: "appendToInstruction:",
  487. fn: function (anIRInstruction) {
  488. var self=this;
  489. smalltalk.send(anIRInstruction, "_appendInstruction_", [self]);
  490. return self;}
  491. }),
  492. smalltalk.IRInstruction);
  493. smalltalk.addMethod(
  494. "_builder",
  495. smalltalk.method({
  496. selector: "builder",
  497. fn: function () {
  498. var self=this;
  499. return self['@builder'];
  500. return self;}
  501. }),
  502. smalltalk.IRInstruction);
  503. smalltalk.addMethod(
  504. "_builder_",
  505. smalltalk.method({
  506. selector: "builder:",
  507. fn: function (aBuilder) {
  508. var self=this;
  509. (self['@builder']=aBuilder);
  510. return self;}
  511. }),
  512. smalltalk.IRInstruction);
  513. smalltalk.addMethod(
  514. "_emitOn_",
  515. smalltalk.method({
  516. selector: "emitOn:",
  517. fn: function (aStream) {
  518. var self=this;
  519. smalltalk.send(smalltalk.send(self, "_instructions", []), "_do_", [(function(each){return smalltalk.send(each, "_emitOn_", [aStream]);})]);
  520. return self;}
  521. }),
  522. smalltalk.IRInstruction);
  523. smalltalk.addMethod(
  524. "_instructions",
  525. smalltalk.method({
  526. selector: "instructions",
  527. fn: function () {
  528. var self=this;
  529. return (($receiver = self['@instructions']) == nil || $receiver == undefined) ? (function(){return (self['@instructions']=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection), "_new", []));})() : $receiver;
  530. return self;}
  531. }),
  532. smalltalk.IRInstruction);
  533. smalltalk.addMethod(
  534. "_with_",
  535. smalltalk.method({
  536. selector: "with:",
  537. fn: function (anObject) {
  538. var self=this;
  539. smalltalk.send(anObject, "_appendToInstruction_", [self]);
  540. return self;}
  541. }),
  542. smalltalk.IRInstruction);
  543. smalltalk.addMethod(
  544. "_on_",
  545. smalltalk.method({
  546. selector: "on:",
  547. fn: function (aBuilder) {
  548. var self=this;
  549. return (function($rec){smalltalk.send($rec, "_builder_", [aBuilder]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  550. return self;}
  551. }),
  552. smalltalk.IRInstruction.klass);
  553. smalltalk.addClass('IRAssignment', smalltalk.IRInstruction, ['left', 'right'], 'Compiler-IR');
  554. smalltalk.addMethod(
  555. "_accept_",
  556. smalltalk.method({
  557. selector: "accept:",
  558. fn: function (aVisitor) {
  559. var self=this;
  560. smalltalk.send(aVisitor, "_visitIRAssignment_", [self]);
  561. return self;}
  562. }),
  563. smalltalk.IRAssignment);
  564. smalltalk.addMethod(
  565. "_emitOn_",
  566. smalltalk.method({
  567. selector: "emitOn:",
  568. fn: function (aStream) {
  569. var self=this;
  570. smalltalk.send(aStream, "_nextPutAssignment_to_", [smalltalk.send(smalltalk.send(self, "_instructions", []), "_first", []), smalltalk.send(smalltalk.send(self, "_instructions", []), "_last", [])]);
  571. return self;}
  572. }),
  573. smalltalk.IRAssignment);
  574. smalltalk.addClass('IRClosure', smalltalk.IRInstruction, ['arguments'], 'Compiler-IR');
  575. smalltalk.addMethod(
  576. "_accept_",
  577. smalltalk.method({
  578. selector: "accept:",
  579. fn: function (aVisitor) {
  580. var self=this;
  581. smalltalk.send(aVisitor, "_visitIRClosure_", [self]);
  582. return self;}
  583. }),
  584. smalltalk.IRClosure);
  585. smalltalk.addMethod(
  586. "_arguments",
  587. smalltalk.method({
  588. selector: "arguments",
  589. fn: function () {
  590. var self=this;
  591. return self['@arguments'];
  592. return self;}
  593. }),
  594. smalltalk.IRClosure);
  595. smalltalk.addMethod(
  596. "_arguments_",
  597. smalltalk.method({
  598. selector: "arguments:",
  599. fn: function (aCollection) {
  600. var self=this;
  601. (self['@arguments']=aCollection);
  602. return self;}
  603. }),
  604. smalltalk.IRClosure);
  605. smalltalk.addMethod(
  606. "_emitOn_",
  607. smalltalk.method({
  608. selector: "emitOn:",
  609. fn: function (aStream) {
  610. var self=this;
  611. smalltalk.send(aStream, "_nextPutClosureWith_arguments_", [(function(){return smalltalk.send(self, "_emitOn_", [aStream], smalltalk.IRClosure.superclass || nil);}), smalltalk.send(self, "_arguments", [])]);
  612. return self;}
  613. }),
  614. smalltalk.IRClosure);
  615. smalltalk.addClass('IRMethod', smalltalk.IRInstruction, ['source', 'selector', 'classReferences', 'messageSends', 'arguments', 'internalVariables', 'source'], 'Compiler-IR');
  616. smalltalk.addMethod(
  617. "_accept_",
  618. smalltalk.method({
  619. selector: "accept:",
  620. fn: function (aVisitor) {
  621. var self=this;
  622. smalltalk.send(aVisitor, "_visitIRMethod_", [self]);
  623. return self;}
  624. }),
  625. smalltalk.IRMethod);
  626. smalltalk.addMethod(
  627. "_arguments",
  628. smalltalk.method({
  629. selector: "arguments",
  630. fn: function () {
  631. var self=this;
  632. return self['@arguments'];
  633. return self;}
  634. }),
  635. smalltalk.IRMethod);
  636. smalltalk.addMethod(
  637. "_arguments_",
  638. smalltalk.method({
  639. selector: "arguments:",
  640. fn: function (aCollection) {
  641. var self=this;
  642. (self['@arguments']=aCollection);
  643. return self;}
  644. }),
  645. smalltalk.IRMethod);
  646. smalltalk.addMethod(
  647. "_classReferences",
  648. smalltalk.method({
  649. selector: "classReferences",
  650. fn: function () {
  651. var self=this;
  652. return self['@classReferences'];
  653. return self;}
  654. }),
  655. smalltalk.IRMethod);
  656. smalltalk.addMethod(
  657. "_classReferences_",
  658. smalltalk.method({
  659. selector: "classReferences:",
  660. fn: function (aCollection) {
  661. var self=this;
  662. (self['@classReferences']=aCollection);
  663. return self;}
  664. }),
  665. smalltalk.IRMethod);
  666. smalltalk.addMethod(
  667. "_emitOn_",
  668. smalltalk.method({
  669. selector: "emitOn:",
  670. fn: function (aStream) {
  671. var self=this;
  672. smalltalk.send(aStream, "_nextPutMethodDeclaration_with_", [self, (function(){return smalltalk.send(aStream, "_nextPutFunctionWith_arguments_", [(function(){((($receiver = smalltalk.send(smalltalk.send(self, "_internalVariables", []), "_notEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aStream, "_nextPutVars_", [smalltalk.send(self, "_internalVariables", [])]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(aStream, "_nextPutVars_", [smalltalk.send(self, "_internalVariables", [])]);})]));return smalltalk.send(self, "_emitOn_", [aStream], smalltalk.IRMethod.superclass || nil);}), smalltalk.send(self, "_arguments", [])]);})]);
  673. return self;}
  674. }),
  675. smalltalk.IRMethod);
  676. smalltalk.addMethod(
  677. "_internalVariables",
  678. smalltalk.method({
  679. selector: "internalVariables",
  680. fn: function () {
  681. var self=this;
  682. return (($receiver = self['@internalVariables']) == nil || $receiver == undefined) ? (function(){return (self['@internalVariables']=smalltalk.send((smalltalk.Set || Set), "_new", []));})() : $receiver;
  683. return self;}
  684. }),
  685. smalltalk.IRMethod);
  686. smalltalk.addMethod(
  687. "_messageSends",
  688. smalltalk.method({
  689. selector: "messageSends",
  690. fn: function () {
  691. var self=this;
  692. return self['@messageSends'];
  693. return self;}
  694. }),
  695. smalltalk.IRMethod);
  696. smalltalk.addMethod(
  697. "_messageSends_",
  698. smalltalk.method({
  699. selector: "messageSends:",
  700. fn: function (aCollection) {
  701. var self=this;
  702. (self['@messageSends']=aCollection);
  703. return self;}
  704. }),
  705. smalltalk.IRMethod);
  706. smalltalk.addMethod(
  707. "_selector",
  708. smalltalk.method({
  709. selector: "selector",
  710. fn: function () {
  711. var self=this;
  712. return self['@selector'];
  713. return self;}
  714. }),
  715. smalltalk.IRMethod);
  716. smalltalk.addMethod(
  717. "_selector_",
  718. smalltalk.method({
  719. selector: "selector:",
  720. fn: function (aString) {
  721. var self=this;
  722. (self['@selector']=aString);
  723. return self;}
  724. }),
  725. smalltalk.IRMethod);
  726. smalltalk.addMethod(
  727. "_source",
  728. smalltalk.method({
  729. selector: "source",
  730. fn: function () {
  731. var self=this;
  732. return self['@source'];
  733. return self;}
  734. }),
  735. smalltalk.IRMethod);
  736. smalltalk.addMethod(
  737. "_source_",
  738. smalltalk.method({
  739. selector: "source:",
  740. fn: function (aString) {
  741. var self=this;
  742. (self['@source']=aString);
  743. return self;}
  744. }),
  745. smalltalk.IRMethod);
  746. smalltalk.addClass('IRNonLocalReturn', smalltalk.IRInstruction, [], 'Compiler-IR');
  747. smalltalk.addMethod(
  748. "_accept_",
  749. smalltalk.method({
  750. selector: "accept:",
  751. fn: function (aVisitor) {
  752. var self=this;
  753. smalltalk.send(aVisitor, "_visitIRNonLocalReturn_", [self]);
  754. return self;}
  755. }),
  756. smalltalk.IRNonLocalReturn);
  757. smalltalk.addMethod(
  758. "_emitOn_",
  759. smalltalk.method({
  760. selector: "emitOn:",
  761. fn: function (aStream) {
  762. var self=this;
  763. smalltalk.send(aStream, "_nextPutNonLocalReturnWith_", [(function(){return smalltalk.send(self, "_emitOn_", [aStream], smalltalk.IRNonLocalReturn.superclass || nil);})]);
  764. return self;}
  765. }),
  766. smalltalk.IRNonLocalReturn);
  767. smalltalk.addClass('IRNonLocalReturnHandling', smalltalk.IRInstruction, [], 'Compiler-IR');
  768. smalltalk.addMethod(
  769. "_accept_",
  770. smalltalk.method({
  771. selector: "accept:",
  772. fn: function (aVisitor) {
  773. var self=this;
  774. smalltalk.send(aVisitor, "_visitIRNonLocalReturnHandling_", [self]);
  775. return self;}
  776. }),
  777. smalltalk.IRNonLocalReturnHandling);
  778. smalltalk.addMethod(
  779. "_emitOn_",
  780. smalltalk.method({
  781. selector: "emitOn:",
  782. fn: function (aStream) {
  783. var self=this;
  784. smalltalk.send(aStream, "_nextPutNonLocalReturnHandlingWith_", [(function(){return smalltalk.send(self, "_emitOn_", [aStream], smalltalk.IRNonLocalReturnHandling.superclass || nil);})]);
  785. return self;}
  786. }),
  787. smalltalk.IRNonLocalReturnHandling);
  788. smalltalk.addClass('IRReturn', smalltalk.IRInstruction, [], 'Compiler-IR');
  789. smalltalk.addMethod(
  790. "_accept_",
  791. smalltalk.method({
  792. selector: "accept:",
  793. fn: function (aVisitor) {
  794. var self=this;
  795. smalltalk.send(aVisitor, "_visitIRReturn_", [self]);
  796. return self;}
  797. }),
  798. smalltalk.IRReturn);
  799. smalltalk.addMethod(
  800. "_emitOn_",
  801. smalltalk.method({
  802. selector: "emitOn:",
  803. fn: function (aStream) {
  804. var self=this;
  805. smalltalk.send(aStream, "_nextPutReturnWith_", [(function(){return smalltalk.send(self, "_emitOn_", [aStream], smalltalk.IRReturn.superclass || nil);})]);
  806. return self;}
  807. }),
  808. smalltalk.IRReturn);
  809. smalltalk.addClass('IRSend', smalltalk.IRInstruction, ['selector', 'superSend'], 'Compiler-IR');
  810. smalltalk.addMethod(
  811. "_accept_",
  812. smalltalk.method({
  813. selector: "accept:",
  814. fn: function (aVisitor) {
  815. var self=this;
  816. smalltalk.send(aVisitor, "_visitIRSend_", [self]);
  817. return self;}
  818. }),
  819. smalltalk.IRSend);
  820. smalltalk.addMethod(
  821. "_emitOn_",
  822. smalltalk.method({
  823. selector: "emitOn:",
  824. fn: function (aStream) {
  825. var self=this;
  826. smalltalk.send(aStream, "_nextPutAll_", ["smalltalk.send("]);
  827. smalltalk.send(smalltalk.send(smalltalk.send(self, "_instructions", []), "_first", []), "_emitOn_", [aStream]);
  828. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(smalltalk.send(self, "_selector", []), "_asSelector", [])]), "__comma", ["\x22, ["])]);
  829. smalltalk.send(smalltalk.send(smalltalk.send(self, "_instructions", []), "_allButFirst", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_emitOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [","]);})]);
  830. smalltalk.send(aStream, "_nextPutAll_", ["])"]);
  831. return self;}
  832. }),
  833. smalltalk.IRSend);
  834. smalltalk.addMethod(
  835. "_selector",
  836. smalltalk.method({
  837. selector: "selector",
  838. fn: function () {
  839. var self=this;
  840. return self['@selector'];
  841. return self;}
  842. }),
  843. smalltalk.IRSend);
  844. smalltalk.addMethod(
  845. "_selector_",
  846. smalltalk.method({
  847. selector: "selector:",
  848. fn: function (aString) {
  849. var self=this;
  850. (self['@selector']=aString);
  851. return self;}
  852. }),
  853. smalltalk.IRSend);
  854. smalltalk.addMethod(
  855. "_superSend",
  856. smalltalk.method({
  857. selector: "superSend",
  858. fn: function () {
  859. var self=this;
  860. return (($receiver = self['@superSend']) == nil || $receiver == undefined) ? (function(){return false;})() : $receiver;
  861. return self;}
  862. }),
  863. smalltalk.IRSend);
  864. smalltalk.addMethod(
  865. "_superSend_",
  866. smalltalk.method({
  867. selector: "superSend:",
  868. fn: function (aBoolean) {
  869. var self=this;
  870. (self['@superSend']=aBoolean);
  871. return self;}
  872. }),
  873. smalltalk.IRSend);
  874. smalltalk.addClass('IRSequence', smalltalk.IRInstruction, [], 'Compiler-IR');
  875. smalltalk.addMethod(
  876. "_accept_",
  877. smalltalk.method({
  878. selector: "accept:",
  879. fn: function (aVisitor) {
  880. var self=this;
  881. smalltalk.send(aVisitor, "_visitIRSequence_", [self]);
  882. return self;}
  883. }),
  884. smalltalk.IRSequence);
  885. smalltalk.addMethod(
  886. "_appendInstruction_",
  887. smalltalk.method({
  888. selector: "appendInstruction:",
  889. fn: function (anIRInstruction) {
  890. var self=this;
  891. smalltalk.send(smalltalk.send(self, "_instructions", []), "_add_", [smalltalk.send(smalltalk.send((smalltalk.IRStatement || IRStatement), "_on_", [smalltalk.send(self, "_builder", [])]), "_with_", [anIRInstruction])]);
  892. return self;}
  893. }),
  894. smalltalk.IRSequence);
  895. smalltalk.addMethod(
  896. "_emitOn_",
  897. smalltalk.method({
  898. selector: "emitOn:",
  899. fn: function (aStream) {
  900. var self=this;
  901. smalltalk.send(aStream, "_nextPutSequenceWith_", [(function(){return smalltalk.send(self, "_emitOn_", [aStream], smalltalk.IRSequence.superclass || nil);})]);
  902. return self;}
  903. }),
  904. smalltalk.IRSequence);
  905. smalltalk.addClass('IRStatement', smalltalk.IRInstruction, ['pc'], 'Compiler-IR');
  906. smalltalk.addMethod(
  907. "_accept_",
  908. smalltalk.method({
  909. selector: "accept:",
  910. fn: function (aVisitor) {
  911. var self=this;
  912. smalltalk.send(aVisitor, "_visitIRStatement_", [self]);
  913. return self;}
  914. }),
  915. smalltalk.IRStatement);
  916. smalltalk.addMethod(
  917. "_emitOn_",
  918. smalltalk.method({
  919. selector: "emitOn:",
  920. fn: function (aStream) {
  921. var self=this;
  922. smalltalk.send(aStream, "_nextPutStatement_with_", [smalltalk.send(self, "_pc", []), (function(){return smalltalk.send(self, "_emitOn_", [aStream], smalltalk.IRStatement.superclass || nil);})]);
  923. return self;}
  924. }),
  925. smalltalk.IRStatement);
  926. smalltalk.addMethod(
  927. "_pc",
  928. smalltalk.method({
  929. selector: "pc",
  930. fn: function () {
  931. var self=this;
  932. return (($receiver = self['@pc']) == nil || $receiver == undefined) ? (function(){return (self['@pc']=smalltalk.send(smalltalk.send(self, "_builder", []), "_nextPc", []));})() : $receiver;
  933. return self;}
  934. }),
  935. smalltalk.IRStatement);
  936. smalltalk.addClass('IRTempDeclaration', smalltalk.IRInstruction, ['name'], 'Compiler-IR');
  937. smalltalk.addMethod(
  938. "_accept_",
  939. smalltalk.method({
  940. selector: "accept:",
  941. fn: function (aVisitor) {
  942. var self=this;
  943. smalltalk.send(aVisitor, "_visitIRTempDeclaration_", [self]);
  944. return self;}
  945. }),
  946. smalltalk.IRTempDeclaration);
  947. smalltalk.addMethod(
  948. "_emitOn_",
  949. smalltalk.method({
  950. selector: "emitOn:",
  951. fn: function (aStream) {
  952. var self=this;
  953. smalltalk.send(aStream, "_nextPutVar_", [smalltalk.send(smalltalk.send(self, "_name", []), "_asVariableName", [])]);
  954. return self;}
  955. }),
  956. smalltalk.IRTempDeclaration);
  957. smalltalk.addMethod(
  958. "_name",
  959. smalltalk.method({
  960. selector: "name",
  961. fn: function () {
  962. var self=this;
  963. return self['@name'];
  964. return self;}
  965. }),
  966. smalltalk.IRTempDeclaration);
  967. smalltalk.addMethod(
  968. "_name_",
  969. smalltalk.method({
  970. selector: "name:",
  971. fn: function (aString) {
  972. var self=this;
  973. (self['@name']=aString);
  974. return self;}
  975. }),
  976. smalltalk.IRTempDeclaration);
  977. smalltalk.addClass('IRValue', smalltalk.IRInstruction, ['value'], 'Compiler-IR');
  978. smalltalk.addMethod(
  979. "_accept_",
  980. smalltalk.method({
  981. selector: "accept:",
  982. fn: function (aVisitor) {
  983. var self=this;
  984. smalltalk.send(aVisitor, "_visitIRValue_", [self]);
  985. return self;}
  986. }),
  987. smalltalk.IRValue);
  988. smalltalk.addMethod(
  989. "_emitOn_",
  990. smalltalk.method({
  991. selector: "emitOn:",
  992. fn: function (aStream) {
  993. var self=this;
  994. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_value", []), "_asJavascript", [])]);
  995. return self;}
  996. }),
  997. smalltalk.IRValue);
  998. smalltalk.addMethod(
  999. "_value",
  1000. smalltalk.method({
  1001. selector: "value",
  1002. fn: function () {
  1003. var self=this;
  1004. return self['@value'];
  1005. return self;}
  1006. }),
  1007. smalltalk.IRValue);
  1008. smalltalk.addMethod(
  1009. "_value_",
  1010. smalltalk.method({
  1011. selector: "value:",
  1012. fn: function (aString) {
  1013. var self=this;
  1014. (self['@value']=aString);
  1015. return self;}
  1016. }),
  1017. smalltalk.IRValue);
  1018. smalltalk.addClass('IRVariable', smalltalk.IRInstruction, ['variable'], 'Compiler-IR');
  1019. smalltalk.addMethod(
  1020. "_accept_",
  1021. smalltalk.method({
  1022. selector: "accept:",
  1023. fn: function (aVisitor) {
  1024. var self=this;
  1025. smalltalk.send(aVisitor, "_visitIRVariable_", [self]);
  1026. return self;}
  1027. }),
  1028. smalltalk.IRVariable);
  1029. smalltalk.addMethod(
  1030. "_emitOn_",
  1031. smalltalk.method({
  1032. selector: "emitOn:",
  1033. fn: function (aStream) {
  1034. var self=this;
  1035. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_variable", []), "_alias", [])]);
  1036. return self;}
  1037. }),
  1038. smalltalk.IRVariable);
  1039. smalltalk.addMethod(
  1040. "_variable",
  1041. smalltalk.method({
  1042. selector: "variable",
  1043. fn: function () {
  1044. var self=this;
  1045. return self['@variable'];
  1046. return self;}
  1047. }),
  1048. smalltalk.IRVariable);
  1049. smalltalk.addMethod(
  1050. "_variable_",
  1051. smalltalk.method({
  1052. selector: "variable:",
  1053. fn: function (aScopeVariable) {
  1054. var self=this;
  1055. (self['@variable']=aScopeVariable);
  1056. return self;}
  1057. }),
  1058. smalltalk.IRVariable);
  1059. smalltalk.addClass('IRVerbatim', smalltalk.IRInstruction, ['source'], 'Compiler-IR');
  1060. smalltalk.addMethod(
  1061. "_accept_",
  1062. smalltalk.method({
  1063. selector: "accept:",
  1064. fn: function (aVisitor) {
  1065. var self=this;
  1066. smalltalk.send(aVisitor, "_visitIRVerbatim_", [self]);
  1067. return self;}
  1068. }),
  1069. smalltalk.IRVerbatim);
  1070. smalltalk.addMethod(
  1071. "_emitOn_",
  1072. smalltalk.method({
  1073. selector: "emitOn:",
  1074. fn: function (aStream) {
  1075. var self=this;
  1076. smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_source", []), "__comma", [";"])]);
  1077. return self;}
  1078. }),
  1079. smalltalk.IRVerbatim);
  1080. smalltalk.addMethod(
  1081. "_source",
  1082. smalltalk.method({
  1083. selector: "source",
  1084. fn: function () {
  1085. var self=this;
  1086. return self['@source'];
  1087. return self;}
  1088. }),
  1089. smalltalk.IRVerbatim);
  1090. smalltalk.addMethod(
  1091. "_source_",
  1092. smalltalk.method({
  1093. selector: "source:",
  1094. fn: function (aString) {
  1095. var self=this;
  1096. (self['@source']=aString);
  1097. return self;}
  1098. }),
  1099. smalltalk.IRVerbatim);
  1100. smalltalk.addClass('IRVisitor', smalltalk.Object, [], 'Compiler-IR');
  1101. smalltalk.addMethod(
  1102. "_visit_",
  1103. smalltalk.method({
  1104. selector: "visit:",
  1105. fn: function (anIRInstruction) {
  1106. var self=this;
  1107. smalltalk.send(anIRInstruction, "_accept_", [self]);
  1108. return self;}
  1109. }),
  1110. smalltalk.IRVisitor);
  1111. smalltalk.addMethod(
  1112. "_visitIRAssignment_",
  1113. smalltalk.method({
  1114. selector: "visitIRAssignment:",
  1115. fn: function (anIRAssignment) {
  1116. var self=this;
  1117. smalltalk.send(self, "_visitIRInstruction_", [anIRAssignment]);
  1118. return self;}
  1119. }),
  1120. smalltalk.IRVisitor);
  1121. smalltalk.addMethod(
  1122. "_visitIRClosure_",
  1123. smalltalk.method({
  1124. selector: "visitIRClosure:",
  1125. fn: function (anIRClosure) {
  1126. var self=this;
  1127. smalltalk.send(self, "_visitIRInstruction_", [anIRClosure]);
  1128. return self;}
  1129. }),
  1130. smalltalk.IRVisitor);
  1131. smalltalk.addMethod(
  1132. "_visitIRInstruction_",
  1133. smalltalk.method({
  1134. selector: "visitIRInstruction:",
  1135. fn: function (anIRInstruction) {
  1136. var self=this;
  1137. smalltalk.send(smalltalk.send(anIRInstruction, "_instructions", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  1138. return self;}
  1139. }),
  1140. smalltalk.IRVisitor);
  1141. smalltalk.addMethod(
  1142. "_visitIRMethod_",
  1143. smalltalk.method({
  1144. selector: "visitIRMethod:",
  1145. fn: function (anIRMethod) {
  1146. var self=this;
  1147. smalltalk.send(self, "_visitIRInstruction_", [anIRMethod]);
  1148. return self;}
  1149. }),
  1150. smalltalk.IRVisitor);
  1151. smalltalk.addMethod(
  1152. "_visitIRNonLocalReturn_",
  1153. smalltalk.method({
  1154. selector: "visitIRNonLocalReturn:",
  1155. fn: function (anIRNonLocalReturn) {
  1156. var self=this;
  1157. smalltalk.send(self, "_visitIRInstruction_", [anIRNonLocalReturn]);
  1158. return self;}
  1159. }),
  1160. smalltalk.IRVisitor);
  1161. smalltalk.addMethod(
  1162. "_visitIRNonLocalReturnHandling_",
  1163. smalltalk.method({
  1164. selector: "visitIRNonLocalReturnHandling:",
  1165. fn: function (anIRNonLocalReturnHandling) {
  1166. var self=this;
  1167. smalltalk.send(self, "_visitIRInstruction_", [anIRNonLocalReturnHandling]);
  1168. return self;}
  1169. }),
  1170. smalltalk.IRVisitor);
  1171. smalltalk.addMethod(
  1172. "_visitIRReturn_",
  1173. smalltalk.method({
  1174. selector: "visitIRReturn:",
  1175. fn: function (anIRReturn) {
  1176. var self=this;
  1177. smalltalk.send(self, "_visitIRInstruction_", [anIRReturn]);
  1178. return self;}
  1179. }),
  1180. smalltalk.IRVisitor);
  1181. smalltalk.addMethod(
  1182. "_visitIRSend_",
  1183. smalltalk.method({
  1184. selector: "visitIRSend:",
  1185. fn: function (anIRSend) {
  1186. var self=this;
  1187. smalltalk.send(self, "_visitIRInstruction_", [anIRSend]);
  1188. return self;}
  1189. }),
  1190. smalltalk.IRVisitor);
  1191. smalltalk.addMethod(
  1192. "_visitIRSequence_",
  1193. smalltalk.method({
  1194. selector: "visitIRSequence:",
  1195. fn: function (anIRSequence) {
  1196. var self=this;
  1197. smalltalk.send(self, "_visitIRInstruction_", [anIRSequence]);
  1198. return self;}
  1199. }),
  1200. smalltalk.IRVisitor);
  1201. smalltalk.addMethod(
  1202. "_visitIRStatement_",
  1203. smalltalk.method({
  1204. selector: "visitIRStatement:",
  1205. fn: function (anIRStatement) {
  1206. var self=this;
  1207. smalltalk.send(self, "_visitIRInstruction_", [anIRStatement]);
  1208. return self;}
  1209. }),
  1210. smalltalk.IRVisitor);
  1211. smalltalk.addMethod(
  1212. "_visitIRTempDeclaration_",
  1213. smalltalk.method({
  1214. selector: "visitIRTempDeclaration:",
  1215. fn: function (anIRTempDeclaration) {
  1216. var self=this;
  1217. smalltalk.send(self, "_visitIRInstruction_", [anIRTempDeclaration]);
  1218. return self;}
  1219. }),
  1220. smalltalk.IRVisitor);
  1221. smalltalk.addMethod(
  1222. "_visitIRValue_",
  1223. smalltalk.method({
  1224. selector: "visitIRValue:",
  1225. fn: function (anIRValue) {
  1226. var self=this;
  1227. smalltalk.send(self, "_visitIRInstruction_", [anIRValue]);
  1228. return self;}
  1229. }),
  1230. smalltalk.IRVisitor);
  1231. smalltalk.addMethod(
  1232. "_visitIRVariable_",
  1233. smalltalk.method({
  1234. selector: "visitIRVariable:",
  1235. fn: function (anIRVariable) {
  1236. var self=this;
  1237. smalltalk.send(self, "_visitIRInstruction_", [anIRVariable]);
  1238. return self;}
  1239. }),
  1240. smalltalk.IRVisitor);
  1241. smalltalk.addMethod(
  1242. "_visitIRVerbatim_",
  1243. smalltalk.method({
  1244. selector: "visitIRVerbatim:",
  1245. fn: function (anIRVerbatim) {
  1246. var self=this;
  1247. smalltalk.send(self, "_visitIRInstruction_", [anIRVerbatim]);
  1248. return self;}
  1249. }),
  1250. smalltalk.IRVisitor);
  1251. smalltalk.addClass('IRJSTranslator', smalltalk.IRVisitor, ['stream'], 'Compiler-IR');
  1252. smalltalk.addMethod(
  1253. "_initialize",
  1254. smalltalk.method({
  1255. selector: "initialize",
  1256. fn: function () {
  1257. var self=this;
  1258. smalltalk.send(self, "_initialize", [], smalltalk.IRJSTranslator.superclass || nil);
  1259. (self['@stream']=smalltalk.send((smalltalk.JSStream || JSStream), "_new", []));
  1260. return self;}
  1261. }),
  1262. smalltalk.IRJSTranslator);
  1263. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-IR');
  1264. smalltalk.addMethod(
  1265. "_contents",
  1266. smalltalk.method({
  1267. selector: "contents",
  1268. fn: function () {
  1269. var self=this;
  1270. return smalltalk.send(self['@stream'], "_contents", []);
  1271. return self;}
  1272. }),
  1273. smalltalk.JSStream);
  1274. smalltalk.addMethod(
  1275. "_initialize",
  1276. smalltalk.method({
  1277. selector: "initialize",
  1278. fn: function () {
  1279. var self=this;
  1280. smalltalk.send(self, "_initialize", [], smalltalk.JSStream.superclass || nil);
  1281. (self['@stream']=smalltalk.send("", "_writeStream", []));
  1282. return self;}
  1283. }),
  1284. smalltalk.JSStream);
  1285. smalltalk.addMethod(
  1286. "_lf",
  1287. smalltalk.method({
  1288. selector: "lf",
  1289. fn: function () {
  1290. var self=this;
  1291. smalltalk.send(self['@stream'], "_lf", []);
  1292. return self;}
  1293. }),
  1294. smalltalk.JSStream);
  1295. smalltalk.addMethod(
  1296. "_nextPut_",
  1297. smalltalk.method({
  1298. selector: "nextPut:",
  1299. fn: function (aString) {
  1300. var self=this;
  1301. smalltalk.send(self['@stream'], "_nextPut_", [aString]);
  1302. return self;}
  1303. }),
  1304. smalltalk.JSStream);
  1305. smalltalk.addMethod(
  1306. "_nextPutAll_",
  1307. smalltalk.method({
  1308. selector: "nextPutAll:",
  1309. fn: function (aString) {
  1310. var self=this;
  1311. smalltalk.send(self['@stream'], "_nextPutAll_", [aString]);
  1312. return self;}
  1313. }),
  1314. smalltalk.JSStream);
  1315. smalltalk.addMethod(
  1316. "_nextPutAssignment_to_",
  1317. smalltalk.method({
  1318. selector: "nextPutAssignment:to:",
  1319. fn: function (varInstruction, valueInstruction) {
  1320. var self=this;
  1321. smalltalk.send(varInstruction, "_emitOn_", [self]);
  1322. smalltalk.send(self['@stream'], "_nextPutAll_", ["="]);
  1323. smalltalk.send(valueInstruction, "_emitOn_", [self]);
  1324. return self;}
  1325. }),
  1326. smalltalk.JSStream);
  1327. smalltalk.addMethod(
  1328. "_nextPutClosureWith_arguments_",
  1329. smalltalk.method({
  1330. selector: "nextPutClosureWith:arguments:",
  1331. fn: function (aBlock, anArray) {
  1332. var self=this;
  1333. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
  1334. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asVariableName", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  1335. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1336. smalltalk.send(aBlock, "_value", []);
  1337. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  1338. return self;}
  1339. }),
  1340. smalltalk.JSStream);
  1341. smalltalk.addMethod(
  1342. "_nextPutFunctionWith_arguments_",
  1343. smalltalk.method({
  1344. selector: "nextPutFunctionWith:arguments:",
  1345. fn: function (aBlock, anArray) {
  1346. var self=this;
  1347. smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
  1348. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asVariableName", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  1349. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1350. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1351. smalltalk.send(aBlock, "_value", []);
  1352. smalltalk.send(self['@stream'], "_nextPutAll_", ["return self;}"]);
  1353. return self;}
  1354. }),
  1355. smalltalk.JSStream);
  1356. smalltalk.addMethod(
  1357. "_nextPutMethodDeclaration_with_",
  1358. smalltalk.method({
  1359. selector: "nextPutMethodDeclaration:with:",
  1360. fn: function (aMethod, aBlock) {
  1361. var self=this;
  1362. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aMethod, "_selector", [])]), "__comma", ["\x22,"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1363. smalltalk.send(aBlock, "_value", []);
  1364. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asArray", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_arguments", []), "_collect_", [(function(each){return smalltalk.send(each, "_value", []);})]), "_asArray", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
  1365. smalltalk.send(smalltalk.send(aMethod, "_classReferences", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asJavascript", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1366. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["]"]);return smalltalk.send($rec, "_nextPutAll_", ["})"]);})(self['@stream']);
  1367. return self;}
  1368. }),
  1369. smalltalk.JSStream);
  1370. smalltalk.addMethod(
  1371. "_nextPutNonLocalReturnHandlingWith_",
  1372. smalltalk.method({
  1373. selector: "nextPutNonLocalReturnHandlingWith:",
  1374. fn: function (aBlock) {
  1375. var self=this;
  1376. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["try {"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1377. smalltalk.send(aBlock, "_value", []);
  1378. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["}"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["catch(e) {if(e===$early)return e[0]; throw e}"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1379. return self;}
  1380. }),
  1381. smalltalk.JSStream);
  1382. smalltalk.addMethod(
  1383. "_nextPutNonLocalReturnWith_",
  1384. smalltalk.method({
  1385. selector: "nextPutNonLocalReturnWith:",
  1386. fn: function (aBlock) {
  1387. var self=this;
  1388. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);
  1389. smalltalk.send(aBlock, "_value", []);
  1390. smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);
  1391. return self;}
  1392. }),
  1393. smalltalk.JSStream);
  1394. smalltalk.addMethod(
  1395. "_nextPutReturnWith_",
  1396. smalltalk.method({
  1397. selector: "nextPutReturnWith:",
  1398. fn: function (aBlock) {
  1399. var self=this;
  1400. smalltalk.send(self['@stream'], "_nextPutAll_", ["return "]);
  1401. smalltalk.send(aBlock, "_value", []);
  1402. return self;}
  1403. }),
  1404. smalltalk.JSStream);
  1405. smalltalk.addMethod(
  1406. "_nextPutSendTo_selector_arguments_",
  1407. smalltalk.method({
  1408. selector: "nextPutSendTo:selector:arguments:",
  1409. fn: function (receiver, selector, arguments) {
  1410. var self=this;
  1411. smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.send("]);
  1412. smalltalk.send(receiver, "_emitOn_", [self]);
  1413. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(selector, "_asSelector", [])]), "__comma", ["\x22,["])]);
  1414. smalltalk.send(arguments, "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_emitOn_", [self]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1415. smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]);
  1416. return self;}
  1417. }),
  1418. smalltalk.JSStream);
  1419. smalltalk.addMethod(
  1420. "_nextPutSequenceWith_",
  1421. smalltalk.method({
  1422. selector: "nextPutSequenceWith:",
  1423. fn: function (aBlock) {
  1424. var self=this;
  1425. smalltalk.send(aBlock, "_value", []);
  1426. return self;}
  1427. }),
  1428. smalltalk.JSStream);
  1429. smalltalk.addMethod(
  1430. "_nextPutStatement_with_",
  1431. smalltalk.method({
  1432. selector: "nextPutStatement:with:",
  1433. fn: function (anInteger, aBlock) {
  1434. var self=this;
  1435. smalltalk.send(aBlock, "_value", []);
  1436. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1437. return self;}
  1438. }),
  1439. smalltalk.JSStream);
  1440. smalltalk.addMethod(
  1441. "_nextPutVar_",
  1442. smalltalk.method({
  1443. selector: "nextPutVar:",
  1444. fn: function (aString) {
  1445. var self=this;
  1446. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [aString]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1447. return self;}
  1448. }),
  1449. smalltalk.JSStream);
  1450. smalltalk.addMethod(
  1451. "_nextPutVars_",
  1452. smalltalk.method({
  1453. selector: "nextPutVars:",
  1454. fn: function (aCollection) {
  1455. var self=this;
  1456. smalltalk.send(self['@stream'], "_nextPutAll_", ["var "]);
  1457. smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  1458. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  1459. return self;}
  1460. }),
  1461. smalltalk.JSStream);
  1462. smalltalk.addMethod(
  1463. "_appendToInstruction_",
  1464. smalltalk.method({
  1465. selector: "appendToInstruction:",
  1466. fn: function (anIRInstruction) {
  1467. var self=this;
  1468. smalltalk.send(anIRInstruction, "_appendBlock_", [self]);
  1469. return self;}
  1470. }),
  1471. smalltalk.BlockClosure);
  1472. smalltalk.addMethod(
  1473. "_appendToInstruction_",
  1474. smalltalk.method({
  1475. selector: "appendToInstruction:",
  1476. fn: function (anInstruction) {
  1477. var self=this;
  1478. smalltalk.send(anInstruction, "_appendString_", [self]);
  1479. return self;}
  1480. }),
  1481. smalltalk.String);
  1482. smalltalk.addMethod(
  1483. "_asVariableName",
  1484. smalltalk.method({
  1485. selector: "asVariableName",
  1486. fn: function () {
  1487. var self=this;
  1488. return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_reservedWords", []), "_includes_", [self])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "__comma", ["_"]);})() : (function(){return self;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "__comma", ["_"]);}), (function(){return self;})]));
  1489. return self;}
  1490. }),
  1491. smalltalk.String);
  1492. smalltalk.addMethod(
  1493. "_emitOn_",
  1494. smalltalk.method({
  1495. selector: "emitOn:",
  1496. fn: function (aStream) {
  1497. var self=this;
  1498. smalltalk.send(aStream, "_nextPutAll_", [self]);
  1499. return self;}
  1500. }),
  1501. smalltalk.String);