Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make nqp::clone use repr_clone.
This means it will work with 6model objects. Also note that repr_clone
has also been taught to deal with Parrot objects, but in a fully 6model
implementation (like we have on JVM) such a code path is not needed.
  • Loading branch information
jnthn committed Feb 1, 2013
1 parent 55631fa commit 5233c6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/QAST/Operations.nqp
Expand Up @@ -1586,7 +1586,7 @@ QAST::Operations.add_core_pirop_mapping('getattr_n', 'repr_get_attr_num', 'NPPs'
QAST::Operations.add_core_pirop_mapping('getattr_s', 'repr_get_attr_str', 'SPPs', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('attrinited', 'repr_is_attr_initialized', 'IPPs', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('create', 'repr_instance_of', 'PP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('clone', 'clone', 'PP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('clone', 'repr_clone', 'PP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('isconcrete', 'repr_defined', 'IP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('iscont', 'is_container', 'IP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('decont', 'nqp_decontainerize', 'PP', :inlinable(1));
Expand Down
6 changes: 3 additions & 3 deletions src/ops/nqp.ops
Expand Up @@ -511,7 +511,8 @@ inline op repr_instance_of(out PMC, invar PMC) :base_core {

=item repr_clone()

Gets a REPR to clone itself.
Clones an object. If it's a 6model object, uses repr_clone. If not, falls back to
Parrot's clone vtable.

=cut

Expand All @@ -527,8 +528,7 @@ inline op repr_clone(out PMC, invar PMC) :base_core {
PARROT_GC_WRITE_BARRIER(interp, $1);
}
else {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Can only use repr_clone on a SixModelObject");
$1 = VTABLE_clone(interp, var);
}
}

Expand Down

0 comments on commit 5233c6d

Please sign in to comment.