Mercurial > hg > xemacs-beta
comparison src/eval.c @ 3989:53260b0cd16b
[xemacs-hg @ 2007-05-26 19:00:16 by aidan]
Small speed improvement to eval, from Sebastian Freundt.
author | aidan |
---|---|
date | Sat, 26 May 2007 19:00:20 +0000 |
parents | 1c2a46ea1f78 |
children | f9a0570637f3 |
comparison
equal
deleted
inserted
replaced
3988:1227374e7199 | 3989:53260b0cd16b |
---|---|
3537 | 3537 |
3538 #ifdef ERROR_CHECK_TRAPPING_PROBLEMS | 3538 #ifdef ERROR_CHECK_TRAPPING_PROBLEMS |
3539 check_proper_critical_section_lisp_protection (); | 3539 check_proper_critical_section_lisp_protection (); |
3540 #endif | 3540 #endif |
3541 | 3541 |
3542 if (!CONSP (form)) | |
3543 { | |
3544 if (SYMBOLP (form)) | |
3545 { | |
3546 return Fsymbol_value (form); | |
3547 } | |
3548 | |
3549 return form; | |
3550 } | |
3551 | |
3542 /* I think this is a pretty safe place to call Lisp code, don't you? */ | 3552 /* I think this is a pretty safe place to call Lisp code, don't you? */ |
3543 while (!in_warnings && !NILP (Vpending_warnings) | 3553 while (!in_warnings && !NILP (Vpending_warnings) |
3544 /* well, perhaps not so safe after all! */ | 3554 /* well, perhaps not so safe after all! */ |
3545 && !(inhibit_flags & INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY)) | 3555 && !(inhibit_flags & INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY)) |
3546 { | 3556 { |
3569 call3 (Qdisplay_warning, class_, messij, level); | 3579 call3 (Qdisplay_warning, class_, messij, level); |
3570 UNGCPRO; | 3580 UNGCPRO; |
3571 unbind_to (speccount); | 3581 unbind_to (speccount); |
3572 } | 3582 } |
3573 | 3583 |
3574 if (!CONSP (form)) | |
3575 { | |
3576 if (SYMBOLP (form)) | |
3577 return Fsymbol_value (form); | |
3578 else | |
3579 return form; | |
3580 } | |
3581 | |
3582 QUIT; | 3584 QUIT; |
3583 if (need_to_garbage_collect) | 3585 if (need_to_garbage_collect) |
3584 { | 3586 { |
3585 struct gcpro gcpro1; | 3587 struct gcpro gcpro1; |
3586 GCPRO1 (form); | 3588 GCPRO1 (form); |
3620 do_debug_on_call (Qt); | 3622 do_debug_on_call (Qt); |
3621 | 3623 |
3622 /* At this point, only original_fun and original_args | 3624 /* At this point, only original_fun and original_args |
3623 have values that will be used below. */ | 3625 have values that will be used below. */ |
3624 retry: | 3626 retry: |
3625 fun = indirect_function (original_fun, 1); | 3627 /* Optimise for no indirection. */ |
3628 fun = original_fun; | |
3629 if (SYMBOLP (fun) && !EQ (fun, Qunbound) | |
3630 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) | |
3631 { | |
3632 fun = indirect_function(original_fun, 1); | |
3633 } | |
3626 | 3634 |
3627 if (SUBRP (fun)) | 3635 if (SUBRP (fun)) |
3628 { | 3636 { |
3629 Lisp_Subr *subr = XSUBR (fun); | 3637 Lisp_Subr *subr = XSUBR (fun); |
3630 int max_args = subr->max_args; | 3638 int max_args = subr->max_args; |