patch 8.2.2400: Vim9: compiled functions are not profiled
Problem: Vim9: compiled functions are not profiled.
Solution: Add initial changes to profile compiled functions. Fix that a
script-local function was hard to debug.
diff --git a/src/vim9.h b/src/vim9.h
index 8d4faa3..9446c15 100644
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -152,6 +152,9 @@
ISN_CMDMOD, // set cmdmod
ISN_CMDMOD_REV, // undo ISN_CMDMOD
+ ISN_PROF_START, // start a line for profiling
+ ISN_PROF_END, // end a line for profiling
+
ISN_UNPACK, // unpack list into items, uses isn_arg.unpack
ISN_SHUFFLE, // move item on stack up or down
ISN_DROP // pop stack and discard value
@@ -366,8 +369,12 @@
// was compiled.
garray_T df_def_args_isn; // default argument instructions
+
+ // After compiling "df_instr" and/or "df_instr_prof" is not NULL.
isn_T *df_instr; // function body to be executed
- int df_instr_count;
+ int df_instr_count; // size of "df_instr"
+ isn_T *df_instr_prof; // like "df_instr" with profiling
+ int df_instr_prof_count; // size of "df_instr_prof"
int df_varcount; // number of local variables
int df_has_closure; // one if a closure was created