aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorTom Tromey2012-08-15 12:56:38 -0600
committerTom Tromey2012-08-15 12:56:38 -0600
commit68b32482437e05f0994c4dd0ab5b0c27d39f0f6d (patch)
treefe01584b00d03559210438ebc608a1d170ee00b3 /src/eval.c
parent5190da91e6ca41287190693a8999a6919a9cd8e6 (diff)
downloademacs-68b32482437e05f0994c4dd0ab5b0c27d39f0f6d.tar.gz
emacs-68b32482437e05f0994c4dd0ab5b0c27d39f0f6d.zip
This introduces a thread-state object and moves various C globals
there. It also introduces #defines for these globals to avoid a monster patch. The #defines mean that this patch also has to rename a few fields whose names clash with the defines. There is currently just a single "thread"; so this patch does not impact Emacs behavior in any significant way.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/eval.c b/src/eval.c
index b531f790cc5..768cdc1a8f8 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -42,12 +42,12 @@ struct backtrace
42 unsigned int debug_on_exit : 1; 42 unsigned int debug_on_exit : 1;
43}; 43};
44 44
45static struct backtrace *backtrace_list; 45/* static struct backtrace *backtrace_list; */
46 46
47#if !BYTE_MARK_STACK 47/* #if !BYTE_MARK_STACK */
48static 48/* static */
49#endif 49/* #endif */
50struct catchtag *catchlist; 50/* struct catchtag *catchlist; */
51 51
52/* Chain of condition handlers currently in effect. 52/* Chain of condition handlers currently in effect.
53 The elements of this chain are contained in the stack frames 53 The elements of this chain are contained in the stack frames
@@ -55,10 +55,10 @@ struct catchtag *catchlist;
55 When an error is signaled (by calling Fsignal, below), 55 When an error is signaled (by calling Fsignal, below),
56 this chain is searched for an element that applies. */ 56 this chain is searched for an element that applies. */
57 57
58#if !BYTE_MARK_STACK 58/* #if !BYTE_MARK_STACK */
59static 59/* static */
60#endif 60/* #endif */
61struct handler *handlerlist; 61/* struct handler *handlerlist; */
62 62
63#ifdef DEBUG_GCPRO 63#ifdef DEBUG_GCPRO
64/* Count levels of GCPRO to detect failure to UNGCPRO. */ 64/* Count levels of GCPRO to detect failure to UNGCPRO. */
@@ -90,19 +90,19 @@ Lisp_Object Vautoload_queue;
90 90
91/* Current number of specbindings allocated in specpdl. */ 91/* Current number of specbindings allocated in specpdl. */
92 92
93ptrdiff_t specpdl_size; 93/* ptrdiff_t specpdl_size; */
94 94
95/* Pointer to beginning of specpdl. */ 95/* Pointer to beginning of specpdl. */
96 96
97struct specbinding *specpdl; 97/* struct specbinding *specpdl; */
98 98
99/* Pointer to first unused element in specpdl. */ 99/* Pointer to first unused element in specpdl. */
100 100
101struct specbinding *specpdl_ptr; 101/* struct specbinding *specpdl_ptr; */
102 102
103/* Depth in Lisp evaluations and function calls. */ 103/* Depth in Lisp evaluations and function calls. */
104 104
105static EMACS_INT lisp_eval_depth; 105/* static EMACS_INT lisp_eval_depth; */
106 106
107/* The value of num_nonmacro_input_events as of the last time we 107/* The value of num_nonmacro_input_events as of the last time we
108 started to enter the debugger. If we decide to enter the debugger 108 started to enter the debugger. If we decide to enter the debugger
@@ -1051,8 +1051,8 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object
1051 c.tag = tag; 1051 c.tag = tag;
1052 c.val = Qnil; 1052 c.val = Qnil;
1053 c.backlist = backtrace_list; 1053 c.backlist = backtrace_list;
1054 c.handlerlist = handlerlist; 1054 c.f_handlerlist = handlerlist;
1055 c.lisp_eval_depth = lisp_eval_depth; 1055 c.f_lisp_eval_depth = lisp_eval_depth;
1056 c.pdlcount = SPECPDL_INDEX (); 1056 c.pdlcount = SPECPDL_INDEX ();
1057 c.poll_suppress_count = poll_suppress_count; 1057 c.poll_suppress_count = poll_suppress_count;
1058 c.interrupt_input_blocked = interrupt_input_blocked; 1058 c.interrupt_input_blocked = interrupt_input_blocked;
@@ -1106,7 +1106,7 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value)
1106 /* Unwind the specpdl stack, and then restore the proper set of 1106 /* Unwind the specpdl stack, and then restore the proper set of
1107 handlers. */ 1107 handlers. */
1108 unbind_to (catchlist->pdlcount, Qnil); 1108 unbind_to (catchlist->pdlcount, Qnil);
1109 handlerlist = catchlist->handlerlist; 1109 handlerlist = catchlist->f_handlerlist;
1110 catchlist = catchlist->next; 1110 catchlist = catchlist->next;
1111 } 1111 }
1112 while (! last_time); 1112 while (! last_time);
@@ -1127,7 +1127,7 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value)
1127 gcpro_level = gcprolist ? gcprolist->level + 1 : 0; 1127 gcpro_level = gcprolist ? gcprolist->level + 1 : 0;
1128#endif 1128#endif
1129 backtrace_list = catch->backlist; 1129 backtrace_list = catch->backlist;
1130 lisp_eval_depth = catch->lisp_eval_depth; 1130 lisp_eval_depth = catch->f_lisp_eval_depth;
1131 1131
1132 _longjmp (catch->jmp, 1); 1132 _longjmp (catch->jmp, 1);
1133} 1133}
@@ -1231,8 +1231,8 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
1231 c.tag = Qnil; 1231 c.tag = Qnil;
1232 c.val = Qnil; 1232 c.val = Qnil;
1233 c.backlist = backtrace_list; 1233 c.backlist = backtrace_list;
1234 c.handlerlist = handlerlist; 1234 c.f_handlerlist = handlerlist;
1235 c.lisp_eval_depth = lisp_eval_depth; 1235 c.f_lisp_eval_depth = lisp_eval_depth;
1236 c.pdlcount = SPECPDL_INDEX (); 1236 c.pdlcount = SPECPDL_INDEX ();
1237 c.poll_suppress_count = poll_suppress_count; 1237 c.poll_suppress_count = poll_suppress_count;
1238 c.interrupt_input_blocked = interrupt_input_blocked; 1238 c.interrupt_input_blocked = interrupt_input_blocked;
@@ -1286,8 +1286,8 @@ internal_condition_case (Lisp_Object (*bfun) (void), Lisp_Object handlers,
1286 c.tag = Qnil; 1286 c.tag = Qnil;
1287 c.val = Qnil; 1287 c.val = Qnil;
1288 c.backlist = backtrace_list; 1288 c.backlist = backtrace_list;
1289 c.handlerlist = handlerlist; 1289 c.f_handlerlist = handlerlist;
1290 c.lisp_eval_depth = lisp_eval_depth; 1290 c.f_lisp_eval_depth = lisp_eval_depth;
1291 c.pdlcount = SPECPDL_INDEX (); 1291 c.pdlcount = SPECPDL_INDEX ();
1292 c.poll_suppress_count = poll_suppress_count; 1292 c.poll_suppress_count = poll_suppress_count;
1293 c.interrupt_input_blocked = interrupt_input_blocked; 1293 c.interrupt_input_blocked = interrupt_input_blocked;
@@ -1324,8 +1324,8 @@ internal_condition_case_1 (Lisp_Object (*bfun) (Lisp_Object), Lisp_Object arg,
1324 c.tag = Qnil; 1324 c.tag = Qnil;
1325 c.val = Qnil; 1325 c.val = Qnil;
1326 c.backlist = backtrace_list; 1326 c.backlist = backtrace_list;
1327 c.handlerlist = handlerlist; 1327 c.f_handlerlist = handlerlist;
1328 c.lisp_eval_depth = lisp_eval_depth; 1328 c.f_lisp_eval_depth = lisp_eval_depth;
1329 c.pdlcount = SPECPDL_INDEX (); 1329 c.pdlcount = SPECPDL_INDEX ();
1330 c.poll_suppress_count = poll_suppress_count; 1330 c.poll_suppress_count = poll_suppress_count;
1331 c.interrupt_input_blocked = interrupt_input_blocked; 1331 c.interrupt_input_blocked = interrupt_input_blocked;
@@ -1366,8 +1366,8 @@ internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object),
1366 c.tag = Qnil; 1366 c.tag = Qnil;
1367 c.val = Qnil; 1367 c.val = Qnil;
1368 c.backlist = backtrace_list; 1368 c.backlist = backtrace_list;
1369 c.handlerlist = handlerlist; 1369 c.f_handlerlist = handlerlist;
1370 c.lisp_eval_depth = lisp_eval_depth; 1370 c.f_lisp_eval_depth = lisp_eval_depth;
1371 c.pdlcount = SPECPDL_INDEX (); 1371 c.pdlcount = SPECPDL_INDEX ();
1372 c.poll_suppress_count = poll_suppress_count; 1372 c.poll_suppress_count = poll_suppress_count;
1373 c.interrupt_input_blocked = interrupt_input_blocked; 1373 c.interrupt_input_blocked = interrupt_input_blocked;
@@ -1410,8 +1410,8 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *),
1410 c.tag = Qnil; 1410 c.tag = Qnil;
1411 c.val = Qnil; 1411 c.val = Qnil;
1412 c.backlist = backtrace_list; 1412 c.backlist = backtrace_list;
1413 c.handlerlist = handlerlist; 1413 c.f_handlerlist = handlerlist;
1414 c.lisp_eval_depth = lisp_eval_depth; 1414 c.f_lisp_eval_depth = lisp_eval_depth;
1415 c.pdlcount = SPECPDL_INDEX (); 1415 c.pdlcount = SPECPDL_INDEX ();
1416 c.poll_suppress_count = poll_suppress_count; 1416 c.poll_suppress_count = poll_suppress_count;
1417 c.interrupt_input_blocked = interrupt_input_blocked; 1417 c.interrupt_input_blocked = interrupt_input_blocked;