Package org.jruby.ir.targets

Examples of org.jruby.ir.targets.JVMVisitor


        return CompilerHolder.instance;
    }

    @Override
    protected ScriptAndCode execute(final Ruby runtime, final IRScriptBody scope, JRubyClassLoader classLoader) {
        JVMVisitor visitor;
        byte[] bytecode;
        Class compiled;
        StaticScope _staticScope;
        IRubyObject _runtimeTopSelf;

        Method _compiledMethod;
        try {
            visitor = new JVMVisitor();
            bytecode = visitor.compileToBytecode(scope);
            compiled = visitor.defineFromBytecode(scope, bytecode, classLoader);
            _staticScope = scope.getStaticScope();
            _runtimeTopSelf = runtime.getTopSelf();
            _staticScope.setModule(_runtimeTopSelf.getMetaClass());

            _compiledMethod = compiled.getMethod("__script__", ThreadContext.class,
View Full Code Here


                        return;
                    }
                }

                String key = SexpMaker.sha1(method.getIRMethod());
                JVMVisitor visitor = new JVMVisitor();
                JITClassGenerator generator = new JITClassGenerator(className, methodName, key, runtime, method, visitor);

                generator.compile();

                // FIXME: reinstate active bytecode size check
                // At this point we still need to reinstate the bytecode size check, to ensure we're not loading code
                // that's so big that JVMs won't even try to compile it. Removed the check because with the new IR JIT
                // bytecode counts often include all nested scopes, even if they'd be different methods. We need a new
                // mechanism of getting all method sizes.
                Class sourceClass = visitor.defineFromBytecode(method.getIRMethod(), generator.bytecode(), new OneShotClassLoader(runtime.getJRubyClassLoader()));

                if (sourceClass == null) {
                    // class could not be found nor generated; give up on JIT and bail out
                    counts.failCount.incrementAndGet();
                    return;
View Full Code Here

TOP

Related Classes of org.jruby.ir.targets.JVMVisitor

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.