Author: leo
Date: Sun Oct  9 05:13:29 2005
New Revision: 9417

Modified:
   trunk/DEPRECATED
   trunk/ops/core.ops
   trunk/ops/ops.num
   trunk/t/pmc/sub.t
Log:
Deprecated 9 - invalidate newsub (4 arguments) opcode

* prepare for deletion of newsub opcode
* remove tests, sub calls are well covered anyway
* update DEPRECATED


Modified: trunk/DEPRECATED
==============================================================================
--- trunk/DEPRECATED    (original)
+++ trunk/DEPRECATED    Sun Oct  9 05:13:29 2005
@@ -1,13 +1,12 @@
-Deprecated opcodes (branches/leo-ctx5 first)
+Deprecated opcodes
 
-newsub(in INT, in INT, labelconst INT, labelconst INT)
+newsub Pdest, IType, ILabel
 
-  Creates a sub in P0 and a continuation in P1. It was a premature
-  attempt to be able to create a return continuation outside a loop.
-  This isn't needed anymore due to continuation recycling and the opcode
-  also has implicit register usage (P0, P1).
+C<newsub> creates a subroutine object just from a label. The
+Sub object is lacking necessary meta information like name, length,
+MMD-info, and more.
 
-  use 3 arg newsub, find_global, set_p_pc, or just foo() syntax
+Use: find_name, find_global, or Sub constants instead.
 
 Register stack opcodes
 

