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

Method doEmit

src/jvm/clojure/lang/Compiler.java:6244–6279  ·  view source on GitHub ↗
(ObjExpr fn, ClassVisitor cv)

Source from the content-addressed store, hash-verified

6242
6243 }
6244 public void doEmit(ObjExpr fn, ClassVisitor cv){
6245 Method m = new Method(getMethodName(), getReturnType(), getArgTypes());
6246
6247 GeneratorAdapter gen = new GeneratorAdapter(ACC_PUBLIC,
6248 m,
6249 null,
6250 //todo don't hardwire this
6251 EXCEPTION_TYPES,
6252 cv);
6253 gen.visitCode();
6254
6255 Label loopLabel = gen.mark();
6256 gen.visitLineNumber(line, loopLabel);
6257 try
6258 {
6259 Var.pushThreadBindings(RT.map(LOOP_LABEL, loopLabel, METHOD, this));
6260
6261 body.emit(C.RETURN, fn, gen);
6262 Label end = gen.mark();
6263
6264 gen.visitLocalVariable("this", "Ljava/lang/Object;", null, loopLabel, end, 0);
6265 for(ISeq lbs = argLocals.seq(); lbs != null; lbs = lbs.next())
6266 {
6267 LocalBinding lb = (LocalBinding) lbs.first();
6268 gen.visitLocalVariable(lb.name, "Ljava/lang/Object;", null, loopLabel, end, lb.idx);
6269 }
6270 }
6271 finally
6272 {
6273 Var.popThreadBindings();
6274 }
6275
6276 gen.returnValue();
6277 //gen.visitMaxs(1, 1);
6278 gen.endMethod();
6279 }
6280
6281
6282

Callers 1

emitMethod · 0.95

Calls 15

getMethodNameMethod · 0.95
getReturnTypeMethod · 0.95
getArgTypesMethod · 0.95
markMethod · 0.95
pushThreadBindingsMethod · 0.95
mapMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
popThreadBindingsMethod · 0.95
returnValueMethod · 0.95
endMethodMethod · 0.95
emitMethod · 0.65

Tested by

no test coverage detected