[svn:parrot] r40287 - in branches/kill_stacks: docs/book/draft lib/Parrot lib/Parrot/OpTrans

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Sun Jul 26 20:33:01 UTC 2009


Author: whiteknight
Date: Sun Jul 26 20:33:00 2009
New Revision: 40287
URL: https://trac.parrot.org/parrot/changeset/40287

Log:
[kill_stacks] remove some of the remaining references and support infrastructure for POP(). We don do dat no mo.

Modified:
   branches/kill_stacks/docs/book/draft/ch08_dynops.pod
   branches/kill_stacks/lib/Parrot/Op.pm
   branches/kill_stacks/lib/Parrot/OpTrans.pm
   branches/kill_stacks/lib/Parrot/OpTrans/C.pm
   branches/kill_stacks/lib/Parrot/OpTrans/CGP.pm
   branches/kill_stacks/lib/Parrot/OpTrans/CGoto.pm
   branches/kill_stacks/lib/Parrot/OpTrans/CSwitch.pm
   branches/kill_stacks/lib/Parrot/OpsFile.pm

Modified: branches/kill_stacks/docs/book/draft/ch08_dynops.pod
==============================================================================
--- branches/kill_stacks/docs/book/draft/ch08_dynops.pod	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/docs/book/draft/ch08_dynops.pod	Sun Jul 26 20:33:00 2009	(r40287)
@@ -206,13 +206,6 @@
 Here, C<x> is an offset in C<size_t> units that represents how far forward
 (positive) or how far backwards (negative) to jump to.
 
-=item * POP()
-
-C<POP> pops the next opcode address off the control stack. To put an address
-onto the control stack, use the C<PUSH> keyword instead. C<PUSH> takes a single
-C<opcode_t *> argument to store, and C<POP> returns a single C<opcode_ *>
-value.
-
 =back
 
 =head2 The Opcode Compiler

Modified: branches/kill_stacks/lib/Parrot/Op.pm
==============================================================================
--- branches/kill_stacks/lib/Parrot/Op.pm	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/lib/Parrot/Op.pm	Sun Jul 26 20:33:00 2009	(r40287)
@@ -329,8 +329,6 @@
     s/{{=0,\+=([^{]*?)}}/ $trans->restart_offset($1)  . "; {{=0}}"; /me;
     s/{{=0,-=([^{]*?)}}/  $trans->restart_offset(-$1) . "; {{=0}}"; /me;
 
-    s/{{=\*}}/            $trans->goto_pop();       /me;
-
     s/{{\+=([^{]*?)}}/    $trans->goto_offset($1);  /me;
     s/{{-=([^{]*?)}}/     $trans->goto_offset(-$1); /me;
     s/{{=([^*][^{]*?)}}/  $trans->goto_address($1); /me;

Modified: branches/kill_stacks/lib/Parrot/OpTrans.pm
==============================================================================
--- branches/kill_stacks/lib/Parrot/OpTrans.pm	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/lib/Parrot/OpTrans.pm	Sun Jul 26 20:33:00 2009	(r40287)
@@ -220,19 +220,6 @@
     return $self->gen_goto( $self->expr_offset(@_) );
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP($address)> macro in an ops file into the
-relevant C code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-
-    return $self->gen_goto( $self->expr_pop(@_) );
-}
-
 =item C<expr_offset($offset)>
 
 Implemented in subclasses to return the C code for C<OFFSET($offset)>.

Modified: branches/kill_stacks/lib/Parrot/OpTrans/C.pm
==============================================================================
--- branches/kill_stacks/lib/Parrot/OpTrans/C.pm	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/lib/Parrot/OpTrans/C.pm	Sun Jul 26 20:33:00 2009	(r40287)
@@ -100,18 +100,6 @@
     return "cur_opcode + $offset";
 }
 
-=item C<expr_pop()>
-
-Returns the C code for C<POP()>. Called by C<goto_offset()>.
-
-=cut
-
-sub expr_pop {
-    my ($self) = @_;
-
-    return "pop_dest(interp)";
-}
-
 our %arg_maps = (
     'op' => "cur_opcode[%ld]",
 

Modified: branches/kill_stacks/lib/Parrot/OpTrans/CGP.pm
==============================================================================
--- branches/kill_stacks/lib/Parrot/OpTrans/CGP.pm	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/lib/Parrot/OpTrans/CGP.pm	Sun Jul 26 20:33:00 2009	(r40287)
@@ -111,20 +111,6 @@
     .      "goto **(void **)(cur_opcode += $offset);\n} while (1)";
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-
-    return "goto **(void **)(cur_opcode = opcode_to_prederef(interp,
-        (opcode_t*)pop_dest(interp)))";
-}
-
 sub run_core_func_start {
     my $type = __PACKAGE__;
     return <<END_C;

Modified: branches/kill_stacks/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- branches/kill_stacks/lib/Parrot/OpTrans/CGoto.pm	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/lib/Parrot/OpTrans/CGoto.pm	Sun Jul 26 20:33:00 2009	(r40287)
@@ -174,20 +174,6 @@
     return "goto *ops_addr[*(cur_opcode += $offset)]";
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-
-    return
-"opcode_t* pop_addr = (opcode_t*)pop_dest(interp);\ncur_opcode = pop_addr;goto *ops_addr[*(pop_addr)]";
-}
-
 my %arg_maps = (
     'op' => "cur_opcode[%ld]",
 

Modified: branches/kill_stacks/lib/Parrot/OpTrans/CSwitch.pm
==============================================================================
--- branches/kill_stacks/lib/Parrot/OpTrans/CSwitch.pm	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/lib/Parrot/OpTrans/CSwitch.pm	Sun Jul 26 20:33:00 2009	(r40287)
@@ -117,20 +117,6 @@
     return "{ cur_opcode += $offset; goto SWITCH_AGAIN; }";
 }
 
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-    return "{ opcode_t *dest = (opcode_t*)pop_dest(interp);
-              cur_opcode = opcode_to_prederef(interp, dest);
-              goto SWITCH_AGAIN; }";
-}
-
 =item C<init_func_init1($base)>
 
 Returns the C code for the init function.

