Tree-based mechanism, dynamic code profiling, and plane code offloading