Package org.teavm.model

Examples of org.teavm.model.ClassHolder


        for (Transformation transformation : transformations) {
            if (name.startsWith(transformation.packageName)) {
                int index = name.lastIndexOf('.');
                String className = name.substring(index + 1);
                String packageName = index > 0 ? name.substring(0, index) : "";
                ClassHolder classHolder = innerMapper.map(transformation.packagePrefix + packageName +
                        "." + transformation.classPrefix + className);
                if (classHolder != null) {
                    classHolder = renamer.rename(classHolder);
                }
                return classHolder;
View Full Code Here


            throw new IllegalArgumentException("Class " + cls.getName() + " is already defined");
        }
    }

    private ClassReader findAndTransformClass(String name) {
        ClassHolder cls = findClass(name);
        if (cls != null && !transformers.isEmpty()) {
            for (ClassHolderTransformer transformer : transformers) {
                transformer.transformClass(cls, innerSource);
            }
            cls = ModelUtils.copyClass(cls);
View Full Code Here

                new GlobalValueNumbering(), new UnusedVariableElimination());
    }

    public void optimizeAll(ListableClassHolderSource classSource) {
        for (String className : classSource.getClassNames()) {
            ClassHolder cls = classSource.get(className);
            for (MethodHolder method : cls.getMethods()) {
                if (method.getProgram() != null && method.getProgram().basicBlockCount() > 0) {
                    Program program = ProgramUtils.copy(method.getProgram());
                    for (MethodOptimization optimization : getOptimizations()) {
                        optimization.optimize(method, program);
                    }
View Full Code Here

TOP

Related Classes of org.teavm.model.ClassHolder

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.