Modified: trunk/ops/core.ops
==============================================================================
--- trunk/ops/core.ops  (original)
+++ trunk/ops/core.ops  Sun Oct  9 05:13:29 2005
@@ -581,11 +581,6 @@ inline op get_addr(out INT, in PMC) {
 
 Generate a new subroutine object in $1 of class $2 and label $3.
 
-=item B<newsub>(in INT, in INT, labelconst INT, labelconst INT)
-
-Generate a new subroutine object in P0 of class $1 subroutine label $3 and
-a return continuation in P1 of class $2 and return address $4.
-
 =cut
 
 inline op newsub(out PMC, in INT, labelconst INT) {
@@ -599,23 +594,7 @@ inline op newsub(out PMC, in INT, labelc
   goto NEXT();
 }
 
-inline op newsub(in INT, in INT, labelconst INT, labelconst INT) {
-  if ($1 <= 0 || $1 >= enum_class_max) {
-    internal_exception(1, "Illegal PMC enum (%d) in newsub", (int)$1);
-    abort(); /* Deserve to lose */
-  }
-  if ($2 <= 0 || $2 >= enum_class_max) {
-    internal_exception(1, "Illegal PMC enum (%d) in newsub", (int)$2);
-    abort(); /* Deserve to lose */
-  }
-  REG_PMC(0) = pmc_new_noinit(interpreter, $1);
-  VTABLE_init(interpreter, REG_PMC(0));
-  VTABLE_set_pointer(interpreter, REG_PMC(0),
-      (CUR_OPCODE + $3));
-  REG_PMC(1) = pmc_new_noinit(interpreter, $2);
-  VTABLE_init(interpreter, REG_PMC(1));
-  VTABLE_set_pointer(interpreter, REG_PMC(1),
-      (CUR_OPCODE + $4));
+op DELETED_newsub(in INT, in INT, labelconst INT, labelconst INT) {
   goto NEXT();
 }
 

Modified: trunk/ops/ops.num
==============================================================================
--- trunk/ops/ops.num   (original)
+++ trunk/ops/ops.num   Sun Oct  9 05:13:29 2005
@@ -678,10 +678,10 @@ new_s_i                         647
 new_s_ic                        648
 newclass_p_s                    649
 newclass_p_sc                   650
-newsub_i_i_ic_ic                651
-newsub_i_ic_ic_ic               652
-newsub_ic_i_ic_ic               653
-newsub_ic_ic_ic_ic              654
+DELETED_newsub_i_i_ic_ic                651
+DELETED_newsub_i_ic_ic_ic               652
+DELETED_newsub_ic_i_ic_ic               653
+DELETED_newsub_ic_ic_ic_ic              654
 newsub_p_i_ic                   655
 newsub_p_ic_ic                  656
 not_i_i                         657

Modified: trunk/t/pmc/sub.t
==============================================================================
--- trunk/t/pmc/sub.t   (original)
+++ trunk/t/pmc/sub.t   Sun Oct  9 05:13:29 2005
@@ -17,7 +17,7 @@ C<Continuation> PMCs.
 
 =cut
 
-use Parrot::Test tests => 49;
+use Parrot::Test tests => 44;
 use Test::More;
 use Parrot::Config;
 
@@ -27,22 +27,6 @@ END {
     unlink($temp, 'temp.pbc');
 };
 
-output_is(<<'CODE', <<'OUTPUT', "PASM subs - newsub");
-    print "main\n"
-    newsub .Sub, .RetContinuation, _func, _ret
-    invoke P0, P1
-_ret:
-    print "back\n"
-    end
-_func:
-    print "func\n"
-    returncc
-CODE
-main
-func
-back
-OUTPUT
-
 output_is(<<'CODE', <<'OUTPUT', "PASM subs - newsub 2");
     print "main\n"
     newsub P0, .Sub, _func
@@ -268,107 +252,6 @@ in func2
 done
 OUTPUT
 
-output_is(<<'CODE', <<'OUTPUT', "sub calling a sub");
-    print "main\n"
-    newsub .Sub, .RetContinuation, _func1, ret1
-    invoke P0, P1
-ret1:
-    print "back\n"
-    end
-
-_func1:
-    print "func1\n"
-    newsub .Sub, .RetContinuation, _func2, ret2
-    invoke P0, P1
-ret2:
-    print "func1\n"
-    returncc
-
-_func2:
-    print "func2\n"
-    returncc
-
-CODE
-main
-func1
-func2
-func1
-back
-OUTPUT
-
-output_like(<<'CODE', <<'OUTPUT', "interp - warnings");
-    new P0, .PerlUndef
-    set I0, P0
-    printerr "main:"
-    newsub .Sub, .RetContinuation, _func, _ret
-    invoke P0, P1
-_ret:
-    printerr ":back"
-    new P0, .PerlUndef
-    set I0, P0
-    end
-_func:
-    warningson 1
-    new P0, .PerlUndef
-    set I0, P0
-    returncc
-CODE
-/^main:Use of uninitialized value in integer context
-current instr\.: '\(null\)' pc (\d+|-1) \(.*?:(\d+|-1)\)
-:back$/s
-OUTPUT
-
-output_like(<<'CODE', <<'OUTPUT', "interp - warnings 2");
-    warningson 1
-    newsub .Sub, .RetContinuation, _func, ret
-    new P10, .PerlUndef
-    set I0, P10
-    printerr ":main"
-    invoke P0, P1
-ret:
-    printerr ":back:"
-    new P10, .PerlUndef
-    set I0, P10
-    printerr ":end"
-    end
-_func:
-    warningsoff 1
-    new P0, .PerlUndef
-    set I0, P0
-    returncc
-CODE
-/^Use of uninitialized value in integer context
-current instr\.: '\(null\)' pc (\d+|-1) .*?
-:main:back:Use of un.*$/sm
-OUTPUT
-
-output_like(<<'CODE', <<'OUTPUT', "interp - warnings 2 - updatecc");
-    # the RetContinuation in P1 is created with warnings off
-    newsub .Sub, .RetContinuation, _func, ret
-    # turn warnings on in main
-    warningson 1
-    new P10, .PerlUndef
-    set I0, P10
-    printerr ":main"
-    invokecc P0
-ret:
-    printerr ":back:"
-    new P10, .PerlUndef
-    set I0, P10
-    printerr ":end"
-    end
-_func:
-    # turn off warnings in the sub
-    warningsoff 1
-    new P0, .PerlUndef
-    set I0, P0
-    returncc
-CODE
-/^Use of uninitialized value in integer context
-current instr\.: '\(null\)' pc (\d+|-1) .*?
-:main:back:Use of un.*$/sm
-OUTPUT
-
 output_is(<<'CODE', <<'OUTPUT', "pcc sub");
     find_global P0, "_the_sub"
     defined I0, P0

Reply via email to