Navigation Menu

Skip to content

Commit

Permalink
Refactor "is copy" binding to avoid extra objectrefs and VTABLE_clone.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jun 25, 2010
1 parent 7e3ddca commit f34e780
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/binder/bind.c
Expand Up @@ -294,11 +294,12 @@ Rakudo_binding_bind_one_param(PARROT_INTERP, PMC *lexpad, llsig_element *sig_inf
Parrot_ext_call(interp, store_meth, "PiP", copy, value);
}
else {
copy = VTABLE_clone(interp, value);
value = descalarref(interp, value);
copy = pmc_new_init(interp, p6s_id, value);
VTABLE_setprop(interp, copy, string_from_literal(interp, "scalar"), copy);
}
ref = pmc_new_init(interp, or_id, copy);
VTABLE_setprop(interp, ref, string_from_literal(interp, "rw"), ref);
VTABLE_set_pmc_keyed_str(interp, lexpad, sig_info->variable_name, ref);
VTABLE_setprop(interp, copy, string_from_literal(interp, "rw"), copy);
VTABLE_set_pmc_keyed_str(interp, lexpad, sig_info->variable_name, copy);
}
}
else {
Expand Down

0 comments on commit f34e780

Please sign in to comment.