A comparative study of static and profile-based heuristics for inlining