Author: jkeenan Date: Mon Feb 26 19:16:39 2007 New Revision: 17199 Modified: branches/buildtools/languages/dotnet/ops/dotnet.ops branches/buildtools/lib/Parrot/OpsFile.pm branches/buildtools/src/ops/cmp.ops branches/buildtools/src/ops/core.ops branches/buildtools/src/ops/object.ops branches/buildtools/src/ops/stm.ops branches/buildtools/src/pmc/parrotclass.pmc branches/buildtools/vtable.tbl
Log: Applying the add_addr.patch and the label.patch supplied by Alek Storm. Modified: branches/buildtools/languages/dotnet/ops/dotnet.ops ============================================================================== --- branches/buildtools/languages/dotnet/ops/dotnet.ops (original) +++ branches/buildtools/languages/dotnet/ops/dotnet.ops Mon Feb 26 19:16:39 2007 @@ -526,7 +526,7 @@ /* Unsigned branch ops. */ -inline op net_bge_un(in INT, in INT, labelconst INT) :base_core { +inline op net_bge_un(in INT, in INT, inconst LABEL) :base_core { if ((unsigned int)$1 >= (unsigned int)$2) { goto OFFSET($3); @@ -537,7 +537,7 @@ } } -inline op net_bge_un(in NUM, in NUM, labelconst INT) :base_core { +inline op net_bge_un(in NUM, in NUM, inconst LABEL) :base_core { if ((unsigned int)$1 >= (unsigned int)$2) { goto OFFSET($3); @@ -548,7 +548,7 @@ } } -inline op net_bge_un(invar PMC, invar PMC, labelconst INT) :base_core { +inline op net_bge_un(invar PMC, invar PMC, inconst LABEL) :base_core { int result; if ($1->vtable->isa(interp, $1, string_from_const_cstring(interp, "UInt64", 0))) @@ -573,7 +573,7 @@ } } -inline op net_bgt_un(in INT, in INT, labelconst INT) :base_core { +inline op net_bgt_un(in INT, in INT, inconst LABEL) :base_core { if ((unsigned int)$1 > (unsigned int)$2) { goto OFFSET($3); @@ -584,7 +584,7 @@ } } -inline op net_bgt_un(in NUM, in NUM, labelconst INT) :base_core { +inline op net_bgt_un(in NUM, in NUM, inconst LABEL) :base_core { if ($1 > $2) { goto OFFSET($3); @@ -595,7 +595,7 @@ } } -inline op net_bgt_un(invar PMC, invar PMC, labelconst INT) :base_core { +inline op net_bgt_un(invar PMC, invar PMC, inconst LABEL) :base_core { int result; if ($1->vtable->isa(interp, $1, string_from_const_cstring(interp, "UInt64", 0))) @@ -620,7 +620,7 @@ } } -inline op net_ble_un(in INT, in INT, labelconst INT) :base_core { +inline op net_ble_un(in INT, in INT, inconst LABEL) :base_core { if ((unsigned int)$1 <= (unsigned int)$2) { goto OFFSET($3); @@ -631,7 +631,7 @@ } } -inline op net_ble_un(in NUM, in NUM, labelconst INT) :base_core { +inline op net_ble_un(in NUM, in NUM, inconst LABEL) :base_core { if ($1 <= $2) { goto OFFSET($3); @@ -642,7 +642,7 @@ } } -inline op net_ble_un(invar PMC, invar PMC, labelconst INT) :base_core { +inline op net_ble_un(invar PMC, invar PMC, inconst LABEL) :base_core { int result; if ($1->vtable->isa(interp, $1, string_from_const_cstring(interp, "UInt64", 0))) @@ -667,7 +667,7 @@ } } -inline op net_blt_un(in INT, in INT, labelconst INT) :base_core { +inline op net_blt_un(in INT, in INT, inconst LABEL) :base_core { if ((unsigned int)$1 < (unsigned int)$2) { goto OFFSET($3); @@ -678,7 +678,7 @@ } } -inline op net_blt_un(in NUM, in NUM, labelconst INT) :base_core { +inline op net_blt_un(in NUM, in NUM, inconst LABEL) :base_core { if ($1 < $2) { goto OFFSET($3); @@ -689,7 +689,7 @@ } } -inline op net_blt_un(invar PMC, invar PMC, labelconst INT) :base_core { +inline op net_blt_un(invar PMC, invar PMC, inconst LABEL) :base_core { int result; if ($1->vtable->isa(interp, $1, string_from_const_cstring(interp, "UInt64", 0))) @@ -714,7 +714,7 @@ } } -inline op net_bne_un(in INT, in INT, labelconst INT) :base_core { +inline op net_bne_un(in INT, in INT, inconst LABEL) :base_core { if ((unsigned int)$1 != (unsigned int)$2) { goto OFFSET($3); @@ -725,7 +725,7 @@ } } -inline op net_bne_un(in NUM, in NUM, labelconst INT) :base_core { +inline op net_bne_un(in NUM, in NUM, inconst LABEL) :base_core { if ($1 != $2) { goto OFFSET($3); @@ -736,7 +736,7 @@ } } -inline op net_bne_un(invar PMC, invar PMC, labelconst INT) :base_core { +inline op net_bne_un(invar PMC, invar PMC, inconst LABEL) :base_core { int result; if ($1->vtable->isa(interp, $1, string_from_const_cstring(interp, "UInt64", 0))) Modified: branches/buildtools/lib/Parrot/OpsFile.pm ============================================================================== --- branches/buildtools/lib/Parrot/OpsFile.pm (original) +++ branches/buildtools/lib/Parrot/OpsFile.pm Mon Feb 26 19:16:39 2007 @@ -51,9 +51,6 @@ inout the argument passes a value into and out of the op inconst the argument passes a constant value into the op invar the argument passes a variable value into the op - label an in argument containing a branch offset or address - labelconst an invar argument containing a branch offset or address - labelvar an inconst argument containing a branch offset or address Argument direction is used to determine the life times of symbols and their related register allocations. When an argument is passed into an @@ -68,6 +65,7 @@ PMC the argument is an PMC KEY the argument is an aggregate PMC key INTKEY the argument is an aggregate PMC integer key + LABEL the argument is an integer branch offset or address The size of the return offset is determined from the op function's signature. @@ -329,29 +327,28 @@ foreach my $arg (@args) { my ( $use, $type ) = - $arg =~ m/^(in|out|inout|inconst|invar|label|labelconst|labelvar) + $arg =~ m/^(in|out|inout|inconst|invar) \s+ - (INT|NUM|STR|PMC|KEY|INTKEY)$/ix; + (INT|NUM|STR|PMC|KEY|INTKEY|LABEL)$/ix; die "Unrecognized arg format '$arg' in '$_'!" unless defined($use) and defined($type); - if ( $type =~ /^INTKEY$/i ) { - $type = "ki"; + # remember it's a label, then to int + if ( $type =~ /^LABEL$/i ) { + $type = "i"; + push @labels, 1; } else { - $type = lc substr( $type, 0, 1 ); + push @labels, 0; } - # convert e.g. "labelvar" to "invar" and remember labels - - if ( $use =~ /label(\w*)/ ) { - push @labels, 1; - $use = "in$1"; + if ( $type =~ /^INTKEY$/i ) { + $type = "ki"; } else { - push @labels, 0; + $type = lc substr( $type, 0, 1 ); } if ( $use eq 'in' ) { Modified: branches/buildtools/src/ops/cmp.ops ============================================================================== --- branches/buildtools/src/ops/cmp.ops (original) +++ branches/buildtools/src/ops/cmp.ops Mon Feb 26 19:16:39 2007 @@ -34,27 +34,27 @@ ######################################## -=item B<eq>(in INT, in INT, labelconst INT) +=item B<eq>(in INT, in INT, inconst LABEL) -=item B<eq>(in NUM, in NUM, labelconst INT) +=item B<eq>(in NUM, in NUM, inconst LABEL) -=item B<eq>(in STR, in STR, labelconst INT) +=item B<eq>(in STR, in STR, inconst LABEL) -=item B<eq>(invar PMC, invar PMC, labelconst INT) +=item B<eq>(invar PMC, invar PMC, inconst LABEL) -=item B<eq>(invar PMC, in INT, labelconst INT) +=item B<eq>(invar PMC, in INT, inconst LABEL) -=item B<eq>(invar PMC, in NUM, labelconst INT) +=item B<eq>(invar PMC, in NUM, inconst LABEL) -=item B<eq>(invar PMC, in STR, labelconst INT) +=item B<eq>(invar PMC, in STR, inconst LABEL) -=item B<eq_str>(invar PMC, invar PMC, labelconst INT) +=item B<eq_str>(invar PMC, invar PMC, inconst LABEL) -=item B<eq_num>(invar PMC, invar PMC, labelconst INT) +=item B<eq_num>(invar PMC, invar PMC, inconst LABEL) -=item B<eq_addr>(in STR, in STR, labelconst INT) +=item B<eq_addr>(in STR, in STR, inconst LABEL) -=item B<eq_addr>(invar PMC, invar PMC, labelconst INT) +=item B<eq_addr>(invar PMC, invar PMC, inconst LABEL) Branch if $1 is equal to $2. For PMCs this does a generic comparison, whatever that is for the involved PMCs. Mixed PMC number/string @@ -66,35 +66,35 @@ =cut -inline op eq(in INT, in INT, labelconst INT) :base_core { +inline op eq(in INT, in INT, inconst LABEL) :base_core { if ($1 == $2) { goto OFFSET($3); } goto NEXT(); } -inline op eq(in NUM, in NUM, labelconst INT) :base_core { +inline op eq(in NUM, in NUM, inconst LABEL) :base_core { if ($1 == $2) { goto OFFSET($3); } goto NEXT(); } -op eq(in STR, in STR, labelconst INT) :base_core { +op eq(in STR, in STR, inconst LABEL) :base_core { if (string_equal(interp, $1, $2) == 0) { goto OFFSET($3); } goto NEXT(); } -op eq (invar PMC, invar PMC, labelconst INT) :base_core { +op eq (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_EQ)) { goto OFFSET($3); } goto NEXT(); } -op eq (invar PMC, in INT, labelconst INT) :base_core { +op eq (invar PMC, in INT, inconst LABEL) :base_core { /* * see also #34949 * the temp is necessary, *if* $1 isa BigInt @@ -107,7 +107,7 @@ goto NEXT(); } -op eq (invar PMC, in NUM, labelconst INT) :base_core { +op eq (invar PMC, in NUM, inconst LABEL) :base_core { /* * the get_number and get_string should probably * be also replaced with code like above, as @@ -120,7 +120,7 @@ goto NEXT(); } -op eq (invar PMC, in STR, labelconst INT) :base_core { +op eq (invar PMC, in STR, inconst LABEL) :base_core { if (0 == string_equal(interp, $1->vtable->get_string(interp, $1), $2)) { goto OFFSET($3); @@ -128,28 +128,28 @@ goto NEXT(); } -op eq_str (invar PMC, invar PMC, labelconst INT) :base_core { +op eq_str (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_STREQ)) { goto OFFSET($3); } goto NEXT(); } -op eq_num (invar PMC, invar PMC, labelconst INT) :base_core { +op eq_num (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_NUMEQ)) { goto OFFSET($3); } goto NEXT(); } -op eq_addr(in STR, in STR, labelconst INT) :base_core { +op eq_addr(in STR, in STR, inconst LABEL) :base_core { if ($1 == $2) { goto OFFSET($3); } goto NEXT(); } -op eq_addr(invar PMC, invar PMC, labelconst INT) :base_core { +op eq_addr(invar PMC, invar PMC, inconst LABEL) :base_core { if ($1 == $2) { goto OFFSET($3); } @@ -158,61 +158,61 @@ ######################################## -=item B<ne>(in INT, in INT, labelconst INT) +=item B<ne>(in INT, in INT, inconst LABEL) -=item B<ne>(in NUM, in NUM, labelconst INT) +=item B<ne>(in NUM, in NUM, inconst LABEL) -=item B<ne>(in STR, in STR, labelconst INT) +=item B<ne>(in STR, in STR, inconst LABEL) -=item B<ne>(invar PMC, invar PMC, labelconst INT) +=item B<ne>(invar PMC, invar PMC, inconst LABEL) -=item B<ne>(invar PMC, in INT, labelconst INT) +=item B<ne>(invar PMC, in INT, inconst LABEL) -=item B<ne>(invar PMC, in NUM, labelconst INT) +=item B<ne>(invar PMC, in NUM, inconst LABEL) -=item B<ne>(invar PMC, in STR, labelconst INT) +=item B<ne>(invar PMC, in STR, inconst LABEL) -=item B<ne_str>(invar PMC, invar PMC, labelconst INT) +=item B<ne_str>(invar PMC, invar PMC, inconst LABEL) -=item B<ne_num>(invar PMC, invar PMC, labelconst INT) +=item B<ne_num>(invar PMC, invar PMC, inconst LABEL) -=item B<ne_addr>(in STR, in STR, labelconst INT) +=item B<ne_addr>(in STR, in STR, inconst LABEL) -=item B<ne_addr>(invar PMC, invar PMC, labelconst INT) +=item B<ne_addr>(invar PMC, invar PMC, inconst LABEL) Branch if $1 is not equal to $2. =cut -inline op ne(in INT, in INT, labelconst INT) :base_core { +inline op ne(in INT, in INT, inconst LABEL) :base_core { if ($1 != $2) { goto OFFSET($3); } goto NEXT(); } -inline op ne(in NUM, in NUM, labelconst INT) :base_core { +inline op ne(in NUM, in NUM, inconst LABEL) :base_core { if ($1 != $2) { goto OFFSET($3); } goto NEXT(); } -op ne(in STR, in STR, labelconst INT) :base_core { +op ne(in STR, in STR, inconst LABEL) :base_core { if (string_equal(interp, $1, $2) != 0) { goto OFFSET($3); } goto NEXT(); } -op ne(invar PMC, invar PMC, labelconst INT) :base_core { +op ne(invar PMC, invar PMC, inconst LABEL) :base_core { if (! mmd_dispatch_i_pp(interp, $1, $2, MMD_EQ)) { goto OFFSET($3); } goto NEXT(); } -op ne (invar PMC, in INT, labelconst INT) :base_core { +op ne (invar PMC, in INT, inconst LABEL) :base_core { PMC *temp = pmc_new(interp, enum_class_Integer); PMC_int_val(temp) = $2; if (! mmd_dispatch_i_pp(interp, $1, temp, MMD_EQ)) { @@ -221,14 +221,14 @@ goto NEXT(); } -op ne (invar PMC, in NUM, labelconst INT) :base_core { +op ne (invar PMC, in NUM, inconst LABEL) :base_core { if ($1->vtable->get_number(interp, $1) != $2) { goto OFFSET($3); } goto NEXT(); } -op ne (invar PMC, in STR, labelconst INT) :base_core { +op ne (invar PMC, in STR, inconst LABEL) :base_core { if (0 != string_equal(interp, $1->vtable->get_string(interp, $1), $2)) { goto OFFSET($3); @@ -236,28 +236,28 @@ goto NEXT(); } -op ne_str (invar PMC, invar PMC, labelconst INT) :base_core { +op ne_str (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_STRCMP) != 0) { goto OFFSET($3); } goto NEXT(); } -op ne_num (invar PMC, invar PMC, labelconst INT) :base_core { +op ne_num (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_NUMCMP) != 0) { goto OFFSET($3); } goto NEXT(); } -op ne_addr(in STR, in STR, labelconst INT) :base_core { +op ne_addr(in STR, in STR, inconst LABEL) :base_core { if ($1 != $2) { goto OFFSET($3); } goto NEXT(); } -op ne_addr(invar PMC, invar PMC, labelconst INT) :base_core { +op ne_addr(invar PMC, invar PMC, inconst LABEL) :base_core { if ($1 != $2) { goto OFFSET($3); } @@ -266,57 +266,57 @@ ######################################## -=item B<lt>(in INT, in INT, labelconst INT) +=item B<lt>(in INT, in INT, inconst LABEL) -=item B<lt>(in NUM, in NUM, labelconst INT) +=item B<lt>(in NUM, in NUM, inconst LABEL) -=item B<lt>(in STR, in STR, labelconst INT) +=item B<lt>(in STR, in STR, inconst LABEL) -=item B<lt>(invar PMC, invar PMC, labelconst INT) +=item B<lt>(invar PMC, invar PMC, inconst LABEL) -=item B<lt>(invar PMC, in INT, labelconst INT) +=item B<lt>(invar PMC, in INT, inconst LABEL) -=item B<lt>(invar PMC, in NUM, labelconst INT) +=item B<lt>(invar PMC, in NUM, inconst LABEL) -=item B<lt>(invar PMC, in STR, labelconst INT) +=item B<lt>(invar PMC, in STR, inconst LABEL) -=item B<lt_str>(invar PMC, invar PMC, labelconst INT) +=item B<lt_str>(invar PMC, invar PMC, inconst LABEL) -=item B<lt_num>(invar PMC, invar PMC, labelconst INT) +=item B<lt_num>(invar PMC, invar PMC, inconst LABEL) Branch if $1 is less than $2. =cut -inline op lt(in INT, in INT, labelconst INT) :base_core { +inline op lt(in INT, in INT, inconst LABEL) :base_core { if ($1 < $2) { goto OFFSET($3); } goto NEXT(); } -inline op lt(in NUM, in NUM, labelconst INT) :base_core { +inline op lt(in NUM, in NUM, inconst LABEL) :base_core { if ($1 < $2) { goto OFFSET($3); } goto NEXT(); } -op lt(in STR, in STR, labelconst INT) :base_core { +op lt(in STR, in STR, inconst LABEL) :base_core { if (string_compare(interp, $1, $2) < 0) { goto OFFSET($3); } goto NEXT(); } -op lt (invar PMC, invar PMC, labelconst INT) :base_core { +op lt (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_CMP) < 0) { goto OFFSET($3); } goto NEXT(); } -op lt (invar PMC, in INT, labelconst INT) :base_core { +op lt (invar PMC, in INT, inconst LABEL) :base_core { PMC *temp = pmc_new(interp, enum_class_Integer); PMC_int_val(temp) = $2; if (mmd_dispatch_i_pp(interp, $1, temp, MMD_CMP) < 0) { @@ -325,14 +325,14 @@ goto NEXT(); } -op lt (invar PMC, in NUM, labelconst INT) :base_core { +op lt (invar PMC, in NUM, inconst LABEL) :base_core { if ($1->vtable->get_number(interp, $1) < $2) { goto OFFSET($3); } goto NEXT(); } -op lt (invar PMC, in STR, labelconst INT) :base_core { +op lt (invar PMC, in STR, inconst LABEL) :base_core { if (string_compare(interp, $1->vtable->get_string(interp, $1), $2) < 0) { goto OFFSET($3); @@ -340,14 +340,14 @@ goto NEXT(); } -op lt_str (invar PMC, invar PMC, labelconst INT) :base_core { +op lt_str (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_STRCMP) < 0) { goto OFFSET($3); } goto NEXT(); } -op lt_num (invar PMC, invar PMC, labelconst INT) :base_core { +op lt_num (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_NUMCMP) < 0) { goto OFFSET($3); } @@ -356,57 +356,57 @@ ######################################## -=item B<le>(in INT, in INT, labelconst INT) +=item B<le>(in INT, in INT, inconst LABEL) -=item B<le>(in NUM, in NUM, labelconst INT) +=item B<le>(in NUM, in NUM, inconst LABEL) -=item B<le>(in STR, in STR, labelconst INT) +=item B<le>(in STR, in STR, inconst LABEL) -=item B<le>(invar PMC, invar PMC, labelconst INT) +=item B<le>(invar PMC, invar PMC, inconst LABEL) -=item B<le>(invar PMC, in INT, labelconst INT) +=item B<le>(invar PMC, in INT, inconst LABEL) -=item B<le>(invar PMC, in NUM, labelconst INT) +=item B<le>(invar PMC, in NUM, inconst LABEL) -=item B<le>(invar PMC, in STR, labelconst INT) +=item B<le>(invar PMC, in STR, inconst LABEL) -=item B<le_str>(invar PMC, invar PMC, labelconst INT) +=item B<le_str>(invar PMC, invar PMC, inconst LABEL) -=item B<le_num>(invar PMC, invar PMC, labelconst INT) +=item B<le_num>(invar PMC, invar PMC, inconst LABEL) Branch if $1 is less than or equal to $2. =cut -inline op le(in INT, in INT, labelconst INT) :base_core { +inline op le(in INT, in INT, inconst LABEL) :base_core { if ($1 <= $2) { goto OFFSET($3); } goto NEXT(); } -inline op le(in NUM, in NUM, labelconst INT) :base_core { +inline op le(in NUM, in NUM, inconst LABEL) :base_core { if ($1 <= $2) { goto OFFSET($3); } goto NEXT(); } -op le(in STR, in STR, labelconst INT) :base_core { +op le(in STR, in STR, inconst LABEL) :base_core { if (string_compare(interp, $1, $2) <= 0) { goto OFFSET($3); } goto NEXT(); } -op le(invar PMC, invar PMC, labelconst INT) :base_core { +op le(invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_CMP) <= 0) { goto OFFSET($3); } goto NEXT(); } -op le(invar PMC, in INT, labelconst INT) :base_core { +op le(invar PMC, in INT, inconst LABEL) :base_core { PMC *temp = pmc_new(interp, enum_class_Integer); PMC_int_val(temp) = $2; if (mmd_dispatch_i_pp(interp, $1, temp, MMD_CMP) <= 0) { @@ -415,14 +415,14 @@ goto NEXT(); } -op le (invar PMC, in NUM, labelconst INT) :base_core { +op le (invar PMC, in NUM, inconst LABEL) :base_core { if ($1->vtable->get_number(interp, $1) <= $2) { goto OFFSET($3); } goto NEXT(); } -op le (invar PMC, in STR, labelconst INT) :base_core { +op le (invar PMC, in STR, inconst LABEL) :base_core { if (string_compare(interp, $1->vtable->get_string(interp, $1), $2) <= 0) { goto OFFSET($3); @@ -430,14 +430,14 @@ goto NEXT(); } -op le_str (invar PMC, invar PMC, labelconst INT) :base_core { +op le_str (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_STRCMP) <= 0) { goto OFFSET($3); } goto NEXT(); } -op le_num (invar PMC, invar PMC, labelconst INT) :base_core { +op le_num (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_NUMCMP) <= 0) { goto OFFSET($3); } @@ -446,30 +446,30 @@ ######################################## -=item B<gt>(invar PMC, invar PMC, labelconst INT) +=item B<gt>(invar PMC, invar PMC, inconst LABEL) -=item B<gt>(invar PMC, in INT, labelconst INT) +=item B<gt>(invar PMC, in INT, inconst LABEL) -=item B<gt>(invar PMC, in NUM, labelconst INT) +=item B<gt>(invar PMC, in NUM, inconst LABEL) -=item B<gt>(invar PMC, in STR, labelconst INT) +=item B<gt>(invar PMC, in STR, inconst LABEL) -=item B<gt_str>(invar PMC, invar PMC, labelconst INT) +=item B<gt_str>(invar PMC, invar PMC, inconst LABEL) -=item B<gt_num>(invar PMC, invar PMC, labelconst INT) +=item B<gt_num>(invar PMC, invar PMC, inconst LABEL) Branch if $1 is greater than $2. =cut -op gt(invar PMC, invar PMC, labelconst INT) :base_core { +op gt(invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_CMP) > 0) { goto OFFSET($3); } goto NEXT(); } -op gt(invar PMC, in INT, labelconst INT) :base_core { +op gt(invar PMC, in INT, inconst LABEL) :base_core { PMC *temp = pmc_new(interp, enum_class_Integer); PMC_int_val(temp) = $2; if (mmd_dispatch_i_pp(interp, $1, temp, MMD_CMP) > 0) { @@ -478,14 +478,14 @@ goto NEXT(); } -op gt (invar PMC, in NUM, labelconst INT) :base_core { +op gt (invar PMC, in NUM, inconst LABEL) :base_core { if ($1->vtable->get_number(interp, $1) > $2) { goto OFFSET($3); } goto NEXT(); } -op gt (invar PMC, in STR, labelconst INT) :base_core { +op gt (invar PMC, in STR, inconst LABEL) :base_core { if (string_compare(interp, $1->vtable->get_string(interp, $1), $2) > 0) { goto OFFSET($3); @@ -493,14 +493,14 @@ goto NEXT(); } -op gt_str (invar PMC, invar PMC, labelconst INT) :base_core { +op gt_str (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_STRCMP) > 0) { goto OFFSET($3); } goto NEXT(); } -op gt_num (invar PMC, invar PMC, labelconst INT) :base_core { +op gt_num (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_NUMCMP) > 0) { goto OFFSET($3); } @@ -509,30 +509,30 @@ ######################################## -=item B<ge>(invar PMC, invar PMC, labelconst INT) +=item B<ge>(invar PMC, invar PMC, inconst LABEL) -=item B<ge>(invar PMC, in INT, labelconst INT) +=item B<ge>(invar PMC, in INT, inconst LABEL) -=item B<ge>(invar PMC, in NUM, labelconst INT) +=item B<ge>(invar PMC, in NUM, inconst LABEL) -=item B<ge>(invar PMC, in STR, labelconst INT) +=item B<ge>(invar PMC, in STR, inconst LABEL) -=item B<ge_str>(invar PMC, invar PMC, labelconst INT) +=item B<ge_str>(invar PMC, invar PMC, inconst LABEL) -=item B<ge_num>(invar PMC, invar PMC, labelconst INT) +=item B<ge_num>(invar PMC, invar PMC, inconst LABEL) Branch if $1 is greater than or equal to $2. =cut -op ge(invar PMC, invar PMC, labelconst INT) :base_core { +op ge(invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_CMP) >= 0) { goto OFFSET($3); } goto NEXT(); } -op ge(invar PMC, in INT, labelconst INT) :base_core { +op ge(invar PMC, in INT, inconst LABEL) :base_core { PMC *temp = pmc_new(interp, enum_class_Integer); PMC_int_val(temp) = $2; if (mmd_dispatch_i_pp(interp, $1, temp, MMD_CMP) >= 0) { @@ -541,14 +541,14 @@ goto NEXT(); } -op ge (invar PMC, in NUM, labelconst INT) :base_core { +op ge (invar PMC, in NUM, inconst LABEL) :base_core { if ($1->vtable->get_number(interp, $1) >= $2) { goto OFFSET($3); } goto NEXT(); } -op ge (invar PMC, in STR, labelconst INT) :base_core { +op ge (invar PMC, in STR, inconst LABEL) :base_core { if (string_compare(interp, $1->vtable->get_string(interp, $1), $2) >= 0) { goto OFFSET($3); @@ -556,14 +556,14 @@ goto NEXT(); } -op ge_str (invar PMC, invar PMC, labelconst INT) :base_core { +op ge_str (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_STRCMP) >= 0) { goto OFFSET($3); } goto NEXT(); } -op ge_num (invar PMC, invar PMC, labelconst INT) :base_core { +op ge_num (invar PMC, invar PMC, inconst LABEL) :base_core { if (mmd_dispatch_i_pp(interp, $1, $2, MMD_NUMCMP) >= 0) { goto OFFSET($3); } @@ -572,24 +572,24 @@ ######################################## -=item B<if_null>(invar PMC, labelconst INT) +=item B<if_null>(invar PMC, inconst LABEL) Branch to $2 if $1 is a NULL PMC. -=item B<if_null>(invar STR, labelconst INT) +=item B<if_null>(invar STR, inconst LABEL) Branch to $2 if $1 is a NULL STRING. =cut -op if_null(invar PMC, labelconst INT) { +op if_null(invar PMC, inconst LABEL) { if (PMC_IS_NULL($1)) { goto OFFSET($2); } goto NEXT(); } -op if_null(invar STR, labelconst INT) { +op if_null(invar STR, inconst LABEL) { if (!$1) { goto OFFSET($2); } @@ -598,24 +598,24 @@ ######################################## -=item B<unless_null>(invar PMC, labelconst INT) +=item B<unless_null>(invar PMC, inconst LABEL) Branch to $2 if $1 is I<not> a NULL PMC. -=item B<unless_null>(invar STR, labelconst INT) +=item B<unless_null>(invar STR, inconst LABEL) Branch to $2 if $1 is I<not> a NULL STRING. =cut -op unless_null(invar PMC, labelconst INT) { +op unless_null(invar PMC, inconst LABEL) { if (!PMC_IS_NULL($1)) { goto OFFSET($2); } goto NEXT(); } -op unless_null(invar STR, labelconst INT) { +op unless_null(invar STR, inconst LABEL) { if ($1) { goto OFFSET($2); } Modified: branches/buildtools/src/ops/core.ops ============================================================================== --- branches/buildtools/src/ops/core.ops (original) +++ branches/buildtools/src/ops/core.ops Mon Feb 26 19:16:39 2007 @@ -166,13 +166,13 @@ ######################################## -=item B<branch>(label INT) +=item B<branch>(in LABEL) Branch forward or backward by the amount in $1. =cut -inline op branch (label INT) :base_loop { +inline op branch (in LABEL) :base_loop { goto OFFSET($1); } @@ -200,14 +200,14 @@ ######################################## -=item B<bsr>(label INT) +=item B<bsr>(in LABEL) Branch to the location specified by $1. Push the current location onto the call stack for later returning. =cut -inline op bsr (label INT) :base_core,check_event { +inline op bsr (in LABEL) :base_core,check_event { stack_push(interp, &interp->dynamic_env, expr NEXT(), STACK_ENTRY_DESTINATION, STACK_CLEANUP_NULL); goto OFFSET($1); @@ -226,14 +226,14 @@ ######################################## -=item B<jsr>(label INT) +=item B<jsr>(in LABEL) Jump to the location specified by register $1. Push the current location onto the call stack for later returning. =cut -inline op jsr(label INT) :base_core,check_event { +inline op jsr(in LABEL) :base_core,check_event { opcode_t * loc; stack_push(interp, &interp->dynamic_env, expr NEXT(), STACK_ENTRY_DESTINATION, STACK_CLEANUP_NULL); @@ -244,13 +244,13 @@ ######################################## -=item B<jump>(label INT) +=item B<jump>(in LABEL) Jump to the address held in register $1. =cut -inline op jump(label INT) :base_loop { +inline op jump(in LABEL) :base_loop { opcode_t * const loc = INTVAL2PTR(opcode_t *, $1); goto ADDRESS(loc); } @@ -286,40 +286,40 @@ ######################################## -=item B<if>(invar INT, labelconst INT) +=item B<if>(invar INT, inconst LABEL) -=item B<if>(invar NUM, labelconst INT) +=item B<if>(invar NUM, inconst LABEL) -=item B<if>(invar PMC, labelconst INT) +=item B<if>(invar PMC, inconst LABEL) -=item B<if>(invar STR, labelconst INT) +=item B<if>(invar STR, inconst LABEL) Check register $1. If true, branch by $2. =cut -inline op if(invar INT, labelconst INT) { +inline op if(invar INT, inconst LABEL) { if ($1 != 0) { goto OFFSET($2); } goto NEXT(); } -inline op if(invar NUM, labelconst INT) { +inline op if(invar NUM, inconst LABEL) { if ($1 != 0.0) { goto OFFSET($2); } goto NEXT(); } -op if (invar STR, labelconst INT) { +op if (invar STR, inconst LABEL) { if (string_bool(interp, $1)) { goto OFFSET($2); } goto NEXT(); } -op if(invar PMC, labelconst INT) { +op if(invar PMC, inconst LABEL) { if ($1->vtable->get_bool(interp, $1)) { goto OFFSET($2); } @@ -328,40 +328,40 @@ ######################################## -=item B<unless>(invar INT, labelconst INT) +=item B<unless>(invar INT, inconst LABEL) -=item B<unless>(invar NUM, labelconst INT) +=item B<unless>(invar NUM, inconst LABEL) -=item B<unless>(invar PMC, labelconst INT) +=item B<unless>(invar PMC, inconst LABEL) -=item B<unless>(invar STR, labelconst INT) +=item B<unless>(invar STR, inconst LABEL) Check register $1. If false, branch by $2. =cut -inline op unless(invar INT, labelconst INT) { +inline op unless(invar INT, inconst LABEL) { if ($1 == 0) { goto OFFSET($2); } goto NEXT(); } -inline op unless(invar NUM, labelconst INT) { +inline op unless(invar NUM, inconst LABEL) { if ($1 == 0.0) { goto OFFSET($2); } goto NEXT(); } -op unless (invar STR, labelconst INT) { +op unless (invar STR, inconst LABEL) { if (!string_bool(interp, $1)) { goto OFFSET($2); } goto NEXT(); } -op unless(invar PMC, labelconst INT) { +op unless(invar PMC, inconst LABEL) { if (!$1->vtable->get_bool(interp, $1)) { goto OFFSET($2); } @@ -627,15 +627,15 @@ =over 4 -=item B<set_addr>(out INT, labelconst INT) +=item B<set_addr>(out INT, inconst LABEL) Sets register $1 to the current address plus the offset $2. -=item B<set_addr>(invar PMC, labelconst INT) +=item B<set_addr>(invar PMC, inconst LABEL) Sets PMC in register $1 to the current address plus the offset $2. -=item B<set_addr>(invar PMC, labelvar INT) +=item B<set_addr>(invar PMC, invar LABEL) Sets PMC in register $1 to the absolute address $2 obtained from B<get_addr>. @@ -645,17 +645,17 @@ =cut -inline op set_addr(out INT, labelconst INT) { +inline op set_addr(out INT, inconst LABEL) { $1 = PTR2OPCODE_T(CUR_OPCODE + $2); goto NEXT(); } -inline op set_addr(invar PMC, labelconst INT) { +inline op set_addr(invar PMC, inconst LABEL) { $1->vtable->set_pointer(interp, $1, (CUR_OPCODE + $2)); goto NEXT(); } -inline op set_addr(invar PMC, labelvar INT) { +inline op set_addr(invar PMC, invar LABEL) { $1->vtable->set_pointer(interp, $1, (void* )$2); goto NEXT(); } @@ -675,7 +675,7 @@ =over 4 -=item B<push_eh>(labelconst INT) +=item B<push_eh>(inconst LABEL) Create an exception handler for the given catch label and push it onto the control stack. @@ -720,7 +720,7 @@ =cut -inline op push_eh(labelconst INT) { +inline op push_eh(inconst LABEL) { PMC * const eh = pmc_new(interp, enum_class_Exception_Handler); VTABLE_set_pointer(interp, eh, CUR_OPCODE + $1); push_exception(interp, eh); @@ -993,7 +993,7 @@ ######################################## -=item B<runinterp>(invar PMC, label INT) +=item B<runinterp>(invar PMC, in LABEL) Run the code starting at offset $2 within interpreter $1. @@ -1003,7 +1003,7 @@ =cut -op runinterp(invar PMC, label INT) { +op runinterp(invar PMC, in LABEL) { Interp * const new_interp = (Interp *)PMC_data($1); Interp_flags_SET(new_interp, PARROT_EXTERN_CODE_FLAG); new_interp->code = interp->code; Modified: branches/buildtools/src/ops/object.ops ============================================================================== --- branches/buildtools/src/ops/object.ops (original) +++ branches/buildtools/src/ops/object.ops Mon Feb 26 19:16:39 2007 @@ -460,7 +460,7 @@ =cut inline op addattribute(invar PMC, in STR) :object_classes { - Parrot_add_attribute(interp, $1, $2); + VTABLE_add_attr(interp, $1, $2); goto NEXT(); } Modified: branches/buildtools/src/ops/stm.ops ============================================================================== --- branches/buildtools/src/ops/stm.ops (original) +++ branches/buildtools/src/ops/stm.ops Mon Feb 26 19:16:39 2007 @@ -31,7 +31,7 @@ goto NEXT(); } -=item B<stm_validate>(label INT) +=item B<stm_validate>(in LABEL) If the current transaction is invalid jump to $1; otherwise, excecution continues normally. @@ -40,13 +40,13 @@ =cut -inline op stm_validate(labelconst INT) { +inline op stm_validate(inconst LABEL) { if (!Parrot_STM_validate(interp)) goto OFFSET($1); goto NEXT(); } -=item B<stm_commit>(labelconst INT) +=item B<stm_commit>(inconst LABEL) Commits the most recently opened transaction. Jumps to $1 if the commit fails. (If the outer transaction is invalid, this should succeed @@ -56,13 +56,13 @@ =cut -inline op stm_commit(labelconst INT) { +inline op stm_commit(inconst LABEL) { if (!Parrot_STM_commit(interp)) goto OFFSET($1); /* retry */ goto NEXT(); } -=item B<stm_wait>(label INT) +=item B<stm_wait>(in LABEL) Does what stm_wait does, but if the outer transaction is invalid after waiting or after the inner transaction is aborted, jumps to $1. @@ -72,7 +72,7 @@ =cut -inline op stm_wait(labelconst INT) { +inline op stm_wait(inconst LABEL) { Parrot_STM_wait(interp); if (!Parrot_STM_validate(interp)) goto OFFSET($1); Modified: branches/buildtools/src/pmc/parrotclass.pmc ============================================================================== --- branches/buildtools/src/pmc/parrotclass.pmc (original) +++ branches/buildtools/src/pmc/parrotclass.pmc Mon Feb 26 19:16:39 2007 @@ -145,7 +145,19 @@ return SELF->vtable->whoami; } +/* + +=item C<void add_attr(STRING* name)> + +Add attribute named C<name>. + +=cut + +*/ + void add_attr(STRING* name) { + Parrot_add_attribute(interp, SELF, name); + } /* Modified: branches/buildtools/vtable.tbl ============================================================================== --- branches/buildtools/vtable.tbl (original) +++ branches/buildtools/vtable.tbl Mon Feb 26 19:16:39 2007 @@ -343,6 +343,10 @@ PMC* subclass(PMC* name) +void add_attr(STRING* idx) +void rem_attr(INTVAL idx) +void rem_attr_str(STRING* idx) + PMC* get_attr(INTVAL idx) PMC* get_attr_str(STRING* idx) void set_attr(INTVAL idx, PMC* value) :write