Skip to content

Commit

Permalink
Provide a non-decont'ing version of istype.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Sep 25, 2013
1 parent bd3d68a commit f97e725
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Original file line number Diff line number Diff line change
Expand Up @@ -2103,12 +2103,14 @@ public static long isinvokable(SixModelObject obj, ThreadContext tc) {
return obj instanceof CodeRef || obj.st.InvocationSpec != null ? 1 : 0;
}
public static long istype(SixModelObject obj, SixModelObject type, ThreadContext tc) {
return istype_nodecont(decont(obj, tc), decont(type, tc), tc);
}
public static long istype_nodecont(SixModelObject obj, SixModelObject type, ThreadContext tc) {
/* Null always type checks false. */
if (obj == null)
return 0;
obj = decont(obj, tc);
type = decont(type, tc);


/* Start by considering cache. */
int typeCheckMode = type.st.ModeFlags & STable.TYPE_CHECK_CACHE_FLAG_MASK;
SixModelObject[] cache = obj.st.TypeCheckCache;
if (cache != null) {
Expand Down

0 comments on commit f97e725

Please sign in to comment.