diff options
Diffstat (limited to 'lib/kernel/src/code.erl')
-rw-r--r-- | lib/kernel/src/code.erl | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl index d73d1ff281..580c070389 100644 --- a/lib/kernel/src/code.erl +++ b/lib/kernel/src/code.erl @@ -107,7 +107,7 @@ is_module_native(_) -> -spec make_stub_module(Module, Beam, Info) -> Module when Module :: module(), Beam :: binary(), - Info :: {list(), list()}. + Info :: {list(), list(), binary()}. make_stub_module(_, _, _) -> erlang:nif_error(undef). @@ -339,7 +339,8 @@ do_start(Flags) -> ok end, %% Quietly load native code for all modules loaded so far - load_native_code_for_all_loaded(), + Architecture = erlang:system_info(hipe_architecture), + load_native_code_for_all_loaded(Architecture), Ok2; Other -> Other @@ -554,18 +555,18 @@ has_ext(Ext, Extlen, File) -> %%% Silently load native code for all modules loaded so far. %%% --spec load_native_code_for_all_loaded() -> ok. -load_native_code_for_all_loaded() -> - Architecture = erlang:system_info(hipe_architecture), +load_native_code_for_all_loaded(undefined) -> + ok; +load_native_code_for_all_loaded(Architecture) -> try hipe_unified_loader:chunk_name(Architecture) of ChunkTag -> Loaded = all_loaded(), - spawn(fun() -> load_all_native(Loaded, ChunkTag) end) + _ = spawn(fun() -> load_all_native(Loaded, ChunkTag) end), + ok catch _:_ -> ok - end, - ok. + end. load_all_native(Loaded, ChunkTag) -> catch load_all_native_1(Loaded, ChunkTag). @@ -582,7 +583,8 @@ load_all_native_1([{Mod,BeamFilename}|T], ChunkTag) -> undefined -> ok; NativeCode when is_binary(NativeCode) -> - load_native_partial(Mod, NativeCode) + _ = load_native_partial(Mod, NativeCode), + ok end; true -> ok end, |