Package org.jruby.compiler.impl

Examples of org.jruby.compiler.impl.SkinnyMethodAdapter.invokevirtual()


                        mv = new SkinnyMethodAdapter(cw.visitMethod(ACC_PUBLIC, "call", COMPILED_CALL_SIG_BLOCK, null, null));
                        mv.start();
                       
                        // check arity
                        mv.aload(1);
                        mv.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class));
                        mv.aload(5);
                        mv.pushInt(scope.getRequiredArgs());
                        mv.pushInt(scope.getRequiredArgs());
                        mv.invokestatic(p(Arity.class), "checkArgumentCount", sig(int.class, Ruby.class, IRubyObject[].class, int.class, int.class));
                        mv.pop();
View Full Code Here


                        case 3:
                            signature = COMPILED_CALL_SIG_THREE_BLOCK;
                            break;
                        }
                       
                        mv.invokevirtual(mnamePath, "call", signature);
                        mv.areturn();
                        mv.end();
                       
                        mv = new SkinnyMethodAdapter(cw.visitMethod(ACC_PUBLIC, "call", signature, null, null));
                    }
View Full Code Here

                        if (specificArity) {
                            for (int i = 0; i < scope.getRequiredArgs(); i++) {
                                mv.aload(ARGS_INDEX + i);
                            }
                            mv.aload(ARGS_INDEX + scope.getRequiredArgs());
                            mv.invokevirtual(typePath, method, StandardASMCompiler.METHOD_SIGNATURES[scope.getRequiredArgs()]);
                        } else {
                            mv.aload(ARGS_INDEX);
                            mv.aload(BLOCK_INDEX);
                            mv.invokevirtual(typePath, method, StandardASMCompiler.METHOD_SIGNATURES[4]);
                        }
View Full Code Here

                            mv.aload(ARGS_INDEX + scope.getRequiredArgs());
                            mv.invokevirtual(typePath, method, StandardASMCompiler.METHOD_SIGNATURES[scope.getRequiredArgs()]);
                        } else {
                            mv.aload(ARGS_INDEX);
                            mv.aload(BLOCK_INDEX);
                            mv.invokevirtual(typePath, method, StandardASMCompiler.METHOD_SIGNATURES[4]);
                        }
                    }
                    mv.label(tryEnd);
                   
                    // normal exit, perform finally and return
View Full Code Here

                        {
                            mv.aload(0);
                            mv.swap();
                            mv.aload(1);
                            mv.swap();
                            mv.invokevirtual(COMPILED_SUPER_CLASS, "handleReturn", sig(IRubyObject.class, ThreadContext.class, JumpException.ReturnJump.class));
                            mv.label(doReturnFinally);

                            // finally
                            if (!callConfig.isNoop()) {
                                invokeCallConfigPost(mv, COMPILED_SUPER_CLASS, callConfig);
View Full Code Here

                        // clear the redo
                        mv.pop();
                       
                        // get runtime, create jump error, and throw it
                        mv.aload(1);
                        mv.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class));
                        mv.invokevirtual(p(Ruby.class), "newRedoLocalJumpError", sig(RaiseException.class));
                        mv.label(doRedoFinally);
                       
                        // finally
                        if (!callConfig.isNoop()) {
View Full Code Here

                        mv.pop();
                       
                        // get runtime, create jump error, and throw it
                        mv.aload(1);
                        mv.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class));
                        mv.invokevirtual(p(Ruby.class), "newRedoLocalJumpError", sig(RaiseException.class));
                        mv.label(doRedoFinally);
                       
                        // finally
                        if (!callConfig.isNoop()) {
                            invokeCallConfigPost(mv, COMPILED_SUPER_CLASS, callConfig);
View Full Code Here

                        mv.aload(CLASS_INDEX);
                        mv.aload(NAME_INDEX);
                        mv.aload(ARGS_INDEX);
                        mv.aload(BLOCK_INDEX);

                        mv.invokevirtual(generatedClassPath, callName, COMPILED_CALL_SIG_BLOCK);
                        mv.areturn();
                    }

                    // if we fall off the switch, error.
                    mv.label(defaultCase);
View Full Code Here

                    }

                    // if we fall off the switch, error.
                    mv.label(defaultCase);
                    mv.aload(THREADCONTEXT_INDEX);
                    mv.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class));
                    mv.ldc("Error: fell off switched invoker for class: " + implementationClass.getBaseName());
                    mv.invokevirtual(p(Ruby.class), "newRuntimeError", sig(RaiseException.class, String.class));
                    mv.athrow();

                    c = endCall(cw, mv, generatedClassName);
View Full Code Here

                    // if we fall off the switch, error.
                    mv.label(defaultCase);
                    mv.aload(THREADCONTEXT_INDEX);
                    mv.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class));
                    mv.ldc("Error: fell off switched invoker for class: " + implementationClass.getBaseName());
                    mv.invokevirtual(p(Ruby.class), "newRuntimeError", sig(RaiseException.class, String.class));
                    mv.athrow();

                    c = endCall(cw, mv, generatedClassName);
                }
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.