1
0

Compiler-Interpreter.deploy.js 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289
  1. smalltalk.addPackage('Compiler-Interpreter');
  2. smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['outerContext', 'innerContext', 'pc', 'locals', 'method', 'ast', 'interpreter', 'methodContext'], 'Compiler-Interpreter');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "arguments",
  6. fn: function (){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. var $1;
  10. $1=_st(_st(self._ast())._arguments())._collect_((function(each){
  11. return smalltalk.withContext(function($ctx2) {
  12. return self._localAt_(each);
  13. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  14. return $1;
  15. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.AIContext)})},
  16. messageSends: ["collect:", "arguments", "ast", "localAt:"]}),
  17. smalltalk.AIContext);
  18. smalltalk.addMethod(
  19. smalltalk.method({
  20. selector: "asString",
  21. fn: function (){
  22. var self=this;
  23. return smalltalk.withContext(function($ctx1) {
  24. var $1;
  25. $1=_st(self["@methodContext"])._asString();
  26. return $1;
  27. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.AIContext)})},
  28. messageSends: ["asString"]}),
  29. smalltalk.AIContext);
  30. smalltalk.addMethod(
  31. smalltalk.method({
  32. selector: "ast",
  33. fn: function (){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx1) {
  36. var $1,$2;
  37. $1=self["@ast"];
  38. if(($receiver = $1) == nil || $receiver == undefined){
  39. self._initializeAST();
  40. } else {
  41. $1;
  42. };
  43. $2=self["@ast"];
  44. return $2;
  45. }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.AIContext)})},
  46. messageSends: ["ifNil:", "initializeAST"]}),
  47. smalltalk.AIContext);
  48. smalltalk.addMethod(
  49. smalltalk.method({
  50. selector: "home",
  51. fn: function (){
  52. var self=this;
  53. return smalltalk.withContext(function($ctx1) {
  54. var $2,$1;
  55. $2=self._isBlockContext();
  56. if(smalltalk.assert($2)){
  57. $1=_st(self._outerContext())._methodContext();
  58. } else {
  59. $1=self;
  60. };
  61. return $1;
  62. }, function($ctx1) {$ctx1.fill(self,"home",{},smalltalk.AIContext)})},
  63. messageSends: ["ifTrue:ifFalse:", "methodContext", "outerContext", "isBlockContext"]}),
  64. smalltalk.AIContext);
  65. smalltalk.addMethod(
  66. smalltalk.method({
  67. selector: "initializeAST",
  68. fn: function (){
  69. var self=this;
  70. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  71. return smalltalk.withContext(function($ctx1) {
  72. self["@ast"]=_st(self._method())._ast();
  73. _st(_st($SemanticAnalyzer())._on_(_st(self._method())._methodClass()))._visit_(self["@ast"]);
  74. return self}, function($ctx1) {$ctx1.fill(self,"initializeAST",{},smalltalk.AIContext)})},
  75. messageSends: ["ast", "method", "visit:", "on:", "methodClass"]}),
  76. smalltalk.AIContext);
  77. smalltalk.addMethod(
  78. smalltalk.method({
  79. selector: "initializeFromMethodContext:",
  80. fn: function (aMethodContext){
  81. var self=this;
  82. return smalltalk.withContext(function($ctx1) {
  83. var $1,$2;
  84. self["@methodContext"]=aMethodContext;
  85. self._pc_(_st(aMethodContext)._pc());
  86. self._receiver_(_st(aMethodContext)._receiver());
  87. self._method_(_st(aMethodContext)._method());
  88. $1=_st(aMethodContext)._outerContext();
  89. if(($receiver = $1) == nil || $receiver == undefined){
  90. $1;
  91. } else {
  92. var outer;
  93. outer=$receiver;
  94. $2=_st(outer)._methodContext();
  95. if(($receiver = $2) == nil || $receiver == undefined){
  96. $2;
  97. } else {
  98. self._outerContext_(_st(self._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
  99. };
  100. _st(_st(aMethodContext)._locals())._keysAndValuesDo_((function(key,value){
  101. return smalltalk.withContext(function($ctx2) {
  102. return _st(self._locals())._at_put_(key,value);
  103. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  104. };
  105. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext)})},
  106. messageSends: ["pc:", "pc", "receiver:", "receiver", "method:", "method", "ifNotNil:", "outerContext:", "fromMethodContext:", "outerContext", "class", "methodContext", "keysAndValuesDo:", "at:put:", "locals"]}),
  107. smalltalk.AIContext);
  108. smalltalk.addMethod(
  109. smalltalk.method({
  110. selector: "initializeInterpreter",
  111. fn: function (){
  112. var self=this;
  113. function $Interpreter(){return smalltalk.Interpreter||(typeof Interpreter=="undefined"?nil:Interpreter)}
  114. return smalltalk.withContext(function($ctx1) {
  115. var $1,$2,$3;
  116. $1=_st($Interpreter())._new();
  117. _st($1)._context_(self);
  118. _st($1)._node_(self._retrieveNode());
  119. $2=_st($1)._yourself();
  120. self["@interpreter"]=$2;
  121. $3=_st(self._innerContext())._isBlockContext();
  122. if(! smalltalk.assert($3)){
  123. self._setupInterpreter_(self["@interpreter"]);
  124. };
  125. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.AIContext)})},
  126. messageSends: ["context:", "new", "node:", "retrieveNode", "yourself", "ifFalse:", "setupInterpreter:", "isBlockContext", "innerContext"]}),
  127. smalltalk.AIContext);
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "initializeLocals",
  131. fn: function (){
  132. var self=this;
  133. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  134. return smalltalk.withContext(function($ctx1) {
  135. self["@locals"]=_st($Dictionary())._new();
  136. _st(self["@locals"])._at_put_("thisContext",self);
  137. return self}, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},smalltalk.AIContext)})},
  138. messageSends: ["new", "at:put:"]}),
  139. smalltalk.AIContext);
  140. smalltalk.addMethod(
  141. smalltalk.method({
  142. selector: "innerContext",
  143. fn: function (){
  144. var self=this;
  145. return smalltalk.withContext(function($ctx1) {
  146. var $1;
  147. $1=self["@innerContext"];
  148. return $1;
  149. }, function($ctx1) {$ctx1.fill(self,"innerContext",{},smalltalk.AIContext)})},
  150. messageSends: []}),
  151. smalltalk.AIContext);
  152. smalltalk.addMethod(
  153. smalltalk.method({
  154. selector: "innerContext:",
  155. fn: function (anAIContext){
  156. var self=this;
  157. return smalltalk.withContext(function($ctx1) {
  158. self["@innerContext"]=anAIContext;
  159. return self}, function($ctx1) {$ctx1.fill(self,"innerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  160. messageSends: []}),
  161. smalltalk.AIContext);
  162. smalltalk.addMethod(
  163. smalltalk.method({
  164. selector: "interpreter",
  165. fn: function (){
  166. var self=this;
  167. return smalltalk.withContext(function($ctx1) {
  168. var $1,$2;
  169. $1=self["@interpreter"];
  170. if(($receiver = $1) == nil || $receiver == undefined){
  171. self._initializeInterpreter();
  172. } else {
  173. $1;
  174. };
  175. $2=self["@interpreter"];
  176. return $2;
  177. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.AIContext)})},
  178. messageSends: ["ifNil:", "initializeInterpreter"]}),
  179. smalltalk.AIContext);
  180. smalltalk.addMethod(
  181. smalltalk.method({
  182. selector: "isBlockContext",
  183. fn: function (){
  184. var self=this;
  185. return smalltalk.withContext(function($ctx1) {
  186. var $1;
  187. $1=_st(self["@methodContext"])._isBlockContext();
  188. return $1;
  189. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.AIContext)})},
  190. messageSends: ["isBlockContext"]}),
  191. smalltalk.AIContext);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "localAt:",
  195. fn: function (aString){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. var $1;
  199. $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
  200. return smalltalk.withContext(function($ctx2) {
  201. return nil;
  202. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  203. return $1;
  204. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString},smalltalk.AIContext)})},
  205. messageSends: ["at:ifAbsent:", "locals"]}),
  206. smalltalk.AIContext);
  207. smalltalk.addMethod(
  208. smalltalk.method({
  209. selector: "localAt:put:",
  210. fn: function (aString,anObject){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(self._locals())._at_put_(aString,anObject);
  214. return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject},smalltalk.AIContext)})},
  215. messageSends: ["at:put:", "locals"]}),
  216. smalltalk.AIContext);
  217. smalltalk.addMethod(
  218. smalltalk.method({
  219. selector: "locals",
  220. fn: function (){
  221. var self=this;
  222. return smalltalk.withContext(function($ctx1) {
  223. var $1,$2;
  224. $1=self["@locals"];
  225. if(($receiver = $1) == nil || $receiver == undefined){
  226. self._initializeLocals();
  227. } else {
  228. $1;
  229. };
  230. $2=self["@locals"];
  231. return $2;
  232. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.AIContext)})},
  233. messageSends: ["ifNil:", "initializeLocals"]}),
  234. smalltalk.AIContext);
  235. smalltalk.addMethod(
  236. smalltalk.method({
  237. selector: "method",
  238. fn: function (){
  239. var self=this;
  240. return smalltalk.withContext(function($ctx1) {
  241. var $1;
  242. $1=self["@method"];
  243. return $1;
  244. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
  245. messageSends: []}),
  246. smalltalk.AIContext);
  247. smalltalk.addMethod(
  248. smalltalk.method({
  249. selector: "method:",
  250. fn: function (aCompiledMethod){
  251. var self=this;
  252. return smalltalk.withContext(function($ctx1) {
  253. self["@method"]=aCompiledMethod;
  254. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.AIContext)})},
  255. messageSends: []}),
  256. smalltalk.AIContext);
  257. smalltalk.addMethod(
  258. smalltalk.method({
  259. selector: "outerContext",
  260. fn: function (){
  261. var self=this;
  262. return smalltalk.withContext(function($ctx1) {
  263. var $1;
  264. $1=self["@outerContext"];
  265. return $1;
  266. }, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.AIContext)})},
  267. messageSends: []}),
  268. smalltalk.AIContext);
  269. smalltalk.addMethod(
  270. smalltalk.method({
  271. selector: "outerContext:",
  272. fn: function (anAIContext){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. self["@outerContext"]=anAIContext;
  276. _st(self["@outerContext"])._innerContext_(self);
  277. return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  278. messageSends: ["innerContext:"]}),
  279. smalltalk.AIContext);
  280. smalltalk.addMethod(
  281. smalltalk.method({
  282. selector: "pc",
  283. fn: function (){
  284. var self=this;
  285. return smalltalk.withContext(function($ctx1) {
  286. var $2,$1;
  287. $2=self["@pc"];
  288. if(($receiver = $2) == nil || $receiver == undefined){
  289. self["@pc"]=(0);
  290. $1=self["@pc"];
  291. } else {
  292. $1=$2;
  293. };
  294. return $1;
  295. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.AIContext)})},
  296. messageSends: ["ifNil:"]}),
  297. smalltalk.AIContext);
  298. smalltalk.addMethod(
  299. smalltalk.method({
  300. selector: "pc:",
  301. fn: function (anInteger){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) {
  304. self["@pc"]=anInteger;
  305. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.AIContext)})},
  306. messageSends: []}),
  307. smalltalk.AIContext);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "receiver",
  311. fn: function (){
  312. var self=this;
  313. return smalltalk.withContext(function($ctx1) {
  314. var $1;
  315. $1=self._localAt_("self");
  316. return $1;
  317. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AIContext)})},
  318. messageSends: ["localAt:"]}),
  319. smalltalk.AIContext);
  320. smalltalk.addMethod(
  321. smalltalk.method({
  322. selector: "receiver:",
  323. fn: function (anObject){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) {
  326. self._localAt_put_("self",anObject);
  327. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.AIContext)})},
  328. messageSends: ["localAt:put:"]}),
  329. smalltalk.AIContext);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "retrieveNode",
  333. fn: function (){
  334. var self=this;
  335. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  336. return smalltalk.withContext(function($ctx1) {
  337. var $2,$3,$1;
  338. $2=_st($ASTPCNodeVisitor())._new();
  339. _st($2)._context_(self);
  340. _st($2)._visit_(self._ast());
  341. $3=_st($2)._currentNode();
  342. $1=$3;
  343. return $1;
  344. }, function($ctx1) {$ctx1.fill(self,"retrieveNode",{},smalltalk.AIContext)})},
  345. messageSends: ["context:", "new", "visit:", "ast", "currentNode"]}),
  346. smalltalk.AIContext);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "selector",
  350. fn: function (){
  351. var self=this;
  352. return smalltalk.withContext(function($ctx1) {
  353. var $2,$1;
  354. $2=self._method();
  355. if(($receiver = $2) == nil || $receiver == undefined){
  356. $1=$2;
  357. } else {
  358. $1=_st(self._method())._selector();
  359. };
  360. return $1;
  361. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.AIContext)})},
  362. messageSends: ["ifNotNil:", "selector", "method"]}),
  363. smalltalk.AIContext);
  364. smalltalk.addMethod(
  365. smalltalk.method({
  366. selector: "setupInterpreter:",
  367. fn: function (anInterpreter){
  368. var self=this;
  369. return smalltalk.withContext(function($ctx1) {
  370. _st(_st(_st(self._innerContext())._arguments())._reversed())._do_((function(each){
  371. return smalltalk.withContext(function($ctx2) {
  372. return _st(anInterpreter)._push_(each);
  373. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  374. _st(anInterpreter)._push_(_st(self._innerContext())._receiver());
  375. return self}, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter},smalltalk.AIContext)})},
  376. messageSends: ["do:", "push:", "reversed", "arguments", "innerContext", "receiver"]}),
  377. smalltalk.AIContext);
  378. smalltalk.addMethod(
  379. smalltalk.method({
  380. selector: "fromMethodContext:",
  381. fn: function (aMethodContext){
  382. var self=this;
  383. return smalltalk.withContext(function($ctx1) {
  384. var $2,$3,$1;
  385. $2=self._new();
  386. _st($2)._initializeFromMethodContext_(aMethodContext);
  387. $3=_st($2)._yourself();
  388. $1=$3;
  389. return $1;
  390. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext.klass)})},
  391. messageSends: ["initializeFromMethodContext:", "new", "yourself"]}),
  392. smalltalk.AIContext.klass);
  393. smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "atEnd",
  397. fn: function (){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx1) {
  400. var $1;
  401. $1=_st(self._interpreter())._atEnd();
  402. return $1;
  403. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
  404. messageSends: ["atEnd", "interpreter"]}),
  405. smalltalk.ASTDebugger);
  406. smalltalk.addMethod(
  407. smalltalk.method({
  408. selector: "buildAST",
  409. fn: function (){
  410. var self=this;
  411. var ast;
  412. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  413. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  414. return smalltalk.withContext(function($ctx1) {
  415. var $1;
  416. ast=_st(_st($Smalltalk())._current())._parse_(_st(self._method())._source());
  417. _st(_st($SemanticAnalyzer())._on_(_st(_st(self._context())._receiver())._class()))._visit_(ast);
  418. $1=ast;
  419. return $1;
  420. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  421. messageSends: ["parse:", "current", "source", "method", "visit:", "on:", "class", "receiver", "context"]}),
  422. smalltalk.ASTDebugger);
  423. smalltalk.addMethod(
  424. smalltalk.method({
  425. selector: "context",
  426. fn: function (){
  427. var self=this;
  428. return smalltalk.withContext(function($ctx1) {
  429. var $1;
  430. $1=self["@context"];
  431. return $1;
  432. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  433. messageSends: []}),
  434. smalltalk.ASTDebugger);
  435. smalltalk.addMethod(
  436. smalltalk.method({
  437. selector: "context:",
  438. fn: function (aContext){
  439. var self=this;
  440. return smalltalk.withContext(function($ctx1) {
  441. self["@context"]=aContext;
  442. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  443. messageSends: []}),
  444. smalltalk.ASTDebugger);
  445. smalltalk.addMethod(
  446. smalltalk.method({
  447. selector: "defaultInterpreterClass",
  448. fn: function (){
  449. var self=this;
  450. function $ASTSteppingInterpreter(){return smalltalk.ASTSteppingInterpreter||(typeof ASTSteppingInterpreter=="undefined"?nil:ASTSteppingInterpreter)}
  451. return smalltalk.withContext(function($ctx1) {
  452. var $1;
  453. $1=$ASTSteppingInterpreter();
  454. return $1;
  455. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  456. messageSends: []}),
  457. smalltalk.ASTDebugger);
  458. smalltalk.addMethod(
  459. smalltalk.method({
  460. selector: "initializeInterpreter",
  461. fn: function (){
  462. var self=this;
  463. var ast,next;
  464. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  465. return smalltalk.withContext(function($ctx1) {
  466. var $1,$2;
  467. ast=self._buildAST();
  468. $1=_st($ASTPCNodeVisitor())._new();
  469. _st($1)._context_(self._context());
  470. _st($1)._visit_(ast);
  471. $2=_st($1)._currentNode();
  472. next=$2;
  473. _st(self._interpreter())._interpret_(next);
  474. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{ast:ast,next:next},smalltalk.ASTDebugger)})},
  475. messageSends: ["buildAST", "context:", "new", "context", "visit:", "currentNode", "interpret:", "interpreter"]}),
  476. smalltalk.ASTDebugger);
  477. smalltalk.addMethod(
  478. smalltalk.method({
  479. selector: "initializeWithContext:",
  480. fn: function (aContext){
  481. var self=this;
  482. return smalltalk.withContext(function($ctx1) {
  483. self._context_(aContext);
  484. self._initializeInterpreter();
  485. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aContext:aContext},smalltalk.ASTDebugger)})},
  486. messageSends: ["context:", "initializeInterpreter"]}),
  487. smalltalk.ASTDebugger);
  488. smalltalk.addMethod(
  489. smalltalk.method({
  490. selector: "interpreter",
  491. fn: function (){
  492. var self=this;
  493. return smalltalk.withContext(function($ctx1) {
  494. var $2,$1;
  495. $2=self["@interpreter"];
  496. if(($receiver = $2) == nil || $receiver == undefined){
  497. self["@interpreter"]=_st(self._defaultInterpreterClass())._new();
  498. $1=self["@interpreter"];
  499. } else {
  500. $1=$2;
  501. };
  502. return $1;
  503. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  504. messageSends: ["ifNil:", "new", "defaultInterpreterClass"]}),
  505. smalltalk.ASTDebugger);
  506. smalltalk.addMethod(
  507. smalltalk.method({
  508. selector: "interpreter:",
  509. fn: function (anInterpreter){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. self["@interpreter"]=anInterpreter;
  513. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  514. messageSends: []}),
  515. smalltalk.ASTDebugger);
  516. smalltalk.addMethod(
  517. smalltalk.method({
  518. selector: "method",
  519. fn: function (){
  520. var self=this;
  521. return smalltalk.withContext(function($ctx1) {
  522. var $1;
  523. $1=_st(self._context())._method();
  524. return $1;
  525. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  526. messageSends: ["method", "context"]}),
  527. smalltalk.ASTDebugger);
  528. smalltalk.addMethod(
  529. smalltalk.method({
  530. selector: "nextNode",
  531. fn: function (){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) {
  534. var $1;
  535. $1=_st(self._interpreter())._nextNode();
  536. return $1;
  537. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTDebugger)})},
  538. messageSends: ["nextNode", "interpreter"]}),
  539. smalltalk.ASTDebugger);
  540. smalltalk.addMethod(
  541. smalltalk.method({
  542. selector: "proceed",
  543. fn: function (){
  544. var self=this;
  545. return smalltalk.withContext(function($ctx1) {
  546. self._shouldBeImplemented();
  547. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
  548. messageSends: ["shouldBeImplemented"]}),
  549. smalltalk.ASTDebugger);
  550. smalltalk.addMethod(
  551. smalltalk.method({
  552. selector: "restart",
  553. fn: function (){
  554. var self=this;
  555. return smalltalk.withContext(function($ctx1) {
  556. self._shouldBeImplemented();
  557. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  558. messageSends: ["shouldBeImplemented"]}),
  559. smalltalk.ASTDebugger);
  560. smalltalk.addMethod(
  561. smalltalk.method({
  562. selector: "step",
  563. fn: function (){
  564. var self=this;
  565. return smalltalk.withContext(function($ctx1) {
  566. _st((function(){
  567. return smalltalk.withContext(function($ctx2) {
  568. return _st(_st(_st(_st(self._interpreter())._nextNode())._notNil())._and_((function(){
  569. return smalltalk.withContext(function($ctx3) {
  570. return _st(_st(self._interpreter())._nextNode())._stopOnStepping();
  571. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})})))._or_((function(){
  572. return smalltalk.withContext(function($ctx3) {
  573. return _st(_st(self._interpreter())._atEnd())._not();
  574. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  575. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  576. return smalltalk.withContext(function($ctx2) {
  577. _st(self._interpreter())._step();
  578. return self._step();
  579. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  580. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTDebugger)})},
  581. messageSends: ["whileFalse:", "or:", "and:", "notNil", "nextNode", "interpreter", "stopOnStepping", "not", "atEnd", "step"]}),
  582. smalltalk.ASTDebugger);
  583. smalltalk.addMethod(
  584. smalltalk.method({
  585. selector: "stepInto",
  586. fn: function (){
  587. var self=this;
  588. return smalltalk.withContext(function($ctx1) {
  589. self._shouldBeImplemented();
  590. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  591. messageSends: ["shouldBeImplemented"]}),
  592. smalltalk.ASTDebugger);
  593. smalltalk.addMethod(
  594. smalltalk.method({
  595. selector: "stepOver",
  596. fn: function (){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. self._step();
  600. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  601. messageSends: ["step"]}),
  602. smalltalk.ASTDebugger);
  603. smalltalk.addMethod(
  604. smalltalk.method({
  605. selector: "context:",
  606. fn: function (aContext){
  607. var self=this;
  608. return smalltalk.withContext(function($ctx1) {
  609. var $2,$3,$1;
  610. $2=self._new();
  611. _st($2)._initializeWithContext_(aContext);
  612. $3=_st($2)._yourself();
  613. $1=$3;
  614. return $1;
  615. }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger.klass)})},
  616. messageSends: ["initializeWithContext:", "new", "yourself"]}),
  617. smalltalk.ASTDebugger.klass);
  618. smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'nextNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
  619. smalltalk.addMethod(
  620. smalltalk.method({
  621. selector: "assign:to:",
  622. fn: function (aNode,anObject){
  623. var self=this;
  624. return smalltalk.withContext(function($ctx1) {
  625. var $2,$1;
  626. $2=_st(_st(aNode)._binding())._isInstanceVar();
  627. if(smalltalk.assert($2)){
  628. $1=_st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  629. } else {
  630. $1=_st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
  631. };
  632. return $1;
  633. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  634. messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"]}),
  635. smalltalk.ASTInterpreter);
  636. smalltalk.addMethod(
  637. smalltalk.method({
  638. selector: "context",
  639. fn: function (){
  640. var self=this;
  641. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  642. return smalltalk.withContext(function($ctx1) {
  643. var $2,$1;
  644. $2=self["@context"];
  645. if(($receiver = $2) == nil || $receiver == undefined){
  646. self["@context"]=_st($AIContext())._new();
  647. $1=self["@context"];
  648. } else {
  649. $1=$2;
  650. };
  651. return $1;
  652. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  653. messageSends: ["ifNil:", "new"]}),
  654. smalltalk.ASTInterpreter);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "context:",
  658. fn: function (anAIContext){
  659. var self=this;
  660. return smalltalk.withContext(function($ctx1) {
  661. self["@context"]=anAIContext;
  662. return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext},smalltalk.ASTInterpreter)})},
  663. messageSends: []}),
  664. smalltalk.ASTInterpreter);
  665. smalltalk.addMethod(
  666. smalltalk.method({
  667. selector: "continue:value:",
  668. fn: function (aBlock,anObject){
  669. var self=this;
  670. return smalltalk.withContext(function($ctx1) {
  671. self["@result"]=anObject;
  672. _st(aBlock)._value_(anObject);
  673. return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject},smalltalk.ASTInterpreter)})},
  674. messageSends: ["value:"]}),
  675. smalltalk.ASTInterpreter);
  676. smalltalk.addMethod(
  677. smalltalk.method({
  678. selector: "currentNode",
  679. fn: function (){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) {
  682. var $1;
  683. $1=self["@currentNode"];
  684. return $1;
  685. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTInterpreter)})},
  686. messageSends: []}),
  687. smalltalk.ASTInterpreter);
  688. smalltalk.addMethod(
  689. smalltalk.method({
  690. selector: "eval:",
  691. fn: function (aString){
  692. var self=this;
  693. var source,function_;
  694. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  695. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  696. return smalltalk.withContext(function($ctx1) {
  697. var $1,$2,$3;
  698. source=_st($String())._streamContents_((function(str){
  699. return smalltalk.withContext(function($ctx2) {
  700. _st(str)._nextPutAll_("(function(");
  701. _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
  702. return smalltalk.withContext(function($ctx3) {
  703. return _st(str)._nextPutAll_(each);
  704. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  705. return smalltalk.withContext(function($ctx3) {
  706. return _st(str)._nextPutAll_(",");
  707. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  708. $1=str;
  709. _st($1)._nextPutAll_("){ return (function() {");
  710. _st($1)._nextPutAll_(aString);
  711. $2=_st($1)._nextPutAll_("})() })");
  712. return $2;
  713. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  714. function_=_st(_st($Compiler())._new())._eval_(source);
  715. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
  716. return $3;
  717. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  718. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"]}),
  719. smalltalk.ASTInterpreter);
  720. smalltalk.addMethod(
  721. smalltalk.method({
  722. selector: "initialize",
  723. fn: function (){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) {
  726. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  727. self["@shouldReturn"]=false;
  728. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTInterpreter)})},
  729. messageSends: ["initialize"]}),
  730. smalltalk.ASTInterpreter);
  731. smalltalk.addMethod(
  732. smalltalk.method({
  733. selector: "interpret:",
  734. fn: function (aNode){
  735. var self=this;
  736. return smalltalk.withContext(function($ctx1) {
  737. self["@shouldReturn"]=false;
  738. self._interpret_continue_(aNode,(function(value){
  739. return smalltalk.withContext(function($ctx2) {
  740. self["@result"]=value;
  741. return self["@result"];
  742. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  743. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  744. messageSends: ["interpret:continue:"]}),
  745. smalltalk.ASTInterpreter);
  746. smalltalk.addMethod(
  747. smalltalk.method({
  748. selector: "interpret:continue:",
  749. fn: function (aNode,aBlock){
  750. var self=this;
  751. return smalltalk.withContext(function($ctx1) {
  752. var $1,$2,$3;
  753. $1=self["@shouldReturn"];
  754. if(smalltalk.assert($1)){
  755. $2=self;
  756. return $2;
  757. };
  758. $3=_st(aNode)._isNode();
  759. if(smalltalk.assert($3)){
  760. self["@currentNode"]=aNode;
  761. self["@currentNode"];
  762. self._interpretNode_continue_(aNode,(function(value){
  763. return smalltalk.withContext(function($ctx2) {
  764. return self._continue_value_(aBlock,value);
  765. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  766. } else {
  767. self._continue_value_(aBlock,aNode);
  768. };
  769. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  770. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "isNode", "interpretNode:continue:", "continue:value:"]}),
  771. smalltalk.ASTInterpreter);
  772. smalltalk.addMethod(
  773. smalltalk.method({
  774. selector: "interpretAll:continue:",
  775. fn: function (aCollection,aBlock){
  776. var self=this;
  777. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  778. return smalltalk.withContext(function($ctx1) {
  779. self._interpretAll_continue_result_(aCollection,aBlock,_st($OrderedCollection())._new());
  780. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  781. messageSends: ["interpretAll:continue:result:", "new"]}),
  782. smalltalk.ASTInterpreter);
  783. smalltalk.addMethod(
  784. smalltalk.method({
  785. selector: "interpretAll:continue:result:",
  786. fn: function (nodes,aBlock,aCollection){
  787. var self=this;
  788. return smalltalk.withContext(function($ctx1) {
  789. var $1;
  790. $1=_st(nodes)._isEmpty();
  791. if(smalltalk.assert($1)){
  792. self._continue_value_(aBlock,aCollection);
  793. } else {
  794. self._interpret_continue_(_st(nodes)._first(),(function(value){
  795. return smalltalk.withContext(function($ctx2) {
  796. return self._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
  797. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  798. };
  799. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  800. messageSends: ["ifTrue:ifFalse:", "isEmpty", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ","]}),
  801. smalltalk.ASTInterpreter);
  802. smalltalk.addMethod(
  803. smalltalk.method({
  804. selector: "interpretAssignmentNode:continue:",
  805. fn: function (aNode,aBlock){
  806. var self=this;
  807. return smalltalk.withContext(function($ctx1) {
  808. self._interpret_continue_(_st(aNode)._right(),(function(value){
  809. return smalltalk.withContext(function($ctx2) {
  810. return self._continue_value_(aBlock,self._assign_to_(_st(aNode)._left(),value));
  811. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  812. return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  813. messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"]}),
  814. smalltalk.ASTInterpreter);
  815. smalltalk.addMethod(
  816. smalltalk.method({
  817. selector: "interpretBlockNode:continue:",
  818. fn: function (aNode,aBlock){
  819. var self=this;
  820. return smalltalk.withContext(function($ctx1) {
  821. var $1,$2;
  822. self._continue_value_(aBlock,(function(){
  823. return smalltalk.withContext(function($ctx2) {
  824. return self._withBlockContext_((function(){
  825. return smalltalk.withContext(function($ctx3) {
  826. $1=self;
  827. _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
  828. $2=_st($1)._result();
  829. return $2;
  830. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  831. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  832. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  833. messageSends: ["continue:value:", "withBlockContext:", "interpret:", "first", "nodes", "result"]}),
  834. smalltalk.ASTInterpreter);
  835. smalltalk.addMethod(
  836. smalltalk.method({
  837. selector: "interpretBlockSequenceNode:continue:",
  838. fn: function (aNode,aBlock){
  839. var self=this;
  840. return smalltalk.withContext(function($ctx1) {
  841. self._interpretSequenceNode_continue_(aNode,aBlock);
  842. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  843. messageSends: ["interpretSequenceNode:continue:"]}),
  844. smalltalk.ASTInterpreter);
  845. smalltalk.addMethod(
  846. smalltalk.method({
  847. selector: "interpretCascadeNode:continue:",
  848. fn: function (aNode,aBlock){
  849. var self=this;
  850. return smalltalk.withContext(function($ctx1) {
  851. self._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  852. return smalltalk.withContext(function($ctx2) {
  853. _st(_st(aNode)._nodes())._do_((function(each){
  854. return smalltalk.withContext(function($ctx3) {
  855. return _st(each)._receiver_(receiver);
  856. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  857. return self._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
  858. return smalltalk.withContext(function($ctx3) {
  859. return self._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
  860. return smalltalk.withContext(function($ctx4) {
  861. return self._continue_value_(aBlock,val);
  862. }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx3)})}));
  863. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  864. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  865. return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  866. messageSends: ["interpret:continue:", "receiver", "do:", "nodes", "receiver:", "interpretAll:continue:", "allButLast", "last", "continue:value:"]}),
  867. smalltalk.ASTInterpreter);
  868. smalltalk.addMethod(
  869. smalltalk.method({
  870. selector: "interpretClassReferenceNode:continue:",
  871. fn: function (aNode,aBlock){
  872. var self=this;
  873. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  874. return smalltalk.withContext(function($ctx1) {
  875. self._continue_value_(aBlock,_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
  876. return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  877. messageSends: ["continue:value:", "at:", "current", "value"]}),
  878. smalltalk.ASTInterpreter);
  879. smalltalk.addMethod(
  880. smalltalk.method({
  881. selector: "interpretDynamicArrayNode:continue:",
  882. fn: function (aNode,aBlock){
  883. var self=this;
  884. return smalltalk.withContext(function($ctx1) {
  885. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  886. return smalltalk.withContext(function($ctx2) {
  887. return self._continue_value_(aBlock,array);
  888. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  889. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  890. messageSends: ["interpretAll:continue:", "nodes", "continue:value:"]}),
  891. smalltalk.ASTInterpreter);
  892. smalltalk.addMethod(
  893. smalltalk.method({
  894. selector: "interpretDynamicDictionaryNode:continue:",
  895. fn: function (aNode,aBlock){
  896. var self=this;
  897. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  898. return smalltalk.withContext(function($ctx1) {
  899. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  900. var hashedCollection;
  901. return smalltalk.withContext(function($ctx2) {
  902. hashedCollection=_st($HashedCollection())._new();
  903. hashedCollection;
  904. _st(array)._do_((function(each){
  905. return smalltalk.withContext(function($ctx3) {
  906. return _st(hashedCollection)._add_(each);
  907. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  908. return self._continue_value_(aBlock,hashedCollection);
  909. }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1)})}));
  910. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  911. messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"]}),
  912. smalltalk.ASTInterpreter);
  913. smalltalk.addMethod(
  914. smalltalk.method({
  915. selector: "interpretJSStatementNode:continue:",
  916. fn: function (aNode,aBlock){
  917. var self=this;
  918. return smalltalk.withContext(function($ctx1) {
  919. self["@shouldReturn"]=true;
  920. self._continue_value_(aBlock,self._eval_(_st(aNode)._source()));
  921. return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  922. messageSends: ["continue:value:", "eval:", "source"]}),
  923. smalltalk.ASTInterpreter);
  924. smalltalk.addMethod(
  925. smalltalk.method({
  926. selector: "interpretMethodNode:continue:",
  927. fn: function (aNode,aBlock){
  928. var self=this;
  929. return smalltalk.withContext(function($ctx1) {
  930. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  931. return smalltalk.withContext(function($ctx2) {
  932. return self._continue_value_(aBlock,_st(array)._first());
  933. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  934. return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  935. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"]}),
  936. smalltalk.ASTInterpreter);
  937. smalltalk.addMethod(
  938. smalltalk.method({
  939. selector: "interpretNode:continue:",
  940. fn: function (aNode,aBlock){
  941. var self=this;
  942. return smalltalk.withContext(function($ctx1) {
  943. _st(aNode)._interpreter_continue_(self,aBlock);
  944. return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  945. messageSends: ["interpreter:continue:"]}),
  946. smalltalk.ASTInterpreter);
  947. smalltalk.addMethod(
  948. smalltalk.method({
  949. selector: "interpretReturnNode:continue:",
  950. fn: function (aNode,aBlock){
  951. var self=this;
  952. return smalltalk.withContext(function($ctx1) {
  953. self._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
  954. return smalltalk.withContext(function($ctx2) {
  955. self["@shouldReturn"]=true;
  956. self["@shouldReturn"];
  957. return self._continue_value_(aBlock,value);
  958. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  959. return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  960. messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"]}),
  961. smalltalk.ASTInterpreter);
  962. smalltalk.addMethod(
  963. smalltalk.method({
  964. selector: "interpretSendNode:continue:",
  965. fn: function (aNode,aBlock){
  966. var self=this;
  967. return smalltalk.withContext(function($ctx1) {
  968. self._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  969. return smalltalk.withContext(function($ctx2) {
  970. return self._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
  971. return smalltalk.withContext(function($ctx3) {
  972. return self._messageFromSendNode_arguments_do_(aNode,args,(function(message){
  973. return smalltalk.withContext(function($ctx4) {
  974. _st(self._context())._pc_(_st(_st(self._context())._pc()).__plus((1)));
  975. return self._continue_value_(aBlock,self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend()));
  976. }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx3)})}));
  977. }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx2)})}));
  978. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  979. return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  980. messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "context", "+", "pc", "continue:value:", "sendMessage:to:superSend:", "superSend"]}),
  981. smalltalk.ASTInterpreter);
  982. smalltalk.addMethod(
  983. smalltalk.method({
  984. selector: "interpretSequenceNode:continue:",
  985. fn: function (aNode,aBlock){
  986. var self=this;
  987. return smalltalk.withContext(function($ctx1) {
  988. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  989. return smalltalk.withContext(function($ctx2) {
  990. return self._continue_value_(aBlock,_st(array)._last());
  991. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  992. return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  993. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"]}),
  994. smalltalk.ASTInterpreter);
  995. smalltalk.addMethod(
  996. smalltalk.method({
  997. selector: "interpretValueNode:continue:",
  998. fn: function (aNode,aBlock){
  999. var self=this;
  1000. return smalltalk.withContext(function($ctx1) {
  1001. self._continue_value_(aBlock,_st(aNode)._value());
  1002. return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1003. messageSends: ["continue:value:", "value"]}),
  1004. smalltalk.ASTInterpreter);
  1005. smalltalk.addMethod(
  1006. smalltalk.method({
  1007. selector: "interpretVariableNode:continue:",
  1008. fn: function (aNode,aBlock){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) {
  1011. var $1,$2,$4,$3;
  1012. $1=self;
  1013. $2=aBlock;
  1014. $4=_st(_st(aNode)._binding())._isInstanceVar();
  1015. if(smalltalk.assert($4)){
  1016. $3=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
  1017. } else {
  1018. $3=_st(self._context())._localAt_(_st(aNode)._value());
  1019. };
  1020. _st($1)._continue_value_($2,$3);
  1021. return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1022. messageSends: ["continue:value:", "ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:", "receiver", "context", "value", "localAt:"]}),
  1023. smalltalk.ASTInterpreter);
  1024. smalltalk.addMethod(
  1025. smalltalk.method({
  1026. selector: "messageFromSendNode:arguments:do:",
  1027. fn: function (aSendNode,aCollection,aBlock){
  1028. var self=this;
  1029. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1030. return smalltalk.withContext(function($ctx1) {
  1031. var $1,$2;
  1032. $1=_st($Message())._new();
  1033. _st($1)._selector_(_st(aSendNode)._selector());
  1034. _st($1)._arguments_(aCollection);
  1035. $2=_st($1)._yourself();
  1036. self._continue_value_(aBlock,$2);
  1037. return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1038. messageSends: ["continue:value:", "selector:", "new", "selector", "arguments:", "yourself"]}),
  1039. smalltalk.ASTInterpreter);
  1040. smalltalk.addMethod(
  1041. smalltalk.method({
  1042. selector: "nextNode",
  1043. fn: function (){
  1044. var self=this;
  1045. return smalltalk.withContext(function($ctx1) {
  1046. var $2,$1;
  1047. $2=self["@nextNode"];
  1048. if(($receiver = $2) == nil || $receiver == undefined){
  1049. $1=self._currentNode();
  1050. } else {
  1051. $1=$2;
  1052. };
  1053. return $1;
  1054. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTInterpreter)})},
  1055. messageSends: ["ifNil:", "currentNode"]}),
  1056. smalltalk.ASTInterpreter);
  1057. smalltalk.addMethod(
  1058. smalltalk.method({
  1059. selector: "nextNode:",
  1060. fn: function (aNode){
  1061. var self=this;
  1062. return smalltalk.withContext(function($ctx1) {
  1063. self["@nextNode"]=aNode;
  1064. return self}, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1065. messageSends: []}),
  1066. smalltalk.ASTInterpreter);
  1067. smalltalk.addMethod(
  1068. smalltalk.method({
  1069. selector: "result",
  1070. fn: function (){
  1071. var self=this;
  1072. return smalltalk.withContext(function($ctx1) {
  1073. var $1;
  1074. $1=self["@result"];
  1075. return $1;
  1076. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1077. messageSends: []}),
  1078. smalltalk.ASTInterpreter);
  1079. smalltalk.addMethod(
  1080. smalltalk.method({
  1081. selector: "sendMessage:to:superSend:",
  1082. fn: function (aMessage,anObject,aBoolean){
  1083. var self=this;
  1084. var method;
  1085. return smalltalk.withContext(function($ctx1) {
  1086. var $1,$2,$3,$4,$5,$6;
  1087. var $early={};
  1088. try {
  1089. $1=aBoolean;
  1090. if(! smalltalk.assert($1)){
  1091. $2=_st(aMessage)._sendTo_(anObject);
  1092. return $2;
  1093. };
  1094. $3=_st(_st(anObject)._class())._superclass();
  1095. if(($receiver = $3) == nil || $receiver == undefined){
  1096. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1097. return $4;
  1098. } else {
  1099. $3;
  1100. };
  1101. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1102. return smalltalk.withContext(function($ctx2) {
  1103. $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1104. throw $early=[$5];
  1105. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1106. $6=_st(_st(method)._fn())._applyTo_arguments_(anObject,_st(aMessage)._arguments());
  1107. return $6;
  1108. }
  1109. catch(e) {if(e===$early)return e[0]; throw e}
  1110. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1111. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "applyTo:arguments:", "fn", "arguments"]}),
  1112. smalltalk.ASTInterpreter);
  1113. smalltalk.addMethod(
  1114. smalltalk.method({
  1115. selector: "shouldReturn",
  1116. fn: function (){
  1117. var self=this;
  1118. return smalltalk.withContext(function($ctx1) {
  1119. var $2,$1;
  1120. $2=self["@shouldReturn"];
  1121. if(($receiver = $2) == nil || $receiver == undefined){
  1122. $1=false;
  1123. } else {
  1124. $1=$2;
  1125. };
  1126. return $1;
  1127. }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.ASTInterpreter)})},
  1128. messageSends: ["ifNil:"]}),
  1129. smalltalk.ASTInterpreter);
  1130. smalltalk.addMethod(
  1131. smalltalk.method({
  1132. selector: "withBlockContext:",
  1133. fn: function (aBlock){
  1134. var self=this;
  1135. var blockResult;
  1136. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  1137. return smalltalk.withContext(function($ctx1) {
  1138. var $1,$2,$3;
  1139. $1=_st($AIContext())._new();
  1140. _st($1)._outerContext_(self._context());
  1141. $2=_st($1)._yourself();
  1142. self._context_($2);
  1143. blockResult=_st(aBlock)._value();
  1144. self._context_(_st(self._context())._outerContext());
  1145. $3=blockResult;
  1146. return $3;
  1147. }, function($ctx1) {$ctx1.fill(self,"withBlockContext:",{aBlock:aBlock,blockResult:blockResult},smalltalk.ASTInterpreter)})},
  1148. messageSends: ["context:", "outerContext:", "new", "context", "yourself", "value", "outerContext"]}),
  1149. smalltalk.ASTInterpreter);
  1150. smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation', 'nextNode'], 'Compiler-Interpreter');
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "atEnd",
  1154. fn: function (){
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) {
  1157. var $1;
  1158. $1=_st(self._shouldReturn())._or_((function(){
  1159. return smalltalk.withContext(function($ctx2) {
  1160. return _st(self._nextNode()).__eq_eq(self._currentNode());
  1161. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1162. return $1;
  1163. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTSteppingInterpreter)})},
  1164. messageSends: ["or:", "shouldReturn", "==", "nextNode", "currentNode"]}),
  1165. smalltalk.ASTSteppingInterpreter);
  1166. smalltalk.addMethod(
  1167. smalltalk.method({
  1168. selector: "initialize",
  1169. fn: function (){
  1170. var self=this;
  1171. return smalltalk.withContext(function($ctx1) {
  1172. smalltalk.ASTInterpreter.fn.prototype._initialize.apply(_st(self), []);
  1173. self["@continuation"]=(function(){
  1174. return smalltalk.withContext(function($ctx2) {
  1175. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1176. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTSteppingInterpreter)})},
  1177. messageSends: ["initialize"]}),
  1178. smalltalk.ASTSteppingInterpreter);
  1179. smalltalk.addMethod(
  1180. smalltalk.method({
  1181. selector: "interpret:continue:",
  1182. fn: function (aNode,aBlock){
  1183. var self=this;
  1184. return smalltalk.withContext(function($ctx1) {
  1185. self["@nextNode"]=aNode;
  1186. self["@continuation"]=(function(){
  1187. return smalltalk.withContext(function($ctx2) {
  1188. return smalltalk.ASTInterpreter.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
  1189. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1190. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTSteppingInterpreter)})},
  1191. messageSends: ["interpret:continue:"]}),
  1192. smalltalk.ASTSteppingInterpreter);
  1193. smalltalk.addMethod(
  1194. smalltalk.method({
  1195. selector: "nextNode",
  1196. fn: function (){
  1197. var self=this;
  1198. return smalltalk.withContext(function($ctx1) {
  1199. var $1;
  1200. $1=self["@nextNode"];
  1201. return $1;
  1202. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTSteppingInterpreter)})},
  1203. messageSends: []}),
  1204. smalltalk.ASTSteppingInterpreter);
  1205. smalltalk.addMethod(
  1206. smalltalk.method({
  1207. selector: "step",
  1208. fn: function (){
  1209. var self=this;
  1210. return smalltalk.withContext(function($ctx1) {
  1211. _st(self["@continuation"])._value();
  1212. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTSteppingInterpreter)})},
  1213. messageSends: ["value"]}),
  1214. smalltalk.ASTSteppingInterpreter);
  1215. smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['useInlinings', 'pc', 'context', 'currentNode'], 'Compiler-Interpreter');
  1216. smalltalk.addMethod(
  1217. smalltalk.method({
  1218. selector: "context",
  1219. fn: function (){
  1220. var self=this;
  1221. return smalltalk.withContext(function($ctx1) {
  1222. var $1;
  1223. $1=self["@context"];
  1224. return $1;
  1225. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTPCNodeVisitor)})},
  1226. messageSends: []}),
  1227. smalltalk.ASTPCNodeVisitor);
  1228. smalltalk.addMethod(
  1229. smalltalk.method({
  1230. selector: "context:",
  1231. fn: function (aContext){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. self["@context"]=aContext;
  1235. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTPCNodeVisitor)})},
  1236. messageSends: []}),
  1237. smalltalk.ASTPCNodeVisitor);
  1238. smalltalk.addMethod(
  1239. smalltalk.method({
  1240. selector: "currentNode",
  1241. fn: function (){
  1242. var self=this;
  1243. return smalltalk.withContext(function($ctx1) {
  1244. var $1;
  1245. $1=self["@currentNode"];
  1246. return $1;
  1247. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTPCNodeVisitor)})},
  1248. messageSends: []}),
  1249. smalltalk.ASTPCNodeVisitor);
  1250. smalltalk.addMethod(
  1251. smalltalk.method({
  1252. selector: "pc",
  1253. fn: function (){
  1254. var self=this;
  1255. return smalltalk.withContext(function($ctx1) {
  1256. var $2,$1;
  1257. $2=self["@pc"];
  1258. if(($receiver = $2) == nil || $receiver == undefined){
  1259. $1=(0);
  1260. } else {
  1261. $1=$2;
  1262. };
  1263. return $1;
  1264. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.ASTPCNodeVisitor)})},
  1265. messageSends: ["ifNil:"]}),
  1266. smalltalk.ASTPCNodeVisitor);
  1267. smalltalk.addMethod(
  1268. smalltalk.method({
  1269. selector: "pc:",
  1270. fn: function (anInteger){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) {
  1273. self["@pc"]=anInteger;
  1274. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.ASTPCNodeVisitor)})},
  1275. messageSends: []}),
  1276. smalltalk.ASTPCNodeVisitor);
  1277. smalltalk.addMethod(
  1278. smalltalk.method({
  1279. selector: "useInlinings",
  1280. fn: function (){
  1281. var self=this;
  1282. return smalltalk.withContext(function($ctx1) {
  1283. var $2,$1;
  1284. $2=self["@useInlinings"];
  1285. if(($receiver = $2) == nil || $receiver == undefined){
  1286. $1=true;
  1287. } else {
  1288. $1=$2;
  1289. };
  1290. return $1;
  1291. }, function($ctx1) {$ctx1.fill(self,"useInlinings",{},smalltalk.ASTPCNodeVisitor)})},
  1292. messageSends: ["ifNil:"]}),
  1293. smalltalk.ASTPCNodeVisitor);
  1294. smalltalk.addMethod(
  1295. smalltalk.method({
  1296. selector: "useInlinings:",
  1297. fn: function (aBoolean){
  1298. var self=this;
  1299. return smalltalk.withContext(function($ctx1) {
  1300. self["@useInlinings"]=aBoolean;
  1301. return self}, function($ctx1) {$ctx1.fill(self,"useInlinings:",{aBoolean:aBoolean},smalltalk.ASTPCNodeVisitor)})},
  1302. messageSends: []}),
  1303. smalltalk.ASTPCNodeVisitor);
  1304. smalltalk.addMethod(
  1305. smalltalk.method({
  1306. selector: "visitJSStatementNode:",
  1307. fn: function (aNode){
  1308. var self=this;
  1309. return smalltalk.withContext(function($ctx1) {
  1310. self["@currentNode"]=aNode;
  1311. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  1312. messageSends: []}),
  1313. smalltalk.ASTPCNodeVisitor);
  1314. smalltalk.addMethod(
  1315. smalltalk.method({
  1316. selector: "visitSendNode:",
  1317. fn: function (aNode){
  1318. var self=this;
  1319. return smalltalk.withContext(function($ctx1) {
  1320. var $1,$2;
  1321. smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  1322. $1=_st(self._pc()).__eq(_st(self._context())._pc());
  1323. if(! smalltalk.assert($1)){
  1324. $2=_st(aNode)._shouldBeInlined();
  1325. if(! smalltalk.assert($2)){
  1326. self._pc_(_st(self._pc()).__plus((1)));
  1327. self["@currentNode"]=aNode;
  1328. self["@currentNode"];
  1329. };
  1330. };
  1331. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  1332. messageSends: ["visitSendNode:", "ifFalse:", "pc:", "+", "pc", "shouldBeInlined", "=", "context"]}),
  1333. smalltalk.ASTPCNodeVisitor);
  1334. smalltalk.addClass('Interpreter', smalltalk.NodeVisitor, ['node', 'context', 'stack', 'returnValue'], 'Compiler-Interpreter');
  1335. smalltalk.addMethod(
  1336. smalltalk.method({
  1337. selector: "assign:to:",
  1338. fn: function (aNode,anObject){
  1339. var self=this;
  1340. return smalltalk.withContext(function($ctx1) {
  1341. var $1;
  1342. $1=_st(_st(aNode)._binding())._isInstanceVar();
  1343. if(smalltalk.assert($1)){
  1344. _st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  1345. } else {
  1346. _st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
  1347. };
  1348. return self}, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.Interpreter)})},
  1349. messageSends: ["ifTrue:ifFalse:", "instVarAt:put:", "value", "receiver", "context", "localAt:put:", "isInstanceVar", "binding"]}),
  1350. smalltalk.Interpreter);
  1351. smalltalk.addMethod(
  1352. smalltalk.method({
  1353. selector: "atEnd",
  1354. fn: function (){
  1355. var self=this;
  1356. return smalltalk.withContext(function($ctx1) {
  1357. var $1;
  1358. $1=_st(self._shouldReturn())._or_((function(){
  1359. return smalltalk.withContext(function($ctx2) {
  1360. return _st(self._node())._isNil();
  1361. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1362. return $1;
  1363. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.Interpreter)})},
  1364. messageSends: ["or:", "isNil", "node", "shouldReturn"]}),
  1365. smalltalk.Interpreter);
  1366. smalltalk.addMethod(
  1367. smalltalk.method({
  1368. selector: "context",
  1369. fn: function (){
  1370. var self=this;
  1371. return smalltalk.withContext(function($ctx1) {
  1372. var $1;
  1373. $1=self["@context"];
  1374. return $1;
  1375. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.Interpreter)})},
  1376. messageSends: []}),
  1377. smalltalk.Interpreter);
  1378. smalltalk.addMethod(
  1379. smalltalk.method({
  1380. selector: "context:",
  1381. fn: function (aContext){
  1382. var self=this;
  1383. return smalltalk.withContext(function($ctx1) {
  1384. self["@context"]=aContext;
  1385. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.Interpreter)})},
  1386. messageSends: []}),
  1387. smalltalk.Interpreter);
  1388. smalltalk.addMethod(
  1389. smalltalk.method({
  1390. selector: "eval:",
  1391. fn: function (aString){
  1392. var self=this;
  1393. var source,function_;
  1394. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1395. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1396. return smalltalk.withContext(function($ctx1) {
  1397. var $1,$2,$3;
  1398. source=_st($String())._streamContents_((function(str){
  1399. return smalltalk.withContext(function($ctx2) {
  1400. _st(str)._nextPutAll_("(function(");
  1401. _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
  1402. return smalltalk.withContext(function($ctx3) {
  1403. return _st(str)._nextPutAll_(each);
  1404. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  1405. return smalltalk.withContext(function($ctx3) {
  1406. return _st(str)._nextPutAll_(",");
  1407. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  1408. $1=str;
  1409. _st($1)._nextPutAll_("){ return (function() {");
  1410. _st($1)._nextPutAll_(aString);
  1411. $2=_st($1)._nextPutAll_("})() })");
  1412. return $2;
  1413. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  1414. function_=_st(_st($Compiler())._new())._eval_(source);
  1415. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
  1416. return $3;
  1417. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.Interpreter)})},
  1418. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"]}),
  1419. smalltalk.Interpreter);
  1420. smalltalk.addMethod(
  1421. smalltalk.method({
  1422. selector: "interpret",
  1423. fn: function (){
  1424. var self=this;
  1425. return smalltalk.withContext(function($ctx1) {
  1426. self._visit_(self._node());
  1427. return self}, function($ctx1) {$ctx1.fill(self,"interpret",{},smalltalk.Interpreter)})},
  1428. messageSends: ["visit:", "node"]}),
  1429. smalltalk.Interpreter);
  1430. smalltalk.addMethod(
  1431. smalltalk.method({
  1432. selector: "interpret:",
  1433. fn: function (aNode){
  1434. var self=this;
  1435. return smalltalk.withContext(function($ctx1) {
  1436. self._node_(aNode);
  1437. self._interpret();
  1438. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.Interpreter)})},
  1439. messageSends: ["node:", "interpret"]}),
  1440. smalltalk.Interpreter);
  1441. smalltalk.addMethod(
  1442. smalltalk.method({
  1443. selector: "messageFromSendNode:arguments:",
  1444. fn: function (aSendNode,aCollection){
  1445. var self=this;
  1446. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1447. return smalltalk.withContext(function($ctx1) {
  1448. var $2,$3,$1;
  1449. $2=_st($Message())._new();
  1450. _st($2)._selector_(_st(aSendNode)._selector());
  1451. _st($2)._arguments_(aCollection);
  1452. $3=_st($2)._yourself();
  1453. $1=$3;
  1454. return $1;
  1455. }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},smalltalk.Interpreter)})},
  1456. messageSends: ["selector:", "selector", "new", "arguments:", "yourself"]}),
  1457. smalltalk.Interpreter);
  1458. smalltalk.addMethod(
  1459. smalltalk.method({
  1460. selector: "messageNotUnderstood:receiver:",
  1461. fn: function (aMessage,anObject){
  1462. var self=this;
  1463. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1464. return smalltalk.withContext(function($ctx1) {
  1465. var $1,$2;
  1466. $1=_st($MessageNotUnderstood())._new();
  1467. _st($1)._meesage_(aMessage);
  1468. _st($1)._receiver_(anObject);
  1469. $2=_st($1)._signal();
  1470. return self}, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},smalltalk.Interpreter)})},
  1471. messageSends: ["meesage:", "new", "receiver:", "signal"]}),
  1472. smalltalk.Interpreter);
  1473. smalltalk.addMethod(
  1474. smalltalk.method({
  1475. selector: "next",
  1476. fn: function (){
  1477. var self=this;
  1478. return smalltalk.withContext(function($ctx1) {
  1479. self._node_(_st(self._node())._nextNode());
  1480. return self}, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.Interpreter)})},
  1481. messageSends: ["node:", "nextNode", "node"]}),
  1482. smalltalk.Interpreter);
  1483. smalltalk.addMethod(
  1484. smalltalk.method({
  1485. selector: "node",
  1486. fn: function (){
  1487. var self=this;
  1488. return smalltalk.withContext(function($ctx1) {
  1489. var $1;
  1490. $1=self["@node"];
  1491. return $1;
  1492. }, function($ctx1) {$ctx1.fill(self,"node",{},smalltalk.Interpreter)})},
  1493. messageSends: []}),
  1494. smalltalk.Interpreter);
  1495. smalltalk.addMethod(
  1496. smalltalk.method({
  1497. selector: "node:",
  1498. fn: function (aNode){
  1499. var self=this;
  1500. return smalltalk.withContext(function($ctx1) {
  1501. self["@node"]=aNode;
  1502. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode},smalltalk.Interpreter)})},
  1503. messageSends: []}),
  1504. smalltalk.Interpreter);
  1505. smalltalk.addMethod(
  1506. smalltalk.method({
  1507. selector: "peek",
  1508. fn: function (){
  1509. var self=this;
  1510. return smalltalk.withContext(function($ctx1) {
  1511. var $1;
  1512. $1=_st(self._stack())._last();
  1513. return $1;
  1514. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.Interpreter)})},
  1515. messageSends: ["last", "stack"]}),
  1516. smalltalk.Interpreter);
  1517. smalltalk.addMethod(
  1518. smalltalk.method({
  1519. selector: "pop",
  1520. fn: function (){
  1521. var self=this;
  1522. var value;
  1523. return smalltalk.withContext(function($ctx1) {
  1524. var $1;
  1525. value=self._peek();
  1526. _st(self._stack())._removeLast();
  1527. $1=value;
  1528. return $1;
  1529. }, function($ctx1) {$ctx1.fill(self,"pop",{value:value},smalltalk.Interpreter)})},
  1530. messageSends: ["peek", "removeLast", "stack"]}),
  1531. smalltalk.Interpreter);
  1532. smalltalk.addMethod(
  1533. smalltalk.method({
  1534. selector: "proceed",
  1535. fn: function (){
  1536. var self=this;
  1537. return smalltalk.withContext(function($ctx1) {
  1538. _st((function(){
  1539. return smalltalk.withContext(function($ctx2) {
  1540. return self._atEnd();
  1541. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  1542. return smalltalk.withContext(function($ctx2) {
  1543. return self._step();
  1544. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1545. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.Interpreter)})},
  1546. messageSends: ["whileFalse:", "atEnd", "step"]}),
  1547. smalltalk.Interpreter);
  1548. smalltalk.addMethod(
  1549. smalltalk.method({
  1550. selector: "push:",
  1551. fn: function (anObject){
  1552. var self=this;
  1553. return smalltalk.withContext(function($ctx1) {
  1554. var $1;
  1555. $1=_st(self._stack())._add_(anObject);
  1556. return $1;
  1557. }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},smalltalk.Interpreter)})},
  1558. messageSends: ["add:", "stack"]}),
  1559. smalltalk.Interpreter);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "result",
  1563. fn: function (){
  1564. var self=this;
  1565. return smalltalk.withContext(function($ctx1) {
  1566. var $2,$1;
  1567. $2=self._returnValue();
  1568. if(($receiver = $2) == nil || $receiver == undefined){
  1569. $1=_st(self._context())._receiver();
  1570. } else {
  1571. $1=$2;
  1572. };
  1573. return $1;
  1574. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.Interpreter)})},
  1575. messageSends: ["ifNil:", "returnValue", "receiver", "context"]}),
  1576. smalltalk.Interpreter);
  1577. smalltalk.addMethod(
  1578. smalltalk.method({
  1579. selector: "returnValue",
  1580. fn: function (){
  1581. var self=this;
  1582. return smalltalk.withContext(function($ctx1) {
  1583. var $1;
  1584. $1=self["@returnValue"];
  1585. return $1;
  1586. }, function($ctx1) {$ctx1.fill(self,"returnValue",{},smalltalk.Interpreter)})},
  1587. messageSends: []}),
  1588. smalltalk.Interpreter);
  1589. smalltalk.addMethod(
  1590. smalltalk.method({
  1591. selector: "returnValue:",
  1592. fn: function (anObject){
  1593. var self=this;
  1594. return smalltalk.withContext(function($ctx1) {
  1595. self["@returnValue"]=anObject;
  1596. return self}, function($ctx1) {$ctx1.fill(self,"returnValue:",{anObject:anObject},smalltalk.Interpreter)})},
  1597. messageSends: []}),
  1598. smalltalk.Interpreter);
  1599. smalltalk.addMethod(
  1600. smalltalk.method({
  1601. selector: "sendMessage:to:superSend:",
  1602. fn: function (aMessage,anObject,aBoolean){
  1603. var self=this;
  1604. var method;
  1605. return smalltalk.withContext(function($ctx1) {
  1606. var $1,$2,$3,$4,$5,$6;
  1607. var $early={};
  1608. try {
  1609. $1=aBoolean;
  1610. if(! smalltalk.assert($1)){
  1611. $2=_st(aMessage)._sendTo_(anObject);
  1612. return $2;
  1613. };
  1614. $3=_st(_st(anObject)._class())._superclass();
  1615. if(($receiver = $3) == nil || $receiver == undefined){
  1616. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1617. return $4;
  1618. } else {
  1619. $3;
  1620. };
  1621. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1622. return smalltalk.withContext(function($ctx2) {
  1623. $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1624. throw $early=[$5];
  1625. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1626. $6=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
  1627. return $6;
  1628. }
  1629. catch(e) {if(e===$early)return e[0]; throw e}
  1630. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.Interpreter)})},
  1631. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "messageNotUnderstood:receiver:", "superclass", "class", "at:ifAbsent:", "selector", "methodDictionary", "sendTo:arguments:", "arguments"]}),
  1632. smalltalk.Interpreter);
  1633. smalltalk.addMethod(
  1634. smalltalk.method({
  1635. selector: "shouldReturn",
  1636. fn: function (){
  1637. var self=this;
  1638. return smalltalk.withContext(function($ctx1) {
  1639. var $1;
  1640. $1=_st(self._returnValue())._notNil();
  1641. return $1;
  1642. }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.Interpreter)})},
  1643. messageSends: ["notNil", "returnValue"]}),
  1644. smalltalk.Interpreter);
  1645. smalltalk.addMethod(
  1646. smalltalk.method({
  1647. selector: "skip",
  1648. fn: function (){
  1649. var self=this;
  1650. return smalltalk.withContext(function($ctx1) {
  1651. self._next();
  1652. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.Interpreter)})},
  1653. messageSends: ["next"]}),
  1654. smalltalk.Interpreter);
  1655. smalltalk.addMethod(
  1656. smalltalk.method({
  1657. selector: "stack",
  1658. fn: function (){
  1659. var self=this;
  1660. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1661. return smalltalk.withContext(function($ctx1) {
  1662. var $2,$1;
  1663. $2=self["@stack"];
  1664. if(($receiver = $2) == nil || $receiver == undefined){
  1665. self["@stack"]=_st($OrderedCollection())._new();
  1666. $1=self["@stack"];
  1667. } else {
  1668. $1=$2;
  1669. };
  1670. return $1;
  1671. }, function($ctx1) {$ctx1.fill(self,"stack",{},smalltalk.Interpreter)})},
  1672. messageSends: ["ifNil:", "new"]}),
  1673. smalltalk.Interpreter);
  1674. smalltalk.addMethod(
  1675. smalltalk.method({
  1676. selector: "step",
  1677. fn: function (){
  1678. var self=this;
  1679. return smalltalk.withContext(function($ctx1) {
  1680. var $1,$2;
  1681. $1=self;
  1682. _st($1)._interpret();
  1683. $2=_st($1)._next();
  1684. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.Interpreter)})},
  1685. messageSends: ["interpret", "next"]}),
  1686. smalltalk.Interpreter);
  1687. smalltalk.addMethod(
  1688. smalltalk.method({
  1689. selector: "visit:",
  1690. fn: function (aNode){
  1691. var self=this;
  1692. return smalltalk.withContext(function($ctx1) {
  1693. var $1;
  1694. $1=self._shouldReturn();
  1695. if(! smalltalk.assert($1)){
  1696. smalltalk.NodeVisitor.fn.prototype._visit_.apply(_st(self), [aNode]);
  1697. };
  1698. return self}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.Interpreter)})},
  1699. messageSends: ["ifFalse:", "visit:", "shouldReturn"]}),
  1700. smalltalk.Interpreter);
  1701. smalltalk.addMethod(
  1702. smalltalk.method({
  1703. selector: "visitAssignmentNode:",
  1704. fn: function (aNode){
  1705. var self=this;
  1706. var value;
  1707. return smalltalk.withContext(function($ctx1) {
  1708. value=self._pop();
  1709. self._pop();
  1710. self._push_(value);
  1711. self._assign_to_(_st(aNode)._left(),value);
  1712. return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,value:value},smalltalk.Interpreter)})},
  1713. messageSends: ["pop", "push:", "assign:to:", "left"]}),
  1714. smalltalk.Interpreter);
  1715. smalltalk.addMethod(
  1716. smalltalk.method({
  1717. selector: "visitBlockNode:",
  1718. fn: function (aNode){
  1719. var self=this;
  1720. var blockNode,blockContext,block,interpreter;
  1721. return smalltalk.withContext(function($ctx1) {
  1722. var $1,$2,$3,$4,$5;
  1723. blockNode=_st(_st(_st(aNode)._nodes())._first())._copy();
  1724. _st(blockNode)._parent_(nil);
  1725. $1=_st(_st(self._context())._class())._new();
  1726. _st($1)._outerContext_(self._context());
  1727. $2=_st($1)._yourself();
  1728. blockContext=$2;
  1729. block=(function(){
  1730. return smalltalk.withContext(function($ctx2) {
  1731. interpreter=_st(self._class())._new();
  1732. interpreter;
  1733. $3=interpreter;
  1734. _st($3)._context_(blockContext);
  1735. _st($3)._node_(_st(blockNode)._nextChild());
  1736. $4=_st($3)._proceed();
  1737. $4;
  1738. self._returnValue_(_st(interpreter)._returnValue());
  1739. $5=_st(_st(interpreter)._stack())._isEmpty();
  1740. if(smalltalk.assert($5)){
  1741. return nil;
  1742. } else {
  1743. return _st(interpreter)._pop();
  1744. };
  1745. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1746. self._push_(block);
  1747. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,blockNode:blockNode,blockContext:blockContext,block:block,interpreter:interpreter},smalltalk.Interpreter)})},
  1748. messageSends: ["copy", "first", "nodes", "parent:", "outerContext:", "new", "class", "context", "yourself", "context:", "node:", "nextChild", "proceed", "returnValue:", "returnValue", "ifTrue:ifFalse:", "isEmpty", "stack", "pop", "push:"]}),
  1749. smalltalk.Interpreter);
  1750. smalltalk.addMethod(
  1751. smalltalk.method({
  1752. selector: "visitClassReferenceNode:",
  1753. fn: function (aNode){
  1754. var self=this;
  1755. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1756. return smalltalk.withContext(function($ctx1) {
  1757. self._push_(_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
  1758. return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.Interpreter)})},
  1759. messageSends: ["push:", "at:", "value", "current"]}),
  1760. smalltalk.Interpreter);
  1761. smalltalk.addMethod(
  1762. smalltalk.method({
  1763. selector: "visitDynamicArrayNode:",
  1764. fn: function (aNode){
  1765. var self=this;
  1766. var array;
  1767. return smalltalk.withContext(function($ctx1) {
  1768. array=[];
  1769. _st(_st(aNode)._nodes())._do_((function(each){
  1770. return smalltalk.withContext(function($ctx2) {
  1771. return _st(array)._addFirst_(self._pop());
  1772. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1773. self._push_(array);
  1774. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.Interpreter)})},
  1775. messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"]}),
  1776. smalltalk.Interpreter);
  1777. smalltalk.addMethod(
  1778. smalltalk.method({
  1779. selector: "visitDynamicDictionaryNode:",
  1780. fn: function (aNode){
  1781. var self=this;
  1782. var hashedCollection;
  1783. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1784. return smalltalk.withContext(function($ctx1) {
  1785. hashedCollection=_st($HashedCollection())._new();
  1786. _st(_st(aNode)._nodes())._do_((function(each){
  1787. return smalltalk.withContext(function($ctx2) {
  1788. return _st(hashedCollection)._add_(self._pop());
  1789. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1790. self._push_(hashedCollection);
  1791. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,hashedCollection:hashedCollection},smalltalk.Interpreter)})},
  1792. messageSends: ["new", "do:", "nodes", "add:", "pop", "push:"]}),
  1793. smalltalk.Interpreter);
  1794. smalltalk.addMethod(
  1795. smalltalk.method({
  1796. selector: "visitJSStatementNode:",
  1797. fn: function (aNode){
  1798. var self=this;
  1799. return smalltalk.withContext(function($ctx1) {
  1800. self._returnValue_(self._eval_(_st(aNode)._source()));
  1801. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.Interpreter)})},
  1802. messageSends: ["returnValue:", "eval:", "source"]}),
  1803. smalltalk.Interpreter);
  1804. smalltalk.addMethod(
  1805. smalltalk.method({
  1806. selector: "visitNode:",
  1807. fn: function (aNode){
  1808. var self=this;
  1809. return smalltalk.withContext(function($ctx1) {
  1810. return self}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.Interpreter)})},
  1811. messageSends: []}),
  1812. smalltalk.Interpreter);
  1813. smalltalk.addMethod(
  1814. smalltalk.method({
  1815. selector: "visitReturnNode:",
  1816. fn: function (aNode){
  1817. var self=this;
  1818. return smalltalk.withContext(function($ctx1) {
  1819. self._returnValue_(self._pop());
  1820. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.Interpreter)})},
  1821. messageSends: ["returnValue:", "pop"]}),
  1822. smalltalk.Interpreter);
  1823. smalltalk.addMethod(
  1824. smalltalk.method({
  1825. selector: "visitSendNode:",
  1826. fn: function (aNode){
  1827. var self=this;
  1828. var receiver,args,message,result;
  1829. return smalltalk.withContext(function($ctx1) {
  1830. var $1;
  1831. args=_st(_st(aNode)._arguments())._collect_((function(each){
  1832. return smalltalk.withContext(function($ctx2) {
  1833. return self._pop();
  1834. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1835. receiver=self._pop();
  1836. message=self._messageFromSendNode_arguments_(aNode,_st(args)._reversed());
  1837. result=self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend());
  1838. _st(self._context())._pc_(_st(_st(self._context())._pc()).__plus((1)));
  1839. $1=_st(_st(aNode)._isCascadeSendNode())._and_((function(){
  1840. return smalltalk.withContext(function($ctx2) {
  1841. return _st(_st(aNode)._isLastChild())._not();
  1842. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1843. if(smalltalk.assert($1)){
  1844. self._push_(receiver);
  1845. } else {
  1846. self._push_(result);
  1847. };
  1848. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},smalltalk.Interpreter)})},
  1849. messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "pc:", "context", "+", "pc", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"]}),
  1850. smalltalk.Interpreter);
  1851. smalltalk.addMethod(
  1852. smalltalk.method({
  1853. selector: "visitValueNode:",
  1854. fn: function (aNode){
  1855. var self=this;
  1856. return smalltalk.withContext(function($ctx1) {
  1857. self._push_(_st(aNode)._value());
  1858. return self}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.Interpreter)})},
  1859. messageSends: ["push:", "value"]}),
  1860. smalltalk.Interpreter);
  1861. smalltalk.addMethod(
  1862. smalltalk.method({
  1863. selector: "visitVariableNode:",
  1864. fn: function (aNode){
  1865. var self=this;
  1866. return smalltalk.withContext(function($ctx1) {
  1867. var $1,$3,$2;
  1868. $1=self;
  1869. $3=_st(_st(aNode)._binding())._isInstanceVar();
  1870. if(smalltalk.assert($3)){
  1871. $2=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
  1872. } else {
  1873. $2=_st(self._context())._localAt_(_st(aNode)._value());
  1874. };
  1875. _st($1)._push_($2);
  1876. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.Interpreter)})},
  1877. messageSends: ["push:", "ifTrue:ifFalse:", "instVarAt:", "value", "receiver", "context", "localAt:", "isInstanceVar", "binding"]}),
  1878. smalltalk.Interpreter);
  1879. smalltalk.addMethod(
  1880. smalltalk.method({
  1881. selector: "interpreter:continue:",
  1882. fn: function (anInterpreter,aBlock){
  1883. var self=this;
  1884. return smalltalk.withContext(function($ctx1) {
  1885. var $1;
  1886. $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
  1887. return $1;
  1888. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.Node)})},
  1889. messageSends: ["interpretNode:continue:"]}),
  1890. smalltalk.Node);
  1891. smalltalk.addMethod(
  1892. smalltalk.method({
  1893. selector: "isSteppingNode",
  1894. fn: function (){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) {
  1897. return false;
  1898. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  1899. messageSends: []}),
  1900. smalltalk.Node);
  1901. smalltalk.addMethod(
  1902. smalltalk.method({
  1903. selector: "interpreter:continue:",
  1904. fn: function (anInterpreter,aBlock){
  1905. var self=this;
  1906. return smalltalk.withContext(function($ctx1) {
  1907. var $1;
  1908. $1=_st(anInterpreter)._interpretAssignmentNode_continue_(self,aBlock);
  1909. return $1;
  1910. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.AssignmentNode)})},
  1911. messageSends: ["interpretAssignmentNode:continue:"]}),
  1912. smalltalk.AssignmentNode);
  1913. smalltalk.addMethod(
  1914. smalltalk.method({
  1915. selector: "isSteppingNode",
  1916. fn: function (){
  1917. var self=this;
  1918. return smalltalk.withContext(function($ctx1) {
  1919. return true;
  1920. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  1921. messageSends: []}),
  1922. smalltalk.AssignmentNode);
  1923. smalltalk.addMethod(
  1924. smalltalk.method({
  1925. selector: "interpreter:continue:",
  1926. fn: function (anInterpreter,aBlock){
  1927. var self=this;
  1928. return smalltalk.withContext(function($ctx1) {
  1929. var $1;
  1930. $1=_st(anInterpreter)._interpretBlockNode_continue_(self,aBlock);
  1931. return $1;
  1932. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockNode)})},
  1933. messageSends: ["interpretBlockNode:continue:"]}),
  1934. smalltalk.BlockNode);
  1935. smalltalk.addMethod(
  1936. smalltalk.method({
  1937. selector: "isSteppingNode",
  1938. fn: function (){
  1939. var self=this;
  1940. return smalltalk.withContext(function($ctx1) {
  1941. return true;
  1942. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
  1943. messageSends: []}),
  1944. smalltalk.BlockNode);
  1945. smalltalk.addMethod(
  1946. smalltalk.method({
  1947. selector: "interpreter:continue:",
  1948. fn: function (anInterpreter,aBlock){
  1949. var self=this;
  1950. return smalltalk.withContext(function($ctx1) {
  1951. var $1;
  1952. $1=_st(anInterpreter)._interpretCascadeNode_continue_(self,aBlock);
  1953. return $1;
  1954. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.CascadeNode)})},
  1955. messageSends: ["interpretCascadeNode:continue:"]}),
  1956. smalltalk.CascadeNode);
  1957. smalltalk.addMethod(
  1958. smalltalk.method({
  1959. selector: "interpreter:continue:",
  1960. fn: function (anInterpreter,aBlock){
  1961. var self=this;
  1962. return smalltalk.withContext(function($ctx1) {
  1963. var $1;
  1964. $1=_st(anInterpreter)._interpretDynamicArrayNode_continue_(self,aBlock);
  1965. return $1;
  1966. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicArrayNode)})},
  1967. messageSends: ["interpretDynamicArrayNode:continue:"]}),
  1968. smalltalk.DynamicArrayNode);
  1969. smalltalk.addMethod(
  1970. smalltalk.method({
  1971. selector: "isSteppingNode",
  1972. fn: function (){
  1973. var self=this;
  1974. return smalltalk.withContext(function($ctx1) {
  1975. return true;
  1976. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  1977. messageSends: []}),
  1978. smalltalk.DynamicArrayNode);
  1979. smalltalk.addMethod(
  1980. smalltalk.method({
  1981. selector: "interpreter:continue:",
  1982. fn: function (anInterpreter,aBlock){
  1983. var self=this;
  1984. return smalltalk.withContext(function($ctx1) {
  1985. var $1;
  1986. $1=_st(anInterpreter)._interpretDynamicDictionaryNode_continue_(self,aBlock);
  1987. return $1;
  1988. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicDictionaryNode)})},
  1989. messageSends: ["interpretDynamicDictionaryNode:continue:"]}),
  1990. smalltalk.DynamicDictionaryNode);
  1991. smalltalk.addMethod(
  1992. smalltalk.method({
  1993. selector: "isSteppingNode",
  1994. fn: function (){
  1995. var self=this;
  1996. return smalltalk.withContext(function($ctx1) {
  1997. return true;
  1998. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
  1999. messageSends: []}),
  2000. smalltalk.DynamicDictionaryNode);
  2001. smalltalk.addMethod(
  2002. smalltalk.method({
  2003. selector: "interpreter:continue:",
  2004. fn: function (anInterpreter,aBlock){
  2005. var self=this;
  2006. return smalltalk.withContext(function($ctx1) {
  2007. var $1;
  2008. $1=_st(anInterpreter)._interpretJSStatementNode_continue_(self,aBlock);
  2009. return $1;
  2010. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.JSStatementNode)})},
  2011. messageSends: ["interpretJSStatementNode:continue:"]}),
  2012. smalltalk.JSStatementNode);
  2013. smalltalk.addMethod(
  2014. smalltalk.method({
  2015. selector: "isSteppingNode",
  2016. fn: function (){
  2017. var self=this;
  2018. return smalltalk.withContext(function($ctx1) {
  2019. return true;
  2020. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
  2021. messageSends: []}),
  2022. smalltalk.JSStatementNode);
  2023. smalltalk.addMethod(
  2024. smalltalk.method({
  2025. selector: "interpreter:continue:",
  2026. fn: function (anInterpreter,aBlock){
  2027. var self=this;
  2028. return smalltalk.withContext(function($ctx1) {
  2029. var $1;
  2030. $1=_st(anInterpreter)._interpretMethodNode_continue_(self,aBlock);
  2031. return $1;
  2032. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.MethodNode)})},
  2033. messageSends: ["interpretMethodNode:continue:"]}),
  2034. smalltalk.MethodNode);
  2035. smalltalk.addMethod(
  2036. smalltalk.method({
  2037. selector: "interpreter:continue:",
  2038. fn: function (anInterpreter,aBlock){
  2039. var self=this;
  2040. return smalltalk.withContext(function($ctx1) {
  2041. var $1;
  2042. $1=_st(anInterpreter)._interpretReturnNode_continue_(self,aBlock);
  2043. return $1;
  2044. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ReturnNode)})},
  2045. messageSends: ["interpretReturnNode:continue:"]}),
  2046. smalltalk.ReturnNode);
  2047. smalltalk.addMethod(
  2048. smalltalk.method({
  2049. selector: "interpreter:continue:",
  2050. fn: function (anInterpreter,aBlock){
  2051. var self=this;
  2052. return smalltalk.withContext(function($ctx1) {
  2053. var $1;
  2054. $1=_st(anInterpreter)._interpretSendNode_continue_(self,aBlock);
  2055. return $1;
  2056. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SendNode)})},
  2057. messageSends: ["interpretSendNode:continue:"]}),
  2058. smalltalk.SendNode);
  2059. smalltalk.addMethod(
  2060. smalltalk.method({
  2061. selector: "isSteppingNode",
  2062. fn: function (){
  2063. var self=this;
  2064. return smalltalk.withContext(function($ctx1) {
  2065. return true;
  2066. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  2067. messageSends: []}),
  2068. smalltalk.SendNode);
  2069. smalltalk.addMethod(
  2070. smalltalk.method({
  2071. selector: "interpreter:continue:",
  2072. fn: function (anInterpreter,aBlock){
  2073. var self=this;
  2074. return smalltalk.withContext(function($ctx1) {
  2075. var $1;
  2076. $1=_st(anInterpreter)._interpretSequenceNode_continue_(self,aBlock);
  2077. return $1;
  2078. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SequenceNode)})},
  2079. messageSends: ["interpretSequenceNode:continue:"]}),
  2080. smalltalk.SequenceNode);
  2081. smalltalk.addMethod(
  2082. smalltalk.method({
  2083. selector: "interpreter:continue:",
  2084. fn: function (anInterpreter,aBlock){
  2085. var self=this;
  2086. return smalltalk.withContext(function($ctx1) {
  2087. var $1;
  2088. $1=_st(anInterpreter)._interpretBlockSequenceNode_continue_(self,aBlock);
  2089. return $1;
  2090. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockSequenceNode)})},
  2091. messageSends: ["interpretBlockSequenceNode:continue:"]}),
  2092. smalltalk.BlockSequenceNode);
  2093. smalltalk.addMethod(
  2094. smalltalk.method({
  2095. selector: "interpreter:continue:",
  2096. fn: function (anInterpreter,aBlock){
  2097. var self=this;
  2098. return smalltalk.withContext(function($ctx1) {
  2099. var $1;
  2100. $1=_st(anInterpreter)._interpretValueNode_continue_(self,aBlock);
  2101. return $1;
  2102. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ValueNode)})},
  2103. messageSends: ["interpretValueNode:continue:"]}),
  2104. smalltalk.ValueNode);
  2105. smalltalk.addMethod(
  2106. smalltalk.method({
  2107. selector: "interpreter:continue:",
  2108. fn: function (anInterpreter,aBlock){
  2109. var self=this;
  2110. return smalltalk.withContext(function($ctx1) {
  2111. var $1;
  2112. $1=_st(anInterpreter)._interpretVariableNode_continue_(self,aBlock);
  2113. return $1;
  2114. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.VariableNode)})},
  2115. messageSends: ["interpretVariableNode:continue:"]}),
  2116. smalltalk.VariableNode);
  2117. smalltalk.addMethod(
  2118. smalltalk.method({
  2119. selector: "interpreter:continue:",
  2120. fn: function (anInterpreter,aBlock){
  2121. var self=this;
  2122. return smalltalk.withContext(function($ctx1) {
  2123. var $1;
  2124. $1=_st(anInterpreter)._interpretClassReferenceNode_continue_(self,aBlock);
  2125. return $1;
  2126. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ClassReferenceNode)})},
  2127. messageSends: ["interpretClassReferenceNode:continue:"]}),
  2128. smalltalk.ClassReferenceNode);