MCPcopy Index your code
hub / github.com/clojure/clojure / writeClassFile

Method writeClassFile

src/jvm/clojure/lang/Compiler.java:8246–8270  ·  view source on GitHub ↗
(String internalName, byte[] bytecode)

Source from the content-addressed store, hash-verified

8244}
8245
8246static public void writeClassFile(String internalName, byte[] bytecode) throws IOException{
8247 String genPath = (String) COMPILE_PATH.deref();
8248 if(genPath == null)
8249 throw Util.runtimeException("*compile-path* not set");
8250 String[] dirs = internalName.split("/");
8251 String p = genPath;
8252 for(int i = 0; i < dirs.length - 1; i++)
8253 {
8254 p += File.separator + dirs[i];
8255 (new File(p)).mkdir();
8256 }
8257 String path = genPath + File.separator + internalName + ".class";
8258 File cf = new File(path);
8259 cf.createNewFile();
8260 FileOutputStream cfs = new FileOutputStream(cf);
8261 try
8262 {
8263 cfs.write(bytecode);
8264 cfs.flush();
8265 }
8266 finally
8267 {
8268 cfs.close();
8269 }
8270}
8271
8272public static void pushNS(){
8273 Var.pushThreadBindings(PersistentHashMap.create(Var.intern(Symbol.intern("clojure.core"),

Callers 2

compileMethod · 0.95
compileMethod · 0.80

Calls 3

runtimeExceptionMethod · 0.95
writeMethod · 0.80
derefMethod · 0.65

Tested by

no test coverage detected