[svn:parrot] r47041 - in branches/gsoc_past_optimization: . runtime/parrot/library/PAST/Walker

tcurtis at svn.parrot.org tcurtis at svn.parrot.org
Thu May 27 01:51:03 UTC 2010


Author: tcurtis
Date: Thu May 27 01:51:03 2010
New Revision: 47041
URL: https://trac.parrot.org/parrot/changeset/47041

Log:
Add PAST::Walker::Dynamic.

Added:
   branches/gsoc_past_optimization/runtime/parrot/library/PAST/Walker/
   branches/gsoc_past_optimization/runtime/parrot/library/PAST/Walker/Dynamic.pir
Modified:
   branches/gsoc_past_optimization/MANIFEST

Modified: branches/gsoc_past_optimization/MANIFEST
==============================================================================
--- branches/gsoc_past_optimization/MANIFEST	Thu May 27 01:44:40 2010	(r47040)
+++ branches/gsoc_past_optimization/MANIFEST	Thu May 27 01:51:03 2010	(r47041)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Thu May 27 01:43:57 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu May 27 01:45:38 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1158,6 +1158,7 @@
 runtime/parrot/library/P6object.pir                         [library]
 runtime/parrot/library/PAST/Transformer.pir                 [library]
 runtime/parrot/library/PAST/Walker.pir                      [library]
+runtime/parrot/library/PAST/Walker/Dynamic.pir              [library]
 runtime/parrot/library/PCT/README                           []doc
 runtime/parrot/library/PGE/Dumper.pir                       [library]
 runtime/parrot/library/PGE/Glob.pir                         [library]

Added: branches/gsoc_past_optimization/runtime/parrot/library/PAST/Walker/Dynamic.pir
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gsoc_past_optimization/runtime/parrot/library/PAST/Walker/Dynamic.pir	Thu May 27 01:51:03 2010	(r47041)
@@ -0,0 +1,70 @@
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+.sub 'onload' :anon :init :load
+    load_bytecode 'PAST/Walker.pbc'
+    $P0 = subclass ['PAST'; 'Walker'], ['PAST'; 'Walker'; 'Dynamic']
+    addattribute $P0, 'block'
+    addattribute $P0, 'op'
+    addattribute $P0, 'stmts'
+    addattribute $P0, 'val'
+    addattribute $P0, 'var'
+.end
+
+.namespace ['PAST'; 'Walker']
+
+.sub 'walk' :multi(['PAST'; 'Walker'; 'Dynamic'], ['PAST'; 'Block'])
+    .param pmc walker
+    .param pmc node
+    $P0 = getattribute walker, 'block'
+    unless null $P0 goto has_handler
+    .tailcall 'walkChildren'(walker, node)
+has_handler:
+    .tailcall $P0(walker, node)
+.end
+
+.sub 'walk' :multi(['PAST'; 'Walker'; 'Dynamic'], ['PAST'; 'Op'])
+    .param pmc walker
+    .param pmc node
+    $P0 = getattribute walker, 'op'
+    unless null $P0 goto has_handler
+    .tailcall 'walkChildren'(walker, node)
+has_handler:
+    .tailcall $P0(walker, node)
+.end
+
+.sub 'walk' :multi(['PAST'; 'Walker'; 'Dynamic'], ['PAST'; 'Stmts'])
+    .param pmc walker
+    .param pmc node
+    $P0 = getattribute walker, 'stmts'
+    unless null $P0 goto has_handler
+    .tailcall 'walkChildren'(walker, node)
+has_handler:
+    .tailcall $P0(walker, node)
+.end
+
+.sub 'walk' :multi(['PAST'; 'Walker'; 'Dynamic'], ['PAST'; 'Val'])
+    .param pmc walker
+    .param pmc node
+    $P0 = getattribute walker, 'val'
+    unless null $P0 goto has_handler
+    .tailcall 'walkChildren'(walker, node)
+has_handler:
+    .tailcall $P0(walker, node)
+.end
+
+.sub 'walk' :multi(['PAST'; 'Walker'; 'Dynamic'], ['PAST'; 'Var'])
+    .param pmc walker
+    .param pmc node
+    $P0 = getattribute walker, 'var'
+    unless null $P0 goto has_handler
+    .tailcall 'walkChildren'(walker, node)
+has_handler:
+    .tailcall $P0(walker, node)
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:


More information about the parrot-commits mailing list