aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorTomohiro Matsuyama2012-08-22 15:38:59 +0900
committerTomohiro Matsuyama2012-08-22 15:38:59 +0900
commitc2d7786e1272a10c62de7bd1c2d8810e510b3ab1 (patch)
tree4dc621ccee2315e7c2af7fcb1e153175b7e7519b /src/eval.c
parent37219830c704441dad626b2e555e27a7f4676d87 (diff)
downloademacs-c2d7786e1272a10c62de7bd1c2d8810e510b3ab1.tar.gz
emacs-c2d7786e1272a10c62de7bd1c2d8810e510b3ab1.zip
Add emacs native profiler.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/eval.c b/src/eval.c
index c41e3f54d4d..b2e49364b52 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -32,17 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
32#include "xterm.h" 32#include "xterm.h"
33#endif 33#endif
34 34
35struct backtrace 35struct backtrace *backtrace_list;
36{
37 struct backtrace *next;
38 Lisp_Object *function;
39 Lisp_Object *args; /* Points to vector of args. */
40 ptrdiff_t nargs; /* Length of vector. */
41 /* Nonzero means call value of debugger when done with this operation. */
42 unsigned int debug_on_exit : 1;
43};
44
45static struct backtrace *backtrace_list;
46 36
47#if !BYTE_MARK_STACK 37#if !BYTE_MARK_STACK
48static 38static
@@ -2081,11 +2071,11 @@ eval_sub (Lisp_Object form)
2081 original_args = XCDR (form); 2071 original_args = XCDR (form);
2082 2072
2083 backtrace.next = backtrace_list; 2073 backtrace.next = backtrace_list;
2084 backtrace_list = &backtrace;
2085 backtrace.function = &original_fun; /* This also protects them from gc. */ 2074 backtrace.function = &original_fun; /* This also protects them from gc. */
2086 backtrace.args = &original_args; 2075 backtrace.args = &original_args;
2087 backtrace.nargs = UNEVALLED; 2076 backtrace.nargs = UNEVALLED;
2088 backtrace.debug_on_exit = 0; 2077 backtrace.debug_on_exit = 0;
2078 backtrace_list = &backtrace;
2089 2079
2090 if (debug_on_next_call) 2080 if (debug_on_next_call)
2091 do_debug_on_call (Qt); 2081 do_debug_on_call (Qt);
@@ -2778,11 +2768,11 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2778 } 2768 }
2779 2769
2780 backtrace.next = backtrace_list; 2770 backtrace.next = backtrace_list;
2781 backtrace_list = &backtrace;
2782 backtrace.function = &args[0]; 2771 backtrace.function = &args[0];
2783 backtrace.args = &args[1]; /* This also GCPROs them. */ 2772 backtrace.args = &args[1]; /* This also GCPROs them. */
2784 backtrace.nargs = nargs - 1; 2773 backtrace.nargs = nargs - 1;
2785 backtrace.debug_on_exit = 0; 2774 backtrace.debug_on_exit = 0;
2775 backtrace_list = &backtrace;
2786 2776
2787 /* Call GC after setting up the backtrace, so the latter GCPROs the args. */ 2777 /* Call GC after setting up the backtrace, so the latter GCPROs the args. */
2788 maybe_gc (); 2778 maybe_gc ();