else if (val instanceof Double)
return new ConstantValue.DoubleConstant(((Double)val).doubleValue());
else if (val instanceof Type)
return new ConstantValue.ClassConstant((Type)val);
else
throw new AnalyzerException(insn, "Unhandled bytecode instruction");
}
case NEW:
{
assert(insn instanceof TypeInsnNode);
TypeInsnNode typeInsn = (TypeInsnNode)insn;
String className = typeInsn.desc;
return new TypedValue.NewValue(className);
}
case BIPUSH:
case SIPUSH:
{
assert(insn instanceof IntInsnNode);
IntInsnNode intInsn = (IntInsnNode)insn;
return new ConstantValue.IntegerConstant(intInsn.operand);
}
case GETSTATIC:
{
assert(insn instanceof FieldInsnNode);
FieldInsnNode fieldInsn = (FieldInsnNode)insn;
return new TypedValue.GetStaticFieldValue(fieldInsn.owner, fieldInsn.name, fieldInsn.desc);
}
case JSR:
default:
throw new AnalyzerException(insn, "Unhandled bytecode instruction");
}
}