2
0

Compiler-Core.deploy.js 24 KB

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