From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.devel Subject: Re: Using __builtin_expect (likely/unlikely macros) Date: Tue, 16 Apr 2019 14:50:40 -0600 Message-ID: <87sguhbrof.fsf@gmail.com> References: <87a7gst973.fsf@gmail.com> <875zrgt12q.fsf@gmail.com> <6919a4c8-df76-ea1e-34db-1fa62a360e5a@cs.ucla.edu> <87h8aykdod.fsf@gmail.com> <4fa7885e-8c66-c7c4-ff71-a013505863af@cs.ucla.edu> <2dfb837d-989d-c736-b6e6-b20c0e940596@cs.ucla.edu> <87o956c4n4.fsf@gmail.com> <1fbd2fca-18f0-0a90-7a45-58419a9e11ee@cs.ucla.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="110618"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 16 22:51:41 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGV3M-000SX9-5c for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2019 22:51:40 +0200 Original-Received: from localhost ([127.0.0.1]:42669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGV3K-0003Ye-Vr for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2019 16:51:39 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGV2a-0003YS-St for emacs-devel@gnu.org; Tue, 16 Apr 2019 16:50:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGV2X-0004lq-TW for emacs-devel@gnu.org; Tue, 16 Apr 2019 16:50:52 -0400 Original-Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:37535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hGV2V-0004j1-Jf for emacs-devel@gnu.org; Tue, 16 Apr 2019 16:50:48 -0400 Original-Received: by mail-pf1-x42b.google.com with SMTP id 8so10991533pfr.4 for ; Tue, 16 Apr 2019 13:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zkyptKBZZsM7s1CtRti8ISHhWBKLqIKg96VRCp05qYw=; b=U15GlCv+YqwDcS6bWR9498+gSd5KoCiaBJw0DOePl3zQNTBMPjOjU1TFMEGmjFbdTk clE+PGUh9KSFMjEzhNYcbYtkF8uv9N+//Aj5v7C1FaAOr4Wsv6dpgb6krlvhOuSZQ+Eo pAPG0+fs4GaNVJSY9SkfSddQ1FeOnt4WJPTuesY6aGnec1+EBpNpVLb4zVAiFh26QJTX 7QxdzWIF2hxX43owg7b+N0L+kJO8OAoBqonAeg/oaJD54/5r3/8Yp6dh7eUit1G2nNkk hNWmRkv97QIdechuGFGFRE4FJr1Xo1RzWsnieQSFzP/S0ElgyZBgCmn5juUpaoe5rCRq oUTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zkyptKBZZsM7s1CtRti8ISHhWBKLqIKg96VRCp05qYw=; b=D9uxltFDILF+8ys2tztiTSy3wm9wH3AOZxsxSyjY5d8h/2Im911XMXN9DfDHoO7BTr Btrh16yOIsNYhc32HaCgX5qEJpCNXOGYtrEJTdGxcV2NdKHJ58EljheheYf9hQ6uWuea 9lSCvHAS2WIPM0ruqncREcU1mUC7PXDNebZ2UG/+s3JbWlFKq+TPN0X2B7YsiSsyPjva 2iomh9qyeS9f+sR7TTfjmFFUZVyaUflu4zvhbU07PqEwX5djIR5ObjvygbqZ5/kRjGww qgbLTiLBO4AVuzuFRmkgzcBZM6TEd1+9MRKxo9/2FZlXGWqNCsKZ5wnf+3zvbnjmLMfs tNTQ== X-Gm-Message-State: APjAAAXijJz5NCpPfyKjKlnODtA3EXvrdQ0OaBquifWwYcmxAdzXE+hr /CzHjG4U+odQzc5SnSuuKHkiZhYN X-Google-Smtp-Source: APXvYqz1KexNj9o2jF/yVldky73iedoNkVQqxDkuQSr7hhQQL4GIS1MNQ2bTBobRZucG4wVYyVtAWQ== X-Received: by 2002:a65:62d2:: with SMTP id m18mr79027680pgv.122.1555447843859; Tue, 16 Apr 2019 13:50:43 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id u6sm53440557pfm.10.2019.04.16.13.50.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 13:50:42 -0700 (PDT) In-Reply-To: <1fbd2fca-18f0-0a90-7a45-58419a9e11ee@cs.ucla.edu> (Paul Eggert's message of "Tue, 16 Apr 2019 10:54:56 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235552 Archived-At: --=-=-= Content-Type: text/plain Paul Eggert writes: > That being said, it might make sense for a few obviously-rarely-called > functions like 'emacs-abort' to be marked with __attribute__ ((cold)), > so long as we don't turn this into a mission to mark all cold functions > (which would cost us more than it would benefit). That is what GCC > itself does, with its own functions. However, I'd like to see > performance figures. Could you try it out on the benchmark of 'cd lisp > && time make compile-always'? Right, I agree that if used, they should be used sparingly. I tested three versions a few times each with both 'make' and 'make -j4': a) Regular Emacs master. b) The below diff with only the _Cold attribute c) The below diff with both _Cold and _Hot attributes a) Normal real 4:17.97s user 3:57.18s sys 20.394s real 1:17.67s user 4:23.78s sys 18.888s b) Cold real 4:10.92s user 3:50.34s sys 20.178s real 1:15.77s user 4:16.73s sys 18.943s c) Hot/Cold real 4:11.43s user 3:51.07s sys 19.961s real 1:16.01s user 4:17.63s sys 18.662s So not much of a difference. For some reason the Hot/Cold performed consistently worse than Cold. I also tested startup/shutdown with perf: Performance counter stats for '../emacs-normal -f kill-emacs' (20 runs): 762.17 msec task-clock:u # 0.844 CPUs utilized ( +- 0.23% ) 0 context-switches:u # 0.000 K/sec 0 cpu-migrations:u # 0.000 K/sec 12,941 page-faults:u # 0.017 M/sec ( +- 0.01% ) 2,998,322,125 cycles:u # 3.934 GHz ( +- 0.06% ) 1,392,869,413 stalled-cycles-frontend:u # 46.45% frontend cycles idle ( +- 0.15% ) 982,206,843 stalled-cycles-backend:u # 32.76% backend cycles idle ( +- 0.18% ) 4,874,186,825 instructions:u # 1.63 insn per cycle # 0.29 stalled cycles per insn ( +- 0.01% ) 1,037,929,374 branches:u # 1361.802 M/sec ( +- 0.01% ) 17,930,471 branch-misses:u # 1.73% of all branches ( +- 0.16% ) 1,209,539,215 L1-dcache-loads:u # 1586.960 M/sec ( +- 0.01% ) 42,346,229 L1-dcache-load-misses:u # 3.50% of all L1-dcache hits ( +- 0.05% ) 9,088,647 LLC-loads:u # 11.925 M/sec ( +- 0.29% ) LLC-load-misses:u 0.90325 +- 0.00441 seconds time elapsed ( +- 0.49% ) Performance counter stats for '../emacs.cold -f kill-emacs' (20 runs): 755.94 msec task-clock:u # 0.845 CPUs utilized ( +- 0.24% ) 0 context-switches:u # 0.000 K/sec 0 cpu-migrations:u # 0.000 K/sec 12,941 page-faults:u # 0.017 M/sec ( +- 0.01% ) 2,976,036,365 cycles:u # 3.937 GHz ( +- 0.06% ) 1,374,451,779 stalled-cycles-frontend:u # 46.18% frontend cycles idle ( +- 0.14% ) 990,227,732 stalled-cycles-backend:u # 33.27% backend cycles idle ( +- 0.18% ) 4,878,661,927 instructions:u # 1.64 insn per cycle # 0.28 stalled cycles per insn ( +- 0.00% ) 1,038,495,525 branches:u # 1373.782 M/sec ( +- 0.00% ) 17,859,906 branch-misses:u # 1.72% of all branches ( +- 0.16% ) 1,209,345,531 L1-dcache-loads:u # 1599.792 M/sec ( +- 0.00% ) 42,444,358 L1-dcache-load-misses:u # 3.51% of all L1-dcache hits ( +- 0.06% ) 9,204,368 LLC-loads:u # 12.176 M/sec ( +- 0.41% ) LLC-load-misses:u 0.89430 +- 0.00217 seconds time elapsed ( +- 0.24% ) Performance counter stats for '../emacs.hot-cold -f kill-emacs' (20 runs): 761.97 msec task-clock:u # 0.845 CPUs utilized ( +- 0.20% ) 0 context-switches:u # 0.000 K/sec 0 cpu-migrations:u # 0.000 K/sec 12,947 page-faults:u # 0.017 M/sec ( +- 0.01% ) 2,989,750,359 cycles:u # 3.924 GHz ( +- 0.04% ) 1,383,312,275 stalled-cycles-frontend:u # 46.27% frontend cycles idle ( +- 0.12% ) 994,643,853 stalled-cycles-backend:u # 33.27% backend cycles idle ( +- 0.13% ) 4,879,318,990 instructions:u # 1.63 insn per cycle # 0.28 stalled cycles per insn ( +- 0.00% ) 1,038,584,045 branches:u # 1363.022 M/sec ( +- 0.00% ) 17,863,736 branch-misses:u # 1.72% of all branches ( +- 0.13% ) 1,209,327,347 L1-dcache-loads:u # 1587.103 M/sec ( +- 0.00% ) 42,501,374 L1-dcache-load-misses:u # 3.51% of all L1-dcache hits ( +- 0.05% ) 9,201,311 LLC-loads:u # 12.076 M/sec ( +- 0.28% ) LLC-load-misses:u 0.90132 +- 0.00201 seconds time elapsed ( +- 0.22% ) Which again shows a slight improvement with the Cold attributes, and still shows the hot attributes degrading performance. Perhaps I was too overzealous with the hot tagging? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=hot-cold.diff Content-Description: hot/cold diff --git a/src/alloc.c b/src/alloc.c index fe2cdb8788..dd783863be 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -633,7 +633,7 @@ display_malloc_warning (void) /* Called if we can't allocate relocatable space for a buffer. */ -_Cold void +void buffer_memory_full (ptrdiff_t nbytes) { /* If buffers use the relocating allocator, no need to free @@ -886,7 +886,7 @@ static void *lrealloc (void *, size_t); /* Like malloc but check for no memory and block interrupt input. */ -_Hot void * +void * xmalloc (size_t size) { void *val; @@ -903,7 +903,7 @@ xmalloc (size_t size) /* Like the above, but zeroes out the memory just allocated. */ -_Hot void * +void * xzalloc (size_t size) { void *val; @@ -921,7 +921,7 @@ xzalloc (size_t size) /* Like realloc but check for no memory and block interrupt input.. */ -_Hot void * +void * xrealloc (void *block, size_t size) { void *val; @@ -944,7 +944,7 @@ xrealloc (void *block, size_t size) /* Like free but block interrupt input. */ -_Hot void +void xfree (void *block) { if (!block) @@ -1125,7 +1125,7 @@ record_xmalloc (size_t size) void *lisp_malloc_loser EXTERNALLY_VISIBLE; #endif -static _Hot void * +static void * lisp_malloc (size_t nbytes, enum mem_type type) { register void *val; @@ -1170,7 +1170,7 @@ lisp_malloc (size_t nbytes, enum mem_type type) /* Free BLOCK. This must be called to free memory allocated with a call to lisp_malloc. */ -static _Hot void +static void lisp_free (void *block) { if (pdumper_object_p (block)) @@ -2325,7 +2325,7 @@ compact_small_strings (void) current_sblock = tb; } -_Cold void +void string_overflow (void) { error ("Maximum string size exceeded"); @@ -4085,7 +4085,7 @@ set_interval_marked (INTERVAL i) either case this counts as memory being full even though malloc did not fail. */ -_Cold void +void memory_full (size_t nbytes) { /* Do not go into hysterics merely because a large request failed. */ diff --git a/src/bytecode.c b/src/bytecode.c index e2fe7153b0..40977799bf 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -336,7 +336,7 @@ bcall0 (Lisp_Object f) ARGS are pushed on the stack according to ARGS_TEMPLATE before executing BYTESTR. */ -_Hot Lisp_Object +Lisp_Object exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args) { diff --git a/src/data.c b/src/data.c index 1291a92955..11cd598ed8 100644 --- a/src/data.c +++ b/src/data.c @@ -130,7 +130,7 @@ set_blv_valcell (struct Lisp_Buffer_Local_Value *blv, Lisp_Object val) blv->valcell = val; } -static _Cold _Noreturn void +static _Noreturn void wrong_length_argument (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) { Lisp_Object size1 = make_fixnum (bool_vector_size (a1)); @@ -142,7 +142,7 @@ wrong_length_argument (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) make_fixnum (bool_vector_size (a3))); } -_Cold _Noreturn void +_Noreturn void wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value) { /* If VALUE is not even a valid Lisp object, we'd want to abort here @@ -155,25 +155,25 @@ wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value) xsignal2 (Qwrong_type_argument, predicate, value); } -_Cold void +void pure_write_error (Lisp_Object obj) { xsignal2 (Qerror, build_string ("Attempt to modify read-only object"), obj); } -_Cold void +void args_out_of_range (Lisp_Object a1, Lisp_Object a2) { xsignal2 (Qargs_out_of_range, a1, a2); } -_Cold void +void args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) { xsignal3 (Qargs_out_of_range, a1, a2, a3); } -_Cold void +void circular_list (Lisp_Object list) { xsignal1 (Qcircular_list, list); @@ -1018,7 +1018,7 @@ do_symval_forwarding (lispfwd valcontents) /* Used to signal a user-friendly error when symbol WRONG is not a member of CHOICE, which should be a list of symbols. */ -_Cold void +void wrong_choice (Lisp_Object choice, Lisp_Object wrong) { ptrdiff_t i = 0, len = list_length (choice); @@ -1051,7 +1051,7 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong) /* Used to signal a user-friendly error if WRONG is not a number or integer/floating-point number outsize of inclusive MIN..MAX range. */ -static _Cold void +static void wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) { AUTO_STRING (value_should_be_from, "Value should be from "); diff --git a/src/dispnew.c b/src/dispnew.c index db9166cbe6..ccb08ec1b9 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -360,7 +360,7 @@ verify_row_hash (struct glyph_row *row) what is displayed on the screen. While this is usually fast, it leads to screen flickering. */ -static _Hot void +static void adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y, struct dim dim) { int i; @@ -2994,7 +2994,7 @@ window_to_frame_hpos (struct window *w, int hpos) /* Redraw frame F. */ -_Hot void +void redraw_frame (struct frame *f) { /* Error if F has no glyphs. */ @@ -3048,7 +3048,7 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", Value is true if redisplay was stopped due to pending input. */ -_Hot bool +bool update_frame (struct frame *f, bool force_p, bool inhibit_hairy_id_p) { /* True means display has been paused because of pending input. */ @@ -3384,7 +3384,7 @@ check_current_matrix_flags (struct window *w) /* Update display of window W. If FORCE_P, don't stop updating when input is pending. */ -static _Hot bool +static bool update_window (struct window *w, bool force_p) { struct glyph_matrix *desired_matrix = w->desired_matrix; @@ -3580,7 +3580,7 @@ update_marginal_area (struct window *w, struct glyph_row *updated_row, /* Update the display of the text area of row VPOS in window W. Value is true if display has changed. */ -static _Hot bool +static bool update_text_area (struct window *w, struct glyph_row *updated_row, int vpos) { struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); @@ -4476,7 +4476,7 @@ scrolling_window (struct window *w, bool header_line_p) Value is true if update was stopped due to pending input. */ -static _Hot bool +static bool update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p, bool set_cursor_p, bool updating_menu_p) { @@ -4779,7 +4779,7 @@ count_match (struct glyph *str1, struct glyph *end1, struct glyph *str2, struct /* Perform a frame-based update on line VPOS in frame FRAME. */ -static _Hot void +static void update_frame_line (struct frame *f, int vpos, bool updating_menu_p) { struct glyph *obody, *nbody, *op1, *op2, *np1, *nend; diff --git a/src/eval.c b/src/eval.c index eb3d856a8f..e9f118c5cb 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1707,25 +1707,25 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool keyboard_quit) /* Like xsignal, but takes 0, 1, 2, or 3 args instead of a list. */ -_Cold void +void xsignal0 (Lisp_Object error_symbol) { xsignal (error_symbol, Qnil); } -_Cold void +void xsignal1 (Lisp_Object error_symbol, Lisp_Object arg) { xsignal (error_symbol, list1 (arg)); } -_Cold void +void xsignal2 (Lisp_Object error_symbol, Lisp_Object arg1, Lisp_Object arg2) { xsignal (error_symbol, list2 (arg1, arg2)); } -_Cold void +void xsignal3 (Lisp_Object error_symbol, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { xsignal (error_symbol, list3 (arg1, arg2, arg3)); @@ -1734,7 +1734,7 @@ xsignal3 (Lisp_Object error_symbol, Lisp_Object arg1, Lisp_Object arg2, Lisp_Obj /* Signal `error' with message S, and additional arg ARG. If ARG is not a proper list, make it a one-element list. */ -_Cold void +void signal_error (const char *s, Lisp_Object arg) { if (NILP (Fproper_list_p (arg))) @@ -1745,7 +1745,7 @@ signal_error (const char *s, Lisp_Object arg) /* Use this for arithmetic overflow, e.g., when an integer result is too large even for a bignum. */ -_Cold void +void overflow_error (void) { xsignal0 (Qoverflow_error); @@ -1892,7 +1892,7 @@ vformat_string (const char *m, va_list ap) } /* Dump an error message; called like vprintf. */ -_Cold void +void verror (const char *m, va_list ap) { xsignal1 (Qerror, vformat_string (m, ap)); @@ -1902,7 +1902,7 @@ verror (const char *m, va_list ap) /* Dump an error message; called like printf. */ /* VARARGS 1 */ -_Cold void +void error (const char *m, ...) { va_list ap; @@ -2171,7 +2171,7 @@ record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs) /* Eval a sub-expression of the current expression (i.e. in the same lexical scope). */ -_Hot Lisp_Object +Lisp_Object eval_sub (Lisp_Object form) { Lisp_Object fun, val, original_fun, original_args; @@ -2863,7 +2863,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) /* Apply a C subroutine SUBR to the NUMARGS evaluated arguments in ARG_VECTOR and return the result of evaluation. */ -_Hot Lisp_Object +Lisp_Object funcall_subr (struct Lisp_Subr *subr, ptrdiff_t numargs, Lisp_Object *args) { if (numargs < subr->min_args @@ -2942,7 +2942,7 @@ funcall_subr (struct Lisp_Subr *subr, ptrdiff_t numargs, Lisp_Object *args) } } -static _Hot Lisp_Object +static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args, ptrdiff_t count) { Lisp_Object *arg_vector; @@ -2978,7 +2978,7 @@ apply_lambda (Lisp_Object fun, Lisp_Object args, ptrdiff_t count) FUN must be either a lambda-expression, a compiled-code object, or a module function. */ -static _Hot Lisp_Object +static Lisp_Object funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, register Lisp_Object *arg_vector) { @@ -3322,7 +3322,7 @@ do_specbind (struct Lisp_Symbol *sym, union specbinding *bind, i.e. bindings to the default value of a variable which can be buffer-local. */ -_Hot void +void specbind (Lisp_Object symbol, Lisp_Object value) { struct Lisp_Symbol *sym; @@ -3580,7 +3580,7 @@ set_unwind_protect_ptr (ptrdiff_t count, void (*func) (void *), void *arg) /* Pop and execute entries from the unwind-protect stack until the depth COUNT is reached. Return VALUE. */ -_Hot Lisp_Object +Lisp_Object unbind_to (ptrdiff_t count, Lisp_Object value) { Lisp_Object quitf = Vquit_flag; diff --git a/src/keyboard.c b/src/keyboard.c index 5569d0db2c..8fb6db987b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1038,7 +1038,7 @@ static Lisp_Object top_level_1 (Lisp_Object); This level has the catches for exiting/returning to editor command loop. It returns nil to exit recursive edit, t to abort it. */ -_Hot Lisp_Object +Lisp_Object command_loop (void) { #ifdef HAVE_STACK_OVERFLOW_HANDLING @@ -8856,7 +8856,7 @@ void init_raw_keybuf_count (void) If FIX_CURRENT_BUFFER, we restore current_buffer from the selected window's buffer. */ -static _Hot int +static int read_key_sequence (Lisp_Object *keybuf, Lisp_Object prompt, bool dont_downcase_last, bool can_return_switch_frame, bool fix_current_buffer, bool prevent_redisplay) diff --git a/src/lisp.h b/src/lisp.h index b98cad5e8e..681efc3b52 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -34,9 +34,6 @@ along with GNU Emacs. If not, see . */ #include #include -#define _Cold __attribute__((cold)) -#define _Hot __attribute__((hot)) - INLINE_HEADER_BEGIN /* Define a TYPE constant ID as an externally visible name. Use like this: @@ -624,7 +621,7 @@ extern Lisp_Object char_table_ref (Lisp_Object, int); extern void char_table_set (Lisp_Object, int, Lisp_Object); /* Defined in data.c. */ -extern _Cold _Noreturn void wrong_type_argument (Lisp_Object, Lisp_Object); +extern _Noreturn void wrong_type_argument (Lisp_Object, Lisp_Object); /* Defined in emacs.c. */ @@ -4098,18 +4095,18 @@ extern Lisp_Object run_hook_with_args (ptrdiff_t nargs, Lisp_Object *args, Lisp_Object (*funcall) (ptrdiff_t nargs, Lisp_Object *args)); extern Lisp_Object quit (void); -INLINE _Cold _Noreturn void +INLINE _Noreturn void xsignal (Lisp_Object error_symbol, Lisp_Object data) { Fsignal (error_symbol, data); } -extern _Cold _Noreturn void xsignal0 (Lisp_Object); -extern _Cold _Noreturn void xsignal1 (Lisp_Object, Lisp_Object); -extern _Cold _Noreturn void xsignal2 (Lisp_Object, Lisp_Object, Lisp_Object); -extern _Cold _Noreturn void xsignal3 (Lisp_Object, Lisp_Object, Lisp_Object, +extern _Noreturn void xsignal0 (Lisp_Object); +extern _Noreturn void xsignal1 (Lisp_Object, Lisp_Object); +extern _Noreturn void xsignal2 (Lisp_Object, Lisp_Object, Lisp_Object); +extern _Noreturn void xsignal3 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -extern _Cold _Noreturn void signal_error (const char *, Lisp_Object); -extern _Cold _Noreturn void overflow_error (void); +extern _Noreturn void signal_error (const char *, Lisp_Object); +extern _Noreturn void overflow_error (void); extern bool FUNCTIONP (Lisp_Object); extern Lisp_Object funcall_subr (struct Lisp_Subr *subr, ptrdiff_t numargs, Lisp_Object *arg_vector); extern Lisp_Object eval_sub (Lisp_Object form); @@ -4148,8 +4145,8 @@ extern void set_unwind_protect_ptr (ptrdiff_t, void (*) (void *), void *); extern Lisp_Object unbind_to (ptrdiff_t, Lisp_Object); extern void rebind_for_thread_switch (void); extern void unbind_for_thread_switch (struct thread_state *); -extern _Cold _Noreturn void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); -extern _Cold _Noreturn void verror (const char *, va_list) +extern _Noreturn void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); +extern _Noreturn void verror (const char *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0); extern Lisp_Object vformat_string (const char *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0); diff --git a/src/lread.c b/src/lread.c index 16ce4afd21..5f33fcd695 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1912,7 +1912,7 @@ readevalloop_eager_expand_eval (Lisp_Object val, Lisp_Object macroexpand) START, END specify region to read in current buffer (from eval-region). If the input is not from a buffer, they must be nil. */ -static _Hot void +static void readevalloop (Lisp_Object readcharfun, struct infile *infile0, Lisp_Object sourcename, @@ -2736,7 +2736,7 @@ read_integer (Lisp_Object readcharfun, EMACS_INT radix) FIRST_IN_LIST is true if this is the first element of a list. */ -static _Hot Lisp_Object +static Lisp_Object read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) { int c; @@ -4092,7 +4092,7 @@ check_obarray (Lisp_Object obarray) /* Intern symbol SYM in OBARRAY using bucket INDEX. */ -static _Hot Lisp_Object +static Lisp_Object intern_sym (Lisp_Object sym, Lisp_Object obarray, Lisp_Object index) { Lisp_Object *ptr; @@ -4116,7 +4116,7 @@ intern_sym (Lisp_Object sym, Lisp_Object obarray, Lisp_Object index) /* Intern a symbol with name STRING in OBARRAY using bucket INDEX. */ -_Hot Lisp_Object +Lisp_Object intern_driver (Lisp_Object string, Lisp_Object obarray, Lisp_Object index) { return intern_sym (Fmake_symbol (string), obarray, index); @@ -4125,7 +4125,7 @@ intern_driver (Lisp_Object string, Lisp_Object obarray, Lisp_Object index) /* Intern the C string STR: return a symbol with that name, interned in the current obarray. */ -_Hot Lisp_Object +Lisp_Object intern_1 (const char *str, ptrdiff_t len) { Lisp_Object obarray = check_obarray (Vobarray); diff --git a/src/term.c b/src/term.c index 472d8d19e5..a492276c88 100644 --- a/src/term.c +++ b/src/term.c @@ -4393,7 +4393,8 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\ return terminal; } -static _Cold void + +static void vfatal (const char *str, va_list ap) { fprintf (stderr, "emacs: "); @@ -4409,7 +4410,7 @@ vfatal (const char *str, va_list ap) Delete TERMINAL, then call error or fatal with str1 or str2, respectively, according to whether MUST_SUCCEED is true. */ -static _Cold void +static void maybe_fatal (bool must_succeed, struct terminal *terminal, const char *str1, const char *str2, ...) { @@ -4424,7 +4425,7 @@ maybe_fatal (bool must_succeed, struct terminal *terminal, verror (str1, ap); } -_Cold void +void fatal (const char *str, ...) { va_list ap; diff --git a/src/xdisp.c b/src/xdisp.c index aca6f09b05..a88fc698b8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13906,7 +13906,7 @@ do { if (polling_stopped_here) start_polling (); \ /* Perhaps in the future avoid recentering windows if it is not necessary; currently that causes some problems. */ -static _Hot void +static void redisplay_internal (void) { struct window *w = XWINDOW (selected_window); @@ -14925,7 +14925,7 @@ buffer_flipping_blocked_p (void) /* Redisplay all leaf windows in the window tree rooted at WINDOW. */ -static _Hot void +static void redisplay_windows (Lisp_Object window) { while (!NILP (window)) @@ -16684,7 +16684,7 @@ set_horizontal_scroll_bar (struct window *w) showing point will be fully (as opposed to partially) visible on display. */ -static _Hot void +static void redisplay_window (Lisp_Object window, bool just_this_one_p) { struct window *w = XWINDOW (window); --=-=-=--