public void pushscript(String clsName, String filename) { PrintWriter pw = new PrintWriter(System.out); writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); clsStack.push(new ClassData(clsName, writer)); cls().visit(RubyInstanceConfig.JAVA_VERSION, ACC_PUBLIC + ACC_SUPER, clsName, null, p(Object.class), null); cls().visitSource(filename, null); pw.flush(); }
public void emit(IRScriptBody script) { String clsName = jvm.scriptToClass(script.getName()); jvm.pushscript(clsName, script.getFileName()); emitScope(script, "__script__", 0); jvm.cls().visitEnd(); jvm.popclass(); }
public String getNewStaticConstant(String type, String name_prefix) { ClassVisitor cv = getClassVisitor(); String realName; synchronized (this) { realName = "__" + constants++; } // declare the field cv.visitField(ACC_PRIVATE | ACC_STATIC | ACC_FINAL, realName, type, null, null).visitEnd(); return realName; } }
public SkinnyMethodAdapter(ClassVisitor cv, int flags, String name, String signature, String something, String[] exceptions) { super(ASM4); setMethodVisitor(cv.visitMethod(flags, name, signature, something, exceptions)); this.cv = cv; this.name = name; this.start = new Label(); this.end = new Label(); }
AsmClassBuilder(JITMethodGenerator generator, JITSignature signature, String methodName) { this.generator = generator; this.signature = signature; this.methodName = methodName; switch (signature.getParameterCount()) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: parentClass = JITNativeInvoker.class; break; default: throw new UnsupportedOperationException("arity " + signature.getParameterCount() + " not supported"); } className = p(NativeInvoker.class) + "$ffi$" + nextClassID.getAndIncrement() + (REIFY ? ("$" + methodName) : ""); classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); classVisitor = DEBUG ? newCheckClassAdapter(classWriter) : classWriter; classVisitor.visit(V1_5, ACC_PUBLIC | ACC_FINAL, className, null, p(parentClass), new String[0]); }
public SkinnyMethodAdapter(ClassVisitor cv, int flags, String name, String signature, String something, String[] exceptions) { super(ASM4); setMethodVisitor(cv.visitMethod(flags, name, signature, something, exceptions)); this.cv = cv; this.name = name; this.start = new Label(); this.end = new Label(); }
AsmClassBuilder(JITMethodGenerator generator, JITSignature signature, String methodName) { this.generator = generator; this.signature = signature; this.methodName = methodName; switch (signature.getParameterCount()) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: parentClass = JITNativeInvoker.class; break; default: throw new UnsupportedOperationException("arity " + signature.getParameterCount() + " not supported"); } className = p(NativeInvoker.class) + "$ffi$" + nextClassID.getAndIncrement() + (REIFY ? ("$" + methodName) : ""); classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); classVisitor = DEBUG ? newCheckClassAdapter(classWriter) : classWriter; classVisitor.visit(V1_5, ACC_PUBLIC | ACC_FINAL, className, null, p(parentClass), new String[0]); }
public String getNewStaticConstant(String type, String name_prefix) { ClassVisitor cv = getClassVisitor(); String realName; synchronized (this) { realName = "__" + constants++; } // declare the field cv.visitField(ACC_PRIVATE | ACC_STATIC | ACC_FINAL, realName, type, null, null).visitEnd(); return realName; } }
public void pushscript(String clsName, String filename) { PrintWriter pw = new PrintWriter(System.out); writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); clsStack.push(new ClassData(clsName, writer)); cls().visit(RubyInstanceConfig.JAVA_VERSION, ACC_PUBLIC + ACC_SUPER, clsName, null, p(Object.class), null); cls().visitSource(filename, null); pw.flush(); }
public void emit(IRScriptBody script) { String clsName = jvm.scriptToClass(script.getName()); jvm.pushscript(clsName, script.getFileName()); emitScope(script, "__script__", 0); jvm.cls().visitEnd(); jvm.popclass(); }
public SkinnyMethodAdapter(ClassVisitor cv, int flags, String name, String signature, String something, String[] exceptions) { super(ASM4); setMethodVisitor(cv.visitMethod(flags, name, signature, something, exceptions)); this.cv = cv; this.name = name; this.start = new Label(); this.end = new Label(); }
AsmClassBuilder(JITMethodGenerator generator, JITSignature signature, String methodName) { this.generator = generator; this.signature = signature; this.methodName = methodName; switch (signature.getParameterCount()) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: parentClass = JITNativeInvoker.class; break; default: throw new UnsupportedOperationException("arity " + signature.getParameterCount() + " not supported"); } className = p(NativeInvoker.class) + "$ffi$" + nextClassID.getAndIncrement() + (REIFY ? ("$" + methodName) : ""); classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES); classVisitor = DEBUG ? newCheckClassAdapter(classWriter) : classWriter; classVisitor.visit(V1_5, ACC_PUBLIC | ACC_FINAL, className, null, p(parentClass), new String[0]); }
public void declareField(String field) { if (!clsData().fieldSet.contains(field)) { cls().visitField(ACC_PROTECTED, field, ci(Object.class), null, null); clsData().fieldSet.add(field); } }
public void pushscript(String clsName, String filename) { writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); clsStack.push(new ClassData7(clsName, writer)); cls().visit(RubyInstanceConfig.JAVA_VERSION, ACC_PUBLIC + ACC_SUPER, clsName, null, p(Object.class), null); cls().visitSource(filename, null); } }
protected void emitMethodJIT(IRMethod method, JVMVisitorMethodContext context) { String clsName = jvm.scriptToClass(method.getFile()); String name = JavaNameMangler.encodeScopeForBacktrace(method) + '$' + methodIndex++; jvm.pushscript(clsName, method.getFile()); emitWithSignatures(method, context, name); jvm.cls().visitEnd(); jvm.popclass(); }
public SkinnyMethodAdapter(ClassVisitor cv, int flags, String name, String signature, String something, String[] exceptions) { super(ASM4); setMethodVisitor(cv.visitMethod(flags, name, signature, something, exceptions)); this.cv = cv; this.name = name; this.start = new Label(); this.end = new Label(); }