1
0

Compiler-Interpreter.js 83 KB

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