Mercurial > hg > xemacs-beta
changeset 5902:2dc8711af537
Make get_char_table in loop bodies more tolerable without optimization.
2015-05-08 Aidan Kehoe <kehoea@parhasard.net>
* chartab.h (get_char_table):
* chartab.h (get_char_table_mirrors_ok): New.
Provide get_char_table_mirrors_ok, which differs from
get_char_table only if ERROR_CHECK_TYPES is defined.
Implement it, and get_char_table, using a macro wrapper of
get_char_table_1, so that on builds without optimization each
get_char_table no longer requires two C function calls.
* chartab.c (updating_mirror_get_range_char_table):
Use get_char_table_mirrors_ok.
* syntax.h:
Ditto.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Fri, 08 May 2015 12:47:13 +0100 |
parents | a485caa1131d |
children | 5afddd952c46 |
files | src/ChangeLog src/chartab.c src/chartab.h src/syntax.h |
diffstat | 4 files changed, 36 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Tue May 05 13:12:14 2015 +0900 +++ b/src/ChangeLog Fri May 08 12:47:13 2015 +0100 @@ -1,3 +1,17 @@ +2015-05-08 Aidan Kehoe <kehoea@parhasard.net> + + * chartab.h (get_char_table): + * chartab.h (get_char_table_mirrors_ok): New. + Provide get_char_table_mirrors_ok, which differs from + get_char_table only if ERROR_CHECK_TYPES is defined. + Implement it, and get_char_table, using a macro wrapper of + get_char_table_1, so that on builds without optimization each + get_char_table no longer requires two C function calls. + * chartab.c (updating_mirror_get_range_char_table): + Use get_char_table_mirrors_ok. + * syntax.h: + Ditto. + 2015-04-20 Jerry James <james@xemacs.org> * lisp.h (max_align_t): Do not define if C11 or C++11, or a later
--- a/src/chartab.c Tue May 05 13:12:14 2015 +0900 +++ b/src/chartab.c Fri May 08 12:47:13 2015 +0100 @@ -1042,7 +1042,7 @@ Lisp_Object multi) { if (range->type == CHARTAB_RANGE_CHAR) - return get_char_table_1 (range->ch, table); + return get_char_table_mirrors_ok (range->ch, table); else return get_range_char_table_1 (range, table, multi); }
--- a/src/chartab.h Tue May 05 13:12:14 2015 +0900 +++ b/src/chartab.h Fri May 08 12:47:13 2015 +0100 @@ -140,13 +140,28 @@ int leading_byte, Ichar c); +#ifdef ERROR_CHECK_TYPES +DECLARE_INLINE_HEADER ( +Lisp_Object +get_char_table_1 (Ichar ch, Lisp_Object table, Boolint mirrors_allowed) +) +#else DECLARE_INLINE_HEADER ( Lisp_Object get_char_table_1 (Ichar ch, Lisp_Object table) ) +#endif { Lisp_Object retval; Lisp_Char_Table *ct = XCHAR_TABLE (table); + +#ifdef ERROR_CHECK_TYPES + if (!mirrors_allowed) + { + assert (!ct->mirror_table_p); + } +#endif + #ifdef MULE if (ch < NUM_ASCII_CHARS) retval = ct->ascii[ch]; @@ -168,16 +183,11 @@ } #ifdef ERROR_CHECK_TYPES -DECLARE_INLINE_HEADER ( -Lisp_Object -get_char_table (Ichar ch, Lisp_Object table) -) -{ - assert (!XCHAR_TABLE (table)->mirror_table_p); - return get_char_table_1 (ch, table); -} +#define get_char_table(ch, table) get_char_table_1 (ch, table, 0) +#define get_char_table_mirrors_ok(ch, table) get_char_table_1 (ch, table, 1) #else -#define get_char_table(ch, table) get_char_table_1 (ch, table) +#define get_char_table get_char_table_1 +#define get_char_mirrors_ok get_char_table_1 #endif enum chartab_range_type
--- a/src/syntax.h Tue May 05 13:12:14 2015 +0900 +++ b/src/syntax.h Fri May 08 12:47:13 2015 +0100 @@ -92,7 +92,7 @@ { type_checking_assert (XCHAR_TABLE (table)->mirror_table_p); update_mirror_syntax_if_dirty (table); - return XFIXNUM (get_char_table_1 (c, table)); + return XFIXNUM (get_char_table_mirrors_ok (c, table)); } #ifdef NOT_WORTH_THE_EFFORT @@ -105,7 +105,7 @@ ) { type_checking_assert (XCHAR_TABLE (table)->mirror_table_p); - return (enum syntaxcode) XFIXNUM (get_char_table_1 (c, table)); + return (enum syntaxcode) XFIXNUM (get_char_table_mirrors_ok (c, table)); } #endif /* NOT_WORTH_THE_EFFORT */