Package org.perl6.nqp.sixmodel

Examples of org.perl6.nqp.sixmodel.SixModelObject


import org.perl6.nqp.sixmodel.TypeObject;

public class Semaphore 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


        throw new RuntimeException("No such attribute '" + name + "' for this object");
    }
   
    public final SixModelObject autoViv(int slot, ThreadContext tc) {
        P6OpaqueREPRData rd = (P6OpaqueREPRData)this.st.REPRData;
        SixModelObject av = rd.autoVivContainers[slot];
        if (av instanceof TypeObject)
            return av;
        else
            return av.clone(tc);
    }
View Full Code Here

            return av.clone(tc);
    }
   
    public SixModelObject clone(ThreadContext tc) {
        try {
            SixModelObject cloned;
            if (this.delegate != null)
                cloned = this.delegate.clone(tc);
            else
                cloned = (SixModelObject)this.clone();
            cloned.sc = null;
View Full Code Here

                argTup[numArgs++] = MD_CACHE_STR;
                break;
            case CallSiteDescriptor.ARG_OBJ:
                if (numArgs >= MD_CACHE_MAX_ARITY)
                    return;
                SixModelObject decont = Ops.decont((SixModelObject)args[i], tc);
                long flag = ((long)decont.st.hashCode()) << 1;
                if (!(decont instanceof TypeObject))
                    flag |= 1;
                argTup[numArgs++] = flag;
                break;
View Full Code Here

                argTup[numArgs++] = MD_CACHE_STR;
                break;
            case CallSiteDescriptor.ARG_OBJ:
                if (numArgs >= MD_CACHE_MAX_ARITY)
                    return null;
                SixModelObject decont = Ops.decont((SixModelObject)args[i], tc);
                long flag = ((long)decont.st.hashCode()) << 1;
                if (!(decont instanceof TypeObject))
                    flag |= 1;
                argTup[numArgs++] = flag;
                break;
View Full Code Here

    public static final int EDGE_CHARRANGE        = 12;
    public static final int EDGE_CHARRANGE_NEG    = 13;
   
    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

        return rval;
    }

    public static SixModelObject open(String path, String mode, ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        h.handle = new FileHandle(tc, path, mode);
        return h;
    }
View Full Code Here

        h.handle = new FileHandle(tc, path, mode);
        return h;
    }

    public static SixModelObject openasync(String path, String mode, ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        h.handle = new AsyncFileHandle(tc, path, mode);
        return h;
    }
View Full Code Here

        h.handle = new AsyncFileHandle(tc, path, mode);
        return h;
    }

    public static SixModelObject socket(long listener, ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        if (listener == 0) {
            h.handle = new SocketHandle(tc);
        } else if (listener > 0) {
            h.handle = new ServerSocketHandle(tc);
View Full Code Here

    public static SixModelObject accept(SixModelObject obj, ThreadContext tc) {
        IOHandleInstance listener = (IOHandleInstance)obj;
        if (listener.handle instanceof ServerSocketHandle) {
            SocketHandle handle = ((ServerSocketHandle)listener.handle).accept(tc);
            if (handle != null) {
                SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
                IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
                h.handle = handle;
                return h;
            }
        } else {
View Full Code Here

TOP

Related Classes of org.perl6.nqp.sixmodel.SixModelObject

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.