Modified: branches/kill_stacks/lib/Parrot/OpsFile.pm
==============================================================================
--- branches/kill_stacks/lib/Parrot/OpsFile.pm	Sun Jul 26 20:18:30 2009	(r40286)
+++ branches/kill_stacks/lib/Parrot/OpsFile.pm	Sun Jul 26 20:33:00 2009	(r40287)
@@ -114,10 +114,6 @@
 
 Transforms to C<PC' = X>. This is used for absolute jumps.
 
-=item C<goto POP()>
-
-Transforms to C<< PC' = <pop> >>. Pops the address off control stack.
-
 =item C<expr OFFSET(X)>
 
 Transforms to C<PC + X>. This is used to give a relative address.
@@ -500,7 +496,6 @@
         #   goto OFFSET(X)     {{+=X}}  PC' = PC + X  Used for branches
         #   goto NEXT()        {{+=S}}  PC' = PC + S  Where S is op size
         #   goto ADDRESS(X)    {{=X}}   PC' = X       Used for absolute jumps
-        #   goto POP()         {{=*}}   PC' = <pop>   Pop address off control stack
         #   expr OFFSET(X)     {{^+X}}  PC + X        Relative address
         #   expr NEXT()        {{^+S}}  PC + S        Where S is op size
         #   expr ADDRESS(X)    {{^X}}   X             Absolute address
@@ -536,9 +531,6 @@
         $branch   ||= $body =~ s/\bgoto\s+OFFSET\((.*?)\)/{{+=$1}}/mg;
                       $body =~ s/\bexpr\s+OFFSET\((.*?)\)/{{^+$1}}/mg;
 
-        $pop      ||= $body =~ s/\bgoto\s+POP\(\)/{{=*}}/mg;
-                      $body =~ s/\bexpr\s+POP\(\)/{{^*}}/mg;
-
         $next     ||= $short_name =~ /runinterp/;
         $next     ||= $body =~ s/\bexpr\s+NEXT\(\)/{{^+$op_size}}/mg;
                       $body =~ s/\bgoto\s+NEXT\(\)/{{+=$op_size}}/mg;
@@ -579,7 +571,6 @@
         # Constants here are defined in include/parrot/op.h
         or_flag( \$jumps, "PARROT_JUMP_ADDRESS"  ) if $absolute;
         or_flag( \$jumps, "PARROT_JUMP_RELATIVE" ) if $branch;
-        or_flag( \$jumps, "PARROT_JUMP_POP"      ) if $pop;
         or_flag( \$jumps, "PARROT_JUMP_ENEXT"    ) if $next;
         or_flag( \$jumps, "PARROT_JUMP_RESTART"  ) if $restart;
 
@@ -675,7 +666,6 @@
 
         #s/goto\s+NEXT\(\)/{{+=$op_size}}/mg;   #not supported--dependent on op size
         s/goto\s+ADDRESS\((.*)\)/{{=$1}}/mg;
-        s/goto\s+POP\(\)/{{=*}}/mg;
         s/HALT\(\)/{{=0}}/mg;
 
         # RT#43721: This ought to throw errors when attempting to rewrite $n


More information about the parrot-commits mailing list