From 9c4a807cc1b83a6918c0ccf19cdc3837d746f53b Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 5 Apr 2017 14:11:56 +0200 Subject: erts: Remove hipe_bifs:remove_refs_from/1 which serves no purpose after all the hipe load&purge fixes merged at 32729cab75325de58bf127e6e8836348071b8682 --- erts/emulator/hipe/hipe_bif0.c | 40 --------------------------------------- erts/emulator/hipe/hipe_bif0.tab | 1 - erts/preloaded/ebin/init.beam | Bin 50096 -> 49240 bytes erts/preloaded/src/init.erl | 8 -------- 4 files changed, 49 deletions(-) (limited to 'erts') diff --git a/erts/emulator/hipe/hipe_bif0.c b/erts/emulator/hipe/hipe_bif0.c index e51e9f2733..9076c65c2a 100644 --- a/erts/emulator/hipe/hipe_bif0.c +++ b/erts/emulator/hipe/hipe_bif0.c @@ -1616,46 +1616,6 @@ static void purge_mfa(struct hipe_mfa_info* p) erts_free(ERTS_ALC_T_HIPE_LL, p); } -/* Called by init:restart after unloading all hipe compiled modules - * to work around old bug that caused execution of deallocated beam code. - * Can be removed now when delete/purge of native modules works better. - * Test: Do init:restart in debug compiled vm with hipe compiled kernel. - */ -static void hipe_purge_all_refs(void) -{ - struct hipe_mfa_info **bucket; - unsigned int i, nrbuckets; - - hipe_mfa_info_table_rwlock(); - - ASSERT(hipe_mfa_info_table.used == 0); - bucket = hipe_mfa_info_table.bucket; - nrbuckets = 1 << hipe_mfa_info_table.log2size; - for (i = 0; i < nrbuckets; ++i) { - ASSERT(bucket[i] == NULL); - while (bucket[i] != NULL) { - struct hipe_mfa_info* mfa = bucket[i]; - bucket[i] = mfa->bucket.next; - - hash_erase(&mod2mfa_tab, mfa); - erts_free(ERTS_ALC_T_HIPE_LL, mfa); - } - } - hipe_mfa_info_table.used = 0; - hipe_mfa_info_table_rwunlock(); -} - -BIF_RETTYPE hipe_bifs_remove_refs_from_1(BIF_ALIST_1) -{ - if (BIF_ARG_1 == am_all) { - hipe_purge_all_refs(); - BIF_RET(am_ok); - } - - ASSERT(!"hipe_bifs_remove_refs_from_1() called"); - BIF_ERROR(BIF_P, BADARG); -} - int hipe_purge_need_blocking(Module* modp) { /* SVERK: Verify if this is really necessary */ diff --git a/erts/emulator/hipe/hipe_bif0.tab b/erts/emulator/hipe/hipe_bif0.tab index 264ea2c34a..078ebc40b7 100644 --- a/erts/emulator/hipe/hipe_bif0.tab +++ b/erts/emulator/hipe/hipe_bif0.tab @@ -82,7 +82,6 @@ bif hipe_bifs:patch_insn/3 bif hipe_bifs:patch_call/3 bif hipe_bifs:add_ref/2 -bif hipe_bifs:remove_refs_from/1 bif hipe_bifs:alloc_loader_state/1 diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam index 92eedd73d8..29442b493f 100644 Binary files a/erts/preloaded/ebin/init.beam and b/erts/preloaded/ebin/init.beam differ diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl index 3dc6953b4c..14e3bf0c61 100644 --- a/erts/preloaded/src/init.erl +++ b/erts/preloaded/src/init.erl @@ -674,16 +674,8 @@ do_unload([M|Mods]) -> catch erlang:purge_module(M), do_unload(Mods); do_unload([]) -> - purge_all_hipe_refs(), ok. -purge_all_hipe_refs() -> - case erlang:system_info(hipe_architecture) of - undefined -> ok; - _ -> hipe_bifs:remove_refs_from(all) - end. - - sub([H|T],L) -> sub(T,del(H,L)); sub([],L) -> L. -- cgit v1.2.3