Package org.perl6.nqp.sixmodel

Examples of org.perl6.nqp.sixmodel.SerializationContext


        st.WHAT = obj;
        return st.WHAT;
    }

    public void compose(ThreadContext tc, STable st, SixModelObject repr_info_hash) {
        SixModelObject repr_info = repr_info_hash.at_key_boxed(tc, "attribute");
        CStructREPRData repr_data = new CStructREPRData();

        long mroLength = repr_info.elems(tc);
        List<AttrInfo> attrInfos = new ArrayList<AttrInfo>();
        for (long i = mroLength - 1; i >= 0; i--) {
            SixModelObject entry = repr_info.at_pos_boxed(tc, i);
            SixModelObject attrs = entry.at_pos_boxed(tc, 1);
            long parents = entry.at_pos_boxed(tc, 2).elems(tc);

            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);

                    if (info.type == null) {
View Full Code Here


import org.perl6.nqp.sixmodel.TypeObject;

public class CallCapture 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 MultiCache 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 VMHash 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

            SerializationReader reader, SixModelObject obj) {
        HashMap<String, SixModelObject> storage = ((VMHashInstance)obj).storage;
        int elems = reader.readInt32();
        for (int i = 0; i < elems; i++) {
            String key = reader.readStr();
            SixModelObject value = reader.readRef();
            storage.put(key, value);
        }
    }
View Full Code Here

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

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

        obj.value = "";
        return obj;
    }
   
    public StorageSpec get_storage_spec(ThreadContext tc, STable st) {
        StorageSpec ss = new StorageSpec();
        ss.inlineable = StorageSpec.INLINED;
        ss.boxed_primitive = StorageSpec.BP_STR;
        ss.can_box = StorageSpec.CAN_BOX_STR;
        return ss;
    }
View Full Code Here

                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);

                    if (info.type == null) {
                        ExceptionHandling.dieInternal(tc, "CStruct representation requires the types of all attributes to be specified");
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.