Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add (untested) perl6_code_object_from_parrot_sub op for moritz++.
  • Loading branch information
jnthn committed Jul 5, 2011
1 parent 6893932 commit 8555c62
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/ops/perl6.ops
Expand Up @@ -620,6 +620,27 @@ inline op perl6_associate_sub_code_object(in PMC, in PMC) :base_core {
}


/*

=item perl6_code_object_from_parrot_sub()

Takes a Parrot Sub PMC and gets the Perl 6 code object associated with it.

=cut

*/
inline op perl6_code_object_from_parrot_sub(out PMC, in PMC) :base_core {
if ($2->vtable->base_type == enum_class_Sub
|| $2->vtable->base_type == enum_class_Coroutine) {
GETATTR_Sub_multi_signature(interp, $2, $1);
}
else {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Can only use perl6_code_object_from_parrot_sub if second operand is a Parrot Sub.");
}
}


/*

=item perl6_enter_multi_dispatch()
Expand Down

0 comments on commit 8555c62

Please sign in to comment.