comparison src/vim9compile.c @ 28101:3bc0a639dfb0 v8.2.4575

patch 8.2.4575: Vim9: test for profiling still fails Commit: https://github.com/vim/vim/commit/139575de6653e7fd5807cb036dfb3684b815c519 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 15 19:29:30 2022 +0000 patch 8.2.4575: Vim9: test for profiling still fails Problem: Vim9: test for profiling still fails. Solution: Update flags for profiling and breakpoints when obtaining the compile type. Do not set the FC_CLOSURE flag for a toplevel function.
author Bram Moolenaar <Bram@vim.org>
date Tue, 15 Mar 2022 20:30:03 +0100
parents 632a84e2ce92
children dd2ed5345f20
comparison
equal deleted inserted replaced
28100:0b5711bd05a9 28101:3bc0a639dfb0
911 sizeof(int) * block_depth); 911 sizeof(int) * block_depth);
912 ufunc->uf_block_depth = block_depth; 912 ufunc->uf_block_depth = block_depth;
913 } 913 }
914 } 914 }
915 915
916 update_has_breakpoint(ufunc); 916 compile_type = get_compile_type(ufunc);
917 compile_type = COMPILE_TYPE(ufunc);
918 #ifdef FEAT_PROFILE 917 #ifdef FEAT_PROFILE
919 // If the outer function is profiled, also compile the nested function for 918 // If the outer function is profiled, also compile the nested function for
920 // profiling. 919 // profiling.
921 if (cctx->ctx_compile_type == CT_PROFILE) 920 if (cctx->ctx_compile_type == CT_PROFILE)
922 compile_type = CT_PROFILE; 921 compile_type = CT_PROFILE;
2473 } 2472 }
2474 ufunc->uf_args_visible = ufunc->uf_args.ga_len; 2473 ufunc->uf_args_visible = ufunc->uf_args.ga_len;
2475 return r; 2474 return r;
2476 } 2475 }
2477 2476
2477 /*
2478 * Get the compilation type that should be used for "ufunc".
2479 * Keep in sync with INSTRUCTIONS().
2480 */
2481 compiletype_T
2482 get_compile_type(ufunc_T *ufunc)
2483 {
2484 // Update uf_has_breakpoint if needed.
2485 update_has_breakpoint(ufunc);
2486
2487 if (debug_break_level > 0 || may_break_in_function(ufunc))
2488 return CT_DEBUG;
2489 #ifdef FEAT_PROFILE
2490 if (do_profiling == PROF_YES)
2491 {
2492 if (!ufunc->uf_profiling && has_profiling(FALSE, ufunc->uf_name, NULL))
2493 func_do_profile(ufunc);
2494 if (ufunc->uf_profiling)
2495 return CT_PROFILE;
2496 }
2497 #endif
2498 return CT_NONE;
2499 }
2500
2478 2501
2479 /* 2502 /*
2480 * Add a function to the list of :def functions. 2503 * Add a function to the list of :def functions.
2481 * This sets "ufunc->uf_dfunc_idx" but the function isn't compiled yet. 2504 * This sets "ufunc->uf_dfunc_idx" but the function isn't compiled yet.
2482 */ 2505 */