aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-05-08 20:09:12 +0200
committerSverker Eriksson <[email protected]>2017-05-08 20:09:12 +0200
commitc002dc9493a2ae9b01d49e39b9e89ef38b165973 (patch)
tree4f4dd01377c80be8b2af1290ec04fd2a64bd1a7f /erts/emulator/beam/beam_load.c
parent1ca124231e0a2ee0db3cb5ff993d7615e573bdfa (diff)
parentf95094d67e56a51bbdaadaf18625bb01c584bf2d (diff)
downloadotp-c002dc9493a2ae9b01d49e39b9e89ef38b165973.tar.gz
otp-c002dc9493a2ae9b01d49e39b9e89ef38b165973.tar.bz2
otp-c002dc9493a2ae9b01d49e39b9e89ef38b165973.zip
Merge branch 'sverker/is_module_native-trace-bug/OTP-14390'
* sverker/is_module_native-trace-bug/OTP-14390: erts: Fix code:is_module_native for local trace erts: Move and rename erts_is_native_break()
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index a0351746b9..23258dbe9c 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -5685,17 +5685,28 @@ erts_is_module_native(BeamCodeHeader* code_hdr)
if (code_hdr != NULL) {
num_functions = code_hdr->num_functions;
for (i=0; i<num_functions; i++) {
- BeamInstr* func_info = (BeamInstr *) code_hdr->functions[i];
- Eterm name = (Eterm) func_info[3];
- if (is_atom(name)) {
- return func_info[1] != 0;
+ ErtsCodeInfo* ci = code_hdr->functions[i];
+ if (is_atom(ci->mfa.function)) {
+ return erts_is_function_native(ci);
}
- else ASSERT(is_nil(name)); /* ignore BIF stubs */
+ else ASSERT(is_nil(ci->mfa.function)); /* ignore BIF stubs */
}
}
return 0;
}
+int
+erts_is_function_native(ErtsCodeInfo *ci)
+{
+#ifdef HIPE
+ ASSERT(ci->op == (BeamInstr) BeamOp(op_i_func_info_IaaI));
+ return erts_codeinfo_to_code(ci)[0] == (BeamInstr) BeamOp(op_hipe_trap_call)
+ || erts_codeinfo_to_code(ci)[0] == (BeamInstr) BeamOp(op_hipe_trap_call_closure);
+#else
+ return 0;
+#endif
+}
+
/*
* Builds a list of all functions including native addresses.
* [{Name,Arity,NativeAddress},...]