Compiler-Interpreter.deploy.js 78 KB

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