[svn:parrot] r40223 - in branches/bsr_jsr_ret: compilers/nqp/src/Grammar compilers/pct/src/PAST runtime/parrot/library/PGE

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Wed Jul 22 23:47:48 UTC 2009


Author: whiteknight
Date: Wed Jul 22 23:47:47 2009
New Revision: 40223
URL: https://trac.parrot.org/parrot/changeset/40223

Log:
[bsr_jsr_ret] replace bsr/ret with local_branch/local_return on suggestion from pmichaud++. Parrot builds, but fails plenty of tests

Modified:
   branches/bsr_jsr_ret/compilers/nqp/src/Grammar/Actions.pir
   branches/bsr_jsr_ret/compilers/pct/src/PAST/Compiler.pir
   branches/bsr_jsr_ret/runtime/parrot/library/PGE/Dumper.pir
   branches/bsr_jsr_ret/runtime/parrot/library/PGE/Hs.pir

Modified: branches/bsr_jsr_ret/compilers/nqp/src/Grammar/Actions.pir
==============================================================================
--- branches/bsr_jsr_ret/compilers/nqp/src/Grammar/Actions.pir	Wed Jul 22 23:46:14 2009	(r40222)
+++ branches/bsr_jsr_ret/compilers/nqp/src/Grammar/Actions.pir	Wed Jul 22 23:47:47 2009	(r40223)
@@ -152,10 +152,12 @@
     .param pmc match
     .local pmc expr, block, past
     .local int cond
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
     cond = match['EXPR']
     cond -= 1
-    bsr get_expr
-    bsr get_block
+    local_branch jmpstack, get_expr
+    local_branch jmpstack, get_block
     $P2 = get_hll_global ['PAST'], 'Op'
     past = $P2.'new'(expr, block, 'pasttype'=>'if', 'node'=>match)
 
@@ -169,8 +171,8 @@
   while:
     unless cond != 0 goto end_while
     cond -= 1
-    bsr get_expr
-    bsr get_block
+    local_branch jmpstack, get_expr
+    local_branch jmpstack, get_block
     past = $P2.'new'(expr, block, past, 'pasttype'=>'if', 'node'=>match)
     goto while
 
@@ -181,12 +183,12 @@
     expr = match['EXPR']
     expr = expr[cond]
     expr = expr.'ast'()
-    ret
+    local_return jmpstack
   get_block:
     block = match['block']
     block = block[cond]
     block = block.'ast'()
-    ret
+    local_return jmpstack
   end:
     match.'!make'(past)
 .end

Modified: branches/bsr_jsr_ret/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/bsr_jsr_ret/compilers/pct/src/PAST/Compiler.pir	Wed Jul 22 23:46:14 2009	(r40222)
+++ branches/bsr_jsr_ret/compilers/pct/src/PAST/Compiler.pir	Wed Jul 22 23:47:47 2009	(r40223)
@@ -1187,11 +1187,13 @@
 
     exprpost = self.'as_post'(exprpast, 'rtype'=>exprrtype)
 
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
     childpast = thenpast
-    bsr make_childpost
+    local_branch jmpstack, make_childpost
     thenpost = childpost
     childpast = elsepast
-    bsr make_childpost
+    local_branch jmpstack, make_childpost
     elsepost = childpost
 
     if null elsepost goto no_elsepost
@@ -1241,7 +1243,7 @@
     unless result goto ret_childpost
     childpost = self.'coerce'(childpost, result)
   ret_childpost:
-    ret
+    local_return jmpstack
 .end
 
 .sub 'unless' :method :multi(_, ['PAST';'Op'])

Modified: branches/bsr_jsr_ret/runtime/parrot/library/PGE/Dumper.pir
==============================================================================
--- branches/bsr_jsr_ret/runtime/parrot/library/PGE/Dumper.pir	Wed Jul 22 23:46:14 2009	(r40222)
+++ branches/bsr_jsr_ret/runtime/parrot/library/PGE/Dumper.pir	Wed Jul 22 23:47:47 2009	(r40223)
@@ -139,7 +139,9 @@
     $I0 = defined capt[spi]
     unless $I0 goto subpats_2
     $P0 = capt[spi]
-    bsr dumper
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
+    local_branch jmpstack, dumper
   subpats_2:
     inc spi
     goto subpats_1
@@ -157,7 +159,7 @@
     $I0 = defined capt[$S0]
     unless $I0 goto subrules_1
     $P0 = capt[$S0]
-    bsr dumper
+    local_branch jmpstack, dumper
     goto subrules_1
 
   dumper:
@@ -165,7 +167,7 @@
     unless $I0 goto dumper_0
     $S0 = $P0.'dump_str'(prefix1, b1, b2)
     out .= $S0
-    ret
+    local_return jmpstack
   dumper_0:
     $I0 = does $P0, 'array'
     unless $I0 goto dumper_3
@@ -183,14 +185,14 @@
     inc $I0
     goto dumper_1
   dumper_2:
-    ret
+    local_return jmpstack
   dumper_3:
     out .= prefix1
     out .= ': '
     $S0 = $P0
     out .= $S0
     out .= "\n"
-    ret
+    local_return jmpstack
 
   end:
     .return (out)

Modified: branches/bsr_jsr_ret/runtime/parrot/library/PGE/Hs.pir
==============================================================================
--- branches/bsr_jsr_ret/runtime/parrot/library/PGE/Hs.pir	Wed Jul 22 23:46:14 2009	(r40222)
+++ branches/bsr_jsr_ret/runtime/parrot/library/PGE/Hs.pir	Wed Jul 22 23:47:47 2009	(r40223)
@@ -192,7 +192,9 @@
     cond = defined capt[spi]
     unless cond goto subpats_fail
     elm = capt[spi]
-    bsr dumper
+    .local pmc jmpstack
+    jmpstack = new 'ResizableIntegerArray'
+    local_branch jmpstack, dumper
     inc spi
     goto subpats_loop
   subpats_fail:
@@ -215,7 +217,7 @@
     tmps = escape key
     out .= tmps
     out .= '", '
-    bsr dumper
+    local_branch jmpstack, dumper
     out .= ")"
     unless it goto end
     out .= ", "
@@ -233,20 +235,20 @@
     unless $I0 goto dumper_string
     tmps = elm."dump_hs"()
     out .= tmps
-    ret
+    local_return jmpstack
   dumper_string:
     $S0 = elm
     tmps = escape $S0
     out .= 'PGE_String "'
     out .= tmps
     out .= '"'
-    ret
+    local_return jmpstack
   dumper_fail:
     out .= PGE_FAIL
     ret
   dumper_done:
     out .= "]"
-    ret
+    local_return jmpstack
   dumper_array:
     ari = 0
     arc = elements elm


More information about the parrot-commits mailing list