From 33699c86256c95dba5d0ff94f79c62a417ce8fd9 Mon Sep 17 00:00:00 2001 From: Stephen Dolan Date: Fri, 27 Jan 2023 21:04:52 +0000 Subject: Load frametables of dynlink'd modules in batch (#11935) --- asmcomp/asmlink.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'asmcomp') diff --git a/asmcomp/asmlink.ml b/asmcomp/asmlink.ml index dd5c069558..7021f8c3d1 100644 --- a/asmcomp/asmlink.ml +++ b/asmcomp/asmlink.ml @@ -235,7 +235,9 @@ let make_startup_file ~ppf_dump units_list ~crc_interfaces = List.flatten (List.map (fun (info,_,_) -> info.ui_defines) units_list) in compile_phrase (Cmm_helpers.entry_point name_list); let units = List.map (fun (info,_,_) -> info) units_list in - List.iter compile_phrase (Cmm_helpers.generic_functions false units); + List.iter compile_phrase + (Cmm_helpers.emit_preallocated_blocks [] (* add gc_roots (for dynlink) *) + (Cmm_helpers.generic_functions false units)); Array.iteri (fun i name -> compile_phrase (Cmm_helpers.predef_exception i name)) Runtimedef.builtin_exceptions; @@ -260,7 +262,8 @@ let make_shared_startup_file ~ppf_dump units = Compilenv.reset "_shared_startup"; Emit.begin_assembly (); List.iter compile_phrase - (Cmm_helpers.generic_functions true (List.map fst units)); + (Cmm_helpers.emit_preallocated_blocks [] (* add gc_roots (for dynlink) *) + (Cmm_helpers.generic_functions true (List.map fst units))); compile_phrase (Cmm_helpers.plugin_header units); compile_phrase (Cmm_helpers.global_table -- cgit v1.2.1