Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Toss current container spec config op.
Not used in NQP itself, and we'll be changing how container stuff is
handled.
  • Loading branch information
jnthn committed Mar 19, 2013
1 parent 87b52fb commit 3c65140
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
1 change: 0 additions & 1 deletion src/QAST/Operations.nqp
Expand Up @@ -1850,7 +1850,6 @@ QAST::Operations.add_core_pirop_mapping('setmethcache', 'publish_method_cache',
QAST::Operations.add_core_pirop_mapping('setmethcacheauth', 'set_method_cache_authoritativeness', '0Pi', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('settypecache', 'publish_type_check_cache', '0PP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('objprimspec', 'repr_get_primitive_type_spec', 'IP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('setcontspec', 'set_container_spec', '0PPsP', :inlinable(1));
QAST::Operations.add_core_pirop_mapping('setinvokespec', 'set_invocation_spec', '0PPsP', :inlinable(1));

# lexical related opcodes
Expand Down
38 changes: 0 additions & 38 deletions src/ops/nqp.ops
Expand Up @@ -2229,44 +2229,6 @@ inline op nqp_decontainerize(out PMC, invar PMC) :base_core {
$1 = decontainerize(interp, $2);
}

/*

=item set_container_spec

Sets the container spec for the type in $1 (it actaully sets it on
the s-table, so the type object or any instance of the type will do).

Either set $2 and $3 to a class handle and an attribute name, or set
$4 to a code ref for the FETCH method. Generally, $2/$3 take precedence
over $4.

=cut

*/
inline op set_container_spec(invar PMC, invar PMC, in STR, invar PMC) :base_core {
if ($1->vtable->base_type == smo_id) {
STable *st = STABLE($1);

/* Allocate and populate new container spec. */
ContainerSpec *new_spec = mem_allocate_zeroed_typed(ContainerSpec);
new_spec->value_slot.class_handle = $2;
new_spec->value_slot.attr_name = $3;
new_spec->fetch_method = $4;

/* Free any existing spec and put the new one in place. */
if (st->container_spec)
mem_sys_free(st->container_spec);
st->container_spec = new_spec;
PARROT_GC_WRITE_BARRIER(interp, STABLE_PMC($1));
ST_SC_WRITE_BARRIER(st);
}
else {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Can only use set_container_spec with a SixModelObject");
}
}


/*

=item set_invocation_spec
Expand Down

0 comments on commit 3c65140

Please sign in to comment.