summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_nfunc_sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam/erl_nfunc_sched.h')
-rw-r--r--erts/emulator/beam/erl_nfunc_sched.h50
1 files changed, 7 insertions, 43 deletions
diff --git a/erts/emulator/beam/erl_nfunc_sched.h b/erts/emulator/beam/erl_nfunc_sched.h
index 54d011695a..033ba58ded 100644
--- a/erts/emulator/beam/erl_nfunc_sched.h
+++ b/erts/emulator/beam/erl_nfunc_sched.h
@@ -25,15 +25,6 @@
#include "bif.h"
#include "error.h"
-typedef struct {
- int applying;
- Export* ep;
- Uint32 flags;
- Uint32 flags_meta;
- BeamInstr* I;
- ErtsTracer meta_tracer;
-} NifExportTrace;
-
/*
* NIF exports need a few more items than the Export struct provides,
* including the erl_module_nif* and a NIF function pointer, so the
@@ -45,11 +36,15 @@ typedef struct {
*/
typedef struct {
- Export exp;
+ struct {
+ ErtsCodeInfo info;
+ BeamInstr call_op; /* call_nif || apply_bif */
+ BeamInstr dfunc;
+ } trampoline;
+
struct erl_module_nif* m; /* NIF module, or NULL if BIF */
void *func; /* Indirect NIF or BIF to execute (may be unused) */
ErtsCodeMFA *current;/* Current as set when originally called */
- NifExportTrace *trace;
/* --- The following is only used on error --- */
BeamInstr *pc; /* Program counter */
ErtsCodeMFA *mfa; /* MFA of original call */
@@ -59,11 +54,6 @@ typedef struct {
} NifExport;
NifExport *erts_new_proc_nif_export(Process *c_p, int argc);
-void erts_nif_export_save_trace(Process *c_p, NifExport *nep, int applying,
- Export* ep, Uint32 flags,
- Uint32 flags_meta, BeamInstr* I,
- ErtsTracer meta_tracer);
-void erts_nif_export_restore_trace(Process *c_p, Eterm result, NifExport *nep);
void erts_destroy_nif_export(Process *p);
NifExport *erts_nif_export_schedule(Process *c_p, Process *dirty_shadow_proc,
ErtsCodeMFA *mfa, BeamInstr *pc,
@@ -81,11 +71,6 @@ ERTS_GLB_INLINE void erts_nif_export_restore(Process *c_p, NifExport *ep,
Eterm result);
ERTS_GLB_INLINE void erts_nif_export_restore_error(Process* c_p, BeamInstr **pc,
Eterm *reg, ErtsCodeMFA **nif_mfa);
-ERTS_GLB_INLINE int erts_nif_export_check_save_trace(Process *c_p, Eterm result,
- int applying, Export* ep,
- Uint32 flags,
- Uint32 flags_meta, BeamInstr* I,
- ErtsTracer meta_tracer);
ERTS_GLB_INLINE Process *erts_proc_shadow2real(Process *c_p);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
@@ -147,8 +132,6 @@ erts_nif_export_restore(Process *c_p, NifExport *ep, Eterm result)
c_p->current = ep->current;
ep->argc = -1; /* Unused nif-export marker... */
- if (ep->trace)
- erts_nif_export_restore_trace(c_p, result, ep);
}
ERTS_GLB_INLINE void
@@ -166,25 +149,6 @@ erts_nif_export_restore_error(Process* c_p, BeamInstr **pc,
erts_nif_export_restore(c_p, nep, THE_NON_VALUE);
}
-ERTS_GLB_INLINE int
-erts_nif_export_check_save_trace(Process *c_p, Eterm result,
- int applying, Export* ep,
- Uint32 flags,
- Uint32 flags_meta, BeamInstr* I,
- ErtsTracer meta_tracer)
-{
- if (is_non_value(result) && c_p->freason == TRAP) {
- NifExport *nep = ERTS_PROC_GET_NIF_TRAP_EXPORT(c_p);
- if (nep && nep->argc >= 0) {
- erts_nif_export_save_trace(c_p, nep, applying, ep,
- flags, flags_meta,
- I, meta_tracer);
- return 1;
- }
- }
- return 0;
-}
-
ERTS_GLB_INLINE Process *
erts_proc_shadow2real(Process *c_p)
{
@@ -208,7 +172,7 @@ erts_proc_shadow2real(Process *c_p)
#define ERTS_I_BEAM_OP_TO_NIF_EXPORT(I) \
(ASSERT(BeamIsOpCode(*(I), op_apply_bif) || \
BeamIsOpCode(*(I), op_call_nif)), \
- ((NifExport *) (((char *) (I)) - offsetof(NifExport, exp.trampoline.raw[0]))))
+ ((NifExport *) (((char *) (I)) - offsetof(NifExport, trampoline.call_op))))
#include "erl_message.h"