Examples of CodeRef


Examples of org.perl6.nqp.runtime.CodeRef

        long[][] hnull = new long[0][];
        MethodType mt = MethodType.methodType(void.class, ThreadContext.class,
                CodeRef.class, CallSiteDescriptor.class, Object[].class);
        Lookup l = MethodHandles.lookup();
        try {
            refs[0] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "new_type", mt).bindTo(this),
                    "new_type", "new_type", snull, snull, snull, snull, hnull, (short)0);
            refs[1] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "add_method", mt).bindTo(this),
                    "add_method", "add_method", snull, snull, snull, snull, hnull, (short)0);
            refs[2] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "add_attribute", mt).bindTo(this),
                    "add_attribute", "add_attribute", snull, snull, snull, snull, hnull, (short)0);
            refs[3] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "compose", mt).bindTo(this),
                    "compose", "compose", snull, snull, snull, snull, hnull, (short)0);
            refs[4] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "attributes", mt).bindTo(this),
                    "attributes", "attributes", snull, snull, snull, snull, hnull, (short)0);
            refs[5] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "methods", mt).bindTo(this),
                    "methods", "methods", snull, snull, snull, snull, hnull, (short)0);
            refs[6] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "name", mt).bindTo(this),
                    "name", "name", snull, snull, snull, snull, hnull, (short)0);
            refs[7] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "attr_new", mt).bindTo(this),
                    "new", "attr_new", snull, snull, snull, snull, hnull, (short)0);
            refs[8] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "attr_compose", mt).bindTo(this),
                    "compose", "attr_compose", snull, snull, snull, snull, hnull, (short)0);
            refs[9] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "attr_name", mt).bindTo(this),
                    "name", "attr_name", snull, snull, snull, snull, hnull, (short)0);
            refs[10] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "attr_type", mt).bindTo(this),
                    "type", "attr_type", snull, snull, snull, snull, hnull, (short)0);
            refs[11] = new CodeRef(this, l.findVirtual(KnowHOWMethods.class, "attr_box_target", mt).bindTo(this),
                    "box_target", "attr_box_target", snull, snull, snull, snull, hnull, (short)0);
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of org.perl6.nqp.runtime.CodeRef

                gc.out = gc.err = new PrintStream( Channels.newOutputStream(sock), true, "UTF-8" );
                gc.interceptExit = true;
                gc.sharingHint = true;

                CompilationUnit cu = CompilationUnit.setupCompilationUnit(gc.mainThread, cuType, true);
                CodeRef entryRef = null;
                if (cu.entryQbid() >= 0) entryRef = cu.lookupCodeRef(cu.entryQbid());
                if (entryRef == null)
                    throw new RuntimeException("This class is not an entry point");
                Ops.invokeMain(gc.mainThread, entryRef, cuType.getName(), argv);
            }
View Full Code Here

Examples of org.perl6.nqp.runtime.CodeRef

        for (int i = 0; i < closureTableEntries; i++) {
            /* Seek to the closure's table row. */
            orig.position(closureTableOffset + i * CLOSURES_TABLE_ENTRY_SIZE);

            /* Resolve the reference to the static code object. */
            CodeRef staticCode = readCodeRef();

            /* Clone it and add it to this SC's code refs list. */
            CodeRef closure = (CodeRef)staticCode.clone(tc);
            closure.sc = sc;
            sc.addCodeRef(closure);

            /* See if there's a code object we need to attach. */
            orig.position(orig.position() + 4);
View Full Code Here

Examples of org.perl6.nqp.runtime.CodeRef

        for (int i = 0; i < contextTableEntries; i++) {
            /* Seek to the context's table row. */
            orig.position(contextTableOffset + i * CONTEXTS_TABLE_ENTRY_SIZE);

            /* Resolve the reference to the static code object this context is for. */
            CodeRef staticCode = readCodeRef();

            /* Create a context and set it up. */
            CallFrame ctx = new CallFrame();
            ctx.tc = tc;
            ctx.codeRef = staticCode;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.