(String superName, String[] interfaceNames, boolean oneTimeUse)
| 4872 | } |
| 4873 | |
| 4874 | void compile(String superName, String[] interfaceNames, boolean oneTimeUse) throws IOException{ |
| 4875 | //create bytecode for a class |
| 4876 | //with name current_ns.defname[$letname]+ |
| 4877 | //anonymous fns get names fn__id |
| 4878 | //derived from AFn/RestFn |
| 4879 | ClassWriter cw = classWriter(); |
| 4880 | // ClassWriter cw = new ClassWriter(0); |
| 4881 | ClassVisitor cv = cw; |
| 4882 | // ClassVisitor cv = new TraceClassVisitor(new CheckClassAdapter(cw), new PrintWriter(System.out)); |
| 4883 | //ClassVisitor cv = new TraceClassVisitor(cw, new PrintWriter(System.out)); |
| 4884 | cv.visit(V1_8, ACC_PUBLIC + ACC_SUPER + ACC_FINAL, internalName, null,superName,interfaceNames); |
| 4885 | // superName != null ? superName : |
| 4886 | // (isVariadic() ? "clojure/lang/RestFn" : "clojure/lang/AFunction"), null); |
| 4887 | String source = (String) SOURCE.deref(); |
| 4888 | int lineBefore = (Integer) LINE_BEFORE.deref(); |
| 4889 | int lineAfter = (Integer) LINE_AFTER.deref() + 1; |
| 4890 | int columnBefore = (Integer) COLUMN_BEFORE.deref(); |
| 4891 | int columnAfter = (Integer) COLUMN_AFTER.deref() + 1; |
| 4892 | |
| 4893 | if(source != null && SOURCE_PATH.deref() != null) |
| 4894 | { |
| 4895 | //cv.visitSource(source, null); |
| 4896 | String smap = "SMAP\n" + |
| 4897 | ((source.lastIndexOf('.') > 0) ? |
| 4898 | source.substring(0, source.lastIndexOf('.')) |
| 4899 | :source) |
| 4900 | // : simpleName) |
| 4901 | + ".java\n" + |
| 4902 | "Clojure\n" + |
| 4903 | "*S Clojure\n" + |
| 4904 | "*F\n" + |
| 4905 | "+ 1 " + source + "\n" + |
| 4906 | (String) SOURCE_PATH.deref() + "\n" + |
| 4907 | "*L\n" + |
| 4908 | String.format("%d#1,%d:%d\n", lineBefore, lineAfter - lineBefore, lineBefore) + |
| 4909 | "*E"; |
| 4910 | cv.visitSource(source, smap); |
| 4911 | } |
| 4912 | addAnnotation(cv, classMeta); |
| 4913 | |
| 4914 | |
| 4915 | // for(int i=0;i<varCallsites.count();i++) |
| 4916 | // { |
| 4917 | // cv.visitField(ACC_PRIVATE + ACC_STATIC + ACC_FINAL |
| 4918 | // , varCallsiteName(i), IFN_TYPE.getDescriptor(), null, null); |
| 4919 | // } |
| 4920 | |
| 4921 | |
| 4922 | if(supportsMeta()) |
| 4923 | { |
| 4924 | cv.visitField(ACC_FINAL, "__meta", IPERSISTENTMAP_TYPE.getDescriptor(), null, null); |
| 4925 | } |
| 4926 | //instance fields for closed-overs |
| 4927 | for(ISeq s = RT.keys(closes); s != null; s = s.next()) |
| 4928 | { |
| 4929 | LocalBinding lb = (LocalBinding) s.first(); |
| 4930 | if(isDeftype()) |
| 4931 | { |
nothing calls this directly
no test coverage detected