Package org.perl6.nqp.sixmodel.reprs

Examples of org.perl6.nqp.sixmodel.reprs.CallCaptureInstance


import org.perl6.nqp.sixmodel.TypeObject;

public class VMIter extends REPR {
    public SixModelObject type_object_for(ThreadContext tc, SixModelObject HOW) {
        STable st = new STable(this, HOW);
        SixModelObject obj = new TypeObject();
        obj.st = st;
        st.WHAT = obj;
        return st.WHAT;
    }
View Full Code Here


import org.perl6.nqp.sixmodel.TypeObject;

public class ContextRef extends REPR {
    public SixModelObject type_object_for(ThreadContext tc, SixModelObject HOW) {
        STable st = new STable(this, HOW);
        SixModelObject obj = new TypeObject();
        obj.st = st;
        st.WHAT = obj;
        return st.WHAT;
    }
View Full Code Here

            if (parents <= 1) {
                long numAttrs = attrs.elems(tc);
                for (long j = 0; j < numAttrs; j++) {
                    SixModelObject attrHash = attrs.at_pos_boxed(tc, j);
                    AttrInfo info = new AttrInfo();
                    info.name = attrHash.at_key_boxed(tc, "name").get_str(tc);
                    info.type = attrHash.at_key_boxed(tc, "type");
                    StorageSpec spec = info.type.st.REPR.get_storage_spec(tc, info.type.st);
                    info.bits = spec.bits;
                    repr_data.fieldTypes.put(info.name, info);
View Full Code Here

            throw ExceptionHandling.dieInternal(tc, "captureposarg requires a CallCapture");
        }
    }
    public static long captureexistsnamed(SixModelObject obj, String name, ThreadContext tc) {
        if (obj instanceof CallCaptureInstance) {
            CallCaptureInstance cc = (CallCaptureInstance)obj;
            return cc.descriptor.nameMap.containsKey(name) ? 1 : 0;
        }
        else {
            throw ExceptionHandling.dieInternal(tc, "capturehasnameds requires a CallCapture");
        }
View Full Code Here

            throw ExceptionHandling.dieInternal(tc, "capturehasnameds requires a CallCapture");
        }
    }
    public static long capturehasnameds(SixModelObject obj, ThreadContext tc) {
        if (obj instanceof CallCaptureInstance) {
            CallCaptureInstance cc = (CallCaptureInstance)obj;
            return cc.descriptor.names == null ? 0 : 1;
        }
        else {
            throw ExceptionHandling.dieInternal(tc, "capturehasnameds requires a CallCapture");
        }
View Full Code Here

            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;
View Full Code Here

            ExceptionHandling.dieInternal(tc, e);
        }
    }
    public static SixModelObject invokewithcapture(SixModelObject invokee, SixModelObject capture, ThreadContext tc) throws Exception {
        if (capture instanceof CallCaptureInstance) {
            CallCaptureInstance cc = (CallCaptureInstance)capture;
            invokeDirect(tc, invokee, cc.descriptor, cc.args);
            return result_o(tc.curFrame);
        }
        else {
            throw ExceptionHandling.dieInternal(tc, "invokewithcapture requires a CallCapture");
View Full Code Here

        }
    }

    /* Capture related operations. */
    public static SixModelObject usecapture(ThreadContext tc, CallSiteDescriptor cs, Object[] args) {
        CallCaptureInstance cc = tc.savedCC;
        cc.descriptor = cs;
        cc.args = args.clone();
        return cc;
    }
View Full Code Here

        cc.args = args.clone();
        return cc;
    }
    public static SixModelObject savecapture(ThreadContext tc, CallSiteDescriptor cs, Object[] args) {
        SixModelObject CallCapture = tc.gc.CallCapture;
        CallCaptureInstance cc = (CallCaptureInstance)CallCapture.st.REPR.allocate(tc, CallCapture.st);
        cc.descriptor = cs;
        cc.args = args.clone();
        return cc;
    }
View Full Code Here

        else
            throw ExceptionHandling.dieInternal(tc, "captureposelems requires a CallCapture");
    }
    public static SixModelObject captureposarg(SixModelObject obj, long idx, ThreadContext tc) {
        if (obj instanceof CallCaptureInstance) {
            CallCaptureInstance cc = (CallCaptureInstance)obj;
            int i = (int)idx;
            switch (cc.descriptor.argFlags[i]) {
            case CallSiteDescriptor.ARG_OBJ:
                return (SixModelObject)cc.args[i];
            case CallSiteDescriptor.ARG_INT:
View Full Code Here

TOP

Related Classes of org.perl6.nqp.sixmodel.reprs.CallCaptureInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.