Package org.jruby.compiler

Examples of org.jruby.compiler.ASTInspector


            classname = "__dash_e__";
        } else {
            classname = filename.replace('\\', '/').replaceAll(".rb", "").replaceAll("-","_dash_");
        }

        ASTInspector inspector = new ASTInspector();
        inspector.inspect(node);
           
        StandardASMCompiler asmCompiler = new StandardASMCompiler(classname, filename);
        ASTCompiler compiler = new ASTCompiler();
        compiler.compileRoot(node, asmCompiler, inspector);
        byte[] bts = asmCompiler.getClassByteArray();
View Full Code Here


        Script script = null;
        try {
            String filename = node.getPosition().getFile();
            String classname = JavaNameMangler.mangledFilenameForStartupClasspath(filename);

            ASTInspector inspector = new ASTInspector();
            inspector.inspect(node);

            StandardASMCompiler asmCompiler = new StandardASMCompiler(classname, filename);
            ASTCompiler compiler = new ASTCompiler();
            if (config.isShowBytecode()) {
                compiler.compileRoot(node, asmCompiler, inspector, false, false);
View Full Code Here

            }
            CompileMode compileMode = runtime.getInstanceConfig().getCompileMode();
            if (compileMode == CompileMode.FORCE) {
                // we pass in an ASTInspector that will force heap variables, so
                // it uses our shared scope
                ASTInspector inspector = new ASTInspector();
                inspector.setFlag(ASTInspector.SCOPE_AWARE);
                Script script = runtime.tryCompile(node, inspector);
                if (script != null) {
                    return new EmbedEvalUnitImpl(container, node, scope, script);
                } else {
                    return new EmbedEvalUnitImpl(container, node, scope);
View Full Code Here

            classname = "__dash_e__";
        } else {
            classname = filename.replace('\\', '/').replaceAll(".rb", "").replaceAll("-","_dash_");
        }

        ASTInspector inspector = new ASTInspector();
        inspector.inspect(node);
           
        StandardASMCompiler asmCompiler = new StandardASMCompiler(classname, filename);
        ASTCompiler compiler = recv.getRuntime().getInstanceConfig().newCompiler();
        compiler.compileRoot(node, asmCompiler, inspector);
        byte[] bts = asmCompiler.getClassByteArray();
View Full Code Here

            t.printStackTrace();
        }
    }

    private Script tryCompile(Node node, String cachedClassName, JRubyClassLoader classLoader, boolean dump) {
        ASTInspector inspector = new ASTInspector();
        inspector.inspect(node);

        return tryCompile(node, cachedClassName, classLoader, inspector, dump);
    }
View Full Code Here

       
        // we get these out ahead of time
        this.file = position.getFile();
        this.line = position.getLine();

        ASTInspector inspector = new ASTInspector();
        inspector.inspect(body);
        inspector.inspect(argsNode);

        // This optimization is temporarily disabled because of the complications
        // arising from moving backref/lastline into scope and not being able
        // to accurately detect that situation.
//        if (inspector.hasClosure() || inspector.hasScopeAwareMethods() || staticScope.getNumberOfVariables() != 0) {
View Full Code Here

            }
            CompileMode compileMode = runtime.getInstanceConfig().getCompileMode();
            if (compileMode == CompileMode.FORCE) {
                // we pass in an ASTInspector that will force heap variables, so
                // it uses our shared scope
                ASTInspector inspector = new ASTInspector();
                inspector.setFlag(ASTInspector.SCOPE_AWARE);
                Script script = runtime.tryCompile(node, inspector);
                if (script != null) {
                    return new EmbedEvalUnitImpl(container, node, scope, script);
                } else {
                    return new EmbedEvalUnitImpl(container, node, scope);
View Full Code Here

       
        // we get these out ahead of time
        this.file = position.getFile();
        this.line = position.getLine();

        ASTInspector inspector = new ASTInspector();
        inspector.inspect(body);
        inspector.inspect(argsNode);

        // This optimization is temporarily disabled because of the complications
        // arising from moving backref/lastline into scope and not being able
        // to accurately detect that situation.
//        if (inspector.hasClosure() || inspector.hasScopeAwareMethods() || staticScope.getNumberOfVariables() != 0) {
View Full Code Here

                        RuntimeHelpers.postLoad(context);
                    }
                }
            };
        }
        ASTInspector inspector = new ASTInspector();
        inspector.inspect(node);

        return tryCompile(node, cachedClassName, classLoader, inspector, dump);
    }
View Full Code Here

TOP

Related Classes of org.jruby.compiler.ASTInspector

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.