private SkinnyMethodAdapter startBlockCall(ClassWriter cw) { SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw, ACC_PUBLIC | ACC_SYNTHETIC | ACC_FINAL, "call", BLOCK_CALL_SIG, null, null); mv.visitCode(); return mv; }
private SkinnyMethodAdapter startBlockCall19(ClassWriter cw) { SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw, ACC_PUBLIC | ACC_SYNTHETIC | ACC_FINAL, "call", BLOCK_CALL_SIG19, null, null); mv.visitCode(); return mv; }
private SkinnyMethodAdapter startBlockCall(ClassWriter cw) { SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw, ACC_PUBLIC | ACC_SYNTHETIC | ACC_FINAL, "call", BLOCK_CALL_SIG, null, null); mv.visitCode(); return mv; }
private SkinnyMethodAdapter startBlockCall19(ClassWriter cw) { SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw, ACC_PUBLIC | ACC_SYNTHETIC | ACC_FINAL, "call", BLOCK_CALL_SIG19, null, null); mv.visitCode(); return mv; }
public void pushmethod(String name, int arity) { Method m; switch (arity) { case 0: case 1: case 2: case 3: m = new Method(name, JVM.OBJECT_TYPE, ARGS[arity]); break; default: throw new RuntimeException("Unsupported arity " + arity + " for " + name); } methodStack.push(new MethodData(new SkinnyMethodAdapter(cls, Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, m.getName(), m.getDescriptor(), null, null), arity)); }
public void pushmethod(String name, int arity) { Method m; switch (arity) { case 0: case 1: case 2: case 3: m = new Method(name, JVM.OBJECT_TYPE, ARGS[arity]); break; default: throw new RuntimeException("Unsupported arity " + arity + " for " + name); } methodStack.push(new MethodData(new SkinnyMethodAdapter(cls, Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, m.getName(), m.getDescriptor(), null, null), arity)); }
private void beginClassInit() { ClassVisitor cv = getClassVisitor(); clinitMethod = new SkinnyMethodAdapter(cv, ACC_PUBLIC | ACC_STATIC, "<clinit>", sig(Void.TYPE), null, null); clinitMethod.start(); }
private void beginClassInit() { ClassVisitor cv = getClassVisitor(); clinitMethod = new SkinnyMethodAdapter(cv, ACC_PUBLIC | ACC_STATIC, "<clinit>", sig(Void.TYPE), null, null); clinitMethod.start(); }
public BaseBodyCompiler(StandardASMCompiler scriptCompiler, String methodName, String rubyName, ASTInspector inspector, StaticScope scope, int scopeIndex) { this.script = scriptCompiler; this.scope = scope; this.inspector = inspector; this.methodName = methodName; this.rubyName = rubyName; this.argParamCount = getActualArgsCount(scope); method = new SkinnyMethodAdapter(script.getClassVisitor(), ACC_PUBLIC | ACC_STATIC, methodName, getSignature(), null, null); createVariableCompiler(); invocationCompiler = OptoFactory.newInvocationCompiler(this, method); this.scopeIndex = scopeIndex; }
public BaseBodyCompiler(StandardASMCompiler scriptCompiler, String methodName, String rubyName, ASTInspector inspector, StaticScope scope, int scopeIndex) { this.script = scriptCompiler; this.scope = scope; this.inspector = inspector; this.methodName = methodName; this.rubyName = rubyName; this.argParamCount = getActualArgsCount(scope); method = new SkinnyMethodAdapter(script.getClassVisitor(), ACC_PUBLIC | ACC_STATIC, methodName, getSignature(), null, null); createVariableCompiler(); invocationCompiler = OptoFactory.newInvocationCompiler(this, method); this.scopeIndex = scopeIndex; }
public void generate(AsmClassBuilder builder, String functionName, JITSignature signature) { Class[] params = new Class[4 + signature.getParameterCount()]; params[0] = ThreadContext.class; params[1] = IRubyObject.class; params[2] = RubyModule.class; params[3] = String.class; Arrays.fill(params, 4, params.length, IRubyObject.class); SkinnyMethodAdapter mv = new SkinnyMethodAdapter(builder.getClassVisitor(), ACC_PUBLIC | ACC_FINAL, functionName, sig(IRubyObject.class, params), null, null); mv.start(); generate(builder, mv, signature, 5); mv.visitMaxs(30, 30); mv.visitEnd(); }
private ClassWriter createJavaMethodCtor(String namePath, String sup, String parameterDesc) throws Exception { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES); String sourceFile = namePath.substring(namePath.lastIndexOf('/') + 1) + ".gen"; cw.visit(RubyInstanceConfig.JAVA_VERSION, ACC_PUBLIC + ACC_SUPER, namePath, null, sup, null); cw.visitSource(sourceFile, null); SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw, ACC_PUBLIC, "<init>", JAVA_SUPER_SIG, null, null); mv.start(); mv.aloadMany(0, 1, 2); mv.visitMethodInsn(INVOKESPECIAL, sup, "<init>", JAVA_SUPER_SIG); mv.aload(0); mv.ldc(parameterDesc); mv.invokevirtual(p(JavaMethod.class), "setParameterDesc", sig(void.class, String.class)); mv.voidreturn(); mv.end(); return cw; }
private ClassWriter createCompiledCtor(String namePath, String shortPath, String sup) { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES); cw.visit(RubyInstanceConfig.JAVA_VERSION, ACC_PUBLIC + ACC_SUPER, namePath, null, sup, null); cw.visitSource(shortPath, null); SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw, ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.aload(0); mv.visitMethodInsn(INVOKESPECIAL, sup, "<init>", "()V"); mv.voidreturn(); mv.end(); return cw; }
private ClassWriter createCompiledCtor(String namePath, String shortPath, String sup) { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES); cw.visit(RubyInstanceConfig.JAVA_VERSION, ACC_PUBLIC + ACC_SUPER, namePath, null, sup, null); cw.visitSource(shortPath, null); SkinnyMethodAdapter mv = new SkinnyMethodAdapter(cw, ACC_PUBLIC, "<init>", "()V", null, null); mv.visitCode(); mv.aload(0); mv.visitMethodInsn(INVOKESPECIAL, sup, "<init>", "()V"); mv.voidreturn(); mv.end(); return cw; }
public void pushmethod(String name, IRScope scope, Signature signature, boolean specificArity) { Method m = new Method(name, Type.getType(signature.type().returnType()), IRRuntimeHelpers.typesFromSignature(signature)); SkinnyMethodAdapter adapter = new SkinnyMethodAdapter(cls, Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, m.getName(), m.getDescriptor(), null, null); methodStack.push( new MethodData( new IRBytecodeAdapter6(adapter, signature, this), scope, signature, specificArity ? scope.getStaticScope().getSignature().required() : -1) ); } }
public void pushmethod(String name, IRScope scope, Signature signature, boolean specificArity) { Method m = new Method(name, Type.getType(signature.type().returnType()), IRRuntimeHelpers.typesFromSignature(signature)); SkinnyMethodAdapter adapter = new SkinnyMethodAdapter(cls, Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, m.getName(), m.getDescriptor(), null, null); methodStack.push( new MethodData( new IRBytecodeAdapter7(adapter, signature, this), scope, signature, specificArity ? scope.getStaticScope().getSignature().required() : -1) ); }
public void pushmethod(String name, IRScope scope, Signature signature, boolean specificArity) { Method m = new Method(name, Type.getType(signature.type().returnType()), IRRuntimeHelpers.typesFromSignature(signature)); SkinnyMethodAdapter adapter = new SkinnyMethodAdapter(cls, Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, m.getName(), m.getDescriptor(), null, null); methodStack.push( new MethodData( new IRBytecodeAdapter6(adapter, signature, this), scope, signature, specificArity ? scope.getStaticScope().getSignature().required() : -1) ); } }
public void pushmethod(String name, IRScope scope, Signature signature, boolean specificArity) { Method m = new Method(name, Type.getType(signature.type().returnType()), IRRuntimeHelpers.typesFromSignature(signature)); SkinnyMethodAdapter adapter = new SkinnyMethodAdapter(cls, Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC, m.getName(), m.getDescriptor(), null, null); methodStack.push( new MethodData( new IRBytecodeAdapter7(adapter, signature, this), scope, signature, specificArity ? scope.getStaticScope().getSignature().required() : -1) ); }
private void beginInit() { ClassVisitor cv = getClassVisitor(); initMethod = new SkinnyMethodAdapter(cv, ACC_PUBLIC, "<init>", sig(Void.TYPE), null, null); initMethod.start(); initMethod.aload(THIS); initMethod.invokespecial(p(AbstractScript.class), "<init>", sig(Void.TYPE)); // JRUBY-3014: make __FILE__ dynamically determined at load time, but // we provide a reasonable default here initMethod.aload(THIS); initMethod.ldc(getSourcename()); initMethod.putfield(getClassname(), "filename", ci(String.class)); }
private void beginInit() { ClassVisitor cv = getClassVisitor(); initMethod = new SkinnyMethodAdapter(cv, ACC_PUBLIC, "<init>", sig(Void.TYPE), null, null); initMethod.start(); initMethod.aload(THIS); initMethod.invokespecial(p(AbstractScript.class), "<init>", sig(Void.TYPE)); // JRUBY-3014: make __FILE__ dynamically determined at load time, but // we provide a reasonable default here initMethod.aload(THIS); initMethod.ldc(getSourcename()); initMethod.putfield(getClassname(), "filename", ci(String.class)); }