Compiler-Core.deploy.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  1. smalltalk.addPackage('Compiler-Core');
  2. smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "classNameFor:",
  6. fn: function (aClass){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. var $2,$3,$1;
  10. $2=_st(aClass)._isMetaclass();
  11. if(smalltalk.assert($2)){
  12. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  13. } else {
  14. $3=_st(aClass)._isNil();
  15. if(smalltalk.assert($3)){
  16. $1="nil";
  17. } else {
  18. $1=_st(aClass)._name();
  19. };
  20. };
  21. return $1;
  22. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
  23. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  24. smalltalk.AbstractCodeGenerator);
  25. smalltalk.addMethod(
  26. smalltalk.method({
  27. selector: "compileNode:",
  28. fn: function (aNode){
  29. var self=this;
  30. return smalltalk.withContext(function($ctx1) {
  31. self._subclassResponsibility();
  32. return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode},smalltalk.AbstractCodeGenerator)})},
  33. messageSends: ["subclassResponsibility"]}),
  34. smalltalk.AbstractCodeGenerator);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "currentClass",
  38. fn: function (){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) {
  41. var $1;
  42. $1=self["@currentClass"];
  43. return $1;
  44. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.AbstractCodeGenerator)})},
  45. messageSends: []}),
  46. smalltalk.AbstractCodeGenerator);
  47. smalltalk.addMethod(
  48. smalltalk.method({
  49. selector: "currentClass:",
  50. fn: function (aClass){
  51. var self=this;
  52. return smalltalk.withContext(function($ctx1) {
  53. self["@currentClass"]=aClass;
  54. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
  55. messageSends: []}),
  56. smalltalk.AbstractCodeGenerator);
  57. smalltalk.addMethod(
  58. smalltalk.method({
  59. selector: "pseudoVariables",
  60. fn: function (){
  61. var self=this;
  62. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  63. return smalltalk.withContext(function($ctx1) {
  64. var $1;
  65. $1=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  66. return $1;
  67. }, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{},smalltalk.AbstractCodeGenerator)})},
  68. messageSends: ["pseudoVariableNames", "current"]}),
  69. smalltalk.AbstractCodeGenerator);
  70. smalltalk.addMethod(
  71. smalltalk.method({
  72. selector: "safeVariableNameFor:",
  73. fn: function (aString){
  74. var self=this;
  75. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  76. return smalltalk.withContext(function($ctx1) {
  77. var $2,$1;
  78. $2=_st(_st(_st($Smalltalk())._current())._reservedWords())._includes_(aString);
  79. if(smalltalk.assert($2)){
  80. $1=_st(aString).__comma("_");
  81. } else {
  82. $1=aString;
  83. };
  84. return $1;
  85. }, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  86. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"]}),
  87. smalltalk.AbstractCodeGenerator);
  88. smalltalk.addMethod(
  89. smalltalk.method({
  90. selector: "source",
  91. fn: function (){
  92. var self=this;
  93. return smalltalk.withContext(function($ctx1) {
  94. var $2,$1;
  95. $2=self["@source"];
  96. if(($receiver = $2) == nil || $receiver == undefined){
  97. $1="";
  98. } else {
  99. $1=$2;
  100. };
  101. return $1;
  102. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.AbstractCodeGenerator)})},
  103. messageSends: ["ifNil:"]}),
  104. smalltalk.AbstractCodeGenerator);
  105. smalltalk.addMethod(
  106. smalltalk.method({
  107. selector: "source:",
  108. fn: function (aString){
  109. var self=this;
  110. return smalltalk.withContext(function($ctx1) {
  111. self["@source"]=aString;
  112. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  113. messageSends: []}),
  114. smalltalk.AbstractCodeGenerator);
  115. smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
  116. smalltalk.addMethod(
  117. smalltalk.method({
  118. selector: "compileNode:",
  119. fn: function (aNode){
  120. var self=this;
  121. var ir,stream;
  122. return smalltalk.withContext(function($ctx1) {
  123. var $2,$3,$1;
  124. _st(self._semanticAnalyzer())._visit_(aNode);
  125. ir=_st(self._translator())._visit_(aNode);
  126. $2=self._irTranslator();
  127. _st($2)._currentClass_(self._currentClass());
  128. _st($2)._visit_(ir);
  129. $3=_st($2)._contents();
  130. $1=$3;
  131. return $1;
  132. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream},smalltalk.CodeGenerator)})},
  133. messageSends: ["visit:", "semanticAnalyzer", "translator", "currentClass:", "currentClass", "irTranslator", "contents"]}),
  134. smalltalk.CodeGenerator);
  135. smalltalk.addMethod(
  136. smalltalk.method({
  137. selector: "irTranslator",
  138. fn: function (){
  139. var self=this;
  140. function $IRJSTranslator(){return smalltalk.IRJSTranslator||(typeof IRJSTranslator=="undefined"?nil:IRJSTranslator)}
  141. return smalltalk.withContext(function($ctx1) {
  142. var $1;
  143. $1=_st($IRJSTranslator())._new();
  144. return $1;
  145. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{},smalltalk.CodeGenerator)})},
  146. messageSends: ["new"]}),
  147. smalltalk.CodeGenerator);
  148. smalltalk.addMethod(
  149. smalltalk.method({
  150. selector: "semanticAnalyzer",
  151. fn: function (){
  152. var self=this;
  153. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  154. return smalltalk.withContext(function($ctx1) {
  155. var $1;
  156. $1=_st($SemanticAnalyzer())._on_(self._currentClass());
  157. return $1;
  158. }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{},smalltalk.CodeGenerator)})},
  159. messageSends: ["on:", "currentClass"]}),
  160. smalltalk.CodeGenerator);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "translator",
  164. fn: function (){
  165. var self=this;
  166. function $IRASTTranslator(){return smalltalk.IRASTTranslator||(typeof IRASTTranslator=="undefined"?nil:IRASTTranslator)}
  167. return smalltalk.withContext(function($ctx1) {
  168. var $2,$3,$1;
  169. $2=_st($IRASTTranslator())._new();
  170. _st($2)._source_(self._source());
  171. _st($2)._theClass_(self._currentClass());
  172. $3=_st($2)._yourself();
  173. $1=$3;
  174. return $1;
  175. }, function($ctx1) {$ctx1.fill(self,"translator",{},smalltalk.CodeGenerator)})},
  176. messageSends: ["source:", "source", "new", "theClass:", "currentClass", "yourself"]}),
  177. smalltalk.CodeGenerator);
  178. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  179. smalltalk.addMethod(
  180. smalltalk.method({
  181. selector: "codeGeneratorClass",
  182. fn: function (){
  183. var self=this;
  184. function $InliningCodeGenerator(){return smalltalk.InliningCodeGenerator||(typeof InliningCodeGenerator=="undefined"?nil:InliningCodeGenerator)}
  185. return smalltalk.withContext(function($ctx1) {
  186. var $2,$1;
  187. $2=self["@codeGeneratorClass"];
  188. if(($receiver = $2) == nil || $receiver == undefined){
  189. $1=$InliningCodeGenerator();
  190. } else {
  191. $1=$2;
  192. };
  193. return $1;
  194. }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.Compiler)})},
  195. messageSends: ["ifNil:"]}),
  196. smalltalk.Compiler);
  197. smalltalk.addMethod(
  198. smalltalk.method({
  199. selector: "codeGeneratorClass:",
  200. fn: function (aClass){
  201. var self=this;
  202. return smalltalk.withContext(function($ctx1) {
  203. self["@codeGeneratorClass"]=aClass;
  204. return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass},smalltalk.Compiler)})},
  205. messageSends: []}),
  206. smalltalk.Compiler);
  207. smalltalk.addMethod(
  208. smalltalk.method({
  209. selector: "compile:",
  210. fn: function (aString){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. var $1;
  214. $1=self._compileNode_(self._parse_(aString));
  215. return $1;
  216. }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.Compiler)})},
  217. messageSends: ["compileNode:", "parse:"]}),
  218. smalltalk.Compiler);
  219. smalltalk.addMethod(
  220. smalltalk.method({
  221. selector: "compile:forClass:",
  222. fn: function (aString,aClass){
  223. var self=this;
  224. return smalltalk.withContext(function($ctx1) {
  225. var $1;
  226. self._currentClass_(aClass);
  227. self._source_(aString);
  228. $1=self._compile_(aString);
  229. return $1;
  230. }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass},smalltalk.Compiler)})},
  231. messageSends: ["currentClass:", "source:", "compile:"]}),
  232. smalltalk.Compiler);
  233. smalltalk.addMethod(
  234. smalltalk.method({
  235. selector: "compileExpression:",
  236. fn: function (aString){
  237. var self=this;
  238. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  239. return smalltalk.withContext(function($ctx1) {
  240. var $1;
  241. self._currentClass_($DoIt());
  242. self._source_(_st("doIt ^[".__comma(aString)).__comma("] value"));
  243. $1=self._compileNode_(self._parse_(self._source()));
  244. return $1;
  245. }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString},smalltalk.Compiler)})},
  246. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"]}),
  247. smalltalk.Compiler);
  248. smalltalk.addMethod(
  249. smalltalk.method({
  250. selector: "compileExpression:on:",
  251. fn: function (aString,anObject){
  252. var self=this;
  253. return smalltalk.withContext(function($ctx1) {
  254. var $1;
  255. self._currentClass_(_st(anObject)._class());
  256. self._source_(_st("xxxDoIt ^[".__comma(aString)).__comma("] value"));
  257. $1=self._compileNode_(self._parse_(self._source()));
  258. return $1;
  259. }, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},smalltalk.Compiler)})},
  260. messageSends: ["currentClass:", "class", "source:", ",", "compileNode:", "parse:", "source"]}),
  261. smalltalk.Compiler);
  262. smalltalk.addMethod(
  263. smalltalk.method({
  264. selector: "compileNode:",
  265. fn: function (aNode){
  266. var self=this;
  267. var generator,result;
  268. return smalltalk.withContext(function($ctx1) {
  269. var $1,$2,$3;
  270. generator=_st(self._codeGeneratorClass())._new();
  271. $1=generator;
  272. _st($1)._source_(self._source());
  273. $2=_st($1)._currentClass_(self._currentClass());
  274. result=_st(generator)._compileNode_(aNode);
  275. self._unknownVariables_([]);
  276. $3=result;
  277. return $3;
  278. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result},smalltalk.Compiler)})},
  279. messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"]}),
  280. smalltalk.Compiler);
  281. smalltalk.addMethod(
  282. smalltalk.method({
  283. selector: "currentClass",
  284. fn: function (){
  285. var self=this;
  286. return smalltalk.withContext(function($ctx1) {
  287. var $1;
  288. $1=self["@currentClass"];
  289. return $1;
  290. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.Compiler)})},
  291. messageSends: []}),
  292. smalltalk.Compiler);
  293. smalltalk.addMethod(
  294. smalltalk.method({
  295. selector: "currentClass:",
  296. fn: function (aClass){
  297. var self=this;
  298. return smalltalk.withContext(function($ctx1) {
  299. self["@currentClass"]=aClass;
  300. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.Compiler)})},
  301. messageSends: []}),
  302. smalltalk.Compiler);
  303. smalltalk.addMethod(
  304. smalltalk.method({
  305. selector: "eval:",
  306. fn: function (aString){
  307. var self=this;
  308. return smalltalk.withContext(function($ctx1) {
  309. return eval(aString);
  310. return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString},smalltalk.Compiler)})},
  311. messageSends: []}),
  312. smalltalk.Compiler);
  313. smalltalk.addMethod(
  314. smalltalk.method({
  315. selector: "evaluateExpression:",
  316. fn: function (aString){
  317. var self=this;
  318. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  319. return smalltalk.withContext(function($ctx1) {
  320. var $1;
  321. $1=self._evaluateExpression_on_(aString,_st($DoIt())._new());
  322. return $1;
  323. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString},smalltalk.Compiler)})},
  324. messageSends: ["evaluateExpression:on:", "new"]}),
  325. smalltalk.Compiler);
  326. smalltalk.addMethod(
  327. smalltalk.method({
  328. selector: "evaluateExpression:on:",
  329. fn: function (aString,anObject){
  330. var self=this;
  331. var result,method;
  332. return smalltalk.withContext(function($ctx1) {
  333. var $1;
  334. method=self._eval_(self._compileExpression_on_(aString,anObject));
  335. _st(method)._category_("xxxDoIt");
  336. _st(_st(anObject)._class())._addCompiledMethod_(method);
  337. result=_st(anObject)._xxxDoIt();
  338. _st(_st(anObject)._class())._removeCompiledMethod_(method);
  339. $1=result;
  340. return $1;
  341. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:on:",{aString:aString,anObject:anObject,result:result,method:method},smalltalk.Compiler)})},
  342. messageSends: ["eval:", "compileExpression:on:", "category:", "addCompiledMethod:", "class", "xxxDoIt", "removeCompiledMethod:"]}),
  343. smalltalk.Compiler);
  344. smalltalk.addMethod(
  345. smalltalk.method({
  346. selector: "install:forClass:category:",
  347. fn: function (aString,aBehavior,anotherString){
  348. var self=this;
  349. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  350. return smalltalk.withContext(function($ctx1) {
  351. var $1;
  352. $1=_st(_st($ClassBuilder())._new())._installMethod_forClass_category_(self._eval_(self._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
  353. return $1;
  354. }, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString},smalltalk.Compiler)})},
  355. messageSends: ["installMethod:forClass:category:", "eval:", "compile:forClass:", "new"]}),
  356. smalltalk.Compiler);
  357. smalltalk.addMethod(
  358. smalltalk.method({
  359. selector: "parse:",
  360. fn: function (aString){
  361. var self=this;
  362. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  363. return smalltalk.withContext(function($ctx1) {
  364. var $1;
  365. $1=_st(_st($Smalltalk())._current())._parse_(aString);
  366. return $1;
  367. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Compiler)})},
  368. messageSends: ["parse:", "current"]}),
  369. smalltalk.Compiler);
  370. smalltalk.addMethod(
  371. smalltalk.method({
  372. selector: "parseExpression:",
  373. fn: function (aString){
  374. var self=this;
  375. return smalltalk.withContext(function($ctx1) {
  376. var $1;
  377. $1=self._parse_(_st("doIt ^[".__comma(aString)).__comma("] value"));
  378. return $1;
  379. }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString},smalltalk.Compiler)})},
  380. messageSends: ["parse:", ","]}),
  381. smalltalk.Compiler);
  382. smalltalk.addMethod(
  383. smalltalk.method({
  384. selector: "recompile:",
  385. fn: function (aClass){
  386. var self=this;
  387. return smalltalk.withContext(function($ctx1) {
  388. var $1;
  389. _st(_st(_st(aClass)._methodDictionary())._values())._do_displayingProgress_((function(each){
  390. return smalltalk.withContext(function($ctx2) {
  391. return self._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  392. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),"Recompiling ".__comma(_st(aClass)._name()));
  393. $1=_st(aClass)._isMetaclass();
  394. if(! smalltalk.assert($1)){
  395. self._recompile_(_st(aClass)._class());
  396. };
  397. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler)})},
  398. messageSends: ["do:displayingProgress:", "install:forClass:category:", "source", "category", ",", "name", "values", "methodDictionary", "ifFalse:", "recompile:", "class", "isMetaclass"]}),
  399. smalltalk.Compiler);
  400. smalltalk.addMethod(
  401. smalltalk.method({
  402. selector: "recompileAll",
  403. fn: function (){
  404. var self=this;
  405. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  406. return smalltalk.withContext(function($ctx1) {
  407. _st(_st(_st($Smalltalk())._current())._classes())._do_displayingProgress_((function(each){
  408. return smalltalk.withContext(function($ctx2) {
  409. return self._recompile_(each);
  410. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),"Compiling all classes...");
  411. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler)})},
  412. messageSends: ["do:displayingProgress:", "recompile:", "classes", "current"]}),
  413. smalltalk.Compiler);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "source",
  417. fn: function (){
  418. var self=this;
  419. return smalltalk.withContext(function($ctx1) {
  420. var $2,$1;
  421. $2=self["@source"];
  422. if(($receiver = $2) == nil || $receiver == undefined){
  423. $1="";
  424. } else {
  425. $1=$2;
  426. };
  427. return $1;
  428. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Compiler)})},
  429. messageSends: ["ifNil:"]}),
  430. smalltalk.Compiler);
  431. smalltalk.addMethod(
  432. smalltalk.method({
  433. selector: "source:",
  434. fn: function (aString){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx1) {
  437. self["@source"]=aString;
  438. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.Compiler)})},
  439. messageSends: []}),
  440. smalltalk.Compiler);
  441. smalltalk.addMethod(
  442. smalltalk.method({
  443. selector: "unknownVariables",
  444. fn: function (){
  445. var self=this;
  446. return smalltalk.withContext(function($ctx1) {
  447. var $1;
  448. $1=self["@unknownVariables"];
  449. return $1;
  450. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{},smalltalk.Compiler)})},
  451. messageSends: []}),
  452. smalltalk.Compiler);
  453. smalltalk.addMethod(
  454. smalltalk.method({
  455. selector: "unknownVariables:",
  456. fn: function (aCollection){
  457. var self=this;
  458. return smalltalk.withContext(function($ctx1) {
  459. self["@unknownVariables"]=aCollection;
  460. return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection},smalltalk.Compiler)})},
  461. messageSends: []}),
  462. smalltalk.Compiler);
  463. smalltalk.addMethod(
  464. smalltalk.method({
  465. selector: "recompile:",
  466. fn: function (aClass){
  467. var self=this;
  468. return smalltalk.withContext(function($ctx1) {
  469. _st(self._new())._recompile_(aClass);
  470. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler.klass)})},
  471. messageSends: ["recompile:", "new"]}),
  472. smalltalk.Compiler.klass);
  473. smalltalk.addMethod(
  474. smalltalk.method({
  475. selector: "recompileAll",
  476. fn: function (){
  477. var self=this;
  478. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  479. return smalltalk.withContext(function($ctx1) {
  480. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  481. return smalltalk.withContext(function($ctx2) {
  482. return self._recompile_(each);
  483. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  484. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler.klass)})},
  485. messageSends: ["do:", "recompile:", "classes", "current"]}),
  486. smalltalk.Compiler.klass);
  487. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  488. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  489. smalltalk.addMethod(
  490. smalltalk.method({
  491. selector: "visit:",
  492. fn: function (aNode){
  493. var self=this;
  494. return smalltalk.withContext(function($ctx1) {
  495. var $1;
  496. $1=_st(aNode)._accept_(self);
  497. return $1;
  498. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.NodeVisitor)})},
  499. messageSends: ["accept:"]}),
  500. smalltalk.NodeVisitor);
  501. smalltalk.addMethod(
  502. smalltalk.method({
  503. selector: "visitAll:",
  504. fn: function (aCollection){
  505. var self=this;
  506. return smalltalk.withContext(function($ctx1) {
  507. var $1;
  508. $1=_st(aCollection)._collect_((function(each){
  509. return smalltalk.withContext(function($ctx2) {
  510. return self._visit_(each);
  511. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  512. return $1;
  513. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},smalltalk.NodeVisitor)})},
  514. messageSends: ["collect:", "visit:"]}),
  515. smalltalk.NodeVisitor);
  516. smalltalk.addMethod(
  517. smalltalk.method({
  518. selector: "visitAssignmentNode:",
  519. fn: function (aNode){
  520. var self=this;
  521. return smalltalk.withContext(function($ctx1) {
  522. var $1;
  523. $1=self._visitNode_(aNode);
  524. return $1;
  525. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  526. messageSends: ["visitNode:"]}),
  527. smalltalk.NodeVisitor);
  528. smalltalk.addMethod(
  529. smalltalk.method({
  530. selector: "visitBlockNode:",
  531. fn: function (aNode){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) {
  534. var $1;
  535. $1=self._visitNode_(aNode);
  536. return $1;
  537. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  538. messageSends: ["visitNode:"]}),
  539. smalltalk.NodeVisitor);
  540. smalltalk.addMethod(
  541. smalltalk.method({
  542. selector: "visitBlockSequenceNode:",
  543. fn: function (aNode){
  544. var self=this;
  545. return smalltalk.withContext(function($ctx1) {
  546. var $1;
  547. $1=self._visitSequenceNode_(aNode);
  548. return $1;
  549. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  550. messageSends: ["visitSequenceNode:"]}),
  551. smalltalk.NodeVisitor);
  552. smalltalk.addMethod(
  553. smalltalk.method({
  554. selector: "visitCascadeNode:",
  555. fn: function (aNode){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) {
  558. var $1;
  559. $1=self._visitNode_(aNode);
  560. return $1;
  561. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  562. messageSends: ["visitNode:"]}),
  563. smalltalk.NodeVisitor);
  564. smalltalk.addMethod(
  565. smalltalk.method({
  566. selector: "visitClassReferenceNode:",
  567. fn: function (aNode){
  568. var self=this;
  569. return smalltalk.withContext(function($ctx1) {
  570. var $1;
  571. $1=self._visitVariableNode_(aNode);
  572. return $1;
  573. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  574. messageSends: ["visitVariableNode:"]}),
  575. smalltalk.NodeVisitor);
  576. smalltalk.addMethod(
  577. smalltalk.method({
  578. selector: "visitDynamicArrayNode:",
  579. fn: function (aNode){
  580. var self=this;
  581. return smalltalk.withContext(function($ctx1) {
  582. var $1;
  583. $1=self._visitNode_(aNode);
  584. return $1;
  585. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  586. messageSends: ["visitNode:"]}),
  587. smalltalk.NodeVisitor);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "visitDynamicDictionaryNode:",
  591. fn: function (aNode){
  592. var self=this;
  593. return smalltalk.withContext(function($ctx1) {
  594. var $1;
  595. $1=self._visitNode_(aNode);
  596. return $1;
  597. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  598. messageSends: ["visitNode:"]}),
  599. smalltalk.NodeVisitor);
  600. smalltalk.addMethod(
  601. smalltalk.method({
  602. selector: "visitJSStatementNode:",
  603. fn: function (aNode){
  604. var self=this;
  605. return smalltalk.withContext(function($ctx1) {
  606. var $1;
  607. $1=self._visitNode_(aNode);
  608. return $1;
  609. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  610. messageSends: ["visitNode:"]}),
  611. smalltalk.NodeVisitor);
  612. smalltalk.addMethod(
  613. smalltalk.method({
  614. selector: "visitMethodNode:",
  615. fn: function (aNode){
  616. var self=this;
  617. return smalltalk.withContext(function($ctx1) {
  618. var $1;
  619. $1=self._visitNode_(aNode);
  620. return $1;
  621. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  622. messageSends: ["visitNode:"]}),
  623. smalltalk.NodeVisitor);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "visitNode:",
  627. fn: function (aNode){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx1) {
  630. var $1;
  631. $1=self._visitAll_(_st(aNode)._nodes());
  632. return $1;
  633. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  634. messageSends: ["visitAll:", "nodes"]}),
  635. smalltalk.NodeVisitor);
  636. smalltalk.addMethod(
  637. smalltalk.method({
  638. selector: "visitReturnNode:",
  639. fn: function (aNode){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. var $1;
  643. $1=self._visitNode_(aNode);
  644. return $1;
  645. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  646. messageSends: ["visitNode:"]}),
  647. smalltalk.NodeVisitor);
  648. smalltalk.addMethod(
  649. smalltalk.method({
  650. selector: "visitSendNode:",
  651. fn: function (aNode){
  652. var self=this;
  653. return smalltalk.withContext(function($ctx1) {
  654. var $1;
  655. $1=self._visitNode_(aNode);
  656. return $1;
  657. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  658. messageSends: ["visitNode:"]}),
  659. smalltalk.NodeVisitor);
  660. smalltalk.addMethod(
  661. smalltalk.method({
  662. selector: "visitSequenceNode:",
  663. fn: function (aNode){
  664. var self=this;
  665. return smalltalk.withContext(function($ctx1) {
  666. var $1;
  667. $1=self._visitNode_(aNode);
  668. return $1;
  669. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  670. messageSends: ["visitNode:"]}),
  671. smalltalk.NodeVisitor);
  672. smalltalk.addMethod(
  673. smalltalk.method({
  674. selector: "visitValueNode:",
  675. fn: function (aNode){
  676. var self=this;
  677. return smalltalk.withContext(function($ctx1) {
  678. var $1;
  679. $1=self._visitNode_(aNode);
  680. return $1;
  681. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  682. messageSends: ["visitNode:"]}),
  683. smalltalk.NodeVisitor);
  684. smalltalk.addMethod(
  685. smalltalk.method({
  686. selector: "visitVariableNode:",
  687. fn: function (aNode){
  688. var self=this;
  689. return smalltalk.withContext(function($ctx1) {
  690. var $1;
  691. $1=self._visitNode_(aNode);
  692. return $1;
  693. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  694. messageSends: ["visitNode:"]}),
  695. smalltalk.NodeVisitor);