Package org.perl6.nqp.sixmodel

Examples of org.perl6.nqp.sixmodel.StorageSpec


     * REPR data deserialization. Deserializes the per-type representation data and
     * attaches it to the supplied STable.
     */
    public void deserialize_repr_data(ThreadContext tc, STable st, SerializationReader reader)
    {
        StorageSpec ss = new StorageSpec();
        ss.inlineable = StorageSpec.INLINED;
        ss.boxed_primitive = StorageSpec.BP_NUM;
        if (reader.version >= 7)
            ss.bits = (short)reader.readLong();
        else
View Full Code Here


        obj.body = new NativeCallBody();
        return obj;
    }
   
    public StorageSpec get_storage_spec(ThreadContext tc, STable st) {
        StorageSpec ss = new StorageSpec();
        ss.inlineable = StorageSpec.INLINED;
        ss.bits = 64;
        return ss;
    }
View Full Code Here

        obj.st = st;
        return obj;
    }
   
    public StorageSpec get_storage_spec(ThreadContext tc, STable st) {
        StorageSpec ss = new StorageSpec();
        ss.inlineable = StorageSpec.INLINED;
        ss.boxed_primitive = StorageSpec.BP_INT;
        ss.bits = 64;
        ss.can_box = StorageSpec.CAN_BOX_INT;
        return ss;
View Full Code Here

        SixModelObject obj;
        if (st.REPRData == null) {
            obj = new VMArrayInstance();
        }
        else {
            StorageSpec ss = ((VMArrayREPRData)st.REPRData).ss;
            switch (ss.boxed_primitive) {
            case StorageSpec.BP_INT:
                if (ss.bits == 64)
                    obj = new VMArrayInstance_i();
                else if (ss.bits == 8)
View Full Code Here

   
    public void compose(ThreadContext tc, STable st, SixModelObject repr_info) {
        SixModelObject arrayInfo = repr_info.at_key_boxed(tc, "array");
        if (arrayInfo != null) {
            SixModelObject type = arrayInfo.at_key_boxed(tc, "type");
            StorageSpec ss = type.st.REPR.get_storage_spec(tc, type.st);
            switch (ss.boxed_primitive) {
            case StorageSpec.BP_INT:
            case StorageSpec.BP_NUM:
            case StorageSpec.BP_STR:
                VMArrayREPRData reprData = new VMArrayREPRData();
View Full Code Here

        SixModelObject obj;
        if (st.REPRData == null) {
            obj = new VMArrayInstance();
        }
        else {
            StorageSpec ss = ((VMArrayREPRData)st.REPRData).ss;
            switch (ss.boxed_primitive) {
            case StorageSpec.BP_INT:
                if (ss.bits == 8)
                    obj = ss.is_unsigned == 0
                        ? new VMArrayInstance_i8()
View Full Code Here

        STable st = new STable(this, HOW);
        SixModelObject obj = new TypeObject();
        obj.st = st;
        st.WHAT = obj;
       
        StorageSpec ss = new StorageSpec();
        ss.inlineable = StorageSpec.INLINED;
        ss.boxed_primitive = StorageSpec.BP_INT;
        ss.bits = 64;
        ss.can_box = StorageSpec.CAN_BOX_INT;
        st.REPRData = ss;
View Full Code Here

     * REPR data deserialization. Deserializes the per-type representation data and
     * attaches it to the supplied STable.
     */
    public void deserialize_repr_data(ThreadContext tc, STable st, SerializationReader reader)
    {
        StorageSpec ss = new StorageSpec();
        ss.inlineable = StorageSpec.INLINED;
        ss.boxed_primitive = StorageSpec.BP_INT;
        if (reader.version >= 7)
            ss.bits = (short)reader.readLong();
        else
View Full Code Here

            NativeLibrary library = libname == null || libname.equals("")
                ? NativeLibrary.getProcess()
                : NativeLibrary.getInstance(libname);
            Pointer entry_point = library.getGlobalVariableAddress(symbol);

            StorageSpec ss = target_spec.st.REPR.get_storage_spec(tc, target_spec.st);
            if (ss.boxed_primitive == StorageSpec.BP_STR)
                entry_point = entry_point.getPointer(0);

            return castNativeCall(tc, target_spec, target_type, entry_point);
        }
View Full Code Here

        if (o == null)
            return target_type;

        ArgType target        = ArgType.INT;
        SixModelObject nqpobj = target_type.st.REPR.allocate(tc, target_type.st);
        StorageSpec        ss = target_spec.st.REPR.get_storage_spec(tc, target_spec.st);

        switch (ss.boxed_primitive) {
            case StorageSpec.BP_INT:
                switch (ss.bits) {
                    case 8:
View Full Code Here

TOP

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

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.