Author: leo
Date: Thu Aug 11 08:54:19 2005
New Revision: 8916

Modified:
   branches/leo-ctx5/imcc/cfg.c
   branches/leo-ctx5/imcc/pcc.c
   branches/leo-ctx5/imcc/t/imcpasm/sub.t
   branches/leo-ctx5/imcc/t/reg/alloc.t
   branches/leo-ctx5/imcc/t/syn/objects.t
   branches/leo-ctx5/imcc/t/syn/pcc.t
   branches/leo-ctx5/ops/core.ops
   branches/leo-ctx5/ops/ops.num
   branches/leo-ctx5/t/op/gc.t
   branches/leo-ctx5/t/op/interp.t
   branches/leo-ctx5/t/pmc/coroutine.t
   branches/leo-ctx5/t/pmc/eval.t
   branches/leo-ctx5/t/pmc/exception.t
   branches/leo-ctx5/t/pmc/freeze.t
   branches/leo-ctx5/t/pmc/nci.t
   branches/leo-ctx5/t/pmc/object-meths.t
   branches/leo-ctx5/t/pmc/pmc.t
   branches/leo-ctx5/t/pmc/sub.t
Log:
Call opcode cleanup part 1

* make register usage of invoke opcodes explicit
* new opcode: yield
* invalidated: updatecc, invoke, invokecc with implicit args
* adjust a bunch of PASM test
* create the new ops for PIR, simplify pcc.c

Please make realclean ... and remove other existing PBCs
The same 2 stream tests are failing.


