[svn:parrot] r44595 - in branches/rm_cflags: lib/Parrot src/ops
bacek at svn.parrot.org
bacek at svn.parrot.org
Tue Mar 2 20:29:41 UTC 2010
Author: bacek
Date: Tue Mar 2 20:29:39 2010
New Revision: 44595
URL: https://trac.parrot.org/parrot/changeset/44595
Log:
Revert r44581-44583. They are not belong to branch. Coke++, bacek--
Modified:
branches/rm_cflags/lib/Parrot/Op.pm
branches/rm_cflags/src/ops/core.ops
Modified: branches/rm_cflags/lib/Parrot/Op.pm
==============================================================================
--- branches/rm_cflags/lib/Parrot/Op.pm Tue Mar 2 19:53:15 2010 (r44594)
+++ branches/rm_cflags/lib/Parrot/Op.pm Tue Mar 2 20:29:39 2010 (r44595)
@@ -300,6 +300,23 @@
return $self->{JUMP};
}
+=item C<full_body()>
+
+For manual ops, C<full_body()> is the same as C<body()>. For auto ops
+this method adds a final C<goto NEXT()> line to the code to represent
+the auto-computed return value. See the note on op types above.
+
+=cut
+
+sub full_body {
+ my $self = shift;
+ my $body = $self->body;
+
+ $body .= sprintf( " {{+=%d}};\n", $self->size ) if $self->type eq 'auto';
+
+ return $body;
+}
+
# Called from rewrite_body() to perform the actual substitutions.
sub _substitute {
my $self = shift;
@@ -365,7 +382,7 @@
=item C<source($trans)>
-Returns the L<C<body()>> of the op with substitutions made by
+Returns the L<C<full_body()>> of the op with substitutions made by
C<$trans> (a subclass of C<Parrot::OpTrans>).
=cut
@@ -385,7 +402,7 @@
? $trans->add_body_prelude()
: '';
- return $self->rewrite_body( $prelude . $self->body, $trans );
+ return $self->rewrite_body( $prelude . $self->full_body, $trans );
}
=item C<size()>
Modified: branches/rm_cflags/src/ops/core.ops
==============================================================================
--- branches/rm_cflags/src/ops/core.ops Tue Mar 2 19:53:15 2010 (r44594)
+++ branches/rm_cflags/src/ops/core.ops Tue Mar 2 20:29:39 2010 (r44595)
@@ -671,8 +671,6 @@
Register a task with the concurrency scheduler. Details about the task are
stored within the task PMC.
-=cut
-
inline op schedule(invar PMC) {
Parrot_cx_schedule_task(interp, $1);
}
@@ -682,8 +680,6 @@
Add an event or exception handler to the concurrency scheduler. Details about
the handler are stored within the handler PMC.
-=cut
-
inline op addhandler(invar PMC) {
Parrot_cx_add_handler(interp, $1);
}
@@ -1405,6 +1401,7 @@
else {
$1 = Parrot_pmc_new(interp, enum_class_Hash);
}
+ goto NEXT();
}
=item B<annotations>(out PMC, in STR)
@@ -1423,6 +1420,7 @@
else {
$1 = PMCNULL;
}
+ goto NEXT();
}
=back
More information about the parrot-commits
mailing list