Compiler-Interpreter.deploy.js 90 KB

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