summaryrefslogtreecommitdiff
path: root/libguile/eval.c
AgeCommit message (Collapse)AuthorFilesLines
2009-03-08Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-4/+4
Conflicts: libguile/gc-card.c libguile/gc-mark.c
2009-03-02Remove "compiled closures" ("cclos") in favor of a simpler mechanism.Ludovic Courtès1-4/+4
The idea is to introduce `gsubrs' whose arity is encoded in their type (more precisely in the sizeof (void *) - 8 MSBs). This removes the indirection introduced by cclos and simplifies the code. * libguile/__scm.h (CCLO): Remove. * libguile/debug.c (scm_procedure_source, scm_procedure_environment): Remove references to `scm_tc7_cclo'. * libguile/eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2): Replace `scm_tc7_cclo' with `scm_tc7_gsubr'. * libguile/eval.i.c (CEVAL): Likewise. No longer make PROC the first argument. Directly invoke `scm_gsubr_apply ()' instead of jump to the `evap(N+1)' label or call to `SCM_APPLY ()'. * libguile/evalext.c (scm_self_evaluating_p): Remove reference to `scm_tc7_cclo'. * libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name): Likewise. * libguile/gc-mark.c (scm_gc_mark_dependencies): Likewise. * libguile/goops.c (scm_class_of): Likewise. * libguile/print.c (iprin1): Likewise. * libguile/gsubr.c (create_gsubr): Use `unsigned int's for REQ, OPT and RST. Use `scm_tc7_gsubr' instead of `scm_makcclo ()' in the default case. (scm_gsubr_apply): Remove calls to `SCM_GSUBR_PROC ()'. (scm_f_gsubr_apply): Remove. * libguile/gsubr.h (SCM_GSUBR_TYPE): New definition. (SCM_GSUBR_MAX): Changed to 33. (SCM_SET_GSUBR_TYPE, SCM_GSUBR_PROC, SCM_SET_GSUBR_PROC, scm_f_gsubr_apply): Remove. * libguile/procprop.c (scm_i_procedure_arity): Remove reference to `scm_tc7_cclo'; add proper handling of `scm_tc7_gsubr'. * libguile/procs.c (scm_makcclo, scm_make_cclo): Remove. (scm_procedure_p): Remove reference to `scm_tc7_cclo'. (scm_thunk_p): Likewise, plus add proper `scm_tc7_gsubr' handling. * libguile/procs.h (SCM_CCLO_LENGTH, SCM_MAKE_CCLO_TAG, SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE, SCM_SET_CCLO_BASE, SCM_CCLO_REF, SCM_CCLO_SET, SCM_CCLO_SUBR, SCM_SET_CCLO_SUBR, scm_makcclo, scm_make_cclo): Remove. * libguile/stacks.c (read_frames): Remove reference to `scm_f_gsubr_apply'. * libguile/tags.h (scm_tc7_cclo): Remove. (scm_tc7_gsubr): New. (scm_tcs_subrs): Add `scm_tc7_gsubr'.
2009-02-05scm_call_N doesn't cons for calling programsAndy Wingo1-6/+32
* libguile/eval.c (scm_call_0, scm_call_1, scm_call_2, scm_call_3) (scm_call_4): Special-case compiled procedures here, to avoid consing. * libguile/vm.h: * libguile/vm.c (scm_c_vm_run): Take a SCM after all. (scm_vm_apply, scm_load_compiled_with_vm): Adapt to vm_run change.
2008-11-11rashly bump stack limit to 40k wordsAndy Wingo1-1/+1
* libguile/eval.c (scm_debug_opts): Whereas, today's machines are larger than yesterday's; GCC consumes more words per stack frame than it used to; and you can get quite some recursion in a halfway-compiled system, be it resolved: let's bump up the C stack limit to 40k words (160 kB / 320 kB, depending on word size).
2008-09-30Merge commit 'origin/master' into vmAndy Wingo1-2/+2
Conflicts: doc/Makefile.am ice-9/Makefile.am libguile/gc.c
2008-09-25export `make-promise' to schemeAndy Wingo1-4/+14
* libguile/eval.h: * libguile/eval.c (scm_make_promise): Rename from `scm_makprom', and export as the scheme procedure, `make-promise'. * libguile/eval.i.c (CEVAL): s/makprom/make_promise/.
2008-09-15Use immutable cells for closures.Ludovic Courtès1-1/+2
* libguile/eval.c (scm_closure): Use `scm_immutable_cell ()' instead of `scm_cell ()'. * libguile/procs.h (SCM_SETCODE, SCM_SETENV): Remove.
2008-09-13Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-1/+1
Conflicts: lib/Makefile.am libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/private-gc.h m4/.cvsignore m4/gnulib-cache.m4 m4/gnulib-comp.m4
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-1/+1
2008-09-10Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-10/+19
Conflicts: libguile/Makefile.am libguile/coop-defs.h libguile/gc-card.c libguile/gc-freelist.c libguile/gc-malloc.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/hashtab.c libguile/hashtab.h libguile/inline.h libguile/private-gc.h libguile/struct.c libguile/struct.h libguile/threads.c libguile/threads.h libguile/vectors.h libguile/weaks.h test-suite/tests/gc.test
2008-09-10Merge commit '29776e85da637ec4d44b2b2822d6934a50c0084b' into ↵Ludovic Courtès1-35/+22
boehm-demers-weiser-gc Conflicts: libguile/gc-card.c libguile/gc.c libguile/gc.h libguile/ports.c
2008-09-10Merge commit '7337d56d5714227865aeca2b40b6bd97cce296d2' into ↵Ludovic Courtès1-5/+6
boehm-demers-weiser-gc Conflicts: libguile/struct.c
2008-09-10Merge commit '032913739218c756f673bfb9c8f66ef9f8f02330' into ↵Ludovic Courtès1-2023/+59
boehm-demers-weiser-gc Conflicts: libguile/gc.c libguile/srcprop.c libguile/srcprop.h
2008-09-10Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into ↵Ludovic Courtès1-18/+25
boehm-demers-weiser-gc Conflicts: libguile/Makefile.am libguile/coop-pthreads.c libguile/gc-freelist.c libguile/gc-segment.c libguile/gc.c libguile/private-gc.h test-suite/tests/environments.nottest
2008-09-05Removed a lot of now-useless SMOB mark/free functions.Ludovic Courtes1-14/+0
* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'. * libguile/async.c (async_gc_mark): Removed. (scm_init_async): Don't invoke `scm_set_smob_mark'. * libguile/coop-pthreads.c (thread_mark): Removed. (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when allocating `launch_data'. (mutex_mark): Removed. (scm_threads_init): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'. * libguile/dynl.c (dynl_obj_mark): Removed. (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'. * libguile/dynwind.c (winder_mark): Removed. (scm_init_dynwind): Don't invoke `scm_set_smob_mark'. * libguile/environments.c (environment_mark): Removed. (environment_free): Removed. (observer_mark): Removed. (core_environments_mark): Removed. (core_environments_finalize): Removed. (leaf_environment_mark): Removed. (leaf_environment_free): Removed. (leaf_environment_funcs): Don't refer to the above funcs. (eval_environment_mark): Removed. (eval_environment_free): Removed. (eval_environment_funcs): Don't refer to the above funcs. (import_environment_mark): Removed. (import_environment_free): Removed. (import_environment_funcs): Don't refer to the above funcs. (export_environment_mark): Removed. (export_environment_free): Removed. (export_environment_funcs): Don't refer to the above funcs. (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/environments.h (scm_environment_funcs)[mark]: Removed. [free]: Removed. * libguile/eval.c (promise_mark): Removed. (promise_free): Removed. (scm_init_eval): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/fluids.c (fluid_free): Removed. (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/futures.c (future_mark): Removed. (scm_init_futures): Don't invoke `scm_set_smob_mark'. * libguile/hashtab.c (hashtable_free): Removed. (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'. * libguile/keywords.c (scm_init_keywords): Don't invoke `scm_set_smob_mark'. * libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'. * libguile/modules.c (scm_init_modules): Don't invoke `scm_set_smob_mark'. * libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'. * libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of `scm_malloc'. (scm_c_make_rstate): Likewise. (rstate_free): Removed. (scm_init_random): Don't invoke `scm_set_smob_free'. * libguile/srcprop.c (srcprops_mark): Removed. (scm_init_srcprop): Don't invoke `srcprops_mark'. * libguile/srfi-14.c (charset_free): Removed. (scm_init_srfi_14): Don't invoke `scm_set_smob_free'. * libguile/srfi-4.c (uvec_mark): Removed. (uvec_free): Removed. (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. * libguile/threads.c (thread_mark): Removed. (fat_mutex_mark): Removed. (fat_cond_mark): Removed. (scm_init_threads): Dont invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/unif.c (bitvector_free): Removed. (array_mark): Removed. (array_free): Removed. (scm_init_unif): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28
2008-09-03* eval.c: Mark #endif with comment.Han-Wen Nienhuys1-1/+1
2008-08-20Never define `_GNU_SOURCE' explicitly since `AC_USE_SYSTEM_EXTENSIONS'Ludovic Courtès1-2/+0
takes care of it. Conflicts: ChangeLog configure.in libguile/eval.c libguile/srfi-14.c libguile/threads.c
2008-03-06Fix type-checking for the second argument of `eval'.Ludovic Courtès1-2/+5
2007-12-08Changes from arch/CVS synchronizationLudovic Courtès1-5/+7
2007-10-21(unmemoize_delay): Extend the environment beforeNeil Jerram1-1/+7
unmemoizing the promise thunk. This fixes a segmentation fault reported by Frank Schwidom.
2007-07-29Changes from arch/CVS synchronizationLudovic Courtès1-18/+2
2007-07-24Changes from arch/CVS synchronizationLudovic Courtès1-19/+22
2007-05-26Changes from arch/CVS synchronizationLudovic Courtès1-5/+6
2007-01-22* eval.c: remove superfluous ifndef DEVAL.Han-Wen Nienhuys1-4/+0
* eval.c: distangle. move duplicate code to eval.i.c and include twice. * backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c, read.h, stacks.c, symbols.c, throw.c: use private-options.h
2007-01-22* private-options.h: idem.Han-Wen Nienhuys1-7/+7
* eval.i.c: copyright nitpicking. * eval.c: distangle. move duplicate code to eval.i.c and include twice. * eval.i.c: new file. * backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c, read.h, stacks.c, symbols.c, throw.c: use private-options.h * private-options.h: new file: contain hardcoded option definitions.
2007-01-22* eval.c: distangle. move duplicate code to eval.i.c and includeHan-Wen Nienhuys1-2031/+36
twice. * eval.i.c: new file. * backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c, read.h, stacks.c, symbols.c, throw.c: use private-options.h
2007-01-19* debug.h (SCM_RESET_DEBUG_MODE): switch to debugging ifHan-Wen Nienhuys1-5/+38
memoize-symbol is set. * eval.h (SCM_MEMOIZE_HDLR): add macros for memoize symbol trap. * eval.c (CEVAL): add memoize_symbol trap. * read.c: idem. * eval.c: terminate option lists with 0.
2007-01-19* srcprop.c: use double cell for storing source-properties. PutHan-Wen Nienhuys1-1/+1
filename in the plist, and share between srcprops if possible. Remove specialized storage. * srcprop.h: remove macros without SCM_ prefix from interface. Remove specialized storage/type definitions. * eval.c: terminate option lists with 0.
2007-01-19* readline.c: terminate option list with NULL.Han-Wen Nienhuys1-11/+13
* read.c: idem. * print.c: idem. * eval.c: terminate option lists with 0. * options.c: remove n (for length) from scm_option_X functions. Detect option list length by looking for NULL name.
2007-01-15merge from 1.8Kevin Ryde1-1/+1
2006-10-09merge from 1.8 branchKevin Ryde1-18/+25
2006-06-17merge from 1.8 branchKevin Ryde1-0/+3
2006-04-17merge from 1.8 branchKevin Ryde1-7/+7
2006-01-29(scm_eval_body): Lock source_mutex with a dynwind contextMarius Vollmer1-6/+9
so that it gets unlocked in all cases. (SCM_APPLY, CEVAL): Likewise.
2006-01-29* futures.h, futures.c: Wrap whole contents in "#if 0"/"#endif".Marius Vollmer1-2/+13
* eval.c, init.c: Comment out all 'future' related things.
2006-01-29Renamed the "frames" that are related to dynamic-wind to "dynamicMarius Vollmer1-11/+11
contexts. Renamed all functions from scm_frame_ to scm_dynwind_. Updated documentation.
2005-12-06(scm_m_cond): Recognize SRFI 61 cond syntax.Marius Vollmer1-1/+32
(CEVAL): Evaluate SRFI 61 cond clauses.
2005-11-04* eval.c (sym_instead): New symbol.Neil Jerram1-84/+28
(ENTER_APPLY): Remove optional use of a continuation when making trap call. (scm_debug_opts): Change doc for 'cheap option to make clear that it is now obsolete. (CEVAL, SCM_APPLY): Remove optional use of a continuation when making trap calls, and implement substitution of eval expressions and return values using the values that the trap call handlers return. * debug.h (SCM_CHEAPTRAPS_P): Removed.
2005-10-23* null-threads.h, pthread-threads.hMarius Vollmer1-1/+4
(SCM_I_PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Removed. (scm_i_pthread_mutexattr_recursive): New. * threads.c (scm_i_pthread_mutexattr_recursive): Declare. (scm_i_critical_section_mutex): Do not initialize statically. (scm_threads_prehistory): Initialize scm_i_pthread_mutexattr_recursive and scm_i_critical_section_mutex here. * eval.c (source_mutex): Do not initialiaze statically. (scm_init_eval): Do it here, using scm_i_pthread_mutexattr_recursive.
2005-08-15* eval.c (eval_letrec_inits): New.Neil Jerram1-15/+29
(CEVAL): Eval letrec initializer forms using eval_letrec_inits. * tests/r5rs_pitfall.test (1.1): Now passes.
2005-07-12(scm_dbg_make_iloc): Should be SCM_IFRAMEMAX andKevin Ryde1-3/+3
SCM_IDISTMAX, and cast uints through scm_t_bits to make gcc happy. Reported by Ken Raeburn.
2005-06-06(scm_eval_options_interface): Use scm_frame_critical_section insteadMarius Vollmer1-5/+5
of SCM_CRITICAL_SECTION_START and SCM_CRITICAL_SECTION_END.
2005-06-05Added comment on how to make case 1.1 of r5rs_pitfall.test succeed.Marius Vollmer1-0/+7
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-03-30Critical section review.Neil Jerram1-1/+15
2005-03-04Define _GNU_SOURCE.Marius Vollmer1-0/+2
2005-03-02See ChangeLog from 2005-03-02.Marius Vollmer1-84/+73
2005-01-24Reverted changed from 2005/01/24 19:14:54, which was a commit to theMarius Vollmer1-22/+12
wrong branch. Sorry.
2005-01-24Threading changes.Marius Vollmer1-12/+22
2005-01-11* eval.c, debug.h (SCM_WARN_DEPRECATED): New debug option.Marius Vollmer1-1/+2
* deprecation.c (scm_issue_deprecation_warning, scm_c_issue_deprecation_warning_fmt): Use it. (mode): Removed. (print_summary): New. (scm_init_deprecation): Initialize SCM_WARN_DEPRECATED instead of mode.