Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
1031-erts-Remove-support-for-old-receive-mark-s...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1031-erts-Remove-support-for-old-receive-mark-set-instruc.patch of Package erlang
From 3abd6a1ec33825741f9cc5cceb2efc4b2a1d2fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org> Date: Mon, 22 May 2023 18:32:03 +0200 Subject: [PATCH 1/2] erts: Remove support for old receive mark/set instructions The compiler hasn't generated these instructions since OTP 23, so it's high time we remove this old cruft. --- erts/emulator/beam/beam_common.c | 4 -- erts/emulator/beam/emu/msg_instrs.tab | 52 ------------------------ erts/emulator/beam/emu/ops.tab | 13 ------ erts/emulator/beam/erl_message.h | 3 -- erts/emulator/beam/erl_proc_sig_queue.c | 45 +------------------- erts/emulator/beam/erl_proc_sig_queue.h | 42 ------------------- erts/emulator/beam/jit/arm/instr_msg.cpp | 44 -------------------- erts/emulator/beam/jit/arm/ops.tab | 13 ------ erts/emulator/beam/jit/x86/instr_msg.cpp | 44 -------------------- erts/emulator/beam/jit/x86/ops.tab | 13 ------ erts/emulator/beam/sys.h | 2 - lib/compiler/src/genop.tab | 13 +----- 12 files changed, 3 insertions(+), 285 deletions(-) diff --git a/erts/emulator/beam/beam_common.c b/erts/emulator/beam/beam_common.c index 6eb97fc864..f25ab2e1ee 100644 --- a/erts/emulator/beam/beam_common.c +++ b/erts/emulator/beam/beam_common.c @@ -555,10 +555,6 @@ handle_error(Process* c_p, ErtsCodePtr pc, Eterm* reg, #else /* To avoid keeping stale references. */ c_p->stop[0] = NIL; -#endif -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - /* No longer safe to use this position */ - erts_msgq_recv_marker_clear(c_p, erts_old_recv_marker_id); #endif c_p->ftrace = NIL; return new_pc; diff --git a/erts/emulator/beam/emu/msg_instrs.tab b/erts/emulator/beam/emu/msg_instrs.tab index dce164cb95..ef733ae80a 100644 --- a/erts/emulator/beam/emu/msg_instrs.tab +++ b/erts/emulator/beam/emu/msg_instrs.tab @@ -19,55 +19,6 @@ // %CopyrightEnd% // -// /* -// * Skeleton for receive statement: -// * -// * recv_mark L1 Optional -// * call make_ref/monitor Optional -// * ... -// * recv_set L1 Optional -// * L1: <-------------------+ -// * <-----------+ | -// * | | -// * loop_rec L2 ------+---+ | -// * ... | | | -// * remove_message | | | -// * jump L3 | | | -// * ... | | | -// * loop_rec_end L1 --+ | | -// * L2: <---------------+ | -// * wait L1 -------------------+ or wait_timeout -// * timeout -// * -// * L3: Code after receive... -// * -// */ - -i_recv_mark() { - /* - * OLD INSTRUCTION: This instruction is to be removed - * in OTP 26. - * - * Save the current end of message queue - */ - /* inlined here... */ - erts_msgq_recv_marker_insert_bind(c_p, erts_old_recv_marker_id); -} - -i_recv_set() { - /* - * OLD INSTRUCTION: This instruction is to be removed - * in OTP 26. - * - * If previously saved recv mark, set save pointer to it - */ - /* inlined here... */ - erts_msgq_recv_marker_set_save(c_p, erts_old_recv_marker_id); - SET_I($NEXT_INSTRUCTION); - goto loop_rec_top__; - //| -no_next -} - recv_marker_reserve(Dst) { SWAPOUT; @@ -98,9 +49,6 @@ i_loop_rec(Dest) { ErtsMessage* msgp; - /* Entry point from recv_set */ - loop_rec_top__: - /* * We need to disable GC while matching messages * in the queue. This since messages with data outside diff --git a/erts/emulator/beam/emu/ops.tab b/erts/emulator/beam/emu/ops.tab index 7c4447d145..dc6e2d723b 100644 --- a/erts/emulator/beam/emu/ops.tab +++ b/erts/emulator/beam/emu/ops.tab @@ -1737,19 +1737,6 @@ unsupported_guard_bif A B C | never() => _ # on_load -# -# R14A. -# -# Superseded in OTP 24 by 'recv_marker_reserve' and friends. -# - -recv_mark f => i_recv_mark -i_recv_mark - -recv_set Fail | label Lbl | loop_rec Lf Reg => - i_recv_set | label Lbl | loop_rec Lf Reg -i_recv_set - # # OTP 21. # diff --git a/erts/emulator/beam/erl_message.h b/erts/emulator/beam/erl_message.h index 449aa92768..cb4d4dff98 100644 --- a/erts/emulator/beam/erl_message.h +++ b/erts/emulator/beam/erl_message.h @@ -306,9 +306,6 @@ typedef struct { signed char used_ix; signed char unused; signed char pending_set_save_ix; -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - signed char old_recv_marker_ix; -#endif } ErtsRecvMarkerBlock; /* Size of default message buffer (erl_message.c) */ diff --git a/erts/emulator/beam/erl_proc_sig_queue.c b/erts/emulator/beam/erl_proc_sig_queue.c index ee1d345fb3..65abf7bf4a 100644 --- a/erts/emulator/beam/erl_proc_sig_queue.c +++ b/erts/emulator/beam/erl_proc_sig_queue.c @@ -67,26 +67,12 @@ Process *ERTS_WRITE_UNLIKELY(erts_dirty_process_signal_handler); Process *ERTS_WRITE_UNLIKELY(erts_dirty_process_signal_handler_high); Process *ERTS_WRITE_UNLIKELY(erts_dirty_process_signal_handler_max); -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS -Eterm erts_old_recv_marker_id; -#endif - void erts_proc_sig_queue_init(void) { ERTS_CT_ASSERT(ERTS_SIG_Q_OP_MASK > ERTS_SIG_Q_OP_MAX); ERTS_CT_ASSERT(ERTS_SIG_Q_OP_MSGQ_LEN_OFFS_MARK > ERTS_SIG_Q_OP_MAX); ERTS_CT_ASSERT(ERTS_SIG_Q_TYPE_MASK >= ERTS_SIG_Q_TYPE_MAX); - -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - { - Eterm *hp = erts_alloc(ERTS_ALC_T_LITERAL, - ERTS_REF_THING_SIZE*sizeof(Eterm)); - erts_old_recv_marker_id = erts_make_ref_in_buffer(hp); - erts_set_literal_tag(&erts_old_recv_marker_id, hp, ERTS_REF_THING_SIZE); - } -#endif - } typedef struct { @@ -3417,12 +3403,6 @@ recv_marker_deallocate(Process *c_p, ErtsRecvMarker *markp) ASSERT(blkp->unused > 0); blkp->unused--; } -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - else if (blkp->ref[ix] == erts_old_recv_marker_id) { - ASSERT(blkp->old_recv_marker_ix == ix); - blkp->old_recv_marker_ix = -1; - } -#endif blkp->marker[pix].next_ix = nix; blkp->marker[nix].prev_ix = pix; @@ -3517,13 +3497,6 @@ recv_marker_alloc_block(Process *c_p, ErtsRecvMarkerBlock **blkpp, markp->next_ix = markp->prev_ix = 0; blkp->used_ix = 0; -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - if (*uniqp == erts_old_recv_marker_id) - blkp->old_recv_marker_ix = 0; - else - blkp->old_recv_marker_ix = -1; -#endif - /* Put the rest in a free list in the ref words... */ blkp->free_ix = 1; for (ix = 1; ix < ERTS_RECV_MARKER_BLOCK_SIZE; ix++) { @@ -3687,13 +3660,6 @@ recv_marker_alloc(Process *c_p, ErtsRecvMarkerBlock **blkpp, blkp->ref[ix] = recv_marker_uniq(c_p, uniqp); -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - if (*uniqp == erts_old_recv_marker_id) { - ASSERT(blkp->old_recv_marker_ix == -1); - blkp->old_recv_marker_ix = ix; - } -#endif - ERTS_HDBG_CHK_RECV_MRKS(c_p); return markp; @@ -8301,9 +8267,7 @@ erl_proc_sig_hdbg_chk_recv_marker_block(Process *c_p) { int ix, used, unused, free; ErtsRecvMarkerBlock *blkp = c_p->sig_qs.recv_mrk_blk; -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - int old_recv_marker = 0; -#endif + if (!blkp) return; @@ -8322,13 +8286,6 @@ erl_proc_sig_hdbg_chk_recv_marker_block(Process *c_p) || ref == am_undefined || is_nil(ref)); -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - if (ref == erts_old_recv_marker_id) { - ERTS_ASSERT(blkp->old_recv_marker_ix == ix); - old_recv_marker++; - } -#endif - if (ref == am_undefined) unused++; diff --git a/erts/emulator/beam/erl_proc_sig_queue.h b/erts/emulator/beam/erl_proc_sig_queue.h index 60c7af5e66..f8045a2812 100644 --- a/erts/emulator/beam/erl_proc_sig_queue.h +++ b/erts/emulator/beam/erl_proc_sig_queue.h @@ -200,10 +200,6 @@ typedef struct { #define ERTS_SIG_HANDLE_REDS_MAX_PREFERED (CONTEXT_REDS/40) -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS -extern Eterm erts_old_recv_marker_id; -#endif - #ifdef ERTS_PROC_SIG_HARD_DEBUG # define ERTS_HDBG_CHECK_SIGNAL_IN_QUEUE(P, B) \ ERTS_HDBG_CHECK_SIGNAL_IN_QUEUE__((P), (B), "") @@ -1894,25 +1890,6 @@ erts_proc_notify_new_sig(Process* rp, erts_aint32_t state, } \ } while (0) -#undef ERTS_PROC_SIG_RECV_MARK_CLEAR_OLD_MARK__ -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - -#define ERTS_PROC_SIG_RECV_MARK_CLEAR_OLD_MARK__(BLKP) \ - do { \ - if ((BLKP)->old_recv_marker_ix >= 0) { \ - int ix__ = (BLKP)->old_recv_marker_ix; \ - ASSERT((BLKP)->ref[ix__] == erts_old_recv_marker_id); \ - ASSERT((BLKP)->marker[ix__].in_sigq); \ - ASSERT(!(BLKP)->marker[ix__].set_save); \ - (BLKP)->unused++; \ - (BLKP)->ref[ix__] = am_undefined; \ - (BLKP)->marker[ix__].pass = ERTS_RECV_MARKER_PASS_MAX; \ - (BLKP)->old_recv_marker_ix = -1; \ - } \ - } while (0) - -#endif - ERTS_GLB_INLINE int erts_msgq_eq_recv_mark_id__(Eterm term1, Eterm term2) { @@ -1994,13 +1971,6 @@ erts_msgq_recv_marker_clear(Process *c_p, Eterm id) if (!blkp) return; - -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - if (id == erts_old_recv_marker_id) { - ERTS_PROC_SIG_RECV_MARK_CLEAR_OLD_MARK__(blkp); - return; - } -#endif for (ix = 0; ix < ERTS_RECV_MARKER_BLOCK_SIZE; ix++) { if (erts_msgq_eq_recv_mark_id__(blkp->ref[ix], id)) { @@ -2030,9 +2000,6 @@ ERTS_GLB_INLINE void erts_msgq_recv_marker_bind(Process *c_p, Eterm bind_id) { ASSERT(!(c_p->sig_qs.flags & FS_HANDLING_SIGS)); -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - ASSERT(bind_id != erts_old_recv_marker_id); -#endif if (is_small(insert_id) || is_big(insert_id)) { ErtsRecvMarkerBlock *blkp = c_p->sig_qs.recv_mrk_blk; @@ -2061,12 +2028,6 @@ erts_msgq_recv_marker_insert_bind(Process *c_p, Eterm id) { ASSERT(!(c_p->sig_qs.flags & FS_HANDLING_SIGS)); if (is_internal_ref(id)) { -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - ErtsRecvMarkerBlock *blkp = c_p->sig_qs.recv_mrk_blk; - if (blkp && erts_old_recv_marker_id == id) - ERTS_PROC_SIG_RECV_MARK_CLEAR_OLD_MARK__(blkp); -#endif - erts_proc_sig_queue_lock(c_p); erts_proc_sig_fetch(c_p); erts_proc_unlock(c_p, ERTS_PROC_LOCK_MSGQ); @@ -2131,9 +2092,6 @@ erts_msgq_set_save_first(Process *c_p) ASSERT(!(c_p->sig_qs.flags & FS_HANDLING_SIGS)); if (blkp) { ERTS_PROC_SIG_RECV_MARK_CLEAR_PENDING_SET_SAVE__(blkp); -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - ERTS_PROC_SIG_RECV_MARK_CLEAR_OLD_MARK__(blkp); -#endif } /* diff --git a/erts/emulator/beam/jit/arm/instr_msg.cpp b/erts/emulator/beam/jit/arm/instr_msg.cpp index dd99af59c2..cb82764ff5 100644 --- a/erts/emulator/beam/jit/arm/instr_msg.cpp +++ b/erts/emulator/beam/jit/arm/instr_msg.cpp @@ -30,50 +30,6 @@ extern "C" #endif } -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - -static void recv_mark(Process *p) { - /* inlined here... */ - erts_msgq_recv_marker_insert_bind(p, erts_old_recv_marker_id); -} - -static void recv_mark_set(Process *p) { - /* inlined here... */ - erts_msgq_recv_marker_set_save(p, erts_old_recv_marker_id); -} - -void BeamModuleAssembler::emit_i_recv_mark() { - /* - * OLD INSTRUCTION: This instruction is to be removed - * in OTP 26. - * - * Save the current end of message queue - */ - emit_enter_runtime(); - - a.mov(ARG1, c_p); - runtime_call<1>(recv_mark); - - emit_leave_runtime(); -} - -void BeamModuleAssembler::emit_i_recv_set() { - /* - * OLD INSTRUCTION: This instruction is to be removed - * in OTP 26. - * - * If previously saved recv mark, set save pointer to it - */ - emit_enter_runtime(); - - a.mov(ARG1, c_p); - runtime_call<1>(recv_mark_set); - - emit_leave_runtime(); -} - -#endif /* ERTS_SUPPORT_OLD_RECV_MARK_INSTRS */ - void BeamModuleAssembler::emit_recv_marker_reserve(const ArgRegister &Dst) { emit_enter_runtime<Update::eHeapAlloc>(); diff --git a/erts/emulator/beam/jit/arm/ops.tab b/erts/emulator/beam/jit/arm/ops.tab index 3e1317bb9d..4c2601dc68 100644 --- a/erts/emulator/beam/jit/arm/ops.tab +++ b/erts/emulator/beam/jit/arm/ops.tab @@ -1437,19 +1437,6 @@ unsupported_guard_bif A B C | never() => _ # on_load -# -# R14A. -# -# Superseded in OTP 24 by 'recv_marker_reserve' and friends. -# - -recv_mark f => i_recv_mark -i_recv_mark - -recv_set Fail | label Lbl | loop_rec Lf Reg => - i_recv_set | label Lbl | loop_rec Lf Reg -i_recv_set - # # OTP 21. # diff --git a/erts/emulator/beam/jit/x86/instr_msg.cpp b/erts/emulator/beam/jit/x86/instr_msg.cpp index d015d3b71b..4b730c1891 100644 --- a/erts/emulator/beam/jit/x86/instr_msg.cpp +++ b/erts/emulator/beam/jit/x86/instr_msg.cpp @@ -30,50 +30,6 @@ extern "C" #endif } -#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - -static void recv_mark(Process *p) { - /* inlined here... */ - erts_msgq_recv_marker_insert_bind(p, erts_old_recv_marker_id); -} - -static void recv_mark_set(Process *p) { - /* inlined here... */ - erts_msgq_recv_marker_set_save(p, erts_old_recv_marker_id); -} - -void BeamModuleAssembler::emit_i_recv_mark() { - /* - * OLD INSTRUCTION: This instruction is to be removed - * in OTP 26. - * - * Save the current end of message queue - */ - emit_enter_runtime(); - - a.mov(ARG1, c_p); - runtime_call<1>(recv_mark); - - emit_leave_runtime(); -} - -void BeamModuleAssembler::emit_i_recv_set() { - /* - * OLD INSTRUCTION: This instruction is to be removed - * in OTP 26. - * - * If previously saved recv mark, set save pointer to it - */ - emit_enter_runtime(); - - a.mov(ARG1, c_p); - runtime_call<1>(recv_mark_set); - - emit_leave_runtime(); -} - -#endif /* ERTS_SUPPORT_OLD_RECV_MARK_INSTRS */ - void BeamModuleAssembler::emit_recv_marker_reserve(const ArgRegister &Dst) { emit_enter_runtime<Update::eHeapAlloc>(); diff --git a/erts/emulator/beam/jit/x86/ops.tab b/erts/emulator/beam/jit/x86/ops.tab index 042b66dd53..c5a8f32de7 100644 --- a/erts/emulator/beam/jit/x86/ops.tab +++ b/erts/emulator/beam/jit/x86/ops.tab @@ -1410,19 +1410,6 @@ unsupported_guard_bif A B C | never() => _ # on_load -# -# R14A. -# -# Superseded in OTP 24 by 'recv_marker_reserve' and friends. -# - -recv_mark f => i_recv_mark -i_recv_mark - -recv_set Fail | label Lbl | loop_rec Lf Reg => - i_recv_set | label Lbl | loop_rec Lf Reg -i_recv_set - # # OTP 21. # diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index c96fd618d2..75085ba7e9 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -21,8 +21,6 @@ #ifndef __SYS_H__ #define __SYS_H__ -#define ERTS_SUPPORT_OLD_RECV_MARK_INSTRS - #if !defined(__GNUC__) || defined(__e2k__) # define ERTS_AT_LEAST_GCC_VSN__(MAJ, MIN, PL) 0 #elif !defined(__GNUC_MINOR__) diff --git a/lib/compiler/src/genop.tab b/lib/compiler/src/genop.tab index 3363f5873f..9e57ed4b56 100755 --- a/lib/compiler/src/genop.tab +++ b/lib/compiler/src/genop.tab @@ -516,17 +516,8 @@ BEAM_FORMAT_NUMBER=0 # R14A -## @spec recv_mark Label -## @doc Save the end of the message queue and the address of -## the label Label so that a recv_set instruction can start -## scanning the inbox from this position. -150: recv_mark/1 - -## @spec recv_set Label -## @doc Check that the saved mark points to Label and set the -## save pointer in the message queue to the last position -## of the message queue saved by the recv_mark instruction. -151: recv_set/1 +150: -recv_mark/1 +151: -recv_set/1 ## @spec gc_bif3 Lbl Live Bif Arg1 Arg2 Arg3 Reg ## @doc Call the bif Bif with the arguments Arg1, Arg2 and Arg3, -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor