Compiler-Interpreter.js 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398
  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 == null){
  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 == null){
  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 == null){
  363. $3;
  364. } else {
  365. var outer;
  366. outer=$receiver;
  367. $4=_st(outer)._methodContext();
  368. if(($receiver = $4) == nil || $receiver == null){
  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;
  394. $1=_st($ASTInterpreter())._new();
  395. _st($1)._context_(self);
  396. _st($1)._node_(self._retrieveNode());
  397. $2=_st($1)._yourself();
  398. self["@interpreter"]=$2;
  399. $3=_st(_st(self._innerContext())._notNil())._and_((function(){
  400. return smalltalk.withContext(function($ctx2) {
  401. return _st(_st(self._innerContext())._isBlockContext())._not();
  402. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  403. if(smalltalk.assert($3)){
  404. self._setupInterpreter_(self["@interpreter"]);
  405. };
  406. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.AIContext)})},
  407. args: [],
  408. source: "initializeInterpreter\x0a\x09interpreter := ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09node: self retrieveNode;\x0a\x09\x09yourself.\x0a\x09\x0a\x09(self innerContext notNil and: [ \x0a\x09\x09self innerContext isBlockContext not ]) ifTrue: [\x0a\x09\x09\x09self setupInterpreter: interpreter ]",
  409. messageSends: ["context:", "new", "node:", "retrieveNode", "yourself", "ifTrue:", "and:", "notNil", "innerContext", "not", "isBlockContext", "setupInterpreter:"],
  410. referencedClasses: ["ASTInterpreter"]
  411. }),
  412. smalltalk.AIContext);
  413. smalltalk.addMethod(
  414. smalltalk.method({
  415. selector: "initializeLocals",
  416. category: 'initialization',
  417. fn: function (){
  418. var self=this;
  419. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  420. return smalltalk.withContext(function($ctx1) {
  421. self["@locals"]=_st($Dictionary())._new();
  422. _st(self["@locals"])._at_put_("thisContext",self);
  423. return self}, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},smalltalk.AIContext)})},
  424. args: [],
  425. source: "initializeLocals\x0a\x09locals := Dictionary new.\x0a\x09locals at: 'thisContext' put: self.",
  426. messageSends: ["new", "at:put:"],
  427. referencedClasses: ["Dictionary"]
  428. }),
  429. smalltalk.AIContext);
  430. smalltalk.addMethod(
  431. smalltalk.method({
  432. selector: "innerContext",
  433. category: 'accessing',
  434. fn: function (){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx1) {
  437. var $1;
  438. $1=self["@innerContext"];
  439. return $1;
  440. }, function($ctx1) {$ctx1.fill(self,"innerContext",{},smalltalk.AIContext)})},
  441. args: [],
  442. source: "innerContext\x0a\x09^ innerContext",
  443. messageSends: [],
  444. referencedClasses: []
  445. }),
  446. smalltalk.AIContext);
  447. smalltalk.addMethod(
  448. smalltalk.method({
  449. selector: "innerContext:",
  450. category: 'accessing',
  451. fn: function (anAIContext){
  452. var self=this;
  453. return smalltalk.withContext(function($ctx1) {
  454. self["@innerContext"]=anAIContext;
  455. return self}, function($ctx1) {$ctx1.fill(self,"innerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  456. args: ["anAIContext"],
  457. source: "innerContext: anAIContext\x0a\x09innerContext := anAIContext",
  458. messageSends: [],
  459. referencedClasses: []
  460. }),
  461. smalltalk.AIContext);
  462. smalltalk.addMethod(
  463. smalltalk.method({
  464. selector: "interpreter",
  465. category: 'interpreting',
  466. fn: function (){
  467. var self=this;
  468. return smalltalk.withContext(function($ctx1) {
  469. var $1,$2;
  470. $1=self["@interpreter"];
  471. if(($receiver = $1) == nil || $receiver == null){
  472. self._initializeInterpreter();
  473. } else {
  474. $1;
  475. };
  476. $2=self["@interpreter"];
  477. return $2;
  478. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.AIContext)})},
  479. args: [],
  480. source: "interpreter\x0a\x09interpreter ifNil: [ self initializeInterpreter ].\x0a\x09^ interpreter",
  481. messageSends: ["ifNil:", "initializeInterpreter"],
  482. referencedClasses: []
  483. }),
  484. smalltalk.AIContext);
  485. smalltalk.addMethod(
  486. smalltalk.method({
  487. selector: "interpreter:",
  488. category: 'interpreting',
  489. fn: function (anInterpreter){
  490. var self=this;
  491. return smalltalk.withContext(function($ctx1) {
  492. self["@interpreter"]=anInterpreter;
  493. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.AIContext)})},
  494. args: ["anInterpreter"],
  495. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  496. messageSends: [],
  497. referencedClasses: []
  498. }),
  499. smalltalk.AIContext);
  500. smalltalk.addMethod(
  501. smalltalk.method({
  502. selector: "isBlockContext",
  503. category: 'testing',
  504. fn: function (){
  505. var self=this;
  506. return smalltalk.withContext(function($ctx1) {
  507. var $1;
  508. $1=_st(self._selector())._isNil();
  509. return $1;
  510. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.AIContext)})},
  511. args: [],
  512. source: "isBlockContext\x0a\x09\x22Block context have an outer context.\x22\x0a\x09\x0a\x09^ self selector isNil",
  513. messageSends: ["isNil", "selector"],
  514. referencedClasses: []
  515. }),
  516. smalltalk.AIContext);
  517. smalltalk.addMethod(
  518. smalltalk.method({
  519. selector: "localAt:",
  520. category: 'accessing',
  521. fn: function (aString){
  522. var self=this;
  523. return smalltalk.withContext(function($ctx1) {
  524. var $2,$1;
  525. $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
  526. return smalltalk.withContext(function($ctx2) {
  527. $2=self._outerContext();
  528. if(($receiver = $2) == nil || $receiver == null){
  529. return $2;
  530. } else {
  531. var context;
  532. context=$receiver;
  533. return _st(context)._localAt_(aString);
  534. };
  535. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  536. return $1;
  537. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString},smalltalk.AIContext)})},
  538. args: ["aString"],
  539. 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 ] ]",
  540. messageSends: ["at:ifAbsent:", "locals", "ifNotNil:", "outerContext", "localAt:"],
  541. referencedClasses: []
  542. }),
  543. smalltalk.AIContext);
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "localAt:put:",
  547. category: 'accessing',
  548. fn: function (aString,anObject){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. _st(self._locals())._at_put_(aString,anObject);
  552. return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject},smalltalk.AIContext)})},
  553. args: ["aString", "anObject"],
  554. source: "localAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
  555. messageSends: ["at:put:", "locals"],
  556. referencedClasses: []
  557. }),
  558. smalltalk.AIContext);
  559. smalltalk.addMethod(
  560. smalltalk.method({
  561. selector: "locals",
  562. category: 'accessing',
  563. fn: function (){
  564. var self=this;
  565. return smalltalk.withContext(function($ctx1) {
  566. var $1,$2;
  567. $1=self["@locals"];
  568. if(($receiver = $1) == nil || $receiver == null){
  569. self._initializeLocals();
  570. } else {
  571. $1;
  572. };
  573. $2=self["@locals"];
  574. return $2;
  575. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.AIContext)})},
  576. args: [],
  577. source: "locals\x0a\x09locals ifNil: [ self initializeLocals ].\x0a\x09\x0a\x09^ locals",
  578. messageSends: ["ifNil:", "initializeLocals"],
  579. referencedClasses: []
  580. }),
  581. smalltalk.AIContext);
  582. smalltalk.addMethod(
  583. smalltalk.method({
  584. selector: "method",
  585. category: 'accessing',
  586. fn: function (){
  587. var self=this;
  588. return smalltalk.withContext(function($ctx1) {
  589. var $1;
  590. $1=self["@method"];
  591. return $1;
  592. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
  593. args: [],
  594. source: "method\x0a\x09^ method",
  595. messageSends: [],
  596. referencedClasses: []
  597. }),
  598. smalltalk.AIContext);
  599. smalltalk.addMethod(
  600. smalltalk.method({
  601. selector: "method:",
  602. category: 'accessing',
  603. fn: function (aCompiledMethod){
  604. var self=this;
  605. return smalltalk.withContext(function($ctx1) {
  606. self["@method"]=aCompiledMethod;
  607. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.AIContext)})},
  608. args: ["aCompiledMethod"],
  609. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  610. messageSends: [],
  611. referencedClasses: []
  612. }),
  613. smalltalk.AIContext);
  614. smalltalk.addMethod(
  615. smalltalk.method({
  616. selector: "methodContext",
  617. category: 'accessing',
  618. fn: function (){
  619. var self=this;
  620. return smalltalk.withContext(function($ctx1) {
  621. var $1,$2,$4,$3;
  622. $1=self._isBlockContext();
  623. if(! smalltalk.assert($1)){
  624. $2=self;
  625. return $2;
  626. };
  627. $4=self._outerContext();
  628. if(($receiver = $4) == nil || $receiver == null){
  629. $3=$4;
  630. } else {
  631. var outer;
  632. outer=$receiver;
  633. $3=_st(outer)._methodContext();
  634. };
  635. return $3;
  636. }, function($ctx1) {$ctx1.fill(self,"methodContext",{},smalltalk.AIContext)})},
  637. args: [],
  638. source: "methodContext\x0a\x09self isBlockContext ifFalse: [ ^ self ].\x0a\x09\x0a\x09^ self outerContext ifNotNil: [ :outer |\x0a\x09\x09outer methodContext ]",
  639. messageSends: ["ifFalse:", "isBlockContext", "ifNotNil:", "outerContext", "methodContext"],
  640. referencedClasses: []
  641. }),
  642. smalltalk.AIContext);
  643. smalltalk.addMethod(
  644. smalltalk.method({
  645. selector: "newBlockContext",
  646. category: 'factory',
  647. fn: function (){
  648. var self=this;
  649. return smalltalk.withContext(function($ctx1) {
  650. var $2,$3,$1;
  651. $2=_st(self._class())._new();
  652. _st($2)._outerContext_(self);
  653. $3=_st($2)._yourself();
  654. $1=$3;
  655. return $1;
  656. }, function($ctx1) {$ctx1.fill(self,"newBlockContext",{},smalltalk.AIContext)})},
  657. args: [],
  658. source: "newBlockContext\x0a\x09^ self class new\x0a\x09\x09outerContext: self;\x0a\x09\x09yourself",
  659. messageSends: ["outerContext:", "new", "class", "yourself"],
  660. referencedClasses: []
  661. }),
  662. smalltalk.AIContext);
  663. smalltalk.addMethod(
  664. smalltalk.method({
  665. selector: "outerContext",
  666. category: 'accessing',
  667. fn: function (){
  668. var self=this;
  669. return smalltalk.withContext(function($ctx1) {
  670. var $1;
  671. $1=self["@outerContext"];
  672. return $1;
  673. }, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.AIContext)})},
  674. args: [],
  675. source: "outerContext\x0a\x09^ outerContext",
  676. messageSends: [],
  677. referencedClasses: []
  678. }),
  679. smalltalk.AIContext);
  680. smalltalk.addMethod(
  681. smalltalk.method({
  682. selector: "outerContext:",
  683. category: 'accessing',
  684. fn: function (anAIContext){
  685. var self=this;
  686. return smalltalk.withContext(function($ctx1) {
  687. self["@outerContext"]=anAIContext;
  688. _st(self["@outerContext"])._innerContext_(self);
  689. return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  690. args: ["anAIContext"],
  691. source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext.\x0a\x09outerContext innerContext: self",
  692. messageSends: ["innerContext:"],
  693. referencedClasses: []
  694. }),
  695. smalltalk.AIContext);
  696. smalltalk.addMethod(
  697. smalltalk.method({
  698. selector: "pc",
  699. category: 'interpreting',
  700. fn: function (){
  701. var self=this;
  702. return smalltalk.withContext(function($ctx1) {
  703. var $2,$1;
  704. $2=self["@pc"];
  705. if(($receiver = $2) == nil || $receiver == null){
  706. self["@pc"]=(0);
  707. $1=self["@pc"];
  708. } else {
  709. $1=$2;
  710. };
  711. return $1;
  712. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.AIContext)})},
  713. args: [],
  714. source: "pc\x0a\x09^ pc ifNil: [ pc := 0 ]",
  715. messageSends: ["ifNil:"],
  716. referencedClasses: []
  717. }),
  718. smalltalk.AIContext);
  719. smalltalk.addMethod(
  720. smalltalk.method({
  721. selector: "pc:",
  722. category: 'interpreting',
  723. fn: function (anInteger){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) {
  726. self["@pc"]=anInteger;
  727. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.AIContext)})},
  728. args: ["anInteger"],
  729. source: "pc: anInteger\x0a\x09pc := anInteger",
  730. messageSends: [],
  731. referencedClasses: []
  732. }),
  733. smalltalk.AIContext);
  734. smalltalk.addMethod(
  735. smalltalk.method({
  736. selector: "receiver",
  737. category: 'interpreting',
  738. fn: function (){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) {
  741. var $1;
  742. $1=self._localAt_("self");
  743. return $1;
  744. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AIContext)})},
  745. args: [],
  746. source: "receiver\x0a\x09^ self localAt: 'self'",
  747. messageSends: ["localAt:"],
  748. referencedClasses: []
  749. }),
  750. smalltalk.AIContext);
  751. smalltalk.addMethod(
  752. smalltalk.method({
  753. selector: "receiver:",
  754. category: 'interpreting',
  755. fn: function (anObject){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) {
  758. self._localAt_put_("self",anObject);
  759. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.AIContext)})},
  760. args: ["anObject"],
  761. source: "receiver: anObject\x0a\x09self localAt: 'self' put: anObject",
  762. messageSends: ["localAt:put:"],
  763. referencedClasses: []
  764. }),
  765. smalltalk.AIContext);
  766. smalltalk.addMethod(
  767. smalltalk.method({
  768. selector: "retrieveNode",
  769. category: 'interpreting',
  770. fn: function (){
  771. var self=this;
  772. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  773. return smalltalk.withContext(function($ctx1) {
  774. var $2,$3,$1;
  775. $2=_st($ASTPCNodeVisitor())._new();
  776. _st($2)._context_(self);
  777. _st($2)._visit_(self._ast());
  778. $3=_st($2)._currentNode();
  779. $1=$3;
  780. return $1;
  781. }, function($ctx1) {$ctx1.fill(self,"retrieveNode",{},smalltalk.AIContext)})},
  782. args: [],
  783. source: "retrieveNode\x0a\x09^ ASTPCNodeVisitor new\x0a\x09\x09context: self;\x0a\x09\x09visit: self ast;\x0a\x09\x09currentNode",
  784. messageSends: ["context:", "new", "visit:", "ast", "currentNode"],
  785. referencedClasses: ["ASTPCNodeVisitor"]
  786. }),
  787. smalltalk.AIContext);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "selector",
  791. category: 'accessing',
  792. fn: function (){
  793. var self=this;
  794. return smalltalk.withContext(function($ctx1) {
  795. var $2,$1;
  796. $2=self._method();
  797. if(($receiver = $2) == nil || $receiver == null){
  798. $1=$2;
  799. } else {
  800. $1=_st(self._method())._selector();
  801. };
  802. return $1;
  803. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.AIContext)})},
  804. args: [],
  805. source: "selector\x0a\x09^ self method ifNotNil: [ \x0a\x09\x09self method selector ]",
  806. messageSends: ["ifNotNil:", "method", "selector"],
  807. referencedClasses: []
  808. }),
  809. smalltalk.AIContext);
  810. smalltalk.addMethod(
  811. smalltalk.method({
  812. selector: "setupInterpreter:",
  813. category: 'interpreting',
  814. fn: function (anInterpreter){
  815. var self=this;
  816. return smalltalk.withContext(function($ctx1) {
  817. _st(_st(_st(self._innerContext())._arguments())._reversed())._do_((function(each){
  818. return smalltalk.withContext(function($ctx2) {
  819. return _st(anInterpreter)._push_(each);
  820. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  821. _st(anInterpreter)._push_(_st(self._innerContext())._receiver());
  822. return self}, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter},smalltalk.AIContext)})},
  823. args: ["anInterpreter"],
  824. 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)",
  825. messageSends: ["do:", "reversed", "arguments", "innerContext", "push:", "receiver"],
  826. referencedClasses: []
  827. }),
  828. smalltalk.AIContext);
  829. smalltalk.addMethod(
  830. smalltalk.method({
  831. selector: "fromMethodContext:",
  832. category: 'instance creation',
  833. fn: function (aMethodContext){
  834. var self=this;
  835. return smalltalk.withContext(function($ctx1) {
  836. var $2,$3,$1;
  837. $2=self._new();
  838. _st($2)._initializeFromMethodContext_(aMethodContext);
  839. $3=_st($2)._yourself();
  840. $1=$3;
  841. return $1;
  842. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext.klass)})},
  843. args: ["aMethodContext"],
  844. source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  845. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  846. referencedClasses: []
  847. }),
  848. smalltalk.AIContext.klass);
  849. smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  850. 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.";
  851. smalltalk.addMethod(
  852. smalltalk.method({
  853. selector: "atEnd",
  854. category: 'testing',
  855. fn: function (){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. var $1;
  859. $1=_st(self._interpreter())._atEnd();
  860. return $1;
  861. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
  862. args: [],
  863. source: "atEnd\x0a\x09^ self interpreter atEnd",
  864. messageSends: ["atEnd", "interpreter"],
  865. referencedClasses: []
  866. }),
  867. smalltalk.ASTDebugger);
  868. smalltalk.addMethod(
  869. smalltalk.method({
  870. selector: "buildAST",
  871. category: 'initialization',
  872. fn: function (){
  873. var self=this;
  874. var ast;
  875. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  876. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  877. return smalltalk.withContext(function($ctx1) {
  878. var $1;
  879. ast=_st(_st($Smalltalk())._current())._parse_(_st(self._method())._source());
  880. _st(_st($SemanticAnalyzer())._on_(_st(_st(self._context())._receiver())._class()))._visit_(ast);
  881. $1=ast;
  882. return $1;
  883. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  884. args: [],
  885. 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",
  886. messageSends: ["parse:", "current", "source", "method", "visit:", "on:", "class", "receiver", "context"],
  887. referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
  888. }),
  889. smalltalk.ASTDebugger);
  890. smalltalk.addMethod(
  891. smalltalk.method({
  892. selector: "context",
  893. category: 'accessing',
  894. fn: function (){
  895. var self=this;
  896. return smalltalk.withContext(function($ctx1) {
  897. var $1;
  898. $1=self["@context"];
  899. return $1;
  900. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  901. args: [],
  902. source: "context\x0a\x09^ context",
  903. messageSends: [],
  904. referencedClasses: []
  905. }),
  906. smalltalk.ASTDebugger);
  907. smalltalk.addMethod(
  908. smalltalk.method({
  909. selector: "context:",
  910. category: 'accessing',
  911. fn: function (aContext){
  912. var self=this;
  913. return smalltalk.withContext(function($ctx1) {
  914. self["@context"]=aContext;
  915. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  916. args: ["aContext"],
  917. source: "context: aContext\x0a\x09context := aContext",
  918. messageSends: [],
  919. referencedClasses: []
  920. }),
  921. smalltalk.ASTDebugger);
  922. smalltalk.addMethod(
  923. smalltalk.method({
  924. selector: "defaultInterpreterClass",
  925. category: 'defaults',
  926. fn: function (){
  927. var self=this;
  928. function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  929. return smalltalk.withContext(function($ctx1) {
  930. var $1;
  931. $1=$ASTInterpreter();
  932. return $1;
  933. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  934. args: [],
  935. source: "defaultInterpreterClass\x0a\x09^ ASTInterpreter",
  936. messageSends: [],
  937. referencedClasses: ["ASTInterpreter"]
  938. }),
  939. smalltalk.ASTDebugger);
  940. smalltalk.addMethod(
  941. smalltalk.method({
  942. selector: "initializeInterpreter",
  943. category: 'initialization',
  944. fn: function (){
  945. var self=this;
  946. var ast,next;
  947. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  948. return smalltalk.withContext(function($ctx1) {
  949. var $1,$2;
  950. ast=self._buildAST();
  951. $1=_st($ASTPCNodeVisitor())._new();
  952. _st($1)._context_(self._context());
  953. _st($1)._visit_(ast);
  954. $2=_st($1)._currentNode();
  955. next=$2;
  956. _st(self._interpreter())._node_(next);
  957. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{ast:ast,next:next},smalltalk.ASTDebugger)})},
  958. args: [],
  959. 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",
  960. messageSends: ["buildAST", "context:", "new", "context", "visit:", "currentNode", "node:", "interpreter"],
  961. referencedClasses: ["ASTPCNodeVisitor"]
  962. }),
  963. smalltalk.ASTDebugger);
  964. smalltalk.addMethod(
  965. smalltalk.method({
  966. selector: "initializeWithContext:",
  967. category: 'initialization',
  968. fn: function (aContext){
  969. var self=this;
  970. return smalltalk.withContext(function($ctx1) {
  971. self._context_(aContext);
  972. self._initializeInterpreter();
  973. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aContext:aContext},smalltalk.ASTDebugger)})},
  974. args: ["aContext"],
  975. source: "initializeWithContext: aContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a\x09\x0a\x09self context: aContext.\x0a\x09self initializeInterpreter",
  976. messageSends: ["context:", "initializeInterpreter"],
  977. referencedClasses: []
  978. }),
  979. smalltalk.ASTDebugger);
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "interpreter",
  983. category: 'accessing',
  984. fn: function (){
  985. var self=this;
  986. return smalltalk.withContext(function($ctx1) {
  987. var $2,$1;
  988. $2=self["@interpreter"];
  989. if(($receiver = $2) == nil || $receiver == null){
  990. self["@interpreter"]=_st(self._defaultInterpreterClass())._new();
  991. $1=self["@interpreter"];
  992. } else {
  993. $1=$2;
  994. };
  995. return $1;
  996. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  997. args: [],
  998. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  999. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  1000. referencedClasses: []
  1001. }),
  1002. smalltalk.ASTDebugger);
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "interpreter:",
  1006. category: 'accessing',
  1007. fn: function (anInterpreter){
  1008. var self=this;
  1009. return smalltalk.withContext(function($ctx1) {
  1010. self["@interpreter"]=anInterpreter;
  1011. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  1012. args: ["anInterpreter"],
  1013. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  1014. messageSends: [],
  1015. referencedClasses: []
  1016. }),
  1017. smalltalk.ASTDebugger);
  1018. smalltalk.addMethod(
  1019. smalltalk.method({
  1020. selector: "method",
  1021. category: 'accessing',
  1022. fn: function (){
  1023. var self=this;
  1024. return smalltalk.withContext(function($ctx1) {
  1025. var $1;
  1026. $1=_st(self._context())._method();
  1027. return $1;
  1028. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  1029. args: [],
  1030. source: "method\x0a\x09^ self context method",
  1031. messageSends: ["method", "context"],
  1032. referencedClasses: []
  1033. }),
  1034. smalltalk.ASTDebugger);
  1035. smalltalk.addMethod(
  1036. smalltalk.method({
  1037. selector: "nextNode",
  1038. category: 'accessing',
  1039. fn: function (){
  1040. var self=this;
  1041. return smalltalk.withContext(function($ctx1) {
  1042. var $1;
  1043. $1=_st(self._interpreter())._nextNode();
  1044. return $1;
  1045. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTDebugger)})},
  1046. args: [],
  1047. source: "nextNode\x0a\x09^ self interpreter nextNode",
  1048. messageSends: ["nextNode", "interpreter"],
  1049. referencedClasses: []
  1050. }),
  1051. smalltalk.ASTDebugger);
  1052. smalltalk.addMethod(
  1053. smalltalk.method({
  1054. selector: "proceed",
  1055. category: 'stepping',
  1056. fn: function (){
  1057. var self=this;
  1058. return smalltalk.withContext(function($ctx1) {
  1059. self._shouldBeImplemented();
  1060. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
  1061. args: [],
  1062. source: "proceed\x0a\x09self shouldBeImplemented",
  1063. messageSends: ["shouldBeImplemented"],
  1064. referencedClasses: []
  1065. }),
  1066. smalltalk.ASTDebugger);
  1067. smalltalk.addMethod(
  1068. smalltalk.method({
  1069. selector: "restart",
  1070. category: 'stepping',
  1071. fn: function (){
  1072. var self=this;
  1073. return smalltalk.withContext(function($ctx1) {
  1074. _st(self._interpreter())._restart();
  1075. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  1076. args: [],
  1077. source: "restart\x0a\x09self interpreter restart",
  1078. messageSends: ["restart", "interpreter"],
  1079. referencedClasses: []
  1080. }),
  1081. smalltalk.ASTDebugger);
  1082. smalltalk.addMethod(
  1083. smalltalk.method({
  1084. selector: "stepInto",
  1085. category: 'stepping',
  1086. fn: function (){
  1087. var self=this;
  1088. return smalltalk.withContext(function($ctx1) {
  1089. self._shouldBeImplemented();
  1090. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  1091. args: [],
  1092. source: "stepInto\x0a\x09self shouldBeImplemented",
  1093. messageSends: ["shouldBeImplemented"],
  1094. referencedClasses: []
  1095. }),
  1096. smalltalk.ASTDebugger);
  1097. smalltalk.addMethod(
  1098. smalltalk.method({
  1099. selector: "stepOver",
  1100. category: 'stepping',
  1101. fn: function (){
  1102. var self=this;
  1103. return smalltalk.withContext(function($ctx1) {
  1104. _st(self._interpreter())._stepOver();
  1105. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  1106. args: [],
  1107. source: "stepOver\x0a\x09self interpreter stepOver",
  1108. messageSends: ["stepOver", "interpreter"],
  1109. referencedClasses: []
  1110. }),
  1111. smalltalk.ASTDebugger);
  1112. smalltalk.addMethod(
  1113. smalltalk.method({
  1114. selector: "context:",
  1115. category: 'instance creation',
  1116. fn: function (aContext){
  1117. var self=this;
  1118. return smalltalk.withContext(function($ctx1) {
  1119. var $2,$3,$1;
  1120. $2=self._new();
  1121. _st($2)._initializeWithContext_(aContext);
  1122. $3=_st($2)._yourself();
  1123. $1=$3;
  1124. return $1;
  1125. }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger.klass)})},
  1126. args: ["aContext"],
  1127. source: "context: aContext\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext;\x0a\x09\x09yourself",
  1128. messageSends: ["initializeWithContext:", "new", "yourself"],
  1129. referencedClasses: []
  1130. }),
  1131. smalltalk.ASTDebugger.klass);
  1132. smalltalk.addClass('ASTInterpreter', smalltalk.NodeVisitor, ['node', 'context', 'stack', 'returnValue', 'returned'], 'Compiler-Interpreter');
  1133. 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";
  1134. smalltalk.addMethod(
  1135. smalltalk.method({
  1136. selector: "assign:to:",
  1137. category: 'private',
  1138. fn: function (aNode,anObject){
  1139. var self=this;
  1140. return smalltalk.withContext(function($ctx1) {
  1141. var $1;
  1142. $1=_st(_st(aNode)._binding())._isInstanceVar();
  1143. if(smalltalk.assert($1)){
  1144. _st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  1145. } else {
  1146. _st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
  1147. };
  1148. return self}, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  1149. args: ["aNode", "anObject"],
  1150. 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 ]",
  1151. messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"],
  1152. referencedClasses: []
  1153. }),
  1154. smalltalk.ASTInterpreter);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "atEnd",
  1158. category: 'testing',
  1159. fn: function (){
  1160. var self=this;
  1161. return smalltalk.withContext(function($ctx1) {
  1162. var $1;
  1163. $1=_st(self._hasReturned())._or_((function(){
  1164. return smalltalk.withContext(function($ctx2) {
  1165. return _st(self._node())._isNil();
  1166. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1167. return $1;
  1168. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTInterpreter)})},
  1169. args: [],
  1170. source: "atEnd\x0a\x09^ self hasReturned or: [ self node isNil ]",
  1171. messageSends: ["or:", "hasReturned", "isNil", "node"],
  1172. referencedClasses: []
  1173. }),
  1174. smalltalk.ASTInterpreter);
  1175. smalltalk.addMethod(
  1176. smalltalk.method({
  1177. selector: "context",
  1178. category: 'accessing',
  1179. fn: function (){
  1180. var self=this;
  1181. return smalltalk.withContext(function($ctx1) {
  1182. var $1;
  1183. $1=self["@context"];
  1184. return $1;
  1185. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  1186. args: [],
  1187. source: "context\x0a\x09^ context",
  1188. messageSends: [],
  1189. referencedClasses: []
  1190. }),
  1191. smalltalk.ASTInterpreter);
  1192. smalltalk.addMethod(
  1193. smalltalk.method({
  1194. selector: "context:",
  1195. category: 'accessing',
  1196. fn: function (aContext){
  1197. var self=this;
  1198. return smalltalk.withContext(function($ctx1) {
  1199. self["@context"]=aContext;
  1200. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1201. args: ["aContext"],
  1202. source: "context: aContext\x0a\x09context := aContext",
  1203. messageSends: [],
  1204. referencedClasses: []
  1205. }),
  1206. smalltalk.ASTInterpreter);
  1207. smalltalk.addMethod(
  1208. smalltalk.method({
  1209. selector: "eval:",
  1210. category: 'private',
  1211. fn: function (aString){
  1212. var self=this;
  1213. var source,function_;
  1214. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1215. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1216. return smalltalk.withContext(function($ctx1) {
  1217. var $1,$2,$3;
  1218. source=_st($String())._streamContents_((function(str){
  1219. return smalltalk.withContext(function($ctx2) {
  1220. _st(str)._nextPutAll_("(function(");
  1221. _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
  1222. return smalltalk.withContext(function($ctx3) {
  1223. return _st(str)._nextPutAll_(each);
  1224. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}),(function(){
  1225. return smalltalk.withContext(function($ctx3) {
  1226. return _st(str)._nextPutAll_(",");
  1227. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1228. $1=str;
  1229. _st($1)._nextPutAll_("){ return (function() {");
  1230. _st($1)._nextPutAll_(aString);
  1231. $2=_st($1)._nextPutAll_("})() })");
  1232. return $2;
  1233. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
  1234. function_=_st(_st($Compiler())._new())._eval_(source);
  1235. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
  1236. return $3;
  1237. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  1238. args: ["aString"],
  1239. 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",
  1240. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  1241. referencedClasses: ["String", "Compiler"]
  1242. }),
  1243. smalltalk.ASTInterpreter);
  1244. smalltalk.addMethod(
  1245. smalltalk.method({
  1246. selector: "hasReturned",
  1247. category: 'testing',
  1248. fn: function (){
  1249. var self=this;
  1250. return smalltalk.withContext(function($ctx1) {
  1251. var $2,$1;
  1252. $2=self["@returned"];
  1253. if(($receiver = $2) == nil || $receiver == null){
  1254. $1=false;
  1255. } else {
  1256. $1=$2;
  1257. };
  1258. return $1;
  1259. }, function($ctx1) {$ctx1.fill(self,"hasReturned",{},smalltalk.ASTInterpreter)})},
  1260. args: [],
  1261. source: "hasReturned\x0a\x09^ returned ifNil: [ false ]",
  1262. messageSends: ["ifNil:"],
  1263. referencedClasses: []
  1264. }),
  1265. smalltalk.ASTInterpreter);
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "interpret",
  1269. category: 'interpreting',
  1270. fn: function (){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) {
  1273. self._visit_(self._node());
  1274. return self}, function($ctx1) {$ctx1.fill(self,"interpret",{},smalltalk.ASTInterpreter)})},
  1275. args: [],
  1276. source: "interpret\x0a\x09\x22Interpret the next node to be evaluated\x22\x0a\x09\x0a\x09self visit: self node",
  1277. messageSends: ["visit:", "node"],
  1278. referencedClasses: []
  1279. }),
  1280. smalltalk.ASTInterpreter);
  1281. smalltalk.addMethod(
  1282. smalltalk.method({
  1283. selector: "interpret:",
  1284. category: 'interpreting',
  1285. fn: function (aNode){
  1286. var self=this;
  1287. return smalltalk.withContext(function($ctx1) {
  1288. self._node_(aNode);
  1289. self._interpret();
  1290. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1291. args: ["aNode"],
  1292. source: "interpret: aNode\x0a\x09self node: aNode.\x0a\x09self interpret",
  1293. messageSends: ["node:", "interpret"],
  1294. referencedClasses: []
  1295. }),
  1296. smalltalk.ASTInterpreter);
  1297. smalltalk.addMethod(
  1298. smalltalk.method({
  1299. selector: "messageFromSendNode:arguments:",
  1300. category: 'private',
  1301. fn: function (aSendNode,aCollection){
  1302. var self=this;
  1303. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1304. return smalltalk.withContext(function($ctx1) {
  1305. var $2,$3,$1;
  1306. $2=_st($Message())._new();
  1307. _st($2)._selector_(_st(aSendNode)._selector());
  1308. _st($2)._arguments_(aCollection);
  1309. $3=_st($2)._yourself();
  1310. $1=$3;
  1311. return $1;
  1312. }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  1313. args: ["aSendNode", "aCollection"],
  1314. source: "messageFromSendNode: aSendNode arguments: aCollection\x0a\x09^ Message new\x0a\x09\x09selector: aSendNode selector;\x0a\x09\x09arguments: aCollection;\x0a\x09\x09yourself",
  1315. messageSends: ["selector:", "new", "selector", "arguments:", "yourself"],
  1316. referencedClasses: ["Message"]
  1317. }),
  1318. smalltalk.ASTInterpreter);
  1319. smalltalk.addMethod(
  1320. smalltalk.method({
  1321. selector: "messageNotUnderstood:receiver:",
  1322. category: 'private',
  1323. fn: function (aMessage,anObject){
  1324. var self=this;
  1325. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1326. return smalltalk.withContext(function($ctx1) {
  1327. var $1,$2;
  1328. $1=_st($MessageNotUnderstood())._new();
  1329. _st($1)._meesage_(aMessage);
  1330. _st($1)._receiver_(anObject);
  1331. $2=_st($1)._signal();
  1332. return self}, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},smalltalk.ASTInterpreter)})},
  1333. args: ["aMessage", "anObject"],
  1334. source: "messageNotUnderstood: aMessage receiver: anObject\x0a\x09MessageNotUnderstood new\x0a\x09\x09meesage: aMessage;\x0a\x09\x09receiver: anObject;\x0a\x09\x09signal",
  1335. messageSends: ["meesage:", "new", "receiver:", "signal"],
  1336. referencedClasses: ["MessageNotUnderstood"]
  1337. }),
  1338. smalltalk.ASTInterpreter);
  1339. smalltalk.addMethod(
  1340. smalltalk.method({
  1341. selector: "next",
  1342. category: 'interpreting',
  1343. fn: function (){
  1344. var self=this;
  1345. return smalltalk.withContext(function($ctx1) {
  1346. self._node_(_st(self._node())._nextNode());
  1347. return self}, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.ASTInterpreter)})},
  1348. args: [],
  1349. source: "next\x0a\x09self node: self node nextNode",
  1350. messageSends: ["node:", "nextNode", "node"],
  1351. referencedClasses: []
  1352. }),
  1353. smalltalk.ASTInterpreter);
  1354. smalltalk.addMethod(
  1355. smalltalk.method({
  1356. selector: "node",
  1357. category: 'accessing',
  1358. fn: function (){
  1359. var self=this;
  1360. return smalltalk.withContext(function($ctx1) {
  1361. var $1;
  1362. $1=self["@node"];
  1363. return $1;
  1364. }, function($ctx1) {$ctx1.fill(self,"node",{},smalltalk.ASTInterpreter)})},
  1365. args: [],
  1366. source: "node\x0a\x09\x22Answer the next node, ie the node to be evaluated in the next step\x22\x0a\x09\x0a\x09^ node",
  1367. messageSends: [],
  1368. referencedClasses: []
  1369. }),
  1370. smalltalk.ASTInterpreter);
  1371. smalltalk.addMethod(
  1372. smalltalk.method({
  1373. selector: "node:",
  1374. category: 'accessing',
  1375. fn: function (aNode){
  1376. var self=this;
  1377. return smalltalk.withContext(function($ctx1) {
  1378. self["@node"]=aNode;
  1379. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1380. args: ["aNode"],
  1381. source: "node: aNode\x0a\x09node := aNode",
  1382. messageSends: [],
  1383. referencedClasses: []
  1384. }),
  1385. smalltalk.ASTInterpreter);
  1386. smalltalk.addMethod(
  1387. smalltalk.method({
  1388. selector: "peek",
  1389. category: 'stack',
  1390. fn: function (){
  1391. var self=this;
  1392. return smalltalk.withContext(function($ctx1) {
  1393. var $1;
  1394. var $early={};
  1395. try {
  1396. _st(self._stack())._ifEmpty_((function(){
  1397. return smalltalk.withContext(function($ctx2) {
  1398. throw $early=[nil];
  1399. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1400. $1=_st(self._stack())._last();
  1401. return $1;
  1402. }
  1403. catch(e) {if(e===$early)return e[0]; throw e}
  1404. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.ASTInterpreter)})},
  1405. args: [],
  1406. 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",
  1407. messageSends: ["ifEmpty:", "stack", "last"],
  1408. referencedClasses: []
  1409. }),
  1410. smalltalk.ASTInterpreter);
  1411. smalltalk.addMethod(
  1412. smalltalk.method({
  1413. selector: "pop",
  1414. category: 'stack',
  1415. fn: function (){
  1416. var self=this;
  1417. var peekedValue;
  1418. return smalltalk.withContext(function($ctx1) {
  1419. var $1;
  1420. peekedValue=self._peek();
  1421. _st(self._stack())._removeLast();
  1422. $1=peekedValue;
  1423. return $1;
  1424. }, function($ctx1) {$ctx1.fill(self,"pop",{peekedValue:peekedValue},smalltalk.ASTInterpreter)})},
  1425. args: [],
  1426. 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",
  1427. messageSends: ["peek", "removeLast", "stack"],
  1428. referencedClasses: []
  1429. }),
  1430. smalltalk.ASTInterpreter);
  1431. smalltalk.addMethod(
  1432. smalltalk.method({
  1433. selector: "proceed",
  1434. category: 'interpreting',
  1435. fn: function (){
  1436. var self=this;
  1437. return smalltalk.withContext(function($ctx1) {
  1438. _st((function(){
  1439. return smalltalk.withContext(function($ctx2) {
  1440. return self._atEnd();
  1441. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1442. return smalltalk.withContext(function($ctx2) {
  1443. return self._step();
  1444. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1445. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTInterpreter)})},
  1446. args: [],
  1447. source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] whileFalse: [ \x0a\x09\x09self step ]",
  1448. messageSends: ["whileFalse:", "atEnd", "step"],
  1449. referencedClasses: []
  1450. }),
  1451. smalltalk.ASTInterpreter);
  1452. smalltalk.addMethod(
  1453. smalltalk.method({
  1454. selector: "push:",
  1455. category: 'stack',
  1456. fn: function (anObject){
  1457. var self=this;
  1458. return smalltalk.withContext(function($ctx1) {
  1459. var $1;
  1460. $1=_st(self._stack())._add_(anObject);
  1461. return $1;
  1462. }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1463. args: ["anObject"],
  1464. source: "push: anObject\x0a\x09\x22Push an object to the context stack\x22\x0a\x09\x0a\x09^ self stack add: anObject",
  1465. messageSends: ["add:", "stack"],
  1466. referencedClasses: []
  1467. }),
  1468. smalltalk.ASTInterpreter);
  1469. smalltalk.addMethod(
  1470. smalltalk.method({
  1471. selector: "restart",
  1472. category: 'interpreting',
  1473. fn: function (){
  1474. var self=this;
  1475. return smalltalk.withContext(function($ctx1) {
  1476. self._node_(_st(_st(self._context())._ast())._nextChild());
  1477. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTInterpreter)})},
  1478. args: [],
  1479. source: "restart\x0a\x09self node: self context ast nextChild",
  1480. messageSends: ["node:", "nextChild", "ast", "context"],
  1481. referencedClasses: []
  1482. }),
  1483. smalltalk.ASTInterpreter);
  1484. smalltalk.addMethod(
  1485. smalltalk.method({
  1486. selector: "result",
  1487. category: 'accessing',
  1488. fn: function (){
  1489. var self=this;
  1490. return smalltalk.withContext(function($ctx1) {
  1491. var $2,$1;
  1492. $2=self._hasReturned();
  1493. if(smalltalk.assert($2)){
  1494. $1=self._returnValue();
  1495. } else {
  1496. $1=_st(self._context())._receiver();
  1497. };
  1498. return $1;
  1499. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1500. args: [],
  1501. source: "result\x0a\x09^ self hasReturned \x0a\x09\x09ifTrue: [ self returnValue ] \x0a\x09\x09ifFalse: [ self context receiver ]",
  1502. messageSends: ["ifTrue:ifFalse:", "hasReturned", "returnValue", "receiver", "context"],
  1503. referencedClasses: []
  1504. }),
  1505. smalltalk.ASTInterpreter);
  1506. smalltalk.addMethod(
  1507. smalltalk.method({
  1508. selector: "returnValue",
  1509. category: 'accessing',
  1510. fn: function (){
  1511. var self=this;
  1512. return smalltalk.withContext(function($ctx1) {
  1513. var $1;
  1514. $1=self["@returnValue"];
  1515. return $1;
  1516. }, function($ctx1) {$ctx1.fill(self,"returnValue",{},smalltalk.ASTInterpreter)})},
  1517. args: [],
  1518. source: "returnValue\x0a\x09^ returnValue",
  1519. messageSends: [],
  1520. referencedClasses: []
  1521. }),
  1522. smalltalk.ASTInterpreter);
  1523. smalltalk.addMethod(
  1524. smalltalk.method({
  1525. selector: "returnValue:",
  1526. category: 'accessing',
  1527. fn: function (anObject){
  1528. var self=this;
  1529. return smalltalk.withContext(function($ctx1) {
  1530. self["@returnValue"]=anObject;
  1531. return self}, function($ctx1) {$ctx1.fill(self,"returnValue:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1532. args: ["anObject"],
  1533. source: "returnValue: anObject\x0a\x09returnValue := anObject",
  1534. messageSends: [],
  1535. referencedClasses: []
  1536. }),
  1537. smalltalk.ASTInterpreter);
  1538. smalltalk.addMethod(
  1539. smalltalk.method({
  1540. selector: "sendMessage:to:superSend:",
  1541. category: 'private',
  1542. fn: function (aMessage,anObject,aBoolean){
  1543. var self=this;
  1544. var method;
  1545. return smalltalk.withContext(function($ctx1) {
  1546. var $1,$2,$3,$4,$5,$6;
  1547. var $early={};
  1548. try {
  1549. $1=aBoolean;
  1550. if(! smalltalk.assert($1)){
  1551. $2=_st(aMessage)._sendTo_(anObject);
  1552. return $2;
  1553. };
  1554. $3=_st(_st(anObject)._class())._superclass();
  1555. if(($receiver = $3) == nil || $receiver == null){
  1556. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1557. return $4;
  1558. } else {
  1559. $3;
  1560. };
  1561. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1562. return smalltalk.withContext(function($ctx2) {
  1563. $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1564. throw $early=[$5];
  1565. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  1566. $6=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
  1567. return $6;
  1568. }
  1569. catch(e) {if(e===$early)return e[0]; throw e}
  1570. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1571. args: ["aMessage", "anObject", "aBoolean"],
  1572. 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",
  1573. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "sendTo:arguments:", "arguments"],
  1574. referencedClasses: []
  1575. }),
  1576. smalltalk.ASTInterpreter);
  1577. smalltalk.addMethod(
  1578. smalltalk.method({
  1579. selector: "setNonLocalReturnFromContext:",
  1580. category: 'interpreting',
  1581. fn: function (aContext){
  1582. var self=this;
  1583. return smalltalk.withContext(function($ctx1) {
  1584. var $1;
  1585. $1=_st(_st(aContext)._interpreter())._hasReturned();
  1586. if(smalltalk.assert($1)){
  1587. self["@returned"]=true;
  1588. self["@returned"];
  1589. self._returnValue_(_st(_st(aContext)._interpreter())._returnValue());
  1590. };
  1591. return self}, function($ctx1) {$ctx1.fill(self,"setNonLocalReturnFromContext:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1592. args: ["aContext"],
  1593. source: "setNonLocalReturnFromContext: aContext\x0a\x09aContext interpreter hasReturned ifTrue: [\x0a\x09\x09returned := true.\x0a\x09\x09self returnValue: aContext interpreter returnValue ]",
  1594. messageSends: ["ifTrue:", "hasReturned", "interpreter", "returnValue:", "returnValue"],
  1595. referencedClasses: []
  1596. }),
  1597. smalltalk.ASTInterpreter);
  1598. smalltalk.addMethod(
  1599. smalltalk.method({
  1600. selector: "skip",
  1601. category: 'interpreting',
  1602. fn: function (){
  1603. var self=this;
  1604. return smalltalk.withContext(function($ctx1) {
  1605. self._next();
  1606. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.ASTInterpreter)})},
  1607. args: [],
  1608. source: "skip\x0a\x09self next",
  1609. messageSends: ["next"],
  1610. referencedClasses: []
  1611. }),
  1612. smalltalk.ASTInterpreter);
  1613. smalltalk.addMethod(
  1614. smalltalk.method({
  1615. selector: "stack",
  1616. category: 'accessing',
  1617. fn: function (){
  1618. var self=this;
  1619. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1620. return smalltalk.withContext(function($ctx1) {
  1621. var $2,$1;
  1622. $2=self["@stack"];
  1623. if(($receiver = $2) == nil || $receiver == null){
  1624. self["@stack"]=_st($OrderedCollection())._new();
  1625. $1=self["@stack"];
  1626. } else {
  1627. $1=$2;
  1628. };
  1629. return $1;
  1630. }, function($ctx1) {$ctx1.fill(self,"stack",{},smalltalk.ASTInterpreter)})},
  1631. args: [],
  1632. source: "stack\x0a\x09^ stack ifNil: [ stack := OrderedCollection new ]",
  1633. messageSends: ["ifNil:", "new"],
  1634. referencedClasses: ["OrderedCollection"]
  1635. }),
  1636. smalltalk.ASTInterpreter);
  1637. smalltalk.addMethod(
  1638. smalltalk.method({
  1639. selector: "step",
  1640. category: 'interpreting',
  1641. fn: function (){
  1642. var self=this;
  1643. return smalltalk.withContext(function($ctx1) {
  1644. var $1,$2;
  1645. $1=self;
  1646. _st($1)._interpret();
  1647. $2=_st($1)._next();
  1648. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTInterpreter)})},
  1649. args: [],
  1650. source: "step\x0a\x09self \x0a\x09\x09interpret; \x0a\x09\x09next",
  1651. messageSends: ["interpret", "next"],
  1652. referencedClasses: []
  1653. }),
  1654. smalltalk.ASTInterpreter);
  1655. smalltalk.addMethod(
  1656. smalltalk.method({
  1657. selector: "stepOver",
  1658. category: 'interpreting',
  1659. fn: function (){
  1660. var self=this;
  1661. return smalltalk.withContext(function($ctx1) {
  1662. self._step();
  1663. _st((function(){
  1664. return smalltalk.withContext(function($ctx2) {
  1665. return _st(self._node())._isSteppingNode();
  1666. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1667. return smalltalk.withContext(function($ctx2) {
  1668. return self._step();
  1669. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1670. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTInterpreter)})},
  1671. args: [],
  1672. source: "stepOver\x0a\x09self step.\x0a\x09\x0a\x09[ self node isSteppingNode ] whileFalse: [ \x0a\x09\x09self step ]",
  1673. messageSends: ["step", "whileFalse:", "isSteppingNode", "node"],
  1674. referencedClasses: []
  1675. }),
  1676. smalltalk.ASTInterpreter);
  1677. smalltalk.addMethod(
  1678. smalltalk.method({
  1679. selector: "visit:",
  1680. category: 'visiting',
  1681. fn: function (aNode){
  1682. var self=this;
  1683. return smalltalk.withContext(function($ctx1) {
  1684. var $1;
  1685. $1=self._hasReturned();
  1686. if(! smalltalk.assert($1)){
  1687. smalltalk.ASTInterpreter.superclass.fn.prototype._visit_.apply(_st(self), [aNode]);
  1688. };
  1689. return self}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1690. args: ["aNode"],
  1691. source: "visit: aNode\x0a\x09self hasReturned ifFalse: [ super visit: aNode ]",
  1692. messageSends: ["ifFalse:", "hasReturned", "visit:"],
  1693. referencedClasses: []
  1694. }),
  1695. smalltalk.ASTInterpreter);
  1696. smalltalk.addMethod(
  1697. smalltalk.method({
  1698. selector: "visitAssignmentNode:",
  1699. category: 'visiting',
  1700. fn: function (aNode){
  1701. var self=this;
  1702. var poppedValue;
  1703. return smalltalk.withContext(function($ctx1) {
  1704. poppedValue=self._pop();
  1705. self._pop();
  1706. self._push_(poppedValue);
  1707. self._assign_to_(_st(aNode)._left(),poppedValue);
  1708. return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,poppedValue:poppedValue},smalltalk.ASTInterpreter)})},
  1709. args: ["aNode"],
  1710. 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",
  1711. messageSends: ["pop", "push:", "assign:to:", "left"],
  1712. referencedClasses: []
  1713. }),
  1714. smalltalk.ASTInterpreter);
  1715. smalltalk.addMethod(
  1716. smalltalk.method({
  1717. selector: "visitBlockNode:",
  1718. category: 'visiting',
  1719. fn: function (aNode){
  1720. var self=this;
  1721. var block;
  1722. function $AIBlockClosure(){return smalltalk.AIBlockClosure||(typeof AIBlockClosure=="undefined"?nil:AIBlockClosure)}
  1723. return smalltalk.withContext(function($ctx1) {
  1724. block=_st($AIBlockClosure())._forContext_node_(self._context(),aNode);
  1725. self._push_(block);
  1726. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,block:block},smalltalk.ASTInterpreter)})},
  1727. args: ["aNode"],
  1728. 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",
  1729. messageSends: ["forContext:node:", "context", "push:"],
  1730. referencedClasses: ["AIBlockClosure"]
  1731. }),
  1732. smalltalk.ASTInterpreter);
  1733. smalltalk.addMethod(
  1734. smalltalk.method({
  1735. selector: "visitClassReferenceNode:",
  1736. category: 'visiting',
  1737. fn: function (aNode){
  1738. var self=this;
  1739. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1740. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1741. return smalltalk.withContext(function($ctx1) {
  1742. self._push_(_st(_st($Smalltalk())._current())._at_ifAbsent_(_st(aNode)._value(),(function(){
  1743. return smalltalk.withContext(function($ctx2) {
  1744. return _st(_st($PlatformInterface())._globals())._at_(_st(aNode)._value());
  1745. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})));
  1746. return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1747. args: ["aNode"],
  1748. source: "visitClassReferenceNode: aNode\x0a\x09self push: (Smalltalk current \x0a\x09\x09at: aNode value \x0a\x09\x09ifAbsent: [ PlatformInterface globals at: aNode value ])",
  1749. messageSends: ["push:", "at:ifAbsent:", "current", "value", "at:", "globals"],
  1750. referencedClasses: ["Smalltalk", "PlatformInterface"]
  1751. }),
  1752. smalltalk.ASTInterpreter);
  1753. smalltalk.addMethod(
  1754. smalltalk.method({
  1755. selector: "visitDynamicArrayNode:",
  1756. category: 'visiting',
  1757. fn: function (aNode){
  1758. var self=this;
  1759. var array;
  1760. return smalltalk.withContext(function($ctx1) {
  1761. array=[];
  1762. _st(_st(aNode)._nodes())._do_((function(each){
  1763. return smalltalk.withContext(function($ctx2) {
  1764. return _st(array)._addFirst_(self._pop());
  1765. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1766. self._push_(array);
  1767. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.ASTInterpreter)})},
  1768. args: ["aNode"],
  1769. 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",
  1770. messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"],
  1771. referencedClasses: []
  1772. }),
  1773. smalltalk.ASTInterpreter);
  1774. smalltalk.addMethod(
  1775. smalltalk.method({
  1776. selector: "visitDynamicDictionaryNode:",
  1777. category: 'visiting',
  1778. fn: function (aNode){
  1779. var self=this;
  1780. var associations,hashedCollection;
  1781. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1782. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1783. return smalltalk.withContext(function($ctx1) {
  1784. associations=_st($OrderedCollection())._new();
  1785. hashedCollection=_st($HashedCollection())._new();
  1786. _st(_st(aNode)._nodes())._do_((function(each){
  1787. return smalltalk.withContext(function($ctx2) {
  1788. return _st(associations)._add_(self._pop());
  1789. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1790. _st(_st(associations)._reversed())._do_((function(each){
  1791. return smalltalk.withContext(function($ctx2) {
  1792. return _st(hashedCollection)._add_(each);
  1793. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  1794. self._push_(hashedCollection);
  1795. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,associations:associations,hashedCollection:hashedCollection},smalltalk.ASTInterpreter)})},
  1796. args: ["aNode"],
  1797. 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",
  1798. messageSends: ["new", "do:", "nodes", "add:", "pop", "reversed", "push:"],
  1799. referencedClasses: ["OrderedCollection", "HashedCollection"]
  1800. }),
  1801. smalltalk.ASTInterpreter);
  1802. smalltalk.addMethod(
  1803. smalltalk.method({
  1804. selector: "visitJSStatementNode:",
  1805. category: 'visiting',
  1806. fn: function (aNode){
  1807. var self=this;
  1808. return smalltalk.withContext(function($ctx1) {
  1809. self["@returned"]=true;
  1810. self._returnValue_(self._eval_(_st(aNode)._source()));
  1811. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1812. args: ["aNode"],
  1813. source: "visitJSStatementNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: (self eval: aNode source)",
  1814. messageSends: ["returnValue:", "eval:", "source"],
  1815. referencedClasses: []
  1816. }),
  1817. smalltalk.ASTInterpreter);
  1818. smalltalk.addMethod(
  1819. smalltalk.method({
  1820. selector: "visitNode:",
  1821. category: 'visiting',
  1822. fn: function (aNode){
  1823. var self=this;
  1824. return smalltalk.withContext(function($ctx1) {
  1825. return self}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1826. args: ["aNode"],
  1827. source: "visitNode: aNode\x0a\x09\x22Do nothing by default. Especially, do not visit children recursively.\x22",
  1828. messageSends: [],
  1829. referencedClasses: []
  1830. }),
  1831. smalltalk.ASTInterpreter);
  1832. smalltalk.addMethod(
  1833. smalltalk.method({
  1834. selector: "visitReturnNode:",
  1835. category: 'visiting',
  1836. fn: function (aNode){
  1837. var self=this;
  1838. return smalltalk.withContext(function($ctx1) {
  1839. self["@returned"]=true;
  1840. self._returnValue_(self._pop());
  1841. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1842. args: ["aNode"],
  1843. source: "visitReturnNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: self pop",
  1844. messageSends: ["returnValue:", "pop"],
  1845. referencedClasses: []
  1846. }),
  1847. smalltalk.ASTInterpreter);
  1848. smalltalk.addMethod(
  1849. smalltalk.method({
  1850. selector: "visitSendNode:",
  1851. category: 'visiting',
  1852. fn: function (aNode){
  1853. var self=this;
  1854. var receiver,args,message,result;
  1855. return smalltalk.withContext(function($ctx1) {
  1856. var $1;
  1857. args=_st(_st(aNode)._arguments())._collect_((function(each){
  1858. return smalltalk.withContext(function($ctx2) {
  1859. return self._pop();
  1860. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1861. receiver=self._pop();
  1862. message=self._messageFromSendNode_arguments_(aNode,_st(args)._reversed());
  1863. result=self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend());
  1864. _st(self._context())._pc_(_st(_st(self._context())._pc()).__plus((1)));
  1865. $1=_st(_st(aNode)._isCascadeSendNode())._and_((function(){
  1866. return smalltalk.withContext(function($ctx2) {
  1867. return _st(_st(aNode)._isLastChild())._not();
  1868. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1869. if(smalltalk.assert($1)){
  1870. self._push_(receiver);
  1871. } else {
  1872. self._push_(result);
  1873. };
  1874. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},smalltalk.ASTInterpreter)})},
  1875. args: ["aNode"],
  1876. 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 ]",
  1877. messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "pc:", "context", "+", "pc", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"],
  1878. referencedClasses: []
  1879. }),
  1880. smalltalk.ASTInterpreter);
  1881. smalltalk.addMethod(
  1882. smalltalk.method({
  1883. selector: "visitValueNode:",
  1884. category: 'visiting',
  1885. fn: function (aNode){
  1886. var self=this;
  1887. return smalltalk.withContext(function($ctx1) {
  1888. self._push_(_st(aNode)._value());
  1889. return self}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1890. args: ["aNode"],
  1891. source: "visitValueNode: aNode\x0a\x09self push: aNode value",
  1892. messageSends: ["push:", "value"],
  1893. referencedClasses: []
  1894. }),
  1895. smalltalk.ASTInterpreter);
  1896. smalltalk.addMethod(
  1897. smalltalk.method({
  1898. selector: "visitVariableNode:",
  1899. category: 'visiting',
  1900. fn: function (aNode){
  1901. var self=this;
  1902. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1903. return smalltalk.withContext(function($ctx1) {
  1904. var $1,$2,$3,$5,$4;
  1905. $1=_st(_st(aNode)._binding())._isUnknownVar();
  1906. if(smalltalk.assert($1)){
  1907. $2=self._push_(_st(_st($PlatformInterface())._globals())._at_ifAbsent_(_st(aNode)._value(),(function(){
  1908. return smalltalk.withContext(function($ctx2) {
  1909. return self._error_("Unknown variable");
  1910. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})));
  1911. return $2;
  1912. };
  1913. $3=self;
  1914. $5=_st(_st(aNode)._binding())._isInstanceVar();
  1915. if(smalltalk.assert($5)){
  1916. $4=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
  1917. } else {
  1918. $4=_st(self._context())._localAt_(_st(aNode)._value());
  1919. };
  1920. _st($3)._push_($4);
  1921. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1922. args: ["aNode"],
  1923. 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 ])",
  1924. messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "globals", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:"],
  1925. referencedClasses: ["PlatformInterface"]
  1926. }),
  1927. smalltalk.ASTInterpreter);
  1928. smalltalk.addClass('ASTInterpreterError', smalltalk.Error, [], 'Compiler-Interpreter');
  1929. smalltalk.ASTInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
  1930. smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['useInlinings', 'pc', 'context', 'blockIndex', 'currentNode'], 'Compiler-Interpreter');
  1931. 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`";
  1932. smalltalk.addMethod(
  1933. smalltalk.method({
  1934. selector: "blockIndex",
  1935. category: 'accessing',
  1936. fn: function (){
  1937. var self=this;
  1938. return smalltalk.withContext(function($ctx1) {
  1939. var $2,$1;
  1940. $2=self["@blockIndex"];
  1941. if(($receiver = $2) == nil || $receiver == null){
  1942. self["@blockIndex"]=(0);
  1943. $1=self["@blockIndex"];
  1944. } else {
  1945. $1=$2;
  1946. };
  1947. return $1;
  1948. }, function($ctx1) {$ctx1.fill(self,"blockIndex",{},smalltalk.ASTPCNodeVisitor)})},
  1949. args: [],
  1950. source: "blockIndex\x0a\x09^ blockIndex ifNil: [ blockIndex := 0 ]",
  1951. messageSends: ["ifNil:"],
  1952. referencedClasses: []
  1953. }),
  1954. smalltalk.ASTPCNodeVisitor);
  1955. smalltalk.addMethod(
  1956. smalltalk.method({
  1957. selector: "context",
  1958. category: 'accessing',
  1959. fn: function (){
  1960. var self=this;
  1961. return smalltalk.withContext(function($ctx1) {
  1962. var $1;
  1963. $1=self["@context"];
  1964. return $1;
  1965. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTPCNodeVisitor)})},
  1966. args: [],
  1967. source: "context\x0a\x09^ context",
  1968. messageSends: [],
  1969. referencedClasses: []
  1970. }),
  1971. smalltalk.ASTPCNodeVisitor);
  1972. smalltalk.addMethod(
  1973. smalltalk.method({
  1974. selector: "context:",
  1975. category: 'accessing',
  1976. fn: function (aContext){
  1977. var self=this;
  1978. return smalltalk.withContext(function($ctx1) {
  1979. self["@context"]=aContext;
  1980. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTPCNodeVisitor)})},
  1981. args: ["aContext"],
  1982. source: "context: aContext\x0a\x09context := aContext",
  1983. messageSends: [],
  1984. referencedClasses: []
  1985. }),
  1986. smalltalk.ASTPCNodeVisitor);
  1987. smalltalk.addMethod(
  1988. smalltalk.method({
  1989. selector: "currentNode",
  1990. category: 'accessing',
  1991. fn: function (){
  1992. var self=this;
  1993. return smalltalk.withContext(function($ctx1) {
  1994. var $1;
  1995. $1=self["@currentNode"];
  1996. return $1;
  1997. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTPCNodeVisitor)})},
  1998. args: [],
  1999. source: "currentNode\x0a\x09^ currentNode",
  2000. messageSends: [],
  2001. referencedClasses: []
  2002. }),
  2003. smalltalk.ASTPCNodeVisitor);
  2004. smalltalk.addMethod(
  2005. smalltalk.method({
  2006. selector: "increaseBlockIndex",
  2007. category: 'accessing',
  2008. fn: function (){
  2009. var self=this;
  2010. return smalltalk.withContext(function($ctx1) {
  2011. self["@blockIndex"]=_st(self._blockIndex()).__plus((1));
  2012. return self}, function($ctx1) {$ctx1.fill(self,"increaseBlockIndex",{},smalltalk.ASTPCNodeVisitor)})},
  2013. args: [],
  2014. source: "increaseBlockIndex\x0a\x09blockIndex := self blockIndex + 1",
  2015. messageSends: ["+", "blockIndex"],
  2016. referencedClasses: []
  2017. }),
  2018. smalltalk.ASTPCNodeVisitor);
  2019. smalltalk.addMethod(
  2020. smalltalk.method({
  2021. selector: "pc",
  2022. category: 'accessing',
  2023. fn: function (){
  2024. var self=this;
  2025. return smalltalk.withContext(function($ctx1) {
  2026. var $2,$1;
  2027. $2=self["@pc"];
  2028. if(($receiver = $2) == nil || $receiver == null){
  2029. $1=(0);
  2030. } else {
  2031. $1=$2;
  2032. };
  2033. return $1;
  2034. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.ASTPCNodeVisitor)})},
  2035. args: [],
  2036. source: "pc\x0a\x09^ pc ifNil: [ 0 ]",
  2037. messageSends: ["ifNil:"],
  2038. referencedClasses: []
  2039. }),
  2040. smalltalk.ASTPCNodeVisitor);
  2041. smalltalk.addMethod(
  2042. smalltalk.method({
  2043. selector: "pc:",
  2044. category: 'accessing',
  2045. fn: function (anInteger){
  2046. var self=this;
  2047. return smalltalk.withContext(function($ctx1) {
  2048. self["@pc"]=anInteger;
  2049. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.ASTPCNodeVisitor)})},
  2050. args: ["anInteger"],
  2051. source: "pc: anInteger\x0a\x09pc := anInteger",
  2052. messageSends: [],
  2053. referencedClasses: []
  2054. }),
  2055. smalltalk.ASTPCNodeVisitor);
  2056. smalltalk.addMethod(
  2057. smalltalk.method({
  2058. selector: "useInlinings",
  2059. category: 'accessing',
  2060. fn: function (){
  2061. var self=this;
  2062. return smalltalk.withContext(function($ctx1) {
  2063. var $2,$1;
  2064. $2=self["@useInlinings"];
  2065. if(($receiver = $2) == nil || $receiver == null){
  2066. $1=true;
  2067. } else {
  2068. $1=$2;
  2069. };
  2070. return $1;
  2071. }, function($ctx1) {$ctx1.fill(self,"useInlinings",{},smalltalk.ASTPCNodeVisitor)})},
  2072. args: [],
  2073. source: "useInlinings\x0a\x09^ useInlinings ifNil: [ true ]",
  2074. messageSends: ["ifNil:"],
  2075. referencedClasses: []
  2076. }),
  2077. smalltalk.ASTPCNodeVisitor);
  2078. smalltalk.addMethod(
  2079. smalltalk.method({
  2080. selector: "useInlinings:",
  2081. category: 'accessing',
  2082. fn: function (aBoolean){
  2083. var self=this;
  2084. return smalltalk.withContext(function($ctx1) {
  2085. self["@useInlinings"]=aBoolean;
  2086. return self}, function($ctx1) {$ctx1.fill(self,"useInlinings:",{aBoolean:aBoolean},smalltalk.ASTPCNodeVisitor)})},
  2087. args: ["aBoolean"],
  2088. source: "useInlinings: aBoolean\x0a\x09useInlinings := aBoolean",
  2089. messageSends: [],
  2090. referencedClasses: []
  2091. }),
  2092. smalltalk.ASTPCNodeVisitor);
  2093. smalltalk.addMethod(
  2094. smalltalk.method({
  2095. selector: "visitBlockNode:",
  2096. category: 'visiting',
  2097. fn: function (aNode){
  2098. var self=this;
  2099. return smalltalk.withContext(function($ctx1) {
  2100. var $1,$2;
  2101. $1=_st(_st(_st(aNode)._parent())._isSendNode())._and_((function(){
  2102. return smalltalk.withContext(function($ctx2) {
  2103. return _st(_st(aNode)._parent())._shouldBeInlined();
  2104. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2105. if(smalltalk.assert($1)){
  2106. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  2107. } else {
  2108. $2=_st(self._blockIndex()).__gt_eq(_st(self._context())._index());
  2109. if(! smalltalk.assert($2)){
  2110. self._increaseBlockIndex();
  2111. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  2112. };
  2113. };
  2114. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2115. args: ["aNode"],
  2116. 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 ]",
  2117. messageSends: ["ifFalse:ifTrue:", "and:", "isSendNode", "parent", "shouldBeInlined", "ifFalse:", ">=", "blockIndex", "index", "context", "increaseBlockIndex", "visitBlockNode:"],
  2118. referencedClasses: []
  2119. }),
  2120. smalltalk.ASTPCNodeVisitor);
  2121. smalltalk.addMethod(
  2122. smalltalk.method({
  2123. selector: "visitJSStatementNode:",
  2124. category: 'visiting',
  2125. fn: function (aNode){
  2126. var self=this;
  2127. return smalltalk.withContext(function($ctx1) {
  2128. self["@currentNode"]=aNode;
  2129. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2130. args: ["aNode"],
  2131. source: "visitJSStatementNode: aNode\x0a\x09currentNode := aNode",
  2132. messageSends: [],
  2133. referencedClasses: []
  2134. }),
  2135. smalltalk.ASTPCNodeVisitor);
  2136. smalltalk.addMethod(
  2137. smalltalk.method({
  2138. selector: "visitSendNode:",
  2139. category: 'visiting',
  2140. fn: function (aNode){
  2141. var self=this;
  2142. return smalltalk.withContext(function($ctx1) {
  2143. var $1,$2,$3;
  2144. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  2145. $1=_st(self._pc()).__eq(_st(self._context())._pc());
  2146. if(! smalltalk.assert($1)){
  2147. $2=_st(aNode)._shouldBeInlined();
  2148. if(! smalltalk.assert($2)){
  2149. $3=_st(self._blockIndex()).__eq(_st(self._context())._index());
  2150. if(smalltalk.assert($3)){
  2151. self._pc_(_st(self._pc()).__plus((1)));
  2152. self["@currentNode"]=aNode;
  2153. self["@currentNode"];
  2154. };
  2155. };
  2156. };
  2157. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2158. args: ["aNode"],
  2159. 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 ] ] ]",
  2160. messageSends: ["visitSendNode:", "ifFalse:", "=", "pc", "context", "shouldBeInlined", "ifTrue:", "blockIndex", "index", "pc:", "+"],
  2161. referencedClasses: []
  2162. }),
  2163. smalltalk.ASTPCNodeVisitor);
  2164. smalltalk.addMethod(
  2165. smalltalk.method({
  2166. selector: "isSteppingNode",
  2167. category: '*Compiler-Interpreter',
  2168. fn: function (){
  2169. var self=this;
  2170. return smalltalk.withContext(function($ctx1) {
  2171. return false;
  2172. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  2173. args: [],
  2174. source: "isSteppingNode\x0a\x09^ false",
  2175. messageSends: [],
  2176. referencedClasses: []
  2177. }),
  2178. smalltalk.Node);
  2179. smalltalk.addMethod(
  2180. smalltalk.method({
  2181. selector: "isSteppingNode",
  2182. category: '*Compiler-Interpreter',
  2183. fn: function (){
  2184. var self=this;
  2185. return smalltalk.withContext(function($ctx1) {
  2186. return true;
  2187. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  2188. args: [],
  2189. source: "isSteppingNode\x0a\x09^ true",
  2190. messageSends: [],
  2191. referencedClasses: []
  2192. }),
  2193. smalltalk.AssignmentNode);
  2194. smalltalk.addMethod(
  2195. smalltalk.method({
  2196. selector: "isSteppingNode",
  2197. category: '*Compiler-Interpreter',
  2198. fn: function (){
  2199. var self=this;
  2200. return smalltalk.withContext(function($ctx1) {
  2201. return true;
  2202. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
  2203. args: [],
  2204. source: "isSteppingNode\x0a\x09^ true",
  2205. messageSends: [],
  2206. referencedClasses: []
  2207. }),
  2208. smalltalk.BlockNode);
  2209. smalltalk.addMethod(
  2210. smalltalk.method({
  2211. selector: "isSteppingNode",
  2212. category: '*Compiler-Interpreter',
  2213. fn: function (){
  2214. var self=this;
  2215. return smalltalk.withContext(function($ctx1) {
  2216. return true;
  2217. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  2218. args: [],
  2219. source: "isSteppingNode\x0a\x09^ true",
  2220. messageSends: [],
  2221. referencedClasses: []
  2222. }),
  2223. smalltalk.DynamicArrayNode);
  2224. smalltalk.addMethod(
  2225. smalltalk.method({
  2226. selector: "isSteppingNode",
  2227. category: '*Compiler-Interpreter',
  2228. fn: function (){
  2229. var self=this;
  2230. return smalltalk.withContext(function($ctx1) {
  2231. return true;
  2232. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
  2233. args: [],
  2234. source: "isSteppingNode\x0a\x09^ true",
  2235. messageSends: [],
  2236. referencedClasses: []
  2237. }),
  2238. smalltalk.DynamicDictionaryNode);
  2239. smalltalk.addMethod(
  2240. smalltalk.method({
  2241. selector: "isSteppingNode",
  2242. category: '*Compiler-Interpreter',
  2243. fn: function (){
  2244. var self=this;
  2245. return smalltalk.withContext(function($ctx1) {
  2246. return true;
  2247. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
  2248. args: [],
  2249. source: "isSteppingNode\x0a\x09^ true",
  2250. messageSends: [],
  2251. referencedClasses: []
  2252. }),
  2253. smalltalk.JSStatementNode);
  2254. smalltalk.addMethod(
  2255. smalltalk.method({
  2256. selector: "isSteppingNode",
  2257. category: '*Compiler-Interpreter',
  2258. fn: function (){
  2259. var self=this;
  2260. return smalltalk.withContext(function($ctx1) {
  2261. return true;
  2262. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  2263. args: [],
  2264. source: "isSteppingNode\x0a\x09^ true",
  2265. messageSends: [],
  2266. referencedClasses: []
  2267. }),
  2268. smalltalk.SendNode);
  2269. });