Code layout optimization