Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement nqp::captureposprimspec on JVM.
  • Loading branch information
jnthn committed May 10, 2013
1 parent 05d2aae commit dcc4c3e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1343,6 +1343,24 @@ public static long capturehasnameds(SixModelObject obj, ThreadContext tc) {
throw ExceptionHandling.dieInternal(tc, "capturehasnameds requires a CallCapture");
}
}
public static long captureposprimspec(SixModelObject obj, long idx, ThreadContext tc) {
if (obj instanceof CallCaptureInstance) {
CallCaptureInstance cc = (CallCaptureInstance)obj;
switch (cc.descriptor.argFlags[(int)idx]) {
case CallSiteDescriptor.ARG_INT:
return StorageSpec.BP_INT;
case CallSiteDescriptor.ARG_NUM:
return StorageSpec.BP_NUM;
case CallSiteDescriptor.ARG_STR:
return StorageSpec.BP_STR;
default:
return StorageSpec.BP_NONE;
}
}
else {
throw ExceptionHandling.dieInternal(tc, "captureposarg requires a CallCapture");
}
}

/* Invocation. */
public static final CallSiteDescriptor emptyCallSite = new CallSiteDescriptor(new byte[0], null);
Expand Down

0 comments on commit dcc4c3e

Please sign in to comment.