aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2012-09-28 22:02:34 -0400
committerStefan Monnier2012-09-28 22:02:34 -0400
commite7c1b6ef850e7b4d021fabf4a922010781ed05bd (patch)
treee7dec53a158a9a5acf94f55597f31814c3138ede /src
parent277f0cfa8b7dde109913f52c40eb8447b71eaffc (diff)
downloademacs-e7c1b6ef850e7b4d021fabf4a922010781ed05bd.tar.gz
emacs-e7c1b6ef850e7b4d021fabf4a922010781ed05bd.zip
* src/lisp.h (struct backtrace): Remove indirection for `function' field.
* src/xdisp.c (redisplay_internal): * src/profiler.c (record_backtrace, sigprof_handler_1): * src/alloc.c (Fgarbage_collect): * src/eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace) (Fbacktrace_frame): Adjust accordingly.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/alloc.c4
-rw-r--r--src/eval.c28
-rw-r--r--src/lisp.h2
-rw-r--r--src/profiler.c4
-rw-r--r--src/xdisp.c4
6 files changed, 30 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c30c4ed955b..500522a2feb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lisp.h (struct backtrace): Remove indirection for `function' field.
4 * xdisp.c (redisplay_internal):
5 * profiler.c (record_backtrace, sigprof_handler_1):
6 * alloc.c (Fgarbage_collect):
7 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
8 (Fbacktrace_frame): Adjust accordingly.
9
12012-09-28 Glenn Morris <rgm@gnu.org> 102012-09-28 Glenn Morris <rgm@gnu.org>
2 11
3 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success) 12 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
diff --git a/src/alloc.c b/src/alloc.c
index 46c9a10c725..df166b4924a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5112,8 +5112,8 @@ See Info node `(elisp)Garbage Collection'. */)
5112 5112
5113 /* Record this function, so it appears on the profiler's backtraces. */ 5113 /* Record this function, so it appears on the profiler's backtraces. */
5114 backtrace.next = backtrace_list; 5114 backtrace.next = backtrace_list;
5115 backtrace.function = &Qautomatic_gc; 5115 backtrace.function = Qautomatic_gc;
5116 backtrace.args = &Qautomatic_gc; 5116 backtrace.args = &Qnil;
5117 backtrace.nargs = 0; 5117 backtrace.nargs = 0;
5118 backtrace.debug_on_exit = 0; 5118 backtrace.debug_on_exit = 0;
5119 backtrace_list = &backtrace; 5119 backtrace_list = &backtrace;
diff --git a/src/eval.c b/src/eval.c
index 851b2bb1129..561ba922482 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -552,7 +552,7 @@ interactive_p (void)
552 552
553 /* If this isn't a byte-compiled function, there may be a frame at 553 /* If this isn't a byte-compiled function, there may be a frame at
554 the top for Finteractive_p. If so, skip it. */ 554 the top for Finteractive_p. If so, skip it. */
555 fun = Findirect_function (*btp->function, Qnil); 555 fun = Findirect_function (btp->function, Qnil);
556 if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p 556 if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p
557 || XSUBR (fun) == &Scalled_interactively_p)) 557 || XSUBR (fun) == &Scalled_interactively_p))
558 btp = btp->next; 558 btp = btp->next;
@@ -565,7 +565,7 @@ interactive_p (void)
565 If this isn't a byte-compiled function, then we may now be 565 If this isn't a byte-compiled function, then we may now be
566 looking at several frames for special forms. Skip past them. */ 566 looking at several frames for special forms. Skip past them. */
567 while (btp 567 while (btp
568 && (EQ (*btp->function, Qbytecode) 568 && (EQ (btp->function, Qbytecode)
569 || btp->nargs == UNEVALLED)) 569 || btp->nargs == UNEVALLED))
570 btp = btp->next; 570 btp = btp->next;
571 571
@@ -573,13 +573,13 @@ interactive_p (void)
573 a special form, ignoring frames for Finteractive_p and/or 573 a special form, ignoring frames for Finteractive_p and/or
574 Fbytecode at the top. If this frame is for a built-in function 574 Fbytecode at the top. If this frame is for a built-in function
575 (such as load or eval-region) return false. */ 575 (such as load or eval-region) return false. */
576 fun = Findirect_function (*btp->function, Qnil); 576 fun = Findirect_function (btp->function, Qnil);
577 if (SUBRP (fun)) 577 if (SUBRP (fun))
578 return 0; 578 return 0;
579 579
580 /* `btp' points to the frame of a Lisp function that called interactive-p. 580 /* `btp' points to the frame of a Lisp function that called interactive-p.
581 Return t if that function was called interactively. */ 581 Return t if that function was called interactively. */
582 if (btp && btp->next && EQ (*btp->next->function, Qcall_interactively)) 582 if (btp && btp->next && EQ (btp->next->function, Qcall_interactively))
583 return 1; 583 return 1;
584 return 0; 584 return 0;
585} 585}
@@ -1496,10 +1496,10 @@ See also the function `condition-case'. */)
1496 if (backtrace_list && !NILP (error_symbol)) 1496 if (backtrace_list && !NILP (error_symbol))
1497 { 1497 {
1498 bp = backtrace_list->next; 1498 bp = backtrace_list->next;
1499 if (bp && bp->function && EQ (*bp->function, Qerror)) 1499 if (bp && EQ (bp->function, Qerror))
1500 bp = bp->next; 1500 bp = bp->next;
1501 if (bp && bp->function) 1501 if (bp)
1502 Vsignaling_function = *bp->function; 1502 Vsignaling_function = bp->function;
1503 } 1503 }
1504 1504
1505 for (h = handlerlist; h; h = h->next) 1505 for (h = handlerlist; h; h = h->next)
@@ -1510,7 +1510,7 @@ See also the function `condition-case'. */)
1510 } 1510 }
1511 1511
1512 if (/* Don't run the debugger for a memory-full error. 1512 if (/* Don't run the debugger for a memory-full error.
1513 (There is no room in memory to do that!) */ 1513 (There is no room in memory to do that!) */
1514 !NILP (error_symbol) 1514 !NILP (error_symbol)
1515 && (!NILP (Vdebug_on_signal) 1515 && (!NILP (Vdebug_on_signal)
1516 /* If no handler is present now, try to run the debugger. */ 1516 /* If no handler is present now, try to run the debugger. */
@@ -2045,7 +2045,7 @@ eval_sub (Lisp_Object form)
2045 original_args = XCDR (form); 2045 original_args = XCDR (form);
2046 2046
2047 backtrace.next = backtrace_list; 2047 backtrace.next = backtrace_list;
2048 backtrace.function = &original_fun; /* This also protects them from gc. */ 2048 backtrace.function = original_fun; /* This also protects them from gc. */
2049 backtrace.args = &original_args; 2049 backtrace.args = &original_args;
2050 backtrace.nargs = UNEVALLED; 2050 backtrace.nargs = UNEVALLED;
2051 backtrace.debug_on_exit = 0; 2051 backtrace.debug_on_exit = 0;
@@ -2713,7 +2713,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2713 } 2713 }
2714 2714
2715 backtrace.next = backtrace_list; 2715 backtrace.next = backtrace_list;
2716 backtrace.function = &args[0]; 2716 backtrace.function = args[0];
2717 backtrace.args = &args[1]; /* This also GCPROs them. */ 2717 backtrace.args = &args[1]; /* This also GCPROs them. */
2718 backtrace.nargs = nargs - 1; 2718 backtrace.nargs = nargs - 1;
2719 backtrace.debug_on_exit = 0; 2719 backtrace.debug_on_exit = 0;
@@ -3289,12 +3289,12 @@ Output stream used is value of `standard-output'. */)
3289 write_string (backlist->debug_on_exit ? "* " : " ", 2); 3289 write_string (backlist->debug_on_exit ? "* " : " ", 2);
3290 if (backlist->nargs == UNEVALLED) 3290 if (backlist->nargs == UNEVALLED)
3291 { 3291 {
3292 Fprin1 (Fcons (*backlist->function, *backlist->args), Qnil); 3292 Fprin1 (Fcons (backlist->function, *backlist->args), Qnil);
3293 write_string ("\n", -1); 3293 write_string ("\n", -1);
3294 } 3294 }
3295 else 3295 else
3296 { 3296 {
3297 tem = *backlist->function; 3297 tem = backlist->function;
3298 Fprin1 (tem, Qnil); /* This can QUIT. */ 3298 Fprin1 (tem, Qnil); /* This can QUIT. */
3299 write_string ("(", -1); 3299 write_string ("(", -1);
3300 if (backlist->nargs == MANY) 3300 if (backlist->nargs == MANY)
@@ -3352,7 +3352,7 @@ If NFRAMES is more than the number of frames, the value is nil. */)
3352 if (!backlist) 3352 if (!backlist)
3353 return Qnil; 3353 return Qnil;
3354 if (backlist->nargs == UNEVALLED) 3354 if (backlist->nargs == UNEVALLED)
3355 return Fcons (Qnil, Fcons (*backlist->function, *backlist->args)); 3355 return Fcons (Qnil, Fcons (backlist->function, *backlist->args));
3356 else 3356 else
3357 { 3357 {
3358 if (backlist->nargs == MANY) /* FIXME: Can this happen? */ 3358 if (backlist->nargs == MANY) /* FIXME: Can this happen? */
@@ -3360,7 +3360,7 @@ If NFRAMES is more than the number of frames, the value is nil. */)
3360 else 3360 else
3361 tem = Flist (backlist->nargs, backlist->args); 3361 tem = Flist (backlist->nargs, backlist->args);
3362 3362
3363 return Fcons (Qt, Fcons (*backlist->function, tem)); 3363 return Fcons (Qt, Fcons (backlist->function, tem));
3364 } 3364 }
3365} 3365}
3366 3366
diff --git a/src/lisp.h b/src/lisp.h
index 21ac55c1063..c3cabe0af29 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2034,7 +2034,7 @@ extern ptrdiff_t specpdl_size;
2034struct backtrace 2034struct backtrace
2035{ 2035{
2036 struct backtrace *next; 2036 struct backtrace *next;
2037 Lisp_Object *function; 2037 Lisp_Object function;
2038 Lisp_Object *args; /* Points to vector of args. */ 2038 Lisp_Object *args; /* Points to vector of args. */
2039 ptrdiff_t nargs; /* Length of vector. */ 2039 ptrdiff_t nargs; /* Length of vector. */
2040 /* Nonzero means call value of debugger when done with this operation. */ 2040 /* Nonzero means call value of debugger when done with this operation. */
diff --git a/src/profiler.c b/src/profiler.c
index 4d748b547f5..44a12fc159c 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -149,7 +149,7 @@ record_backtrace (log_t *log, size_t count)
149 /* Copy the backtrace contents into working memory. */ 149 /* Copy the backtrace contents into working memory. */
150 for (; i < asize && backlist; i++, backlist = backlist->next) 150 for (; i < asize && backlist; i++, backlist = backlist->next)
151 /* FIXME: For closures we should ignore the environment. */ 151 /* FIXME: For closures we should ignore the environment. */
152 ASET (backtrace, i, *backlist->function); 152 ASET (backtrace, i, backlist->function);
153 153
154 /* Make sure that unused space of working memory is filled with nil. */ 154 /* Make sure that unused space of working memory is filled with nil. */
155 for (; i < asize; i++) 155 for (; i < asize; i++)
@@ -218,7 +218,7 @@ static void
218sigprof_handler_1 (int signal) 218sigprof_handler_1 (int signal)
219{ 219{
220 eassert (HASH_TABLE_P (cpu_log)); 220 eassert (HASH_TABLE_P (cpu_log));
221 if (backtrace_list && EQ (*backtrace_list->function, Qautomatic_gc)) 221 if (backtrace_list && EQ (backtrace_list->function, Qautomatic_gc))
222 /* Special case the time-count inside GC because the hash-table 222 /* Special case the time-count inside GC because the hash-table
223 code is not prepared to be used while the GC is running. 223 code is not prepared to be used while the GC is running.
224 More specifically it uses ASIZE at many places where it does 224 More specifically it uses ASIZE at many places where it does
diff --git a/src/xdisp.c b/src/xdisp.c
index 701ae22cd06..b23a06ff3d1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12975,8 +12975,8 @@ redisplay_internal (void)
12975 12975
12976 /* Record this function, so it appears on the profiler's backtraces. */ 12976 /* Record this function, so it appears on the profiler's backtraces. */
12977 backtrace.next = backtrace_list; 12977 backtrace.next = backtrace_list;
12978 backtrace.function = &Qredisplay_internal; 12978 backtrace.function = Qredisplay_internal;
12979 backtrace.args = &Qredisplay_internal; 12979 backtrace.args = &Qnil;
12980 backtrace.nargs = 0; 12980 backtrace.nargs = 0;
12981 backtrace.debug_on_exit = 0; 12981 backtrace.debug_on_exit = 0;
12982 backtrace_list = &backtrace; 12982 backtrace_list = &backtrace;