1
0

Compiler-IR.deploy.js 57 KB

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