Modified: branches/leo-ctx5/imcc/cfg.c
==============================================================================
--- branches/leo-ctx5/imcc/cfg.c        (original)
+++ branches/leo-ctx5/imcc/cfg.c        Thu Aug 11 08:54:19 2005
@@ -528,7 +528,7 @@ analyse_life_symbol(Parrot_Interp interp
                 prev = ins->prev;
                 if (prev->type & (ITPCCSUB|ITPCCYIELD))
                     r->usage |= U_NON_VOLATILE;
-                else if (prev->opnum == PARROT_OP_invokecc ||
+                else if (prev->opnum == PARROT_OP_invoke_p_p ||
                          prev->opnum == PARROT_OP_invokecc_p)
                     r->usage |= U_NON_VOLATILE;
                 else if (ins->type & ITADDR)

Modified: branches/leo-ctx5/imcc/pcc.c
==============================================================================
--- branches/leo-ctx5/imcc/pcc.c        (original)
+++ branches/leo-ctx5/imcc/pcc.c        Thu Aug 11 08:54:19 2005
@@ -225,17 +225,7 @@ expand_pcc_sub_ret(Parrot_Interp interp,
      * we have a pcc_begin_yield
      */
     if (is_yield) {
-        char buf[16];
-        /*
-         * get current sub
-         *
-         */
-        regs[0] = get_pasm_reg(interp, "P0");
-        sprintf(buf, "%d", CURRENT_SUB);
-        regs[1] = get_const(interp, buf, 'I');
-        ins = insINS(interp, unit, ins, "interpinfo", regs, 2);
-        regs[0] = get_pasm_reg(interp, "P0");
-        ins = insINS(interp, unit, ins, "invoke", regs, 1);
+        ins = insINS(interp, unit, ins, "yield", regs, 0);
     }
     else {
         /*
@@ -279,7 +269,6 @@ expand_pcc_sub_call(Parrot_Interp interp
 {
     SymReg *arg, *sub, *reg, *regs[2];
     int  n;
-    int need_cc;
     int tail_call;
     int meth_call = 0;
     SymReg *s0 = NULL;
@@ -388,21 +377,6 @@ expand_pcc_sub_call(Parrot_Interp interp
             return;
         }
     }
-    /*
-     * if an explicit return continuation is passed, set it to P1
-     */
-    arg = sub->pcc_sub->cc;
-    need_cc = 0;
-    if (arg) {
-        if (arg->color != 1) {
-            reg = get_pasm_reg(interp, "P1");
-            regs[0] = reg;
-            regs[1] = arg;
-            ins = insINS(interp, unit, ins, "set", regs, 2);
-        }
-    }
-    else if (!(sub->pcc_sub->flags & isNCI))
-        need_cc = 1;
 
     /*
      * handle return results
@@ -416,6 +390,7 @@ expand_pcc_sub_call(Parrot_Interp interp
      * takes method-like arguments according to pdd03
      *
      * so convert to opcode and await the returned PMC as P5
+     * XXX FIXME
      */
     if (meth_call && s0 && strcmp(s0->name, "\"instantiate\"") == 0) {
         SymReg *p5 = get_pasm_reg(interp, "P5");
@@ -423,25 +398,24 @@ expand_pcc_sub_call(Parrot_Interp interp
         ins = insINS(interp, unit, ins, "instantiate", regs, 1);
     }
     else {
-        /*
-         * if we reuse the continuation, update it
-         */
-        if (!(sub->pcc_sub->flags & isNCI))
-            if (!need_cc)
-                ins = insINS(interp, unit, ins, "updatecc", regs, 0);
         /* insert the call */
         if (meth_call && sub->pcc_sub->sub->set != 'P') {
             regs[0] = s0;
             n = 0;
             if (s0)
                 n = 1;
-            ins = insINS(interp, unit, ins,
-                    need_cc ? "callmethodcc" : "callmethod", regs, n);
+            ins = insINS(interp, unit, ins, "callmethodcc" , regs, n);
         }
         else {
             regs[0] = sub->pcc_sub->sub;
-            ins = insINS(interp, unit, ins,
-                    need_cc ? "invokecc" : "invoke", regs, 1);
+            arg = sub->pcc_sub->cc;
+            if (arg) {
+                regs[1] = arg;
+                ins = insINS(interp, unit, ins, "invoke" ,regs, 2);
+            }
+            else {
+                ins = insINS(interp, unit, ins, "invokecc" ,regs, 1);
+            }
         }
         ins->type |= ITPCCSUB;
         /*

Modified: branches/leo-ctx5/imcc/t/imcpasm/sub.t
==============================================================================
--- branches/leo-ctx5/imcc/t/imcpasm/sub.t      (original)
+++ branches/leo-ctx5/imcc/t/imcpasm/sub.t      Thu Aug 11 08:54:19 2005
@@ -11,7 +11,7 @@ pir_2_pasm_like(<<'CODE', <<'OUT', "non-
     $P26 = new Sub
     $I15 = addr _sub1
     $P26 = $I15
-    invoke $P26
+    invokecc $P26
     ret
 _sub1:
     ret
@@ -23,7 +23,7 @@ _main:
  new P(\d+), \d+ # \.Sub
  set_addr I(\d+), _sub1
  set P\1, I\2
- invoke P\1
+ invokecc P\1
  ret
 _sub1:
  ret/
@@ -34,7 +34,7 @@ pir_2_pasm_like(<<'CODE', <<'OUT', "nonl
     $P26 = new Sub
     $I15 = addr _f
     $P26 = $I15
-    invoke $P26
+    invokecc $P26
     ret
 .end
 .sub _f
@@ -47,7 +47,7 @@ _main:
  new P(\d+), \d+ # \.Sub
  set_addr I(\d+), _f
  set P\1, I\2
- invoke P\1
+ invokecc P\1
  ret
 _f:
  ret/

Modified: branches/leo-ctx5/imcc/t/reg/alloc.t
==============================================================================
--- branches/leo-ctx5/imcc/t/reg/alloc.t        (original)
+++ branches/leo-ctx5/imcc/t/reg/alloc.t        Thu Aug 11 08:54:19 2005
@@ -26,7 +26,7 @@ ex:
 .end
 .sub alligator
     get_params "(0)", $P0
-    invoke $P0
+    invokecc $P0
 .end
 CODE
 Hi

Modified: branches/leo-ctx5/imcc/t/syn/objects.t
==============================================================================
--- branches/leo-ctx5/imcc/t/syn/objects.t      (original)
+++ branches/leo-ctx5/imcc/t/syn/objects.t      Thu Aug 11 08:54:19 2005
@@ -126,7 +126,7 @@ pir_output_is(<<'CODE', <<'OUT', "initia
     find_type I1, "Baz"
     new P3, I1
     find_global P0, "_sub"
-    invokecc
+    invokecc P0
     print "done\n"
     end
 .end

Modified: branches/leo-ctx5/imcc/t/syn/pcc.t
==============================================================================
--- branches/leo-ctx5/imcc/t/syn/pcc.t  (original)
+++ branches/leo-ctx5/imcc/t/syn/pcc.t  Thu Aug 11 08:54:19 2005
@@ -357,7 +357,7 @@ pir_output_is(<<'CODE', <<'OUT', "corout
   .pcc_end
     print $I2
     print "\n"
-    invoke $P0
+    invokecc $P0
     goto ret_addr
  after_loop:
   print "done in main\n"
@@ -379,7 +379,7 @@ pir_output_is(<<'CODE', <<'OUT', "corout
     goto loop
  done:
   print "done in coroutine\n"
-  invoke when_done
+  invokecc when_done
   end
 .end
 CODE
@@ -1341,10 +1341,8 @@ pir_output_is(<<'CODE', <<'OUT', "onelin
   .pcc_end
     print $I2
     print "\n"
-    savetop
-    invoke $P0
+    invokecc $P0
     goto ret_addr
-    restoretop
  after_loop:
   print "done in main\n"
   end
@@ -1363,7 +1361,7 @@ pir_output_is(<<'CODE', <<'OUT', "onelin
     goto loop
  done:
   print "done in coroutine\n"
-  invoke when_done
+  invokecc when_done
   end
 .end
 CODE

Modified: branches/leo-ctx5/ops/core.ops
==============================================================================
--- branches/leo-ctx5/ops/core.ops      (original)
+++ branches/leo-ctx5/ops/core.ops      Thu Aug 11 08:54:19 2005
@@ -379,66 +379,38 @@ continuations.
 
 ########################################
 
-=item B<invoke>()
-
-Call the subroutine in P0, with Parrot calling convention as
-described in PDD03.
-
-=item B<invoke>(in PMC)
+=item B<invokecc>(in PMC)
 
-Call the subroutine in $1 with no defined calling convention or invoke
-a continuation for returning from a subroutine.
+Call the subroutine in $1 and generate a new return continuation, if needed.
+E.g. a NCI subroutine, which executes code in some C library will not
+create a continuation, neither the not-first call to a coroutine.
 
-=item B<invokecc>()
+=item B<invoke>(in PMC, in PMC)
 
-Call the subroutine in P0 and generate a new return continuation in P1.
+Call the subroutine in $1 and use continuation $2.
 
-=item B<invokecc>(in PMC)
+=item B<yield>()
 
-Call the subroutine in $1 and generate a new return continuation in P1.
+Yield results from a coroutine.
 
 =item B<tailcall>(in PMC)
 
 Call the subroutine in $1 and use the current continuation as the subs
 continuation.
 
-=item B<updatecc>()
-
-Update the state of the return continuation in P1. This is necessary,
-when any context stuff was changed between creating the return continuation
-and invoke'ing it.
-
 =item B<returncc>()
 
 Return from the sub or method via the current continuation.
 
 =cut
 
-inline op invoke() {
-  opcode_t *dest;
-  PMC * p = REG_PMC(0);
-
-  interpreter->current_object = NULL;
-  interpreter->current_cont = REG_PMC(1);
-  dest = (opcode_t *)p->vtable->invoke(interpreter, p, expr NEXT());
-
-  goto ADDRESS(dest);
+inline op DELETED_invoke() {
+  goto NEXT();
 }
 
-inline op invoke(in PMC) {
+inline op invokecc(in PMC) {
   opcode_t *dest;
   PMC * p = $1;
-
-  interpreter->current_object = NULL;
-  interpreter->current_cont = REG_PMC(1);
-  dest = (opcode_t *)p->vtable->invoke(interpreter, p, expr NEXT());
-
-  goto ADDRESS(dest);
-}
-
-inline op invokecc() {
-  opcode_t *dest;
-  PMC * p = REG_PMC(0);
   dest = expr NEXT();
   interpreter->current_object = NULL;
   interpreter->current_cont = NEED_CONTINUATION;
@@ -446,12 +418,19 @@ inline op invokecc() {
   goto ADDRESS(dest);
 }
 
-inline op invokecc(in PMC) {
+inline op invoke(in PMC, in PMC) {
   opcode_t *dest;
   PMC * p = $1;
-  dest = expr NEXT();
+
   interpreter->current_object = NULL;
-  interpreter->current_cont = NEED_CONTINUATION;
+  interpreter->current_cont = $2;
+  dest = (opcode_t *)p->vtable->invoke(interpreter, p, expr NEXT());
+  goto ADDRESS(dest);
+}
+
+inline op yield() {
+  opcode_t *dest = expr NEXT();
+  PMC * p = CONTEXT(interpreter->ctx)->current_sub;
   dest = (opcode_t *)p->vtable->invoke(interpreter, p, dest);
   goto ADDRESS(dest);
 }
@@ -466,7 +445,7 @@ inline op tailcall(in PMC) {
   goto ADDRESS(dest);
 }
 
-inline op updatecc() {
+inline op DELETED_updatecc() {
   goto NEXT();
 }
 

Modified: branches/leo-ctx5/ops/ops.num
==============================================================================
--- branches/leo-ctx5/ops/ops.num       (original)
+++ branches/leo-ctx5/ops/ops.num       Thu Aug 11 08:54:19 2005
@@ -469,9 +469,9 @@ interpinfo_p_ic                 438
 intrestore_i                    439
 intsave_i                       440
 intsave_ic                      441
-invoke                          442
-invoke_p                        443
-invokecc                        444
+DELETED_invoke                          442
+invoke_p_p                      443
+yield                           444
 invokecc_p                      445
 isa_i_p_s                       446
 isa_i_p_sc                      447
@@ -1241,7 +1241,7 @@ unshift_p_sc                   1210
 upcase_s                       1211
 upcase_s_s                     1212
 upcase_s_sc                    1213
-updatecc                       1214
+DELETED_updatecc                       1214
 valid_type_i_i                 1215
 valid_type_i_ic                1216
 warningsoff_i                  1217

Modified: branches/leo-ctx5/t/op/gc.t
==============================================================================
--- branches/leo-ctx5/t/op/gc.t (original)
+++ branches/leo-ctx5/t/op/gc.t Thu Aug 11 08:54:19 2005
@@ -147,7 +147,7 @@ _main:
     set I17, 0
 loop:
     sweep 1
-    invokecc
+    invokecc P0
     inc I17
     lt I17, I16, loop
     print "ok\n"
@@ -257,7 +257,7 @@ output_is(<<'CODE', <<OUTPUT, "coro cont
 .include "interpinfo.pasm"
     newsub P0, .Coroutine, co1
 l:
-    invokecc
+    invokecc P0
     inc I20
     lt I20, 3, l
     print "done\n"
@@ -267,8 +267,7 @@ co1:
 col:
     print "coro\n"
     sweep 1
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
     branch col
 CODE
 coro

Modified: branches/leo-ctx5/t/op/interp.t
==============================================================================
--- branches/leo-ctx5/t/op/interp.t     (original)
+++ branches/leo-ctx5/t/op/interp.t     Thu Aug 11 08:54:19 2005
@@ -158,7 +158,7 @@ output_is(<<'CODE', <<'OUTPUT', "clone a
     clone P3, P2
     print "ok 1\n"
     set_addr P3, _foo
-    invoke P3
+    invokecc P3
     print P0
     print I0
     print S0
@@ -188,7 +188,7 @@ output_is(<<'CODE', <<'OUTPUT', "clone a
     clone P3, P2
     print "ok 1\n"
     set_addr P3, _foo
-    invoke P3
+    invokecc P3
     print P0
     print I0
     print S0
@@ -223,7 +223,7 @@ output_is(<<'CODE', <<'OUTPUT', "clone a
     clone P3, P2
     print "ok 1\n"
     set_addr P3, _foo
-    invoke P3
+    invokecc P3
 cont:
     print P0
     print I0

Modified: branches/leo-ctx5/t/pmc/coroutine.t
==============================================================================
--- branches/leo-ctx5/t/pmc/coroutine.t (original)
+++ branches/leo-ctx5/t/pmc/coroutine.t Thu Aug 11 08:54:19 2005
@@ -37,8 +37,7 @@ lp:
 _coro:
     find_global P11, "i"
     dec P11
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
     branch _coro
 CODE
 back 1
@@ -57,7 +56,7 @@ co1:
     set I10, 4
     print "start 1\n"
 co1_loop:
-    invoke
+    invokecc P0
     print "back  1\n"
     dec I10
     ne I10, 0, co1_loop
@@ -72,11 +71,10 @@ co2:
     set_addr P5, co3
     set P6, P0
 co2_loop:
-    invoke
+    invokecc P0
     print "back  2\n"
     set I3, I3
-    set P0, P5
-    invoke
+    invokecc P5
     print "back  2b\n"
     set P0, P6
     branch co2_loop
@@ -89,11 +87,11 @@ co3:
     set_addr P7, co2_loop
     set P8, P0
 co3_loop:
-    invoke
+    invokecc P0
     print "back  3\n"
     set I3, I3
     set P0, P7
-    invoke
+    invokecc P7
     print "back  3b\n"
     set P0, P8
     branch co3_loop
@@ -132,7 +130,7 @@ output_is(<<'CODE', <<'OUTPUT', "Corouti
     invokecc P0
     find_lex P21, "a"
     print P21
-    invoke P0
+    invokecc P0
     print P21
     print "done\n"
     end
@@ -143,10 +141,9 @@ co1:
     set P22, "coro\n"
 
     store_lex -1, "a", P22
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
     print P22
-    invoke P0
+    yield
 CODE
 main
 coro
@@ -187,7 +184,7 @@ output_is(<<'CODE', <<'OUTPUT', "Corouti
     print P10
     print "\n"
 
-    invoke P5
+    invokecc P5
 
     find_lex P10, "b"
     print P10
@@ -197,7 +194,7 @@ output_is(<<'CODE', <<'OUTPUT', "Corouti
     print P10
     print "\n"
 
-    invoke P5
+    invokecc P5
 
     print "done\n"
     end
@@ -216,7 +213,7 @@ co1:
     invokecc P6
 
     # return
-    invoke P5
+    yield
 
     find_lex P10, "b"
     print P10
@@ -227,7 +224,7 @@ co1:
     print "\n"
 
     # return again
-    invoke P5
+    yield
 
     find_lex P10, "b"
     print P10
@@ -238,14 +235,13 @@ co1:
     print "\n"
 
     # return again
-    invoke P5
+    yield
 
 co2:
     new_pad 1
 
     # return
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
 
 CODE
 21
@@ -340,8 +336,7 @@ _coro:
 corolp:
     find_global P17, "i"
     dec P17
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
     branch corolp
 _catchc:
     print "catch coro\n"
@@ -377,8 +372,7 @@ _coro:
 corolp:
     find_global P17, "i"
     dec P17
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
     find_global P17, "no_such"
     branch corolp
 _catchc:
@@ -413,8 +407,7 @@ _coro:
 corolp:
     find_global P17, "i"
     dec P17
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
     find_global P17, "no_such"
     branch corolp
 _catchc:
@@ -451,8 +444,7 @@ _coro:
 corolp:
     find_global P17, "i"
     dec P17
-    interpinfo P0, .INTERPINFO_CURRENT_SUB
-    invoke P0
+    yield
     find_global P17, "no_such"
     branch corolp
 _catchc:

Modified: branches/leo-ctx5/t/pmc/eval.t
==============================================================================
--- branches/leo-ctx5/t/pmc/eval.t      (original)
+++ branches/leo-ctx5/t/pmc/eval.t      Thu Aug 11 08:54:19 2005
@@ -215,7 +215,7 @@ output_is(<<'CODE', <<'OUTPUT', "compile
     compreg P1, "PAST" # get compiler
     set_args "(0)", 'Parrot_AST( PCC_Sub( Stmts( Py_Print( Const(8) ) 
Py_Print_nl() ) ) )'
     get_results "(0)", P6
-    invoke P1
+    invokecc P1
     print "before\n"
     invokecc P6
     invokecc P6
@@ -248,7 +248,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "com
             pasm_source .= "set S1, 'Parrot_AST( PCC_Sub( Stmts( Py_Print( 
Const(8) ) Py_Print_nl() ) ) )'\n"
            pasm_source .= "set_args \"(0)\", S1\n"
             pasm_source .= "get_results \"(0)\", P6\n"
-            pasm_source .= "invoke P1\n"
+            pasm_source .= "invokecc P1\n"
         # PASM
         pasm_source .= "print \"PASM: before\\n\"\n"
         pasm_source .= "invokecc P6\n"

Modified: branches/leo-ctx5/t/pmc/exception.t
==============================================================================
--- branches/leo-ctx5/t/pmc/exception.t (original)
+++ branches/leo-ctx5/t/pmc/exception.t Thu Aug 11 08:54:19 2005
@@ -489,7 +489,7 @@ pir_output_is(<<'CODE', <<'OUTPUT', "pus
     .local pmc cc
     cc = interpinfo .INTERPINFO_CURRENT_CONT
     print "foo\n"
-    invoke cc
+    invokecc cc
 .end
 
 .sub action

Modified: branches/leo-ctx5/t/pmc/freeze.t
==============================================================================
--- branches/leo-ctx5/t/pmc/freeze.t    (original)
+++ branches/leo-ctx5/t/pmc/freeze.t    Thu Aug 11 08:54:19 2005
@@ -375,7 +375,7 @@ output_is(<<'CODE', <<'OUTPUT', "freeze/
     typeof S10, P0
     print S10
     print "\n"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 .pcc_sub _foo:
@@ -763,12 +763,12 @@ OUTPUT
 
 pir_output_is(<<'CODE', <<'OUTPUT', "freeze/thaw a ResizableBooleanArray");
 .sub test @MAIN
-    .local pmc original_arr, thawed_arr 
+    .local pmc original_arr, thawed_arr
     .local string frozen_arr
-    original_arr = new ResizableBooleanArray 
+    original_arr = new ResizableBooleanArray
     set original_arr, 666
     original_arr[555] = 777
-    
+
     # Dump some data before freezing
     print "Before freezing:\n"
     typeof S10, original_arr   # type

Modified: branches/leo-ctx5/t/pmc/nci.t
==============================================================================
--- branches/leo-ctx5/t/pmc/nci.t       (original)
+++ branches/leo-ctx5/t/pmc/nci.t       Thu Aug 11 08:54:19 2005
@@ -359,7 +359,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_dd 
   print "dlfunced\n"
   set_args "(0)", 4.0
   get_results "(0)", N5
-  invoke P0
+  invokecc P0
   ne N5, 8.0, nok_1
   print "ok 1\n"
   end
@@ -433,7 +433,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_fff
   set N6, 3.0
   set_args "(0,0)", N5, N6
   get_results "(0)", N5
-  invoke P0
+  invokecc P0
   ne N5, 4.0, nok_1
   print "ok 1\n"
   end
@@ -457,7 +457,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_isc
   set I6, 3
   set_args "(0,0)", I5, I6
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   ne I5, 6, nok_1
   print "ok 1\n"
   end
@@ -481,7 +481,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_ssc
   set I6, 3
   set_args "(0,0)", I5, I6
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   ne I5, 6, nok_1
   print "ok 1\n"
   end
@@ -505,7 +505,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_csc
   set I6, 7
   set_args "(0,0)", I5, I6
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   ne I5, 42, nok_1
   print "ok 1\n"
   end
@@ -528,7 +528,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_it"
   set S5, "ko\n"
   set_args "(0)", S5
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   ne I5, 2, nok_1
   printerr "ok 2\n"
   end
@@ -554,7 +554,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_tt"
   set S5, "ko\n"
   set_args "(0)", S5
   get_results "(0)", S5
-  invoke P0
+  invokecc P0
   print S5
   end
 nok_1: print "nok 1\n"
@@ -580,7 +580,7 @@ loop:
   set N5, 77.0
   set_args "(0)", 4.0
   get_results "(0)", N5
-  invoke P0
+  invokecc P0
   ne N5, 8.0, nok_1
   dec I10
   gt I10, 0, loop
@@ -608,12 +608,12 @@ output_is(<<'CODE', <<'OUTPUT', "nci_dd 
   print "ok 1\n"
   set_args "(0)", 4.0
   get_results "(0)", N5
-  invoke P0
+  invokecc P0
   ne N5, 8.0, nok_1
   print "ok 2\n"
   set_args "(0)", 4.0
   get_results "(0)", N5
-  invoke P2
+  invokecc P2
   ne N5, 8.0, nok_1
   end
 nok_1: print "nok 1\n"
@@ -636,7 +636,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_iii
   set I7, 30
   set_args "(0,0,0)", I5,I6,I7
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   print I5
   print "\n"
   end
@@ -654,7 +654,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_i4i
   set I5, -7
   set_args "(0,0)", P5,I5
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   print I5
   print "\n"
   end
@@ -674,7 +674,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_ii3
 
   set_args "(0,0)", I5,P5
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
 
   print I5
   print "\n"
@@ -692,7 +692,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_tb"
   set S5, "ko\n"
   set_args "(0)", S5
   get_results "(0)", S5
-  invoke P0
+  invokecc P0
   print S5
   end
 CODE
@@ -705,7 +705,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_tB"
   set S5, "ko\n"
   set_args "(0)", S5
   get_results "(0)", S5
-  invoke P0
+  invokecc P0
   print S5
   end
 CODE
@@ -720,7 +720,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   set I5, 0
   set_args "(0)", I5
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
   new P2, .ResizablePMCArray
 .include "datatypes.pasm"
   push P2, .DATATYPE_INT
@@ -753,7 +753,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   # this test function returns a struct { float[2]; double }
   set_args "(0)", 1
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
   new P2, .ResizablePMCArray
 .include "datatypes.pasm"
   push P2, .DATATYPE_FLOAT
@@ -786,7 +786,7 @@ output_like(<<'CODE', <<'OUTPUT', "nci_p
   # this test function returns a struct { char; int }
   set_args "(0)", 2
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
   new P2, .ResizablePMCArray
 .include "datatypes.pasm"
   push P2, .DATATYPE_CHAR
@@ -821,7 +821,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   # this test function returns a struct { char*; int }
   set_args "(0)", 3
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
   new P2, .ResizablePMCArray
 .include "datatypes.pasm"
   push P2, .DATATYPE_CSTR
@@ -850,7 +850,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   # this test function returns a struct { char; x->{int, double} }
   set_args "(0)", 4
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
 .include "datatypes.pasm"
   # the contained structure
   new P3, .ResizablePMCArray
@@ -905,7 +905,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   dlfunc P0, P1, "nci_pi", "pi"
   set_args "(0)", 8
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
 .include "datatypes.pasm"
   # the contained structure pointer
   new  P6, .OrderedHash
@@ -977,7 +977,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   # this test function returns a struct { int (*f)(char *) }
   set_args "(0)", 5
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
   new P2, .ResizablePMCArray
 .include "datatypes.pasm"
   push P2, .DATATYPE_FUNC_PTR
@@ -993,7 +993,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   set P0, P5[0]
   set_args "(0)", "hello call_back"
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   print I5
   print "\n"
   end
@@ -1009,7 +1009,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   # this test function returns a struct { int; {int; int} int }
   set_args "(0)", 6
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
 .include "datatypes.pasm"
   # the nested structure
   new P3, .ResizablePMCArray
@@ -1065,7 +1065,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   # this test function returns a struct { char; {char; int} char }
   set_args "(0)", 7
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
 .include "datatypes.pasm"
   # the nested structure
   new P3, .ResizablePMCArray
@@ -1121,7 +1121,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_pi 
   # this test function returns a struct { char; {char; int} char }
   set_args "(0)", 7
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
 .include "datatypes.pasm"
   # the nested structure
   new P3, .OrderedHash
@@ -1248,7 +1248,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_ip"
   set I5, 1
   set_args "(0)", P5
   get_results "(0)", I5
-  invoke P0
+  invokecc P0
   print I5
   print "\n"
   end
@@ -1264,10 +1264,10 @@ output_is(<<'CODE', <<'OUTPUT', "nci_vP"
   new P5, .String
   set P5, "ok\n"
   set_args "(0)", P5
-  invoke P0
+  invokecc P0
   null P5
   set_args "(0)", P5
-  invoke P0
+  invokecc P0
   end
 CODE
 ok
@@ -1296,7 +1296,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_cb_
   # P5 is the cb
   # P7 is user_data
   set_args "(0,0)", P5, P7
-  invoke P0
+  invokecc P0
   # call_back will be called at any time
   # so spin a bit
   set I20, 0
@@ -1431,7 +1431,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_cb_
   # P5 is the cb
   # P7 is user_data
   set_args "(0,0)", P5, P7
-  invoke P0
+  invokecc P0
   # call_back will be called at any time
   # so spin a bit
   set I20, 0
@@ -1580,7 +1580,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_cb_
   # P5 is the cb
   # P7 is user_data
   set_args "(0,0)", P5, P7
-  invoke P0
+  invokecc P0
   # call_back will be called at any time
   # so spin a bit
   set I20, 0
@@ -1639,7 +1639,7 @@ output_is(<<'CODE', <<'OUTPUT', "nci_cb_
   # P5 is the cb
   # P7 is user_data
   set_args "(0,0)", P5, P7
-  invoke P0
+  invokecc P0
   # call_back will be called at any time
   # so spin a bit
   set I20, 0
@@ -1995,7 +1995,7 @@ output_is(<<'CODE', <<'OUTPUT', 'nci_pip
   loadlib P1, "libnci_test"
   set_args "(0,0)", 4, P5
   dlfunc P0, P1, "nci_pip", "pip"
-  invoke
+  invokecc P0
   end
 
 CODE
@@ -2031,7 +2031,7 @@ output_is(<<'CODE', <<'OUTPUT', 'nci_i33
   set_args "(0,0)", P2, P3
   get_results "(0)", I5
   dlfunc P0, P1, "nci_i33", "i33"
-  invoke P0
+  invokecc P0
 
   print "Double: "
   print P2
@@ -2085,7 +2085,7 @@ output_is(<<'CODE', <<'OUTPUT', 'nci_vpi
   set_args "(0,0,0)", P5, 1, 2
   loadlib P1, "libnci_test"
   dlfunc P0, P1, "nci_vpii", "vpii"
-  invoke P0
+  invokecc P0
 
   set I0, P5[ 'x' ]
   set P6, P5[ 'nested' ]
@@ -2117,7 +2117,7 @@ output_is(<<'CODE', <<'OUTPUT', 'nci_pii
   dlfunc P0, P1, "nci_piiii", "piiii"
   set_args "(0,0,0,0)", 100,200,400,800
   get_results "(0)", P5
-  invoke P0
+  invokecc P0
 
   new  P6, .OrderedHash
   set  P6[ 'count' ], .DATATYPE_INT

Modified: branches/leo-ctx5/t/pmc/object-meths.t
==============================================================================
--- branches/leo-ctx5/t/pmc/object-meths.t      (original)
+++ branches/leo-ctx5/t/pmc/object-meths.t      Thu Aug 11 08:54:19 2005
@@ -223,7 +223,7 @@ output_is(<<'CODE', <<'OUTPUT', "constru
     find_type I1, "Bar"
     new P3, I1
     find_global P0, "_sub"
-    invokecc
+    invokecc P0
     print "done\n"
     end
 
@@ -480,12 +480,12 @@ output_is(<<'CODE', <<'OUTPUT', "fetchme
     fetchmethod P0, P2, S0
     print "main\n"
     # P2, S0 are as in callmethod
-    invokecc
+    invokecc P0
     print "back\n"
     # check class
     fetchmethod P0, P3, S0
     set P2, P3
-    invokecc
+    invokecc P0
     print "back\n"
     end
 
@@ -669,7 +669,7 @@ output_is(<<'CODE', <<'OUTPUT', "constru
     find_type I1, "Bar"
     new P3, I1
     find_global P0, "_sub"
-    invokecc
+    invokecc P0
     print "done\n"
     end
 

Modified: branches/leo-ctx5/t/pmc/pmc.t
==============================================================================
--- branches/leo-ctx5/t/pmc/pmc.t       (original)
+++ branches/leo-ctx5/t/pmc/pmc.t       Thu Aug 11 08:54:19 2005
@@ -448,7 +448,7 @@ output_is(<<'CODE', <<'OUT', ".const - S
 .pcc_sub @MAIN main:
     print "ok 1\n"
     .const .Sub P0 = "foo"
-    invokecc
+    invokecc P0
     print "ok 3\n"
     end
 .pcc_sub foo:

Modified: branches/leo-ctx5/t/pmc/sub.t
==============================================================================
--- branches/leo-ctx5/t/pmc/sub.t       (original)
+++ branches/leo-ctx5/t/pmc/sub.t       Thu Aug 11 08:54:19 2005
@@ -30,7 +30,7 @@ END {
 output_is(<<'CODE', <<'OUTPUT', "PASM subs - newsub");
     print "main\n"
     newsub .Sub, .RetContinuation, _func, _ret
-    invoke
+    invoke P0, P1
 _ret:
     print "back\n"
     end
@@ -46,7 +46,7 @@ OUTPUT
 output_is(<<'CODE', <<'OUTPUT', "PASM subs - newsub 2");
     print "main\n"
     newsub P0, .Sub, _func
-    invokecc
+    invokecc P0
     print "back\n"
     end
 _func:
@@ -80,7 +80,7 @@ func:
 .include "interpinfo.pasm"
     interpinfo P0, .INTERPINFO_CURRENT_SUB
     set_args "(0)", I5
-    invokecc   # recursive invoke
+    invokecc P0  # recursive invoke
 
 endfunc:
     returncc
@@ -108,7 +108,7 @@ endcont:
     store_global "foo", P4
     print "going to cont\n"
     clone P0, P1
-    invoke
+    invokecc P0
 done:
     print "done\n"
     end
@@ -163,25 +163,25 @@ main:
 
     set_args "(0)", P5
     get_results "(0)", P0
-    invokecc
+    invokecc P0
 
     new P5, .Integer
     set P5, 3
     set_args "(0)", P5
     get_results "(0)", P2
-    invokecc
+    invokecc P0
     print P2
     print "\n"
 
     set_args "(0)", P5
     get_results "(0)", P2
-    invokecc
+    invokecc P0
     print P2
     print "\n"
 
     set_args "(0)", P5
     get_results "(0)", P2
-    invokecc
+    invokecc P0
     print P2
     print "\n"
 
@@ -219,7 +219,7 @@ output_is(<<'CODE', <<'OUTPUT', "PASM su
     new P0, .Sub
     set_addr P0, func1
 
-    invokecc
+    invokecc P0
     print "done\n"
     end
 
@@ -246,7 +246,7 @@ OUTPUT
 output_is(<<'CODE', <<'OUTPUT', "PASM subs - tail invoke with newsub");
     newsub P0, .Sub, func1
 
-    invokecc
+    invokecc P0
     print "done\n"
     end
 
@@ -271,18 +271,16 @@ OUTPUT
 output_is(<<'CODE', <<'OUTPUT', "sub calling a sub");
     print "main\n"
     newsub .Sub, .RetContinuation, _func1, ret1
-    invoke
+    invoke P0, P1
 ret1:
     print "back\n"
     end
 
 _func1:
     print "func1\n"
-    pushbottomp
     newsub .Sub, .RetContinuation, _func2, ret2
-    invoke
+    invoke P0, P1
 ret2:
-    popbottomp
     print "func1\n"
     returncc
 
@@ -303,7 +301,7 @@ output_like(<<'CODE', <<'OUTPUT', "inter
     set I0, P0
     printerr "main:"
     newsub .Sub, .RetContinuation, _func, _ret
-    invoke
+    invoke P0, P1
 _ret:
     printerr ":back"
     new P0, .PerlUndef
@@ -326,7 +324,7 @@ output_like(<<'CODE', <<'OUTPUT', "inter
     new P10, .PerlUndef
     set I0, P10
     printerr ":main"
-    invoke
+    invoke P0, P1
 ret:
     printerr ":back:"
     new P10, .PerlUndef
@@ -352,9 +350,7 @@ output_like(<<'CODE', <<'OUTPUT', "inter
     new P10, .PerlUndef
     set I0, P10
     printerr ":main"
-    # update the state of the return continuation
-    updatecc
-    invoke
+    invokecc P0
 ret:
     printerr ":back:"
     new P10, .PerlUndef
@@ -380,7 +376,7 @@ output_is(<<'CODE', <<'OUTPUT', "pcc sub
     print "not "
 ok:
     print "ok 1\n"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 .pcc_sub _the_sub:
@@ -399,7 +395,7 @@ output_is(<<'CODE', <<'OUTPUT', "pcc sub
     print "not "
 ok:
     print "ok 1\n"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 
@@ -429,7 +425,7 @@ output_is(<<'CODE', <<'OUTPUT', "pcc sub
     print "not "
 ok:
     print "ok 1\n"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 .pcc_sub _the::sub::some::where:
@@ -489,7 +485,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
     print "not "
 ok1:
     print "found sub\n"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -523,7 +519,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
 ok1:
     print "found sub1\n"
     set P10, P0
-    invokecc
+    invokecc P0
     print "back\n"
     find_global P0, "_sub2"
     defined I0, P0
@@ -531,10 +527,10 @@ ok1:
     print "not "
 ok2:
     print "found sub2\n"
-    invokecc
+    invokecc P0
     print "back\n"
     set P0, P10
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -564,7 +560,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
 ok1:
     print "found sub1\n"
     set P10, P0
-    invokecc
+    invokecc P0
     print "back\n"
     find_global P0, "_sub2"
     defined I0, P0
@@ -572,10 +568,10 @@ ok1:
     print "not "
 ok2:
     print "found sub2\n"
-    invokecc
+    invokecc P0
     print "back\n"
     set P0, P10
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -728,7 +724,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
     load_bytecode "temp.pasm"
     print "loaded\n"
     find_global P0, "_sub2"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -747,7 +743,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
     load_bytecode "temp.pbc"
     print "loaded\n"
     find_global P0, "_sub2"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -775,7 +771,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
     load_bytecode "temp.pasm"
     print "loaded\n"
     find_global P0, "_sub1"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -794,7 +790,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
     load_bytecode "temp.pbc"
     print "loaded\n"
     find_global P0, "_sub1"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -822,7 +818,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
     load_bytecode "temp.pasm"
     print "loaded\n"
     find_global P0, "_sub1"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -842,7 +838,7 @@ output_is(<<'CODE', <<'OUTPUT', "load_by
     load_bytecode "temp.pbc"
     print "loaded\n"
     find_global P0, "_sub1"
-    invokecc
+    invokecc P0
     print "back\n"
     end
 CODE
@@ -889,9 +885,9 @@ output_is(<<'CODE', <<'OUTPUT', '@MAIN p
 .pcc_sub @MAIN _main:
     print "main\n"
     find_global P0, "_first"
-    invokecc
+    invokecc P0
     find_global P0, "_second"
-    invokecc
+    invokecc P0
     end
 CODE
 main
@@ -1033,7 +1029,7 @@ output_is(<<'CODE', <<'OUTPUT', "sub nam
     print P20
     print "\n"
     find_global P0, "the_sub"
-    invokecc
+    invokecc P0
     interpinfo P20, .INTERPINFO_CURRENT_SUB
     print P20
     print "\n"
@@ -1060,7 +1056,7 @@ output_is(<<'CODE', <<'OUTPUT', "sub nam
     print P20
     print "\n"
     find_global P0, "the_sub"
-    invokecc
+    invokecc P0
     interpinfo P20, .INTERPINFO_CURRENT_SUB
     print P20
     print "\n"

Reply via email to