2
0

Compiler-Interpreter.deploy.js 79 KB

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