aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/hipe_unified_loader.erl
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2014-03-21 16:37:11 +0100
committerHenrik Nord <[email protected]>2014-03-21 16:37:26 +0100
commit9d46875b53ffb21bc55aec4a2c76472133ea5d1c (patch)
tree2e0fa6e8829213470acc239b8885c3a79ced63f0 /lib/kernel/src/hipe_unified_loader.erl
parentbbe92ec2c359373205149dabc61ef0d50784760f (diff)
parentb326df0d935d221574abf58d5e2a3efddd020278 (diff)
downloadotp-9d46875b53ffb21bc55aec4a2c76472133ea5d1c.tar.gz
otp-9d46875b53ffb21bc55aec4a2c76472133ea5d1c.tar.bz2
otp-9d46875b53ffb21bc55aec4a2c76472133ea5d1c.zip
Merge branch 'yiannist/hipe-llvm-backend'
* yiannist/hipe-llvm-backend: Support the LLVM backend in HiPE Implement the LLVM backend Extend RTL API to support the LLVM backend Add support for llvm unique symbols in hipe_gensym Add a BIF that only returns the atom ok Move some common code in hipe_pack_constants Add better specs in hipe_pack_constants and cleanup OTP-11801
Diffstat (limited to 'lib/kernel/src/hipe_unified_loader.erl')
-rw-r--r--lib/kernel/src/hipe_unified_loader.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/kernel/src/hipe_unified_loader.erl b/lib/kernel/src/hipe_unified_loader.erl
index 976d5e35cb..e5928c7b63 100644
--- a/lib/kernel/src/hipe_unified_loader.erl
+++ b/lib/kernel/src/hipe_unified_loader.erl
@@ -194,6 +194,13 @@ load_common(Mod, Bin, Beam, OldReferencesToPatch) ->
CodeSize, CodeBinary, Refs,
0,[] % ColdSize, CRrefs
] = binary_to_term(Bin),
+ ?debug_msg("***** ErLLVM *****~nVersion: ~s~nCheckSum: ~w~nConstAlign: ~w~n" ++
+ "ConstSize: ~w~nConstMap: ~w~nLabelMap: ~w~nExportMap ~w~nRefs ~w~n",
+ [Version, CheckSum, ConstAlign, ConstSize, ConstMap, LabelMap, ExportMap,
+ Refs]),
+ %% Write HiPE binary code to a file in the current directory in order to
+ %% debug by disassembling.
+ %% file:write_file("erl.o", CodeBinary, [binary]),
%% Check that we are loading up-to-date code.
version_check(Version, Mod),
case hipe_bifs:check_crc(CheckSum) of
@@ -221,6 +228,7 @@ load_common(Mod, Bin, Beam, OldReferencesToPatch) ->
{MFAs,Addresses} = exports(ExportMap, CodeAddress),
%% Remove references to old versions of the module.
ReferencesToPatch = get_refs_from(MFAs, []),
+ %% io:format("References to patch: ~w~n", [ReferencesToPatch]),
ok = remove_refs_from(MFAs),
%% Patch all dynamic references in the code.
%% Function calls, Atoms, Constants, System calls
@@ -246,8 +254,7 @@ load_common(Mod, Bin, Beam, OldReferencesToPatch) ->
AddressesOfClosuresToPatch =
calculate_addresses(ClosurePatches, CodeAddress, Addresses),
export_funs(Addresses),
- export_funs(Mod, BeamBinary, Addresses, AddressesOfClosuresToPatch),
- ok
+ export_funs(Mod, BeamBinary, Addresses, AddressesOfClosuresToPatch)
end,
%% Redirect references to the old module to the new module's BEAM stub.
patch_to_emu_step2(OldReferencesToPatch),