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

Method emit

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

Source from the content-addressed store, hash-verified

6446 abstract Type[] getArgTypes();
6447
6448 public void emit(ObjExpr fn, ClassVisitor cv){
6449 Method m = new Method(getMethodName(), getReturnType(), getArgTypes());
6450
6451 GeneratorAdapter gen = new GeneratorAdapter(ACC_PUBLIC,
6452 m,
6453 null,
6454 //todo don't hardwire this
6455 EXCEPTION_TYPES,
6456 cv);
6457 gen.visitCode();
6458
6459 Label loopLabel = gen.mark();
6460 gen.visitLineNumber(line, loopLabel);
6461 try
6462 {
6463 Var.pushThreadBindings(RT.map(LOOP_LABEL, loopLabel, METHOD, this));
6464
6465 body.emit(C.RETURN, fn, gen);
6466 Label end = gen.mark();
6467 gen.visitLocalVariable("this", "Ljava/lang/Object;", null, loopLabel, end, 0);
6468 for(ISeq lbs = argLocals.seq(); lbs != null; lbs = lbs.next())
6469 {
6470 LocalBinding lb = (LocalBinding) lbs.first();
6471 gen.visitLocalVariable(lb.name, "Ljava/lang/Object;", null, loopLabel, end, lb.idx);
6472 }
6473 }
6474 finally
6475 {
6476 Var.popThreadBindings();
6477 }
6478
6479 gen.returnValue();
6480 //gen.visitMaxs(1, 1);
6481 gen.endMethod();
6482 }
6483
6484 void emitClearLocals(GeneratorAdapter gen){
6485 }

Callers 2

emitMethodsMethod · 0.95
emitMethodsMethod · 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