public void doEmitPrim(ObjExpr fn, ClassVisitor cv){
Type returnType;
if (retClass == double.class || retClass == long.class)
returnType = getReturnType();
else returnType = OBJECT_TYPE;
Method ms = new Method("invokePrim", returnType, argtypes);
GeneratorAdapter gen = new GeneratorAdapter(ACC_PUBLIC + ACC_FINAL,
ms,
null,
//todo don't hardwire this
EXCEPTION_TYPES,
cv);
gen.visitCode();
Label loopLabel = gen.mark();
gen.visitLineNumber(line, loopLabel);
try
{
Var.pushThreadBindings(RT.map(LOOP_LABEL, loopLabel, METHOD, this));
emitBody(objx, gen, retClass, body);
Label end = gen.mark();
gen.visitLocalVariable("this", "Ljava/lang/Object;", null, loopLabel, end, 0);
for(ISeq lbs = argLocals.seq(); lbs != null; lbs = lbs.next())
{
LocalBinding lb = (LocalBinding) lbs.first();
gen.visitLocalVariable(lb.name, argtypes[lb.idx-1].getDescriptor(), null, loopLabel, end, lb.idx);
}
}
finally
{
Var.popThreadBindings();
}
gen.returnValue();
//gen.visitMaxs(1, 1);
gen.endMethod();
//generate the regular invoke, calling the prim method
Method m = new Method(getMethodName(), OBJECT_TYPE, getArgTypes());
gen = new GeneratorAdapter(ACC_PUBLIC,
m,
null,
//todo don't hardwire this