replaced vindex/vkind fields with constant_t, do codestat calculation during writing