Compiler-Interpreter.js 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403
  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/Compiler-Core", "amber_core/Kernel-Exceptions", "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 $ASTInterpreterError(){return smalltalk.ASTInterpreterError||(typeof ASTInterpreterError=="undefined"?nil:ASTInterpreterError)}
  74. return smalltalk.withContext(function($ctx1) {
  75. _st($ASTInterpreterError())._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\x09ASTInterpreterError signal: 'Method cannot be interpreted by the interpreter.'",
  79. messageSends: ["signal:"],
  80. referencedClasses: ["ASTInterpreterError"]
  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._selector())._isNil();
  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 selector isNil",
  518. messageSends: ["isNil", "selector"],
  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('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  855. 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.";
  856. smalltalk.addMethod(
  857. smalltalk.method({
  858. selector: "atEnd",
  859. category: 'testing',
  860. fn: function (){
  861. var self=this;
  862. return smalltalk.withContext(function($ctx1) {
  863. var $1;
  864. $1=_st(self._interpreter())._atEnd();
  865. return $1;
  866. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
  867. args: [],
  868. source: "atEnd\x0a\x09^ self interpreter atEnd",
  869. messageSends: ["atEnd", "interpreter"],
  870. referencedClasses: []
  871. }),
  872. smalltalk.ASTDebugger);
  873. smalltalk.addMethod(
  874. smalltalk.method({
  875. selector: "buildAST",
  876. category: 'initialization',
  877. fn: function (){
  878. var self=this;
  879. var ast;
  880. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  881. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  882. return smalltalk.withContext(function($ctx1) {
  883. var $1;
  884. ast=_st(_st($Smalltalk())._current())._parse_(_st(self._method())._source());
  885. _st(_st($SemanticAnalyzer())._on_(_st(_st(self._context())._receiver())._class()))._visit_(ast);
  886. $1=ast;
  887. return $1;
  888. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  889. args: [],
  890. 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",
  891. messageSends: ["parse:", "current", "source", "method", "visit:", "on:", "class", "receiver", "context"],
  892. referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
  893. }),
  894. smalltalk.ASTDebugger);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "context",
  898. category: 'accessing',
  899. fn: function (){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) {
  902. var $1;
  903. $1=self["@context"];
  904. return $1;
  905. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  906. args: [],
  907. source: "context\x0a\x09^ context",
  908. messageSends: [],
  909. referencedClasses: []
  910. }),
  911. smalltalk.ASTDebugger);
  912. smalltalk.addMethod(
  913. smalltalk.method({
  914. selector: "context:",
  915. category: 'accessing',
  916. fn: function (aContext){
  917. var self=this;
  918. return smalltalk.withContext(function($ctx1) {
  919. self["@context"]=aContext;
  920. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  921. args: ["aContext"],
  922. source: "context: aContext\x0a\x09context := aContext",
  923. messageSends: [],
  924. referencedClasses: []
  925. }),
  926. smalltalk.ASTDebugger);
  927. smalltalk.addMethod(
  928. smalltalk.method({
  929. selector: "defaultInterpreterClass",
  930. category: 'defaults',
  931. fn: function (){
  932. var self=this;
  933. function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  934. return smalltalk.withContext(function($ctx1) {
  935. var $1;
  936. $1=$ASTInterpreter();
  937. return $1;
  938. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  939. args: [],
  940. source: "defaultInterpreterClass\x0a\x09^ ASTInterpreter",
  941. messageSends: [],
  942. referencedClasses: ["ASTInterpreter"]
  943. }),
  944. smalltalk.ASTDebugger);
  945. smalltalk.addMethod(
  946. smalltalk.method({
  947. selector: "initializeInterpreter",
  948. category: 'initialization',
  949. fn: function (){
  950. var self=this;
  951. var ast,next;
  952. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  953. return smalltalk.withContext(function($ctx1) {
  954. var $1,$2;
  955. ast=self._buildAST();
  956. $1=_st($ASTPCNodeVisitor())._new();
  957. _st($1)._context_(self._context());
  958. _st($1)._visit_(ast);
  959. $2=_st($1)._currentNode();
  960. next=$2;
  961. _st(self._interpreter())._node_(next);
  962. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{ast:ast,next:next},smalltalk.ASTDebugger)})},
  963. args: [],
  964. 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",
  965. messageSends: ["buildAST", "context:", "new", "context", "visit:", "currentNode", "node:", "interpreter"],
  966. referencedClasses: ["ASTPCNodeVisitor"]
  967. }),
  968. smalltalk.ASTDebugger);
  969. smalltalk.addMethod(
  970. smalltalk.method({
  971. selector: "initializeWithContext:",
  972. category: 'initialization',
  973. fn: function (aContext){
  974. var self=this;
  975. return smalltalk.withContext(function($ctx1) {
  976. self._context_(aContext);
  977. self._initializeInterpreter();
  978. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aContext:aContext},smalltalk.ASTDebugger)})},
  979. args: ["aContext"],
  980. source: "initializeWithContext: aContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a\x09\x0a\x09self context: aContext.\x0a\x09self initializeInterpreter",
  981. messageSends: ["context:", "initializeInterpreter"],
  982. referencedClasses: []
  983. }),
  984. smalltalk.ASTDebugger);
  985. smalltalk.addMethod(
  986. smalltalk.method({
  987. selector: "interpreter",
  988. category: 'accessing',
  989. fn: function (){
  990. var self=this;
  991. return smalltalk.withContext(function($ctx1) {
  992. var $2,$1;
  993. $2=self["@interpreter"];
  994. if(($receiver = $2) == nil || $receiver == undefined){
  995. self["@interpreter"]=_st(self._defaultInterpreterClass())._new();
  996. $1=self["@interpreter"];
  997. } else {
  998. $1=$2;
  999. };
  1000. return $1;
  1001. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  1002. args: [],
  1003. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  1004. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  1005. referencedClasses: []
  1006. }),
  1007. smalltalk.ASTDebugger);
  1008. smalltalk.addMethod(
  1009. smalltalk.method({
  1010. selector: "interpreter:",
  1011. category: 'accessing',
  1012. fn: function (anInterpreter){
  1013. var self=this;
  1014. return smalltalk.withContext(function($ctx1) {
  1015. self["@interpreter"]=anInterpreter;
  1016. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  1017. args: ["anInterpreter"],
  1018. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  1019. messageSends: [],
  1020. referencedClasses: []
  1021. }),
  1022. smalltalk.ASTDebugger);
  1023. smalltalk.addMethod(
  1024. smalltalk.method({
  1025. selector: "method",
  1026. category: 'accessing',
  1027. fn: function (){
  1028. var self=this;
  1029. return smalltalk.withContext(function($ctx1) {
  1030. var $1;
  1031. $1=_st(self._context())._method();
  1032. return $1;
  1033. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  1034. args: [],
  1035. source: "method\x0a\x09^ self context method",
  1036. messageSends: ["method", "context"],
  1037. referencedClasses: []
  1038. }),
  1039. smalltalk.ASTDebugger);
  1040. smalltalk.addMethod(
  1041. smalltalk.method({
  1042. selector: "nextNode",
  1043. category: 'accessing',
  1044. fn: function (){
  1045. var self=this;
  1046. return smalltalk.withContext(function($ctx1) {
  1047. var $1;
  1048. $1=_st(self._interpreter())._nextNode();
  1049. return $1;
  1050. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTDebugger)})},
  1051. args: [],
  1052. source: "nextNode\x0a\x09^ self interpreter nextNode",
  1053. messageSends: ["nextNode", "interpreter"],
  1054. referencedClasses: []
  1055. }),
  1056. smalltalk.ASTDebugger);
  1057. smalltalk.addMethod(
  1058. smalltalk.method({
  1059. selector: "proceed",
  1060. category: 'stepping',
  1061. fn: function (){
  1062. var self=this;
  1063. return smalltalk.withContext(function($ctx1) {
  1064. self._shouldBeImplemented();
  1065. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
  1066. args: [],
  1067. source: "proceed\x0a\x09self shouldBeImplemented",
  1068. messageSends: ["shouldBeImplemented"],
  1069. referencedClasses: []
  1070. }),
  1071. smalltalk.ASTDebugger);
  1072. smalltalk.addMethod(
  1073. smalltalk.method({
  1074. selector: "restart",
  1075. category: 'stepping',
  1076. fn: function (){
  1077. var self=this;
  1078. return smalltalk.withContext(function($ctx1) {
  1079. _st(self._interpreter())._restart();
  1080. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  1081. args: [],
  1082. source: "restart\x0a\x09self interpreter restart",
  1083. messageSends: ["restart", "interpreter"],
  1084. referencedClasses: []
  1085. }),
  1086. smalltalk.ASTDebugger);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "stepInto",
  1090. category: 'stepping',
  1091. fn: function (){
  1092. var self=this;
  1093. return smalltalk.withContext(function($ctx1) {
  1094. self._shouldBeImplemented();
  1095. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  1096. args: [],
  1097. source: "stepInto\x0a\x09self shouldBeImplemented",
  1098. messageSends: ["shouldBeImplemented"],
  1099. referencedClasses: []
  1100. }),
  1101. smalltalk.ASTDebugger);
  1102. smalltalk.addMethod(
  1103. smalltalk.method({
  1104. selector: "stepOver",
  1105. category: 'stepping',
  1106. fn: function (){
  1107. var self=this;
  1108. return smalltalk.withContext(function($ctx1) {
  1109. _st(self._interpreter())._stepOver();
  1110. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  1111. args: [],
  1112. source: "stepOver\x0a\x09self interpreter stepOver",
  1113. messageSends: ["stepOver", "interpreter"],
  1114. referencedClasses: []
  1115. }),
  1116. smalltalk.ASTDebugger);
  1117. smalltalk.addMethod(
  1118. smalltalk.method({
  1119. selector: "context:",
  1120. category: 'instance creation',
  1121. fn: function (aContext){
  1122. var self=this;
  1123. return smalltalk.withContext(function($ctx1) {
  1124. var $2,$3,$1;
  1125. $2=self._new();
  1126. _st($2)._initializeWithContext_(aContext);
  1127. $3=_st($2)._yourself();
  1128. $1=$3;
  1129. return $1;
  1130. }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger.klass)})},
  1131. args: ["aContext"],
  1132. source: "context: aContext\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext;\x0a\x09\x09yourself",
  1133. messageSends: ["initializeWithContext:", "new", "yourself"],
  1134. referencedClasses: []
  1135. }),
  1136. smalltalk.ASTDebugger.klass);
  1137. smalltalk.addClass('ASTInterpreter', smalltalk.NodeVisitor, ['node', 'context', 'stack', 'returnValue', 'returned'], 'Compiler-Interpreter');
  1138. smalltalk.ASTInterpreter.comment="I visit an AST, interpreting (evaluating) nodes one after the other, using a small stack machine.\x0a\x0a## API\x0a\x0aWhile my instances should be used from within an `ASTDebugger`, which provides a more high level interface,\x0ayou can use methods from the `interpreting` protocol:\x0a\x0a- `#step` evaluates the current `node` only\x0a- `#stepOver` evaluates the AST from the current `node` up to the next stepping node (most likely the next send node)\x0a- `#proceed` evaluates eagerly the AST\x0a- `#restart` select the first node of the AST\x0a- `#skip` skips the current node, moving to the next one if any";
  1139. smalltalk.addMethod(
  1140. smalltalk.method({
  1141. selector: "assign:to:",
  1142. category: 'private',
  1143. fn: function (aNode,anObject){
  1144. var self=this;
  1145. return smalltalk.withContext(function($ctx1) {
  1146. var $1;
  1147. $1=_st(_st(aNode)._binding())._isInstanceVar();
  1148. if(smalltalk.assert($1)){
  1149. _st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  1150. } else {
  1151. _st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
  1152. };
  1153. return self}, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  1154. args: ["aNode", "anObject"],
  1155. 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 ]",
  1156. messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"],
  1157. referencedClasses: []
  1158. }),
  1159. smalltalk.ASTInterpreter);
  1160. smalltalk.addMethod(
  1161. smalltalk.method({
  1162. selector: "atEnd",
  1163. category: 'testing',
  1164. fn: function (){
  1165. var self=this;
  1166. return smalltalk.withContext(function($ctx1) {
  1167. var $1;
  1168. $1=_st(self._hasReturned())._or_((function(){
  1169. return smalltalk.withContext(function($ctx2) {
  1170. return _st(self._node())._isNil();
  1171. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1172. return $1;
  1173. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTInterpreter)})},
  1174. args: [],
  1175. source: "atEnd\x0a\x09^ self hasReturned or: [ self node isNil ]",
  1176. messageSends: ["or:", "hasReturned", "isNil", "node"],
  1177. referencedClasses: []
  1178. }),
  1179. smalltalk.ASTInterpreter);
  1180. smalltalk.addMethod(
  1181. smalltalk.method({
  1182. selector: "context",
  1183. category: 'accessing',
  1184. fn: function (){
  1185. var self=this;
  1186. return smalltalk.withContext(function($ctx1) {
  1187. var $1;
  1188. $1=self["@context"];
  1189. return $1;
  1190. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  1191. args: [],
  1192. source: "context\x0a\x09^ context",
  1193. messageSends: [],
  1194. referencedClasses: []
  1195. }),
  1196. smalltalk.ASTInterpreter);
  1197. smalltalk.addMethod(
  1198. smalltalk.method({
  1199. selector: "context:",
  1200. category: 'accessing',
  1201. fn: function (aContext){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) {
  1204. self["@context"]=aContext;
  1205. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1206. args: ["aContext"],
  1207. source: "context: aContext\x0a\x09context := aContext",
  1208. messageSends: [],
  1209. referencedClasses: []
  1210. }),
  1211. smalltalk.ASTInterpreter);
  1212. smalltalk.addMethod(
  1213. smalltalk.method({
  1214. selector: "eval:",
  1215. category: 'private',
  1216. fn: function (aString){
  1217. var self=this;
  1218. var source,function_;
  1219. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1220. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1221. return smalltalk.withContext(function($ctx1) {
  1222. var $1,$2,$3;
  1223. source=_st($String())._streamContents_((function(str){
  1224. return smalltalk.withContext(function($ctx2) {
  1225. _st(str)._nextPutAll_("(function(");
  1226. _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
  1227. return smalltalk.withContext(function($ctx3) {
  1228. return _st(str)._nextPutAll_(each);
  1229. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}),(function(){
  1230. return smalltalk.withContext(function($ctx3) {
  1231. return _st(str)._nextPutAll_(",");
  1232. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1233. $1=str;
  1234. _st($1)._nextPutAll_("){ return (function() {");
  1235. _st($1)._nextPutAll_(aString);
  1236. $2=_st($1)._nextPutAll_("})() })");
  1237. return $2;
  1238. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
  1239. function_=_st(_st($Compiler())._new())._eval_(source);
  1240. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
  1241. return $3;
  1242. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  1243. args: ["aString"],
  1244. 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",
  1245. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  1246. referencedClasses: ["String", "Compiler"]
  1247. }),
  1248. smalltalk.ASTInterpreter);
  1249. smalltalk.addMethod(
  1250. smalltalk.method({
  1251. selector: "hasReturned",
  1252. category: 'testing',
  1253. fn: function (){
  1254. var self=this;
  1255. return smalltalk.withContext(function($ctx1) {
  1256. var $2,$1;
  1257. $2=self["@returned"];
  1258. if(($receiver = $2) == nil || $receiver == undefined){
  1259. $1=false;
  1260. } else {
  1261. $1=$2;
  1262. };
  1263. return $1;
  1264. }, function($ctx1) {$ctx1.fill(self,"hasReturned",{},smalltalk.ASTInterpreter)})},
  1265. args: [],
  1266. source: "hasReturned\x0a\x09^ returned ifNil: [ false ]",
  1267. messageSends: ["ifNil:"],
  1268. referencedClasses: []
  1269. }),
  1270. smalltalk.ASTInterpreter);
  1271. smalltalk.addMethod(
  1272. smalltalk.method({
  1273. selector: "interpret",
  1274. category: 'interpreting',
  1275. fn: function (){
  1276. var self=this;
  1277. return smalltalk.withContext(function($ctx1) {
  1278. self._visit_(self._node());
  1279. return self}, function($ctx1) {$ctx1.fill(self,"interpret",{},smalltalk.ASTInterpreter)})},
  1280. args: [],
  1281. source: "interpret\x0a\x09\x22Interpret the next node to be evaluated\x22\x0a\x09\x0a\x09self visit: self node",
  1282. messageSends: ["visit:", "node"],
  1283. referencedClasses: []
  1284. }),
  1285. smalltalk.ASTInterpreter);
  1286. smalltalk.addMethod(
  1287. smalltalk.method({
  1288. selector: "interpret:",
  1289. category: 'interpreting',
  1290. fn: function (aNode){
  1291. var self=this;
  1292. return smalltalk.withContext(function($ctx1) {
  1293. self._node_(aNode);
  1294. self._interpret();
  1295. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1296. args: ["aNode"],
  1297. source: "interpret: aNode\x0a\x09self node: aNode.\x0a\x09self interpret",
  1298. messageSends: ["node:", "interpret"],
  1299. referencedClasses: []
  1300. }),
  1301. smalltalk.ASTInterpreter);
  1302. smalltalk.addMethod(
  1303. smalltalk.method({
  1304. selector: "messageFromSendNode:arguments:",
  1305. category: 'private',
  1306. fn: function (aSendNode,aCollection){
  1307. var self=this;
  1308. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1309. return smalltalk.withContext(function($ctx1) {
  1310. var $2,$3,$1;
  1311. $2=_st($Message())._new();
  1312. _st($2)._selector_(_st(aSendNode)._selector());
  1313. _st($2)._arguments_(aCollection);
  1314. $3=_st($2)._yourself();
  1315. $1=$3;
  1316. return $1;
  1317. }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  1318. args: ["aSendNode", "aCollection"],
  1319. source: "messageFromSendNode: aSendNode arguments: aCollection\x0a\x09^ Message new\x0a\x09\x09selector: aSendNode selector;\x0a\x09\x09arguments: aCollection;\x0a\x09\x09yourself",
  1320. messageSends: ["selector:", "new", "selector", "arguments:", "yourself"],
  1321. referencedClasses: ["Message"]
  1322. }),
  1323. smalltalk.ASTInterpreter);
  1324. smalltalk.addMethod(
  1325. smalltalk.method({
  1326. selector: "messageNotUnderstood:receiver:",
  1327. category: 'private',
  1328. fn: function (aMessage,anObject){
  1329. var self=this;
  1330. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1331. return smalltalk.withContext(function($ctx1) {
  1332. var $1,$2;
  1333. $1=_st($MessageNotUnderstood())._new();
  1334. _st($1)._meesage_(aMessage);
  1335. _st($1)._receiver_(anObject);
  1336. $2=_st($1)._signal();
  1337. return self}, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},smalltalk.ASTInterpreter)})},
  1338. args: ["aMessage", "anObject"],
  1339. source: "messageNotUnderstood: aMessage receiver: anObject\x0a\x09MessageNotUnderstood new\x0a\x09\x09meesage: aMessage;\x0a\x09\x09receiver: anObject;\x0a\x09\x09signal",
  1340. messageSends: ["meesage:", "new", "receiver:", "signal"],
  1341. referencedClasses: ["MessageNotUnderstood"]
  1342. }),
  1343. smalltalk.ASTInterpreter);
  1344. smalltalk.addMethod(
  1345. smalltalk.method({
  1346. selector: "next",
  1347. category: 'interpreting',
  1348. fn: function (){
  1349. var self=this;
  1350. return smalltalk.withContext(function($ctx1) {
  1351. self._node_(_st(self._node())._nextNode());
  1352. return self}, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.ASTInterpreter)})},
  1353. args: [],
  1354. source: "next\x0a\x09self node: self node nextNode",
  1355. messageSends: ["node:", "nextNode", "node"],
  1356. referencedClasses: []
  1357. }),
  1358. smalltalk.ASTInterpreter);
  1359. smalltalk.addMethod(
  1360. smalltalk.method({
  1361. selector: "node",
  1362. category: 'accessing',
  1363. fn: function (){
  1364. var self=this;
  1365. return smalltalk.withContext(function($ctx1) {
  1366. var $1;
  1367. $1=self["@node"];
  1368. return $1;
  1369. }, function($ctx1) {$ctx1.fill(self,"node",{},smalltalk.ASTInterpreter)})},
  1370. args: [],
  1371. source: "node\x0a\x09\x22Answer the next node, ie the node to be evaluated in the next step\x22\x0a\x09\x0a\x09^ node",
  1372. messageSends: [],
  1373. referencedClasses: []
  1374. }),
  1375. smalltalk.ASTInterpreter);
  1376. smalltalk.addMethod(
  1377. smalltalk.method({
  1378. selector: "node:",
  1379. category: 'accessing',
  1380. fn: function (aNode){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. self["@node"]=aNode;
  1384. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1385. args: ["aNode"],
  1386. source: "node: aNode\x0a\x09node := aNode",
  1387. messageSends: [],
  1388. referencedClasses: []
  1389. }),
  1390. smalltalk.ASTInterpreter);
  1391. smalltalk.addMethod(
  1392. smalltalk.method({
  1393. selector: "peek",
  1394. category: 'stack',
  1395. fn: function (){
  1396. var self=this;
  1397. return smalltalk.withContext(function($ctx1) {
  1398. var $1;
  1399. var $early={};
  1400. try {
  1401. _st(self._stack())._ifEmpty_((function(){
  1402. return smalltalk.withContext(function($ctx2) {
  1403. throw $early=[nil];
  1404. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1405. $1=_st(self._stack())._last();
  1406. return $1;
  1407. }
  1408. catch(e) {if(e===$early)return e[0]; throw e}
  1409. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.ASTInterpreter)})},
  1410. args: [],
  1411. 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",
  1412. messageSends: ["ifEmpty:", "stack", "last"],
  1413. referencedClasses: []
  1414. }),
  1415. smalltalk.ASTInterpreter);
  1416. smalltalk.addMethod(
  1417. smalltalk.method({
  1418. selector: "pop",
  1419. category: 'stack',
  1420. fn: function (){
  1421. var self=this;
  1422. var peekedValue;
  1423. return smalltalk.withContext(function($ctx1) {
  1424. var $1;
  1425. peekedValue=self._peek();
  1426. _st(self._stack())._removeLast();
  1427. $1=peekedValue;
  1428. return $1;
  1429. }, function($ctx1) {$ctx1.fill(self,"pop",{peekedValue:peekedValue},smalltalk.ASTInterpreter)})},
  1430. args: [],
  1431. 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",
  1432. messageSends: ["peek", "removeLast", "stack"],
  1433. referencedClasses: []
  1434. }),
  1435. smalltalk.ASTInterpreter);
  1436. smalltalk.addMethod(
  1437. smalltalk.method({
  1438. selector: "proceed",
  1439. category: 'interpreting',
  1440. fn: function (){
  1441. var self=this;
  1442. return smalltalk.withContext(function($ctx1) {
  1443. _st((function(){
  1444. return smalltalk.withContext(function($ctx2) {
  1445. return self._atEnd();
  1446. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1447. return smalltalk.withContext(function($ctx2) {
  1448. return self._step();
  1449. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1450. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTInterpreter)})},
  1451. args: [],
  1452. source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] whileFalse: [ \x0a\x09\x09self step ]",
  1453. messageSends: ["whileFalse:", "atEnd", "step"],
  1454. referencedClasses: []
  1455. }),
  1456. smalltalk.ASTInterpreter);
  1457. smalltalk.addMethod(
  1458. smalltalk.method({
  1459. selector: "push:",
  1460. category: 'stack',
  1461. fn: function (anObject){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) {
  1464. var $1;
  1465. $1=_st(self._stack())._add_(anObject);
  1466. return $1;
  1467. }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1468. args: ["anObject"],
  1469. source: "push: anObject\x0a\x09\x22Push an object to the context stack\x22\x0a\x09\x0a\x09^ self stack add: anObject",
  1470. messageSends: ["add:", "stack"],
  1471. referencedClasses: []
  1472. }),
  1473. smalltalk.ASTInterpreter);
  1474. smalltalk.addMethod(
  1475. smalltalk.method({
  1476. selector: "restart",
  1477. category: 'interpreting',
  1478. fn: function (){
  1479. var self=this;
  1480. return smalltalk.withContext(function($ctx1) {
  1481. self._node_(_st(_st(self._context())._ast())._nextChild());
  1482. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTInterpreter)})},
  1483. args: [],
  1484. source: "restart\x0a\x09self node: self context ast nextChild",
  1485. messageSends: ["node:", "nextChild", "ast", "context"],
  1486. referencedClasses: []
  1487. }),
  1488. smalltalk.ASTInterpreter);
  1489. smalltalk.addMethod(
  1490. smalltalk.method({
  1491. selector: "result",
  1492. category: 'accessing',
  1493. fn: function (){
  1494. var self=this;
  1495. return smalltalk.withContext(function($ctx1) {
  1496. var $2,$1;
  1497. $2=self._hasReturned();
  1498. if(smalltalk.assert($2)){
  1499. $1=self._returnValue();
  1500. } else {
  1501. $1=_st(self._context())._receiver();
  1502. };
  1503. return $1;
  1504. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1505. args: [],
  1506. source: "result\x0a\x09^ self hasReturned \x0a\x09\x09ifTrue: [ self returnValue ] \x0a\x09\x09ifFalse: [ self context receiver ]",
  1507. messageSends: ["ifTrue:ifFalse:", "hasReturned", "returnValue", "receiver", "context"],
  1508. referencedClasses: []
  1509. }),
  1510. smalltalk.ASTInterpreter);
  1511. smalltalk.addMethod(
  1512. smalltalk.method({
  1513. selector: "returnValue",
  1514. category: 'accessing',
  1515. fn: function (){
  1516. var self=this;
  1517. return smalltalk.withContext(function($ctx1) {
  1518. var $1;
  1519. $1=self["@returnValue"];
  1520. return $1;
  1521. }, function($ctx1) {$ctx1.fill(self,"returnValue",{},smalltalk.ASTInterpreter)})},
  1522. args: [],
  1523. source: "returnValue\x0a\x09^ returnValue",
  1524. messageSends: [],
  1525. referencedClasses: []
  1526. }),
  1527. smalltalk.ASTInterpreter);
  1528. smalltalk.addMethod(
  1529. smalltalk.method({
  1530. selector: "returnValue:",
  1531. category: 'accessing',
  1532. fn: function (anObject){
  1533. var self=this;
  1534. return smalltalk.withContext(function($ctx1) {
  1535. self["@returnValue"]=anObject;
  1536. return self}, function($ctx1) {$ctx1.fill(self,"returnValue:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1537. args: ["anObject"],
  1538. source: "returnValue: anObject\x0a\x09returnValue := anObject",
  1539. messageSends: [],
  1540. referencedClasses: []
  1541. }),
  1542. smalltalk.ASTInterpreter);
  1543. smalltalk.addMethod(
  1544. smalltalk.method({
  1545. selector: "sendMessage:to:superSend:",
  1546. category: 'private',
  1547. fn: function (aMessage,anObject,aBoolean){
  1548. var self=this;
  1549. var method;
  1550. return smalltalk.withContext(function($ctx1) {
  1551. var $1,$2,$3,$4,$5,$6;
  1552. var $early={};
  1553. try {
  1554. $1=aBoolean;
  1555. if(! smalltalk.assert($1)){
  1556. $2=_st(aMessage)._sendTo_(anObject);
  1557. return $2;
  1558. };
  1559. $3=_st(_st(anObject)._class())._superclass();
  1560. if(($receiver = $3) == nil || $receiver == undefined){
  1561. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1562. return $4;
  1563. } else {
  1564. $3;
  1565. };
  1566. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1567. return smalltalk.withContext(function($ctx2) {
  1568. $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1569. throw $early=[$5];
  1570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  1571. $6=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
  1572. return $6;
  1573. }
  1574. catch(e) {if(e===$early)return e[0]; throw e}
  1575. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1576. args: ["aMessage", "anObject", "aBoolean"],
  1577. 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",
  1578. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "sendTo:arguments:", "arguments"],
  1579. referencedClasses: []
  1580. }),
  1581. smalltalk.ASTInterpreter);
  1582. smalltalk.addMethod(
  1583. smalltalk.method({
  1584. selector: "setNonLocalReturnFromContext:",
  1585. category: 'interpreting',
  1586. fn: function (aContext){
  1587. var self=this;
  1588. return smalltalk.withContext(function($ctx1) {
  1589. var $1;
  1590. $1=_st(_st(aContext)._interpreter())._hasReturned();
  1591. if(smalltalk.assert($1)){
  1592. self["@returned"]=true;
  1593. self["@returned"];
  1594. self._returnValue_(_st(_st(aContext)._interpreter())._returnValue());
  1595. };
  1596. return self}, function($ctx1) {$ctx1.fill(self,"setNonLocalReturnFromContext:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1597. args: ["aContext"],
  1598. source: "setNonLocalReturnFromContext: aContext\x0a\x09aContext interpreter hasReturned ifTrue: [\x0a\x09\x09returned := true.\x0a\x09\x09self returnValue: aContext interpreter returnValue ]",
  1599. messageSends: ["ifTrue:", "hasReturned", "interpreter", "returnValue:", "returnValue"],
  1600. referencedClasses: []
  1601. }),
  1602. smalltalk.ASTInterpreter);
  1603. smalltalk.addMethod(
  1604. smalltalk.method({
  1605. selector: "skip",
  1606. category: 'interpreting',
  1607. fn: function (){
  1608. var self=this;
  1609. return smalltalk.withContext(function($ctx1) {
  1610. self._next();
  1611. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.ASTInterpreter)})},
  1612. args: [],
  1613. source: "skip\x0a\x09self next",
  1614. messageSends: ["next"],
  1615. referencedClasses: []
  1616. }),
  1617. smalltalk.ASTInterpreter);
  1618. smalltalk.addMethod(
  1619. smalltalk.method({
  1620. selector: "stack",
  1621. category: 'accessing',
  1622. fn: function (){
  1623. var self=this;
  1624. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1625. return smalltalk.withContext(function($ctx1) {
  1626. var $2,$1;
  1627. $2=self["@stack"];
  1628. if(($receiver = $2) == nil || $receiver == undefined){
  1629. self["@stack"]=_st($OrderedCollection())._new();
  1630. $1=self["@stack"];
  1631. } else {
  1632. $1=$2;
  1633. };
  1634. return $1;
  1635. }, function($ctx1) {$ctx1.fill(self,"stack",{},smalltalk.ASTInterpreter)})},
  1636. args: [],
  1637. source: "stack\x0a\x09^ stack ifNil: [ stack := OrderedCollection new ]",
  1638. messageSends: ["ifNil:", "new"],
  1639. referencedClasses: ["OrderedCollection"]
  1640. }),
  1641. smalltalk.ASTInterpreter);
  1642. smalltalk.addMethod(
  1643. smalltalk.method({
  1644. selector: "step",
  1645. category: 'interpreting',
  1646. fn: function (){
  1647. var self=this;
  1648. return smalltalk.withContext(function($ctx1) {
  1649. var $1,$2;
  1650. $1=self;
  1651. _st($1)._interpret();
  1652. $2=_st($1)._next();
  1653. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTInterpreter)})},
  1654. args: [],
  1655. source: "step\x0a\x09self \x0a\x09\x09interpret; \x0a\x09\x09next",
  1656. messageSends: ["interpret", "next"],
  1657. referencedClasses: []
  1658. }),
  1659. smalltalk.ASTInterpreter);
  1660. smalltalk.addMethod(
  1661. smalltalk.method({
  1662. selector: "stepOver",
  1663. category: 'interpreting',
  1664. fn: function (){
  1665. var self=this;
  1666. return smalltalk.withContext(function($ctx1) {
  1667. self._step();
  1668. _st((function(){
  1669. return smalltalk.withContext(function($ctx2) {
  1670. return _st(self._node())._isSteppingNode();
  1671. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1672. return smalltalk.withContext(function($ctx2) {
  1673. return self._step();
  1674. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1675. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTInterpreter)})},
  1676. args: [],
  1677. source: "stepOver\x0a\x09self step.\x0a\x09\x0a\x09[ self node isSteppingNode ] whileFalse: [ \x0a\x09\x09self step ]",
  1678. messageSends: ["step", "whileFalse:", "isSteppingNode", "node"],
  1679. referencedClasses: []
  1680. }),
  1681. smalltalk.ASTInterpreter);
  1682. smalltalk.addMethod(
  1683. smalltalk.method({
  1684. selector: "visit:",
  1685. category: 'visiting',
  1686. fn: function (aNode){
  1687. var self=this;
  1688. return smalltalk.withContext(function($ctx1) {
  1689. var $1;
  1690. $1=self._hasReturned();
  1691. if(! smalltalk.assert($1)){
  1692. smalltalk.ASTInterpreter.superclass.fn.prototype._visit_.apply(_st(self), [aNode]);
  1693. };
  1694. return self}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1695. args: ["aNode"],
  1696. source: "visit: aNode\x0a\x09self hasReturned ifFalse: [ super visit: aNode ]",
  1697. messageSends: ["ifFalse:", "hasReturned", "visit:"],
  1698. referencedClasses: []
  1699. }),
  1700. smalltalk.ASTInterpreter);
  1701. smalltalk.addMethod(
  1702. smalltalk.method({
  1703. selector: "visitAssignmentNode:",
  1704. category: 'visiting',
  1705. fn: function (aNode){
  1706. var self=this;
  1707. var poppedValue;
  1708. return smalltalk.withContext(function($ctx1) {
  1709. poppedValue=self._pop();
  1710. self._pop();
  1711. self._push_(poppedValue);
  1712. self._assign_to_(_st(aNode)._left(),poppedValue);
  1713. return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,poppedValue:poppedValue},smalltalk.ASTInterpreter)})},
  1714. args: ["aNode"],
  1715. 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",
  1716. messageSends: ["pop", "push:", "assign:to:", "left"],
  1717. referencedClasses: []
  1718. }),
  1719. smalltalk.ASTInterpreter);
  1720. smalltalk.addMethod(
  1721. smalltalk.method({
  1722. selector: "visitBlockNode:",
  1723. category: 'visiting',
  1724. fn: function (aNode){
  1725. var self=this;
  1726. var block;
  1727. function $AIBlockClosure(){return smalltalk.AIBlockClosure||(typeof AIBlockClosure=="undefined"?nil:AIBlockClosure)}
  1728. return smalltalk.withContext(function($ctx1) {
  1729. block=_st($AIBlockClosure())._forContext_node_(self._context(),aNode);
  1730. self._push_(block);
  1731. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,block:block},smalltalk.ASTInterpreter)})},
  1732. args: ["aNode"],
  1733. 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",
  1734. messageSends: ["forContext:node:", "context", "push:"],
  1735. referencedClasses: ["AIBlockClosure"]
  1736. }),
  1737. smalltalk.ASTInterpreter);
  1738. smalltalk.addMethod(
  1739. smalltalk.method({
  1740. selector: "visitClassReferenceNode:",
  1741. category: 'visiting',
  1742. fn: function (aNode){
  1743. var self=this;
  1744. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1745. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1746. return smalltalk.withContext(function($ctx1) {
  1747. self._push_(_st(_st($Smalltalk())._current())._at_ifAbsent_(_st(aNode)._value(),(function(){
  1748. return smalltalk.withContext(function($ctx2) {
  1749. return _st(_st($PlatformInterface())._globals())._at_(_st(aNode)._value());
  1750. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})));
  1751. return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1752. args: ["aNode"],
  1753. source: "visitClassReferenceNode: aNode\x0a\x09self push: (Smalltalk current \x0a\x09\x09at: aNode value \x0a\x09\x09ifAbsent: [ PlatformInterface globals at: aNode value ])",
  1754. messageSends: ["push:", "at:ifAbsent:", "current", "value", "at:", "globals"],
  1755. referencedClasses: ["Smalltalk", "PlatformInterface"]
  1756. }),
  1757. smalltalk.ASTInterpreter);
  1758. smalltalk.addMethod(
  1759. smalltalk.method({
  1760. selector: "visitDynamicArrayNode:",
  1761. category: 'visiting',
  1762. fn: function (aNode){
  1763. var self=this;
  1764. var array;
  1765. return smalltalk.withContext(function($ctx1) {
  1766. array=[];
  1767. _st(_st(aNode)._nodes())._do_((function(each){
  1768. return smalltalk.withContext(function($ctx2) {
  1769. return _st(array)._addFirst_(self._pop());
  1770. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1771. self._push_(array);
  1772. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.ASTInterpreter)})},
  1773. args: ["aNode"],
  1774. 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",
  1775. messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"],
  1776. referencedClasses: []
  1777. }),
  1778. smalltalk.ASTInterpreter);
  1779. smalltalk.addMethod(
  1780. smalltalk.method({
  1781. selector: "visitDynamicDictionaryNode:",
  1782. category: 'visiting',
  1783. fn: function (aNode){
  1784. var self=this;
  1785. var associations,hashedCollection;
  1786. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1787. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1788. return smalltalk.withContext(function($ctx1) {
  1789. associations=_st($OrderedCollection())._new();
  1790. hashedCollection=_st($HashedCollection())._new();
  1791. _st(_st(aNode)._nodes())._do_((function(each){
  1792. return smalltalk.withContext(function($ctx2) {
  1793. return _st(associations)._add_(self._pop());
  1794. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1795. _st(_st(associations)._reversed())._do_((function(each){
  1796. return smalltalk.withContext(function($ctx2) {
  1797. return _st(hashedCollection)._add_(each);
  1798. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  1799. self._push_(hashedCollection);
  1800. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,associations:associations,hashedCollection:hashedCollection},smalltalk.ASTInterpreter)})},
  1801. args: ["aNode"],
  1802. 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",
  1803. messageSends: ["new", "do:", "nodes", "add:", "pop", "reversed", "push:"],
  1804. referencedClasses: ["OrderedCollection", "HashedCollection"]
  1805. }),
  1806. smalltalk.ASTInterpreter);
  1807. smalltalk.addMethod(
  1808. smalltalk.method({
  1809. selector: "visitJSStatementNode:",
  1810. category: 'visiting',
  1811. fn: function (aNode){
  1812. var self=this;
  1813. return smalltalk.withContext(function($ctx1) {
  1814. self["@returned"]=true;
  1815. self._returnValue_(self._eval_(_st(aNode)._source()));
  1816. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1817. args: ["aNode"],
  1818. source: "visitJSStatementNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: (self eval: aNode source)",
  1819. messageSends: ["returnValue:", "eval:", "source"],
  1820. referencedClasses: []
  1821. }),
  1822. smalltalk.ASTInterpreter);
  1823. smalltalk.addMethod(
  1824. smalltalk.method({
  1825. selector: "visitNode:",
  1826. category: 'visiting',
  1827. fn: function (aNode){
  1828. var self=this;
  1829. return smalltalk.withContext(function($ctx1) {
  1830. return self}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1831. args: ["aNode"],
  1832. source: "visitNode: aNode\x0a\x09\x22Do nothing by default. Especially, do not visit children recursively.\x22",
  1833. messageSends: [],
  1834. referencedClasses: []
  1835. }),
  1836. smalltalk.ASTInterpreter);
  1837. smalltalk.addMethod(
  1838. smalltalk.method({
  1839. selector: "visitReturnNode:",
  1840. category: 'visiting',
  1841. fn: function (aNode){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) {
  1844. self["@returned"]=true;
  1845. self._returnValue_(self._pop());
  1846. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1847. args: ["aNode"],
  1848. source: "visitReturnNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: self pop",
  1849. messageSends: ["returnValue:", "pop"],
  1850. referencedClasses: []
  1851. }),
  1852. smalltalk.ASTInterpreter);
  1853. smalltalk.addMethod(
  1854. smalltalk.method({
  1855. selector: "visitSendNode:",
  1856. category: 'visiting',
  1857. fn: function (aNode){
  1858. var self=this;
  1859. var receiver,args,message,result;
  1860. return smalltalk.withContext(function($ctx1) {
  1861. var $1;
  1862. args=_st(_st(aNode)._arguments())._collect_((function(each){
  1863. return smalltalk.withContext(function($ctx2) {
  1864. return self._pop();
  1865. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1866. receiver=self._pop();
  1867. message=self._messageFromSendNode_arguments_(aNode,_st(args)._reversed());
  1868. result=self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend());
  1869. _st(self._context())._pc_(_st(_st(self._context())._pc()).__plus((1)));
  1870. $1=_st(_st(aNode)._isCascadeSendNode())._and_((function(){
  1871. return smalltalk.withContext(function($ctx2) {
  1872. return _st(_st(aNode)._isLastChild())._not();
  1873. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1874. if(smalltalk.assert($1)){
  1875. self._push_(receiver);
  1876. } else {
  1877. self._push_(result);
  1878. };
  1879. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},smalltalk.ASTInterpreter)})},
  1880. args: ["aNode"],
  1881. 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 ]",
  1882. messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "pc:", "context", "+", "pc", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"],
  1883. referencedClasses: []
  1884. }),
  1885. smalltalk.ASTInterpreter);
  1886. smalltalk.addMethod(
  1887. smalltalk.method({
  1888. selector: "visitValueNode:",
  1889. category: 'visiting',
  1890. fn: function (aNode){
  1891. var self=this;
  1892. return smalltalk.withContext(function($ctx1) {
  1893. self._push_(_st(aNode)._value());
  1894. return self}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1895. args: ["aNode"],
  1896. source: "visitValueNode: aNode\x0a\x09self push: aNode value",
  1897. messageSends: ["push:", "value"],
  1898. referencedClasses: []
  1899. }),
  1900. smalltalk.ASTInterpreter);
  1901. smalltalk.addMethod(
  1902. smalltalk.method({
  1903. selector: "visitVariableNode:",
  1904. category: 'visiting',
  1905. fn: function (aNode){
  1906. var self=this;
  1907. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1908. return smalltalk.withContext(function($ctx1) {
  1909. var $1,$2,$3,$5,$4;
  1910. $1=_st(_st(aNode)._binding())._isUnknownVar();
  1911. if(smalltalk.assert($1)){
  1912. $2=self._push_(_st(_st($PlatformInterface())._globals())._at_ifAbsent_(_st(aNode)._value(),(function(){
  1913. return smalltalk.withContext(function($ctx2) {
  1914. return self._error_("Unknown variable");
  1915. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})));
  1916. return $2;
  1917. };
  1918. $3=self;
  1919. $5=_st(_st(aNode)._binding())._isInstanceVar();
  1920. if(smalltalk.assert($5)){
  1921. $4=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
  1922. } else {
  1923. $4=_st(self._context())._localAt_(_st(aNode)._value());
  1924. };
  1925. _st($3)._push_($4);
  1926. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1927. args: ["aNode"],
  1928. 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 ])",
  1929. messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "globals", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:"],
  1930. referencedClasses: ["PlatformInterface"]
  1931. }),
  1932. smalltalk.ASTInterpreter);
  1933. smalltalk.addClass('ASTInterpreterError', smalltalk.Error, [], 'Compiler-Interpreter');
  1934. smalltalk.ASTInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
  1935. smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['useInlinings', 'pc', 'context', 'blockIndex', 'currentNode'], 'Compiler-Interpreter');
  1936. 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`";
  1937. smalltalk.addMethod(
  1938. smalltalk.method({
  1939. selector: "blockIndex",
  1940. category: 'accessing',
  1941. fn: function (){
  1942. var self=this;
  1943. return smalltalk.withContext(function($ctx1) {
  1944. var $2,$1;
  1945. $2=self["@blockIndex"];
  1946. if(($receiver = $2) == nil || $receiver == undefined){
  1947. self["@blockIndex"]=(0);
  1948. $1=self["@blockIndex"];
  1949. } else {
  1950. $1=$2;
  1951. };
  1952. return $1;
  1953. }, function($ctx1) {$ctx1.fill(self,"blockIndex",{},smalltalk.ASTPCNodeVisitor)})},
  1954. args: [],
  1955. source: "blockIndex\x0a\x09^ blockIndex ifNil: [ blockIndex := 0 ]",
  1956. messageSends: ["ifNil:"],
  1957. referencedClasses: []
  1958. }),
  1959. smalltalk.ASTPCNodeVisitor);
  1960. smalltalk.addMethod(
  1961. smalltalk.method({
  1962. selector: "context",
  1963. category: 'accessing',
  1964. fn: function (){
  1965. var self=this;
  1966. return smalltalk.withContext(function($ctx1) {
  1967. var $1;
  1968. $1=self["@context"];
  1969. return $1;
  1970. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTPCNodeVisitor)})},
  1971. args: [],
  1972. source: "context\x0a\x09^ context",
  1973. messageSends: [],
  1974. referencedClasses: []
  1975. }),
  1976. smalltalk.ASTPCNodeVisitor);
  1977. smalltalk.addMethod(
  1978. smalltalk.method({
  1979. selector: "context:",
  1980. category: 'accessing',
  1981. fn: function (aContext){
  1982. var self=this;
  1983. return smalltalk.withContext(function($ctx1) {
  1984. self["@context"]=aContext;
  1985. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTPCNodeVisitor)})},
  1986. args: ["aContext"],
  1987. source: "context: aContext\x0a\x09context := aContext",
  1988. messageSends: [],
  1989. referencedClasses: []
  1990. }),
  1991. smalltalk.ASTPCNodeVisitor);
  1992. smalltalk.addMethod(
  1993. smalltalk.method({
  1994. selector: "currentNode",
  1995. category: 'accessing',
  1996. fn: function (){
  1997. var self=this;
  1998. return smalltalk.withContext(function($ctx1) {
  1999. var $1;
  2000. $1=self["@currentNode"];
  2001. return $1;
  2002. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTPCNodeVisitor)})},
  2003. args: [],
  2004. source: "currentNode\x0a\x09^ currentNode",
  2005. messageSends: [],
  2006. referencedClasses: []
  2007. }),
  2008. smalltalk.ASTPCNodeVisitor);
  2009. smalltalk.addMethod(
  2010. smalltalk.method({
  2011. selector: "increaseBlockIndex",
  2012. category: 'accessing',
  2013. fn: function (){
  2014. var self=this;
  2015. return smalltalk.withContext(function($ctx1) {
  2016. self["@blockIndex"]=_st(self._blockIndex()).__plus((1));
  2017. return self}, function($ctx1) {$ctx1.fill(self,"increaseBlockIndex",{},smalltalk.ASTPCNodeVisitor)})},
  2018. args: [],
  2019. source: "increaseBlockIndex\x0a\x09blockIndex := self blockIndex + 1",
  2020. messageSends: ["+", "blockIndex"],
  2021. referencedClasses: []
  2022. }),
  2023. smalltalk.ASTPCNodeVisitor);
  2024. smalltalk.addMethod(
  2025. smalltalk.method({
  2026. selector: "pc",
  2027. category: 'accessing',
  2028. fn: function (){
  2029. var self=this;
  2030. return smalltalk.withContext(function($ctx1) {
  2031. var $2,$1;
  2032. $2=self["@pc"];
  2033. if(($receiver = $2) == nil || $receiver == undefined){
  2034. $1=(0);
  2035. } else {
  2036. $1=$2;
  2037. };
  2038. return $1;
  2039. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.ASTPCNodeVisitor)})},
  2040. args: [],
  2041. source: "pc\x0a\x09^ pc ifNil: [ 0 ]",
  2042. messageSends: ["ifNil:"],
  2043. referencedClasses: []
  2044. }),
  2045. smalltalk.ASTPCNodeVisitor);
  2046. smalltalk.addMethod(
  2047. smalltalk.method({
  2048. selector: "pc:",
  2049. category: 'accessing',
  2050. fn: function (anInteger){
  2051. var self=this;
  2052. return smalltalk.withContext(function($ctx1) {
  2053. self["@pc"]=anInteger;
  2054. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.ASTPCNodeVisitor)})},
  2055. args: ["anInteger"],
  2056. source: "pc: anInteger\x0a\x09pc := anInteger",
  2057. messageSends: [],
  2058. referencedClasses: []
  2059. }),
  2060. smalltalk.ASTPCNodeVisitor);
  2061. smalltalk.addMethod(
  2062. smalltalk.method({
  2063. selector: "useInlinings",
  2064. category: 'accessing',
  2065. fn: function (){
  2066. var self=this;
  2067. return smalltalk.withContext(function($ctx1) {
  2068. var $2,$1;
  2069. $2=self["@useInlinings"];
  2070. if(($receiver = $2) == nil || $receiver == undefined){
  2071. $1=true;
  2072. } else {
  2073. $1=$2;
  2074. };
  2075. return $1;
  2076. }, function($ctx1) {$ctx1.fill(self,"useInlinings",{},smalltalk.ASTPCNodeVisitor)})},
  2077. args: [],
  2078. source: "useInlinings\x0a\x09^ useInlinings ifNil: [ true ]",
  2079. messageSends: ["ifNil:"],
  2080. referencedClasses: []
  2081. }),
  2082. smalltalk.ASTPCNodeVisitor);
  2083. smalltalk.addMethod(
  2084. smalltalk.method({
  2085. selector: "useInlinings:",
  2086. category: 'accessing',
  2087. fn: function (aBoolean){
  2088. var self=this;
  2089. return smalltalk.withContext(function($ctx1) {
  2090. self["@useInlinings"]=aBoolean;
  2091. return self}, function($ctx1) {$ctx1.fill(self,"useInlinings:",{aBoolean:aBoolean},smalltalk.ASTPCNodeVisitor)})},
  2092. args: ["aBoolean"],
  2093. source: "useInlinings: aBoolean\x0a\x09useInlinings := aBoolean",
  2094. messageSends: [],
  2095. referencedClasses: []
  2096. }),
  2097. smalltalk.ASTPCNodeVisitor);
  2098. smalltalk.addMethod(
  2099. smalltalk.method({
  2100. selector: "visitBlockNode:",
  2101. category: 'visiting',
  2102. fn: function (aNode){
  2103. var self=this;
  2104. return smalltalk.withContext(function($ctx1) {
  2105. var $1,$2;
  2106. $1=_st(_st(_st(aNode)._parent())._isSendNode())._and_((function(){
  2107. return smalltalk.withContext(function($ctx2) {
  2108. return _st(_st(aNode)._parent())._shouldBeInlined();
  2109. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2110. if(smalltalk.assert($1)){
  2111. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  2112. } else {
  2113. $2=_st(self._blockIndex()).__gt_eq(_st(self._context())._index());
  2114. if(! smalltalk.assert($2)){
  2115. self._increaseBlockIndex();
  2116. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  2117. };
  2118. };
  2119. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2120. args: ["aNode"],
  2121. 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 ]",
  2122. messageSends: ["ifFalse:ifTrue:", "and:", "isSendNode", "parent", "shouldBeInlined", "ifFalse:", ">=", "blockIndex", "index", "context", "increaseBlockIndex", "visitBlockNode:"],
  2123. referencedClasses: []
  2124. }),
  2125. smalltalk.ASTPCNodeVisitor);
  2126. smalltalk.addMethod(
  2127. smalltalk.method({
  2128. selector: "visitJSStatementNode:",
  2129. category: 'visiting',
  2130. fn: function (aNode){
  2131. var self=this;
  2132. return smalltalk.withContext(function($ctx1) {
  2133. self["@currentNode"]=aNode;
  2134. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2135. args: ["aNode"],
  2136. source: "visitJSStatementNode: aNode\x0a\x09currentNode := aNode",
  2137. messageSends: [],
  2138. referencedClasses: []
  2139. }),
  2140. smalltalk.ASTPCNodeVisitor);
  2141. smalltalk.addMethod(
  2142. smalltalk.method({
  2143. selector: "visitSendNode:",
  2144. category: 'visiting',
  2145. fn: function (aNode){
  2146. var self=this;
  2147. return smalltalk.withContext(function($ctx1) {
  2148. var $1,$2,$3;
  2149. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  2150. $1=_st(self._pc()).__eq(_st(self._context())._pc());
  2151. if(! smalltalk.assert($1)){
  2152. $2=_st(aNode)._shouldBeInlined();
  2153. if(! smalltalk.assert($2)){
  2154. $3=_st(self._blockIndex()).__eq(_st(self._context())._index());
  2155. if(smalltalk.assert($3)){
  2156. self._pc_(_st(self._pc()).__plus((1)));
  2157. self["@currentNode"]=aNode;
  2158. self["@currentNode"];
  2159. };
  2160. };
  2161. };
  2162. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2163. args: ["aNode"],
  2164. 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 ] ] ]",
  2165. messageSends: ["visitSendNode:", "ifFalse:", "=", "pc", "context", "shouldBeInlined", "ifTrue:", "blockIndex", "index", "pc:", "+"],
  2166. referencedClasses: []
  2167. }),
  2168. smalltalk.ASTPCNodeVisitor);
  2169. smalltalk.addMethod(
  2170. smalltalk.method({
  2171. selector: "isSteppingNode",
  2172. category: '*Compiler-Interpreter',
  2173. fn: function (){
  2174. var self=this;
  2175. return smalltalk.withContext(function($ctx1) {
  2176. return false;
  2177. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  2178. args: [],
  2179. source: "isSteppingNode\x0a\x09^ false",
  2180. messageSends: [],
  2181. referencedClasses: []
  2182. }),
  2183. smalltalk.Node);
  2184. smalltalk.addMethod(
  2185. smalltalk.method({
  2186. selector: "isSteppingNode",
  2187. category: '*Compiler-Interpreter',
  2188. fn: function (){
  2189. var self=this;
  2190. return smalltalk.withContext(function($ctx1) {
  2191. return true;
  2192. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  2193. args: [],
  2194. source: "isSteppingNode\x0a\x09^ true",
  2195. messageSends: [],
  2196. referencedClasses: []
  2197. }),
  2198. smalltalk.AssignmentNode);
  2199. smalltalk.addMethod(
  2200. smalltalk.method({
  2201. selector: "isSteppingNode",
  2202. category: '*Compiler-Interpreter',
  2203. fn: function (){
  2204. var self=this;
  2205. return smalltalk.withContext(function($ctx1) {
  2206. return true;
  2207. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
  2208. args: [],
  2209. source: "isSteppingNode\x0a\x09^ true",
  2210. messageSends: [],
  2211. referencedClasses: []
  2212. }),
  2213. smalltalk.BlockNode);
  2214. smalltalk.addMethod(
  2215. smalltalk.method({
  2216. selector: "isSteppingNode",
  2217. category: '*Compiler-Interpreter',
  2218. fn: function (){
  2219. var self=this;
  2220. return smalltalk.withContext(function($ctx1) {
  2221. return true;
  2222. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  2223. args: [],
  2224. source: "isSteppingNode\x0a\x09^ true",
  2225. messageSends: [],
  2226. referencedClasses: []
  2227. }),
  2228. smalltalk.DynamicArrayNode);
  2229. smalltalk.addMethod(
  2230. smalltalk.method({
  2231. selector: "isSteppingNode",
  2232. category: '*Compiler-Interpreter',
  2233. fn: function (){
  2234. var self=this;
  2235. return smalltalk.withContext(function($ctx1) {
  2236. return true;
  2237. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
  2238. args: [],
  2239. source: "isSteppingNode\x0a\x09^ true",
  2240. messageSends: [],
  2241. referencedClasses: []
  2242. }),
  2243. smalltalk.DynamicDictionaryNode);
  2244. smalltalk.addMethod(
  2245. smalltalk.method({
  2246. selector: "isSteppingNode",
  2247. category: '*Compiler-Interpreter',
  2248. fn: function (){
  2249. var self=this;
  2250. return smalltalk.withContext(function($ctx1) {
  2251. return true;
  2252. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
  2253. args: [],
  2254. source: "isSteppingNode\x0a\x09^ true",
  2255. messageSends: [],
  2256. referencedClasses: []
  2257. }),
  2258. smalltalk.JSStatementNode);
  2259. smalltalk.addMethod(
  2260. smalltalk.method({
  2261. selector: "isSteppingNode",
  2262. category: '*Compiler-Interpreter',
  2263. fn: function (){
  2264. var self=this;
  2265. return smalltalk.withContext(function($ctx1) {
  2266. return true;
  2267. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  2268. args: [],
  2269. source: "isSteppingNode\x0a\x09^ true",
  2270. messageSends: [],
  2271. referencedClasses: []
  2272. }),
  2273. smalltalk.SendNode);
  2274. });