Compiler-Interpreter.deploy.js 80 KB

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