Package org.perl6.nqp.runtime

Examples of org.perl6.nqp.runtime.ResumeStatus$Frame


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


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.TypeObject;

public class P6str 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 VMException 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

                AsyncSocketHandle handle = new AsyncSocketHandle(curTC, channel);
                IOHandleInstance ioHandle = (IOHandleInstance) IOType.st.REPR.allocate(curTC,
                        IOType.st);
                ioHandle.handle = handle;

                SixModelObject result = Array.st.REPR.allocate(curTC, Array.st);
                result.push_boxed(curTC, task.schedulee);
                result.push_boxed(curTC, ioHandle);
                result.push_boxed(curTC, Null);

                ((ConcBlockingQueueInstance) task.queue).push_boxed(curTC, result);
            }

            @Override
            public void failed(Throwable exc, AsyncTaskInstance task) {
                ThreadContext curTC = tc.gc.getCurrentThreadContext();
                SixModelObject result = Array.st.REPR.allocate(curTC, Array.st);
                result.push_boxed(curTC, task.schedulee);
                result.push_boxed(curTC, IOType);
                result.push_boxed(curTC, Ops.box_s(exc.getMessage(), Str, curTC));
            }
        };

        try {
            listenChan.accept(task, handler);
View Full Code Here

                        try {
                            /* We're done. Decode and box. */
                            ThreadContext curTC = tc.gc.getCurrentThreadContext();
                            ss.bb.flip();
                            String decoded = dec.decode(ss.bb).toString();
                            SixModelObject boxed = Ops.box_s(decoded, Str, curTC);
                           
                            /* Call done handler. */
                            Ops.invokeDirect(curTC, done, slurpResultCSD, new Object[] { boxed });
                        } catch (IOException e) {
                            failed(e, ss);
                        }
                    }
                    else {
                        /* Need to read some more. */
                        chan.read(ss.bb, ss.bb.position(), ss, this);
                    }
                }
               
                public void failed(Throwable exc, SlurpState ss) {
                    /* Box error. */
                    ThreadContext curTC = tc.gc.getCurrentThreadContext();
                    SixModelObject boxed = Ops.box_s(exc.toString(), Str, curTC);
                   
                    /* Call error handler. */
                    Ops.invokeDirect(curTC, error, slurpResultCSD, new Object[] { boxed });
                }
            };
View Full Code Here

                }

                public void failed(Throwable exc, SpurtState ss) {
                    /* Box error. */
                    ThreadContext curTC = tc.gc.getCurrentThreadContext();
                    SixModelObject boxed = Ops.box_s(exc.toString(), Str, curTC);

                    /* Call error handler. */
                    Ops.invokeDirect(curTC, error, spurtErrorCSD, new Object[] { boxed });
                }
            };
View Full Code Here

            }
           
            public void failed(Throwable exc, LinesState ss) {
                /* Box error. */
                ThreadContext curTC = tc.gc.getCurrentThreadContext();
                SixModelObject boxed = Ops.box_s(exc.toString(), Str, curTC);
               
                /* Call error handler. */
                Ops.invokeDirect(curTC, error, linesErrorCSD, new Object[] { boxed });
            }
        };
View Full Code Here

    }

    private JavaClass compileJast(SixModelObject jast, SixModelObject jastNodes, boolean split, ThreadContext tc) throws Exception {

        SixModelObject jastClassObj = jastNodes.at_key_boxed(tc, "JAST::Class");
        SixModelObject jastField = jastNodes.at_key_boxed(tc, "JAST::Field");
        SixModelObject jastMethod = jastNodes.at_key_boxed(tc, "JAST::Method");

        JastClass jastClass = new JastClass(jast, jastClassObj, tc);
        JavaClass c = new JavaClass();

        c.name = jastClass.className;
        c.serialized = jastClass.serialized;

        String className = jastClass.className.replace('.', '/');
        String superName = jastClass.superName.replace('.', '/');

        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
        cw.visit(Opcodes.V1_7, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, className, null,
                superName, null);
        cw.visitSource(jastClass.filename, null);

        SixModelObject iter = iter(jastClass.fields, tc);
        while (istrue(iter, tc) != 0) {
            JastField field = new JastField(iter.shift_boxed(tc), jastField, tc);

            cw.visitField(
                    field.isStatic
                        ? Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC
                        : Opcodes.ACC_PUBLIC,
                    field.name, field.type.getDescriptor(), null, null);
        }

        iter = iter(jastClass.methods, tc);
        while (istrue(iter, tc) != 0) {
            JastMethod method = new JastMethod(iter.shift_boxed(tc), jastMethod, tc);
            compileMethod(c, method, cw, className, split, tc);
        }

        // Add empty constructor.
        MethodVisitor constructor = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
View Full Code Here

            method.locals.put("this", new VariableDef(0, "L"+className+";", method.beginAll, method.endAll));

        m.visitCode();
        m.visitLabel(method.beginAll);

        SixModelObject iter = iter(method.instructions, tc);
        while (istrue(iter, tc) != 0) {
            SixModelObject insn = iter.shift_boxed(tc);
            compileInstruction(insn, method, m, tc);
        }

        m.visitLabel(method.endAll);
        for (Map.Entry<String, VariableDef> e : method.locals.entrySet()) {
View Full Code Here

TOP

Related Classes of org.perl6.nqp.runtime.ResumeStatus$Frame

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.