Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Toss another Perl 6 op that duplicated an NQP one.
  • Loading branch information
jnthn committed Apr 9, 2013
1 parent e088624 commit 83d0f6c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.pm
Expand Up @@ -2746,7 +2746,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
:op('bind'),
QAST::Var.new(:name<$?REGEX>, :scope<lexical>, :decl('var')),
QAST::Op.new(
:op('p6vmcodetoobj'),
:op('getcodeobj'),
QAST::Op.new( :op('curcode') )
)));
$block.symbol('$?REGEX', :scope<lexical>);
Expand Down
1 change: 0 additions & 1 deletion src/Perl6/Ops.pm
Expand Up @@ -22,7 +22,6 @@ $ops.add_hll_pirop_mapping('perl6', 'p6bindcaptosig', 'perl6_bind_sig_to_cap', '
$ops.add_hll_pirop_mapping('perl6', 'p6typecheckrv', 'perl6_type_check_return_value', '0PP', :inlinable(1));
$ops.add_hll_pirop_mapping('perl6', 'p6decontrv', 'perl6_decontainerize_return_value', 'PP', :inlinable(1));
$ops.add_hll_pirop_mapping('perl6', 'p6capturelex', 'perl6_capture_lex', '0P');
$ops.add_hll_pirop_mapping('perl6', 'p6vmcodetoobj', 'perl6_code_object_from_parrot_sub', 'PP');
$ops.add_hll_pirop_mapping('perl6', 'p6bindassert', 'perl6_assert_bind_ok', '0PP');
$ops.add_hll_pirop_mapping('perl6', 'p6getpackage', 'perl6_get_package_through_who', 'PPs');
$ops.add_hll_pirop_mapping('perl6', 'p6stateinit', 'perl6_state_needs_init', 'I');
Expand Down
2 changes: 1 addition & 1 deletion src/core/Backtrace.pm
Expand Up @@ -43,7 +43,7 @@ my class Backtrace is List {
next if nqp::isnull($bt[$_]<sub>);
my $code;
try {
$code = pir::perl6_code_object_from_parrot_sub__PP($bt[$_]<sub>);
$code = nqp::getcodeobj($bt[$_]<sub>);
};
my $line = $bt[$_]<annotations><line>;
my $file = $bt[$_]<annotations><file>;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Code.pm
Expand Up @@ -12,7 +12,7 @@ my class Code does Callable {
multi method Str(Code:D:) { self.name }

method outer(Code:D:) {
pir::perl6_code_object_from_parrot_sub__PP($!do.get_outer())
nqp::getcodeobj($!do.get_outer())
}

# returns an identifier for this code object
Expand Down
23 changes: 0 additions & 23 deletions src/ops/perl6.ops
Expand Up @@ -1052,29 +1052,6 @@ inline op find_method_null_ok(out PMC, in PMC, in STR) :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) {
PMC *p6sub;
GETATTR_Sub_multi_signature(interp, $2, p6sub);
$1 = PMC_IS_NULL(p6sub) ? Rakudo_types_mu_get() : p6sub;
}
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_decontainerize_return_value()
Expand Down

0 comments on commit 83d0f6c

Please sign in to comment.