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

Method emit

src/jvm/clojure/lang/Compiler.java:9179–9226  ·  view source on GitHub ↗
(ObjExpr obj, ClassVisitor cv)

Source from the content-addressed store, hash-verified

9177 }
9178
9179 public void emit(ObjExpr obj, ClassVisitor cv){
9180 Method m = new Method(getMethodName(), getReturnType(), getArgTypes());
9181
9182 Type[] extypes = null;
9183 if(exclasses.length > 0)
9184 {
9185 extypes = new Type[exclasses.length];
9186 for(int i=0;i<exclasses.length;i++)
9187 extypes[i] = Type.getType(exclasses[i]);
9188 }
9189 GeneratorAdapter gen = new GeneratorAdapter(ACC_PUBLIC,
9190 m,
9191 null,
9192 extypes,
9193 cv);
9194 addAnnotation(gen,methodMeta);
9195 for(int i = 0; i < parms.count(); i++)
9196 {
9197 IPersistentMap meta = RT.meta(parms.nth(i));
9198 addParameterAnnotation(gen, meta, i);
9199 }
9200 gen.visitCode();
9201
9202 Label loopLabel = gen.mark();
9203
9204 gen.visitLineNumber(line, loopLabel);
9205 try
9206 {
9207 Var.pushThreadBindings(RT.map(LOOP_LABEL, loopLabel, METHOD, this));
9208
9209 emitBody(objx, gen, retClass, body);
9210 Label end = gen.mark();
9211 gen.visitLocalVariable("this", obj.objtype.getDescriptor(), null, loopLabel, end, 0);
9212 for(ISeq lbs = argLocals.seq(); lbs != null; lbs = lbs.next())
9213 {
9214 LocalBinding lb = (LocalBinding) lbs.first();
9215 gen.visitLocalVariable(lb.name, argTypes[lb.idx-1].getDescriptor(), null, loopLabel, end, lb.idx);
9216 }
9217 }
9218 finally
9219 {
9220 Var.popThreadBindings();
9221 }
9222
9223 gen.returnValue();
9224 //gen.visitMaxs(1, 1);
9225 gen.endMethod();
9226 }
9227}
9228
9229 static boolean inty(Class c){

Callers

nothing calls this directly

Calls 15

getMethodNameMethod · 0.95
getReturnTypeMethod · 0.95
getArgTypesMethod · 0.95
getTypeMethod · 0.95
metaMethod · 0.95
markMethod · 0.95
pushThreadBindingsMethod · 0.95
mapMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
popThreadBindingsMethod · 0.95
returnValueMethod · 0.95

Tested by

no test coverage detected