Quantum weights of dyons and of instantons with nontrivial holonomy