From 81c7db0e247a6ee1b7a5c2764aa9575d7f6fb88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 28 Feb 2014 06:08:51 +0100 Subject: hipe: Break apart hipe_bif:make_fe/3 into two BIFs This commit is a preparation for eliminating a race condition loading the native code for modules whose BEAM code has already been loaded. Here we introduce two new BIFs so that looking up a fun entry is separate from setting the native address in the fun entry. --- lib/kernel/src/hipe_unified_loader.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/kernel') diff --git a/lib/kernel/src/hipe_unified_loader.erl b/lib/kernel/src/hipe_unified_loader.erl index e111cb800e..fd55b54d1f 100644 --- a/lib/kernel/src/hipe_unified_loader.erl +++ b/lib/kernel/src/hipe_unified_loader.erl @@ -566,8 +566,8 @@ patch_closure(DestMFA, Uniq, Index, Address, Addresses) -> RemoteOrLocal = local, % closure code refs are local DestAddress = get_native_address(DestMFA, Addresses, RemoteOrLocal), BEAMAddress = hipe_bifs:fun_to_address(DestMFA), - FE = hipe_bifs:make_fe(DestAddress, mod(DestMFA), - {Uniq, Index, BEAMAddress}), + FE = hipe_bifs:get_fe(mod(DestMFA), {Uniq, Index, BEAMAddress}), + hipe_bifs:set_native_address_in_fe(FE, DestAddress), ?debug_msg("Patch FE(~w) to 0x~.16b->0x~.16b (emu:0x~.16b)\n", [DestMFA, FE, DestAddress, BEAMAddress]), ?ASSERT(assert_local_patch(Address)), -- cgit v1.2.3