[aot] Avoid a stack overflow if profiler enter-leave events are requested in the full-aot mode.