Search in sources :

Example 1 with Code

use of org.eclipse.ceylon.langtools.tools.javac.jvm.Code in project ceylon by eclipse.

the class Gen method initCode.

private int initCode(JCMethodDecl tree, Env<GenContext> env, boolean fatcode) {
    MethodSymbol meth = tree.sym;
    // Create a new code structure.
    meth.code = code = new Code(meth, fatcode, lineDebugInfo ? toplevel.lineMap : null, varDebugInfo, stackMap, debugCode, genCrt ? new CRTable(tree, env.toplevel.endPositions) : null, syms, types, pool);
    items = new Items(pool, code, syms, types);
    if (code.debugCode) {
        System.err.println(meth + " for body " + tree);
    }
    // for `this'.
    if ((tree.mods.flags & STATIC) == 0) {
        Type selfType = meth.owner.type;
        if (meth.isConstructor() && selfType != syms.objectType)
            selfType = UninitializedType.uninitializedThis(selfType);
        code.setDefined(code.newLocal(new VarSymbol(FINAL, names._this, selfType, meth.owner)));
    }
    // the method.
    for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
        checkDimension(l.head.pos(), l.head.sym.type);
        code.setDefined(code.newLocal(l.head.sym));
    }
    // Get ready to generate code for method body.
    int startpcCrt = genCrt ? code.curCP() : 0;
    code.entryPoint();
    // Suppress initial stackmap
    code.pendingStackMap = false;
    return startpcCrt;
}
Also used : Type(org.eclipse.ceylon.langtools.tools.javac.code.Type) Items(org.eclipse.ceylon.langtools.tools.javac.jvm.Items) Code(org.eclipse.ceylon.langtools.tools.javac.jvm.Code)

Aggregations

Type (org.eclipse.ceylon.langtools.tools.javac.code.Type)1 Code (org.eclipse.ceylon.langtools.tools.javac.jvm.Code)1 Items (org.eclipse.ceylon.langtools.tools.javac.jvm.Items)1