diff options
| author | Maxime Dénès | 2015-07-09 21:08:44 +0200 |
|---|---|---|
| committer | Maxime Dénès | 2015-07-10 00:01:22 +0200 |
| commit | c4486dfda07b872d20746778df5c443b052b92b9 (patch) | |
| tree | a1388b2bc366d249e7da63065181b81d12f5283b /library | |
| parent | 2c59d19ad207a6bf193e9f0c9d73258b3133d484 (diff) | |
Native compiler: refactor code handling pre-computed values.
Fixes #4139 (Not_found exception with Require in modules).
Diffstat (limited to 'library')
| -rw-r--r-- | library/declaremods.ml | 10 | ||||
| -rw-r--r-- | library/declaremods.mli | 2 | ||||
| -rw-r--r-- | library/global.mli | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/library/declaremods.ml b/library/declaremods.ml index a82f5260ba..f66656d09a 100644 --- a/library/declaremods.ml +++ b/library/declaremods.ml @@ -845,10 +845,6 @@ type library_objects = Lib.lib_objects * Lib.lib_objects (** For the native compiler, we cache the library values *) -type library_values = Nativecode.symbol array -let library_values = - Summary.ref (Dirmap.empty : library_values Dirmap.t) ~name:"LIBVALUES" - let register_library dir cenv (objs:library_objects) digest univ = let mp = MPfile dir in let () = @@ -857,15 +853,15 @@ let register_library dir cenv (objs:library_objects) digest univ = ignore(Global.lookup_module mp); with Not_found -> (* If not, let's do it now ... *) - let mp', values = Global.import cenv univ digest in + let mp' = Global.import cenv univ digest in if not (ModPath.equal mp mp') then anomaly (Pp.str "Unexpected disk module name"); - library_values := Dirmap.add dir values !library_values in let sobjs,keepobjs = objs in do_module false Lib.load_objects 1 dir mp ([],Objs sobjs) keepobjs -let get_library_symbols_tbl dir = Dirmap.find dir !library_values +let get_library_native_symbols dir = + Safe_typing.get_library_native_symbols (Global.safe_env ()) dir let start_library dir = let mp = Global.start_library dir in diff --git a/library/declaremods.mli b/library/declaremods.mli index c3578ec421..319d168d05 100644 --- a/library/declaremods.mli +++ b/library/declaremods.mli @@ -75,7 +75,7 @@ val register_library : Safe_typing.compiled_library -> library_objects -> Safe_typing.vodigest -> Univ.universe_context_set -> unit -val get_library_symbols_tbl : library_name -> Nativecode.symbol array +val get_library_native_symbols : library_name -> Nativecode.symbols val start_library : library_name -> unit diff --git a/library/global.mli b/library/global.mli index 248e1f86dd..75a1ebee94 100644 --- a/library/global.mli +++ b/library/global.mli @@ -102,7 +102,7 @@ val export : ?except:Future.UUIDSet.t -> DirPath.t -> module_path * Safe_typing.compiled_library * Safe_typing.native_library val import : Safe_typing.compiled_library -> Univ.universe_context_set -> Safe_typing.vodigest -> - module_path * Nativecode.symbol array + module_path (** {6 Misc } *) |
