Black hole entropy, marginal stability and mirror symmetry