replace hardcoded eval frame control flags skip_code_recursive_flag/cache_limit_hit_flag (#146355)
Summary:
This PR and the previous:
- Moves parts of `eval_frame.c` to C++.
- Reduces code duplication in `dynamo__custom_eval_frame` and makes the control flow more clear.
- Enables `convert_frame` to signal to `eval_frame.cpp` in a general manner how to evaluate this frame, recursive frames, and future frames with the same code object (default/compile, skip, run-only). e.g. this will allow us to change skipping/cache limit hit eval_frame behavior directly from convert_frame without requiring changes to C/C++.
X-link: https://github.com/pytorch/pytorch/pull/146355
Approved by: https://github.com/jansel
ghstack dependencies: #145603
Reviewed By: jeanschmidt
Differential Revision: D69854999
fbshipit-source-id: efa9a6cf38fd5b9c5b78dd169d2411712825200e