Compiler-IR.deploy.js 57 KB

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