diff options
Diffstat (limited to 'erts/emulator/beam/erl_nfunc_sched.h')
-rw-r--r-- | erts/emulator/beam/erl_nfunc_sched.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/erts/emulator/beam/erl_nfunc_sched.h b/erts/emulator/beam/erl_nfunc_sched.h index c016bc035a..c97525ad78 100644 --- a/erts/emulator/beam/erl_nfunc_sched.h +++ b/erts/emulator/beam/erl_nfunc_sched.h @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2016-2021. All Rights Reserved. + * Copyright Ericsson AB 2016-2023. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ #include "erl_process.h" #include "bif.h" #include "error.h" +#include "jit/beam_asm.h" /* * Native function wrappers are used to schedule native functions on both @@ -40,10 +41,10 @@ typedef struct { struct { ErtsCodeInfo info; #ifdef BEAMASM - // Code used by tracing/nif load - BeamInstr trace[1]; + char call_bif_nif[BEAM_ASM_NFUNC_SIZE]; +#else + BeamInstr call_bif_nif; /* call_bif || call_nif */ #endif - BeamInstr call_op; /* call_bif || call_nif */ BeamInstr dfunc; } trampoline; @@ -176,17 +177,11 @@ erts_proc_shadow2real(Process *c_p) #if defined(ERTS_WANT_NFUNC_SCHED_INTERNALS__) && !defined(ERTS_NFUNC_SCHED_INTERNALS__) #define ERTS_NFUNC_SCHED_INTERNALS__ -#ifdef BEAMASM -#define NFUNC_FIELD__ trampoline.trace -#else -#define NFUNC_FIELD__ trampoline.call_op -#endif - #define ERTS_I_BEAM_OP_TO_NFUNC(I) \ (ASSERT(BeamIsOpCode(*(const BeamInstr*)(I), op_call_bif_W) || \ BeamIsOpCode(*(const BeamInstr*)(I), op_call_nif_WWW)), \ ((ErtsNativeFunc *) (((char *) (I)) - \ - offsetof(ErtsNativeFunc, NFUNC_FIELD__)))) + offsetof(ErtsNativeFunc, trampoline.call_bif_nif)))) #include "erl_message.h" #include <stddef.h> @@ -244,6 +239,8 @@ erts_flush_dirty_shadow_proc(Process *sproc) } c_p->off_heap.overhead += sproc->off_heap.overhead; + + ASSERT(sproc->wrt_bins == NULL); } ERTS_GLB_INLINE void @@ -268,6 +265,7 @@ erts_cache_dirty_shadow_proc(Process *sproc) sproc->mbuf = NULL; sproc->mbuf_sz = 0; ERTS_INIT_OFF_HEAP(&sproc->off_heap); + sproc->wrt_bins = NULL; } ERTS_GLB_INLINE Process * |