[svn:parrot] r46364 - trunk/runtime/parrot/library/PGE

bacek at svn.parrot.org bacek at svn.parrot.org
Thu May 6 15:01:01 UTC 2010


Author: bacek
Date: Thu May  6 15:01:00 2010
New Revision: 46364
URL: https://trac.parrot.org/parrot/changeset/46364

Log:
Migrate PGE::Dumper to StringBuilder and avoid usage of concat_s_s op.

Modified:
   trunk/runtime/parrot/library/PGE/Dumper.pir

Modified: trunk/runtime/parrot/library/PGE/Dumper.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Dumper.pir	Thu May  6 15:00:46 2010	(r46363)
+++ trunk/runtime/parrot/library/PGE/Dumper.pir	Thu May  6 15:01:00 2010	(r46364)
@@ -112,8 +112,10 @@
     if has_b1 goto start
     b1 = "["
   start:
-    .local string out
-    out = concat prefix, ':'
+    .local pmc out
+    out = new ['StringBuilder']
+    out = prefix
+    out .= ':'
     unless self goto subpats
     out .= ' <'
     $S0 = self
@@ -136,8 +138,8 @@
     unless spi < spc goto subrules
     prefix1 = concat prefix, b1
     $S0 = spi
-    concat prefix1, $S0
-    concat prefix1, b2
+    prefix1 = concat prefix1, $S0
+    prefix1 = concat prefix1, b2
     $I0 = defined capt[spi]
     unless $I0 goto subpats_2
     $P0 = capt[spi]
@@ -154,8 +156,8 @@
     unless it goto end
     $S0 = shift it
     prefix1 = concat prefix, '<'
-    concat prefix1, $S0
-    concat prefix1, ">"
+    prefix1 = concat prefix1, $S0
+    prefix1 = concat prefix1, ">"
     $I0 = defined capt[$S0]
     unless $I0 goto subrules_1
     $P0 = capt[$S0]
@@ -178,8 +180,8 @@
     $P1 = $P0[$I0]
     prefix2 = concat prefix1, b1
     $S0 = $I0
-    concat prefix2, $S0
-    concat prefix2, b2
+    prefix2 = concat prefix2, $S0
+    prefix2 = concat prefix2, b2
     $S0 = $P1.'dump_str'(prefix2, b1, b2)
     out .= $S0
     inc $I0
@@ -195,7 +197,8 @@
     local_return jmpstack
 
   end:
-    .return (out)
+    $S0 = out
+    .return ($S0)
 .end
 
 


More information about the parrot-commits mailing list