1
0

Compiler-IR.deploy.js 58 KB

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