OCCAM-v2: Combining Static and Dynamic Analysis for Effective and Efficient Whole-program Specialization