Package org.perl6.nqp.sixmodel

Examples of org.perl6.nqp.sixmodel.SerializationContext


import org.perl6.nqp.sixmodel.StorageSpec;
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.SixModelObject;
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

import org.perl6.nqp.sixmodel.SixModelObject;
import org.perl6.nqp.sixmodel.TypeObject;

public class CodeRefREPR 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.SixModelObject;
import org.perl6.nqp.sixmodel.TypeObject;

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

    }
    public static SixModelObject createsc(String handle, ThreadContext tc) {
        if (tc.gc.scs.containsKey(handle))
            return tc.gc.scRefs.get(handle);

        SerializationContext sc = new SerializationContext(handle);
        tc.gc.scs.put(handle, sc);

        SixModelObject SCRef = tc.gc.SCRef;
        SCRefInstance ref = (SCRefInstance)SCRef.st.REPR.allocate(tc, SCRef.st);
        ref.referencedSC = sc;
View Full Code Here

        return ref;
    }
    public static SixModelObject scsetobj(SixModelObject scRef, long idx, SixModelObject obj, ThreadContext tc) {
        if (scRef instanceof SCRefInstance) {
            SerializationContext sc = ((SCRefInstance)scRef).referencedSC;
            sc.addObject(obj, (int) idx);
            if (obj.st.sc == null) {
                sc.addSTable(obj.st);
                obj.st.sc = sc;
            }
            return obj;
        }
        else {
View Full Code Here

        }
    }
    public static SixModelObject scsetcode(SixModelObject scRef, long idx, SixModelObject obj, ThreadContext tc) {
        if (scRef instanceof SCRefInstance) {
            if (obj instanceof CodeRef) {
                SerializationContext referencedSC = ((SCRefInstance)scRef).referencedSC;
                referencedSC.addCodeRef((CodeRef)obj, (int)idx);
                obj.sc = referencedSC;
                return obj;
            }
            else {
                throw ExceptionHandling.dieInternal(tc, "scsetcode can only store a CodeRef");
View Full Code Here

        else {
            throw ExceptionHandling.dieInternal(tc, "setobjsc requires an SCRef");
        }
    }
    public static SixModelObject getobjsc(SixModelObject obj, ThreadContext tc) {
        SerializationContext sc = obj.sc;
        if (sc == null)
            return null;
        if (!tc.gc.scRefs.containsKey(sc.handle)) {
            SixModelObject SCRef = tc.gc.SCRef;
            SCRefInstance ref = (SCRefInstance)SCRef.st.REPR.allocate(tc, SCRef.st);
View Full Code Here

            throw ExceptionHandling.dieInternal(tc, "serialize was not passed a valid SCRef");
        }
    }
    public static String deserialize(String blob, SixModelObject scRef, SixModelObject sh, SixModelObject cr, SixModelObject conflict, ThreadContext tc) throws IOException {
        if (scRef instanceof SCRefInstance) {
            SerializationContext sc = ((SCRefInstance)scRef).referencedSC;

            String[] shArray = new String[(int)sh.elems(tc)];
            for (int i = 0; i < shArray.length; i++) {
                sh.at_pos_native(tc, i);
                shArray[i] = tc.native_s;
View Full Code Here

         * owner we need to repossess. */
        SixModelObject owner = obj.sc.owned_objects.get(obj);
        if (owner != null)
            obj = owner;

        SerializationContext compSC = tc.compilingSCs.get(cscSize - 1).referencedSC;
        if (obj.sc != compSC) {
            compSC.repossessObject(obj.sc, obj);
            obj.sc = compSC;
        }
    }
View Full Code Here

TOP

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

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.