diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/eval.c | 30 |
2 files changed, 28 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c6a45756ec5..1e25015da20 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Inline setter functions for Lisp_Objects slots of struct specbinding. | ||
| 4 | * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions. | ||
| 5 | Adjust users. | ||
| 6 | |||
| 1 | 2012-08-20 Martin Rudalics <rudalics@gmx.at> | 7 | 2012-08-20 Martin Rudalics <rudalics@gmx.at> |
| 2 | 8 | ||
| 3 | * window.c (select_window): Always make selected window's buffer | 9 | * window.c (select_window): Always make selected window's buffer |
diff --git a/src/eval.c b/src/eval.c index 771cd7b160a..c41e3f54d4d 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -133,7 +133,21 @@ Lisp_Object inhibit_lisp_code; | |||
| 133 | static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); | 133 | static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); |
| 134 | static int interactive_p (int); | 134 | static int interactive_p (int); |
| 135 | static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); | 135 | static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); |
| 136 | 136 | ||
| 137 | /* Functions to set Lisp_Object slots of struct specbinding. */ | ||
| 138 | |||
| 139 | static inline void | ||
| 140 | set_specpdl_symbol (Lisp_Object symbol) | ||
| 141 | { | ||
| 142 | specpdl_ptr->symbol = symbol; | ||
| 143 | } | ||
| 144 | |||
| 145 | static inline void | ||
| 146 | set_specpdl_old_value (Lisp_Object oldval) | ||
| 147 | { | ||
| 148 | specpdl_ptr->old_value = oldval; | ||
| 149 | } | ||
| 150 | |||
| 137 | void | 151 | void |
| 138 | init_eval_once (void) | 152 | init_eval_once (void) |
| 139 | { | 153 | { |
| @@ -3136,8 +3150,8 @@ specbind (Lisp_Object symbol, Lisp_Object value) | |||
| 3136 | case SYMBOL_PLAINVAL: | 3150 | case SYMBOL_PLAINVAL: |
| 3137 | /* The most common case is that of a non-constant symbol with a | 3151 | /* The most common case is that of a non-constant symbol with a |
| 3138 | trivial value. Make that as fast as we can. */ | 3152 | trivial value. Make that as fast as we can. */ |
| 3139 | specpdl_ptr->symbol = symbol; | 3153 | set_specpdl_symbol (symbol); |
| 3140 | specpdl_ptr->old_value = SYMBOL_VAL (sym); | 3154 | set_specpdl_old_value (SYMBOL_VAL (sym)); |
| 3141 | specpdl_ptr->func = NULL; | 3155 | specpdl_ptr->func = NULL; |
| 3142 | ++specpdl_ptr; | 3156 | ++specpdl_ptr; |
| 3143 | if (!sym->constant) | 3157 | if (!sym->constant) |
| @@ -3152,7 +3166,7 @@ specbind (Lisp_Object symbol, Lisp_Object value) | |||
| 3152 | { | 3166 | { |
| 3153 | Lisp_Object ovalue = find_symbol_value (symbol); | 3167 | Lisp_Object ovalue = find_symbol_value (symbol); |
| 3154 | specpdl_ptr->func = 0; | 3168 | specpdl_ptr->func = 0; |
| 3155 | specpdl_ptr->old_value = ovalue; | 3169 | set_specpdl_old_value (ovalue); |
| 3156 | 3170 | ||
| 3157 | eassert (sym->redirect != SYMBOL_LOCALIZED | 3171 | eassert (sym->redirect != SYMBOL_LOCALIZED |
| 3158 | || (EQ (SYMBOL_BLV (sym)->where, | 3172 | || (EQ (SYMBOL_BLV (sym)->where, |
| @@ -3186,7 +3200,7 @@ specbind (Lisp_Object symbol, Lisp_Object value) | |||
| 3186 | let_shadows_buffer_binding_p which is itself only used | 3200 | let_shadows_buffer_binding_p which is itself only used |
| 3187 | in set_internal for local_if_set. */ | 3201 | in set_internal for local_if_set. */ |
| 3188 | eassert (NILP (where) || EQ (where, cur_buf)); | 3202 | eassert (NILP (where) || EQ (where, cur_buf)); |
| 3189 | specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf)); | 3203 | set_specpdl_symbol (Fcons (symbol, Fcons (where, cur_buf))); |
| 3190 | 3204 | ||
| 3191 | /* If SYMBOL is a per-buffer variable which doesn't have a | 3205 | /* If SYMBOL is a per-buffer variable which doesn't have a |
| 3192 | buffer-local value here, make the `let' change the global | 3206 | buffer-local value here, make the `let' change the global |
| @@ -3203,7 +3217,7 @@ specbind (Lisp_Object symbol, Lisp_Object value) | |||
| 3203 | } | 3217 | } |
| 3204 | } | 3218 | } |
| 3205 | else | 3219 | else |
| 3206 | specpdl_ptr->symbol = symbol; | 3220 | set_specpdl_symbol (symbol); |
| 3207 | 3221 | ||
| 3208 | specpdl_ptr++; | 3222 | specpdl_ptr++; |
| 3209 | set_internal (symbol, value, Qnil, 1); | 3223 | set_internal (symbol, value, Qnil, 1); |
| @@ -3221,8 +3235,8 @@ record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg) | |||
| 3221 | if (specpdl_ptr == specpdl + specpdl_size) | 3235 | if (specpdl_ptr == specpdl + specpdl_size) |
| 3222 | grow_specpdl (); | 3236 | grow_specpdl (); |
| 3223 | specpdl_ptr->func = function; | 3237 | specpdl_ptr->func = function; |
| 3224 | specpdl_ptr->symbol = Qnil; | 3238 | set_specpdl_symbol (Qnil); |
| 3225 | specpdl_ptr->old_value = arg; | 3239 | set_specpdl_old_value (arg); |
| 3226 | specpdl_ptr++; | 3240 | specpdl_ptr++; |
| 3227 | } | 3241 | } |
| 3228 | 3242 | ||