1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

381 commits

Author SHA1 Message Date
Andy Wingo
b071ce2147 redo the SCM tagging strategy
Currently failing some guardian tests.

* libguile/tags.h: Refactor tagging so that tc3 bits for a pair live in
  the SCM value, not in the heap words.  Do the same for structs.  This
  more rational tagging strategy will make native code generation
  easier.  Note that this means that to check a heap pointer for its
  type, you first have to ensure that it has the expected tc3, as not
  all the type bits are on the heap.
  (SCM_TYP3): Check the SCM tag type, not the bits in the cell.
  (SCM_HAS_TYP3): New helper.
  (SCM_I_CONSP): Redefine to just check the typ3.
  (scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct): Remove, as
  they are no longer necessary.

* libguile/array-handle.c (scm_i_array_implementation_for_obj): Check
  for heap objects before checking type bits, so we don't check pairs.

* libguile/evalext.c (scm_self_evaluating_p):
* libguile/gc.c (scm_i_tag_name):
* libguile/goops.c (scm_class_of)
* libguile/hash.c (scm_hasher):
* libguile/print.c (iprin1): Adapt to tagging changes.

* libguile/gc.c (scm_storage_prehistory): Register all displacements
  here.  There are the same displacements as before, unfortunately.

* libguile/list.c (SCM_I_CONS):
* libguile/pairs.c (scm_cons):
* libguile/pairs.h (scm_is_pair):
* libguile/vm-engine.h (CONS): Tag pairs with scm_tc3_pair.

* libguile/modules.c (scm_post_boot_init_modules):
* libguile/modules.h (SCM_MODULEP):
* libguile/struct.c (struct_finalizer_trampoline, scm_i_alloc_struct):
  (scm_make_vtable_vtable):
* libguile/struct.h (SCM_STRUCTP, SCM_STRUCT_VTABLE_DATA):
  (SCM_STRUCT_VTABLE_SLOTS):
* libguile/vm-i-scheme.c (make-struct): Adapt to struct tagging
  changes.

* libguile/numbers.h (SCM_I_INUMP):
* module/rnrs/arithmetic/fixnums.scm (fixnum?, inline-fixnum?): Adapt
  to the new fixnum tag.

* libguile/numbers.h (SCM_INEXACTP): Make sure of the tc3 before looking
  at the cell type.
2013-01-15 19:13:03 +01:00
Andy Wingo
8b49b6b1f5 Merge remote-tracking branch 'local-2.0/stable-2.0'
Conflicts:
	configure.ac
2012-03-11 11:06:14 +01:00
Andy Wingo
9adbf27f4e more libgc 7.1 compat
* configure.ac:
* libguile/gc.c (GC_set_finalize_on_demand): Check for this function,
  and shim if it isn't present.
2012-03-08 23:50:41 +01:00
Andy Wingo
bc61280992 Merge remote-tracking branch 'local-2.0/stable-2.0'
Conflicts:
	configure.ac
	libguile/finalizers.c
	libguile/finalizers.h
	libguile/gc.c
	libguile/gc.h
	libguile/inline.c
	libguile/inline.h
	libguile/ports.c
	libguile/smob.c
	libguile/smob.h
	module/ice-9/deprecated.scm
	module/ice-9/r4rs.scm
2012-03-08 13:22:09 +01:00
Andy Wingo
f740445a9b run finalizers asynchronously in asyncs
* libguile/finalizers.c: New excitement!  We'll be running finalizers
  asynchronously, from asyncs.  This will make it safer to allocate
  while holding a mutex.
  (GC_set_finalizer_notifier): Add back-compat shim.

* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
  during boot.

* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
  on demand.
  (scm_gc): Explicitly run finalizers here.

* libguile/threads.c (guilify_self_2): Run finalizers here if
  queue_finalizer_async happened to run during guilify_self_1.

* configure.ac: Add check for GC_set_finalizer_notifier.
2012-03-08 13:12:10 +01:00
Andy Wingo
eaf99988ae run finalizers asynchronously (in asyncs and/or pthreads)
* libguile/finalizers.c: New excitement!  We'll be running finalizers in
  threads, if that's available.  If it's not available, during early
  boot, we can run finalizers in asyncs.  This will make it safer to
  allocate while holding a mutex.

* libguile/posix.c (scm_fork): Shut down the finalizer thread before
  forking.

* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
  during boot and, if available, initialialize the finalizer thread at
  the very end.

* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
  on demand.
  (scm_gc): Explicitly run finalizers here.  If you're calling this
  function, you probably want synchronous GC.
2012-02-24 13:33:02 +01:00
Andy Wingo
44b76a785c Revert "install pthread_atfork handlers for guile's static mutexen"
This reverts commit 6a97b1f93a.
2012-02-23 14:18:56 +01:00
Andy Wingo
6a97b1f93a install pthread_atfork handlers for guile's static mutexen
* libguile/async.c:
* libguile/deprecation.c:
* libguile/fluids.c:
* libguile/gc.c:
* libguile/instructions.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/strings.c:
* libguile/threads.c: Use the SCM_PTHREAD_ATFORK_LOCK_STATIC_MUTEX
  mechanism to lock a number of static mutexen.
2012-02-17 12:11:14 +01:00
Andy Wingo
dfadcf85cb Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/debug.h
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/tree-il/peval.scm
	module/language/tree-il/primitives.scm
2012-01-30 20:27:35 +01:00
Andy Wingo
e1fbe716e8 fix hook invocation during thread guilification
* libguile/gc.c (run_before_gc_c_hook): Don't run pre-GC hooks from a
  thread that is in the process of guilification.
2012-01-30 17:06:37 +01:00
Andy Wingo
0bdd43515e Merge commit 'f78a1ccede' 2012-01-10 00:23:49 +01:00
Andy Wingo
34cf38c3a2 stdlib.h, not malloc.h
* configure.ac: Remove check for malloc.h.

* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/mallocs.c:
* libguile/smob.c: Use stdlib instead of malloc.h.
2011-12-22 09:54:24 -05:00
Andy Wingo
52b680f85e fix scm_protects deprecation warning
* libguile/gc.c: Fix warning about scm_protects being deprecated.
2011-12-19 15:55:07 +01:00
Andy Wingo
bfe35b90ff Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
2011-12-13 10:20:44 +01:00
Chris K. Jester-Young
4eb286127c fix compilation with gc 7.1
* configure.ac: Add checks for GC_gcollect_and_unmap and
  GC_get_unmapped_bytes.
* libguile/gc-malloc.c (scm_realloc): GC_gcollect() if we don't have
  GC_gcollect_and_unmap.
* libguile/gc.c (GC_get_heap_usage_safe): Likewise, don't
  GC_get_unmapped_bytes if the function doesn't exist.
2011-12-08 21:14:06 +01:00
Andy Wingo
b2208d2e98 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/fluids.c
	libguile/gc.c
	libguile/gc.h
	libguile/objcodes.c
	libguile/procprop.c
	libguile/vm.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
2011-12-01 23:31:50 +01:00
Andy Wingo
738c899e4c fix deadlock in before-gc-hook on certain 7.2alpha gc versions
* libguile/gc.c (scm_init_gc): Only adjust gc frequency in the gc start
  hook if we know that it won't take a lock.
2011-12-01 12:57:49 +01:00
Andy Wingo
fd51e66190 attempt to handle steady-state mallocations better
* libguile/gc-malloc.c (scm_realloc): Call the new
  scm_gc_register_allocation() here.  If we have to collect, do a
  GC_gcollect_and_unmap.

* libguile/gc.c (scm_gc_register_allocation): Add a routine to track
  steady-state mallocation, and cause gc to run if there is a high
  mallocation rate.
  (adjust_gc_frequency): Reset the bytes-until-GC countdown timer.
2011-11-29 21:36:31 +01:00
Andy Wingo
7a4eb5e5ec adjust_gc_frequency before gc, for more precision
* libguile/gc.c (scm_init_gc): Run the adjust_gc_frequency from the
  before-gc-hook, not the after-gc-hook.  More precise, this way.
2011-11-29 20:24:23 +01:00
Andy Wingo
8ac704338d fix uninitialized variable in gc.c
* libguile/gc.c (get_image_size): Fix use of uninitialized variable.
2011-11-29 13:43:52 +01:00
Andy Wingo
d1c036248c switch off debugging flag that was mistakenly left on
* libguile/gc.c (HEURISTICS_DEBUG): Whoops, switch this off.
2011-11-29 10:17:07 +01:00
Andy Wingo
6360beb28a increase garbage collection rate if the process is growing
* configure.ac: Check for GC_get_free_space_divisor.
* libguile/gc.c (GC_get_free_space_divisor): Define an implementation,
  if needed.
  (accumulate_gc_timer): Fix indentation.
  (get_image_size): New terrible hack.  Needs implementations on other
  platforms.
  (adjust_gc_frequency): Attempt to adjust the GC frequency based on
  process image growth.  Needs more comments.
  (scm_init_gc): Add the adjust_gc_frequency to the after_gc_c_hook.
2011-11-29 10:12:22 +01:00
Andy Wingo
14294ce0df get heap stats with GC_get_heap_usage_safe, if available.
* configure.ac: Check for GC_get_heap_usage_safe.
* libguile/gc.c (SCM_DEFINE): Use GC_get_heap_usage_safe.
2011-11-28 19:58:53 +01:00
Andy Wingo
fbe1cb7f64 remove public scm_protects export
* libguile/gc.h:
* libguile/gc.c: Remove scm_protects from the API.  It is deprecated on
  stable-2.0.
2011-11-24 11:47:36 +01:00
Andy Wingo
f0d1bacd78 deprecate direct scm_protects access
* libguile/gc.h:
* libguile/gc.c: Deprecate direct access to scm_protects.
2011-11-21 10:56:29 +01:00
Andy Wingo
a141db8604 remove weak pairs, rewrite weak vectors
* libguile/weak-vector.c:
* libguile/weak-vector.h: Renamed from weaks.[ch].  Remove weak pairs.
  They were not safe to access with `car' and `cdr'.  Remove weak alist
  vectors, as we have weak tables and sets.  Reimplement weak vectors,
  moving the implementation here.

* libguile/vectors.c:
* libguile/vectors.h: Remove the extra header word.  Use
  scm_c_weak_vector_ref / scm_c_weak_vector_set_x to access weak
  vectors.

* libguile/snarf.h: Remove the extra header word in vectors.

* libguile/threads.c (do_thread_exit, fat_mutex_lock, fat_mutex_unlock):
  Instead of weak pairs, store thread-owned mutexes in a list of
  one-element weak vectors.

* libguile/guardians.c (finalize_guarded): Similarly, store object
  guardians in a list of one-element weak vectors.

* libguile/modules.c (scm_module_reverse_lookup): We no longer need to
  handle the case of weak references.

* libguile/print.c (iprin1): Use the standard vector accessor to print
  vectors.

* libguile.h:
* libguile/Makefile.am:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/goops.c:
* libguile/init.c:
* libguile/objprop.c:
* libguile/struct.c: Update includes.

* module/ice-9/weak-vector.scm: Load weak vector definitions using an
  extension instead of %init-weaks-builtins.

* test-suite/tests/weaks.test: Use the make-...-hash-table names instead
  of the old alist vector names.
2011-10-24 12:54:14 +02:00
Andy Wingo
7005c60fcb add weak table implementation
* libguile/weak-table.c:
* libguile/weak-table.h: New files, implementing open-addressed weak
  hash tables, similar to the implementation of weak sets.  This will
  let us remove weak pairs.

* libguile.h:
* libguile/Makefile.am:
* libguile/evalext.c:
* libguile/gc.c:
* libguile/init.c:
* libguile/print.c:
* libguile/tags.h: Update all the pieces for the new files and tc7.
2011-10-24 10:58:57 +02:00
Andy Wingo
26b263541b add weak sets
* libguile/weak-set.c:
* libguile/weak-set.h: New files, implementing weak sets, for use in the
  symbol table and port set.  Eventually we will be able to remove weak
  pairs.

* libguile.h:
* libguile/Makefile.am: Add new files.

* libguile/evalext.c:
* libguile/gc.c:
* libguile/init.c:
* libguile/print.c:
* libguile/tags.h: Add support for the new types.
2011-10-23 20:45:01 +02:00
Andy Wingo
74ec8d786f fix scm_i_tag_name
* libguile/gc.c (scm_i_tag_name): Fix to work as intended, though it was
  not called.  See http://article.gmane.org/gmane.lisp.guile.devel/12685.
2011-07-28 17:52:29 +02:00
Andy Wingo
a8952d1fb7 remove scm_newcell_count, scm_newcell2_count
* libguile/inline.h:
* libguile/gc.c: Remove declaration and definition of unused
  "scm_newcell_count" and "scm_newcell2_count".  Since SCM_INTERNAL is
  "extern", these symbols were not externally visible anyway, at least
  under Linux or Windows.
2011-05-26 15:58:42 +02:00
Andy Wingo
00b6ef23f3 measure time spent in gc
* libguile/gc.c (scm_gc_stats): Set the gc-time-taken entry to our
  recorded value.
  (start_gc_timer, accumulate_gc_timer, scm_init_gc): Arrange to record
  a conservative estimate of time spent in GC.
2011-05-04 20:19:52 +02:00
Andy Wingo
0fbdbe6c84 fix pre-GC_set_start_callback compilation
* libguile/gc.c: Move declaration of run_before_gc_hook up.
2011-04-15 16:41:34 +00:00
Andy Wingo
66b229d56e pre-GC_set_start_callback compatibility
* configure.ac: Add a check for GC_set_start_callback.

* libguile/gc.c (scm_i_gc): If we don't have GC_set_start_callback, run
  the before-gc hook manually here.
  (scm_init_gc): Otherwise set it as a start callback.

* libguile/hashtab.c (weak_gc_callback, weak_gc_hook)
  (weak_gc_finalizer, scm_c_register_weak_gc_callback): Fix to work
  either way, with or without GC_set_start_callback.
2011-04-15 18:31:06 +02:00
Andy Wingo
cc3546b027 use gc_start_callback + asyncs for after-gc-hook, instead of finalizers
* libguile/gc.c (run_before_gc_c_hook, scm_storage_prehistory)
  (after_gc_async_thunk, queue_after_gc_hook, scm_init_gc): Instead of
  playing our finalizer trick, connect to the GC start callback, and use
  it to queue an async after-gc-hook.  Seems to fix the after-gc-hook on
  non-threaded builds.  Though this does re-enable the before-gc C hook,
  we don't wire up the Scheme hook because we're in the alloc lock; and
  indeed, a before-GC scheme hook isn't a great idea...
2011-04-15 17:45:52 +02:00
Andy Wingo
17ab1dc3d6 add heap-allocated-since-gc to gc-stats
* libguile/gc.c (scm_gc_stats): Use add bytes_since_gc to the alist,
  under "heap-allocated-since-gc", and remove dead code.
2011-03-17 12:39:59 +01:00
Andy Wingo
ec7f624d65 re-enable the after-gc-hook
* libguile/gc.c (scm_gc): No need to take a mutex here.  Don't run the
  hook, the hook will run itself.
  (scm_c_register_gc_callback): New private helper, registers a callback
  the next time GC happens.
  (system_gc_callback): Guile's internal callback that runs
  scm_after_gc_c_hook, which itself queues a call to the after-gc-hook.
  (scm_storage_prehistory): Queue up a call to system_gc_callback.
2011-02-24 16:30:08 +01:00
Ludovic Courtès
5b46a8c2c8 Use "pointer" instead of "foreign" when dealing with wrapped pointers.
* libguile/foreign.h (scm_t_foreign_finalizer): Rename to...
  (scm_t_pointer_finalizer): ... this.
  (SCM_FOREIGN_P): Rename to...
  (SCM_POINTER_P): this.
  (SCM_VALIDATE_FOREIGN): Rename to...
  (SCM_VALIDATE_POINTER): ... this.
  (SCM_FOREIGN_HAS_FINALIZER): Rename to...
  (SCM_POINTER_HAS_FINALIZER): ... this.
  (scm_take_foreign_pointer): Rename to...
  (scm_from_pointer): ... this.
  (scm_foreign_address): Rename to...
  (scm_pointer_address): ... this.
  (scm_foreign_to_bytevector): Rename to...
  (scm_pointer_to_bytevector): ... this.
  (scm_foreign_set_finalizer_x): Rename to...
  (scm_set_pointer_finalizer_x): ... this.
  (scm_bytevector_to_foreign): Rename to...
  (scm_bytevector_to_pointer): ... this.
  (scm_i_foreign_print): Rename to...
  (scm_i_pointer_print): ... this.

* libguile/foreign.c: Update accordingly.

* libguile/tags.h (scm_tc7_foreign): Rename to...
  (scm_tc7_pointer): ... this.

* libguile/foreign.c, libguile/deprecated.c, libguile/dynl.c,
  libguile/evalext.c, libguile/gc.c, libguile/goops.c, libguile/gsubr.c,
  libguile/gsubr.h, libguile/print.c, libguile/snarf.h,
  libguile/vm-i-system.c, module/system/foreign.scm,
  test-suite/standalone/test-ffi, test-suite/tests/foreign.test: Update
  accordingly.
2010-07-28 12:24:25 +02:00
Ludovic Courtès
65c7a8bd64 Remove dead code related to `scm_i_terminating'.
* libguile/fports.c (scm_i_terminating): Remove declaration.
  (fport_flush): Remove code conditional of `scm_i_terminating'.

* libguile/gc.c (scm_i_terminating): Remove.
2010-05-28 17:02:14 +02:00
Ludovic Courtès
8c93b597b3 Fix the visibility of a few of internal symbols.
* libguile/gc.h (scm_i_gc): Make internal.
* libguile/posix.h (scm_i_locale_mutex): Likewise.
* libguile/arrays.h (scm_i_tc16_array): Likewise.
* libguile/numbers.c (scm_i_num_less_p): Likewise.
* libguile/discouraged.h (scm_i_init_discouraged): Likewise.
* libguile/continuations.c (scm_i_dummy): Made static.
* libguile/gc.c (scm_i_cell_validation_already_running): Likewise.
* libguile/discouraged.h (scm_i_init_discouraged): Likewise.
2010-05-28 17:02:13 +02:00
Ludovic Courtès
acbccb0c83 Reinstate `scm_protects', for backward compatibility.
Partly reverts e7efe8e793 ("decruftify
scm_sys_protects").

* libguile/gc.c (protects): Rename to...
  (scm_protects): ... this.

* libguile/gc.h (scm_protects): Add declaration.
2010-02-13 19:33:51 +01:00
Andy Wingo
cc7005bc37 remove scm_tc7_gsubr
* libguile/tags.h (scm_tc7_gsubr): Return to the pool of unused tc7s, as
  there are no more gsubrs. Yay :)

* libguile/programs.h (SCM_F_PROGRAM_IS_PRIMITIVE):
  (SCM_PROGRAM_IS_PRIMITIVE): New flag and accessor.

* libguile/gsubr.c (create_gsubr):
* libguile/snarf.h (SCM_STATIC_PROGRAM): Give subrs a PRIMITIVE flag.

* libguile/smob.h:
* libguile/smob.c (scm_i_smob_arity): New internal procedure. Uses the
  old GSUBR type macros, local to the file.

* libguile/procprop.c (scm_i_procedure_arity): Call out to
  scm_i_smob_arity, and remove a gsubr case.

* libguile/gc.c (scm_i_tag_name):
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (scm_class_of):
* libguile/vm.c (apply_foreign):
* libguile/hash.c (scm_hasher):
* libguile/debug.c (scm_procedure_name):
* libguile/print.c (iprin1): Remove gsubr cases.

* libguile/gsubr.h (SCM_PRIMITIVE_P): Fix to work with the new VM
  program regimen.
  (SCM_GSUBR_TYPE, SCM_GSUBR_MAKTYPE, SCM_GSUBR_MAX, SCM_GSUBR_REQ)
  (SCM_GSUBR_OPT, SCM_GSUBR_REST): Remove these macros, that are no
  longer useful.
* libguile/gsubr.c (scm_i_gsubr_apply, scm_i_gsubr_apply_list)
  (scm_i_gsubr_apply_array): Remove internal gsubr application
  functions.
2010-01-07 23:49:39 +01:00
Andy Wingo
6f3b0cc29e tc7 tags for vm-related data
* libguile/tags.h (scm_tc7_frame, scm_tc7_objcode, scm_tc7_vm)
  (scm_tc7_vm_cont): Take more tc7s for VM-related data structures.

* libguile/evalext.c (scm_self_evaluating_p):
* libguile/gc.c (scm_i_tag_name):
* libguile/goops.c (scm_class_of, create_standard_classes):
* libguile/print.c (iprin1): Add cases for the new tc7s.

* libguile/frames.c:
* libguile/frames.h:
* libguile/objcodes.c:
* libguile/objcodes.h:
* libguile/vm.c:
* libguile/vm.h: Desmobify.

* libguile/vm.c (scm_vm_apply): Export to Scheme, because VM objects are
  no longer applicable.

* module/system/repl/command.scm (profile):
* module/system/vm/trace.scm (vm-trace):
* module/system/vm/vm.scm (vm-load): Call vm-apply to run a program in a
  VM instead of treating the VM as applicable.
2010-01-07 23:42:41 +01:00
Andy Wingo
e2c2a6994d add foreign value wrapper
* libguile/foreign.h:
* libguile/foreign.c: New files, implementing simple wrappers around
  foreign values, such as those that one might link in dynamically from
  a library.

* libguile/tags.h (scm_tc7_foreign): Take a tc7 for foreign values.

* libguile.h:
* libguile/init.c: Add foreign.h to headers and init.

* libguile/print.c (iprin1): Add printer for foreign values.

* libguile/gc.c (scm_i_tag_name): Case for foreign values.
* libguile/goops.c (scm_class_of, create_standard_classes): Add a class
  for foreign values.

* libguile/evalext.c (scm_self_evaluating_p): Add case for foreign
  values.

* libguile/Makefile.am: Add foreign.[ch] to the build.
2010-01-04 12:39:21 +01:00
Ludovic Courtès
bc4adf1739 Remove unneeded #include <assert.h>.
* libguile/backtrace.c, libguile/eval.c, libguile/gc.c,
  libguile/goops.c, libguile/memoize.c, libguile/threads.c,
  libguile/uniform.c, libguile/vm.c,
  test-suite/standalone/test-conversion.c,
  test-suite/standalone/test-list.c: Don't include <assert.h>.
2009-12-15 20:20:38 +01:00
Ludovic Courtès
cd169c5a22 Remove uses of the non-standard `__FUNCTION__'.
* libguile/gc.c (scm_gc_sweep): Replace `__FUNCTION__' by `FUNC_NAME'.

* libguile/read.c (scm_read_r6rs_block_comment): Likewise.
2009-12-15 01:01:16 +01:00
Andy Wingo
ea68d342f1 procedures-with-setters implemented in terms of structs
* libguile/tags.h (scm_tc7_pws): No more.

* libguile/procs.c (scm_procedure_with_setter_p)
  (scm_make_procedure_with_setter, scm_procedure, scm_setter): Implement
  procedures-with-setters in terms of applicable structs with setters.

* libguile/procs.h: Remove a big, outdated comment, and the deprecated
  macros.

* libguile/deprecated.h (SCM_PROCEDURE_WITH_SETTER_P, SCM_PROCEDURE)
  (SCM_SETTER): Deprecate these. SCM_PROCEDURE and SCM_SETTER are bad
  names.

* libguile/evalext.c (scm_self_evaluating_p):
* libguile/gc.c (scm_i_tag_name):
* libguile/goops.c: (scm_class_of):
* libguile/print.c (iprin1):
* libguile/procprop.c (scm_i_procedure_arity):
* libguile/procs.c (scm_procedure_p):
* libguile/debug.c (scm_procedure_source): Remove a tc7_pws case.

* libguile/goops.h:
* libguile/goops.c (scm_class_procedure_with_setter): Remove this class;
  it is subsumed by applicable_struct_with_setter.

* libguile/struct.h: Update a comment.

* libguile/vm-i-system.c (call, goto/args, mv-call): Remove PWS cases.
2009-12-07 09:56:58 +01:00
Andy Wingo
e7efe8e793 decruftify scm_sys_protects
* libguile/root.h
* libguile/root.c (scm_sys_protects): It used to be that for some reason
  we'd define a special array of "protected" values. This was a little
  silly, always, but with the BDW GC it's completely unnecessary. Also
  many of these variables were unused, and none of them were good API.
  So remove this array, and either eliminate, make static, or make
  internal the various values.

* libguile/snarf.h: No need to generate calls to scm_permanent_object.

* guile-readline/readline.c (scm_init_readline): No need to call
  scm_permanent_object.

* libguile/array-map.c (ramap, rafe): Remove the dubious nullvect
  optimizations.

* libguile/async.c (scm_init_async): No need to init scm_asyncs, it is
  no more.

* libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is
  no more.

* libguile/gc.c: Make scm_protects a static var.
  (scm_storage_prehistory): Change the sanity check to use the address
  of protects.
  (scm_init_gc_protect_object): No need to clear the scm_sys_protects,
  as it is no more.

* libguile/keywords.c: Make the keyword obarray a static var.
* libguile/numbers.c: Make flo0 a static var.
* libguile/objprop.c: Make object_whash a static var.
* libguile/properties.c: Make properties_whash a static var.

* libguile/srcprop.h:
* libguile/srcprop.c: Make scm_source_whash a global with internal
  linkage.

* libguile/strings.h:
* libguile/strings.c: Make scm_nullstr a global with internal linkage.

* libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect,
  it's unused.
2009-12-05 12:38:43 +01:00
Andy Wingo
562cd1b8f8 more boot cleanup
* libguile/bytevectors.c (scm_bootstrap_bytevectors): Remove a call to
  scm_gc_protect_object.

* libguile/gc.h:
* libguile/gc.c (scm_init_gc_protect_object): Rename from
  scm_init_storage, and just return void. Make the GC boot procs have
  internal linkage.

* libguile/init.c: Adapt to the name change.
2009-12-05 11:44:09 +01:00
Andy Wingo
f39448c5a3 remove a bunch of needless scm_permanent_object calls
* libguile/array-handle.c:
* libguile/bytevectors.c:
* libguile/deprecated.c:
* libguile/eval.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/gc.c:
* libguile/gdbint.c:
* libguile/goops.c:
* libguile/instructions.c:
* libguile/load.c:
* libguile/modules.c:
* libguile/numbers.c:
* libguile/options.c:
* libguile/ports.c:
* libguile/scmsigs.c:
* libguile/srcprop.c:
* libguile/srfi-4.c:
* libguile/stacks.c:
* libguile/threads.c:
* libguile/vm.c: Remove calls to scm_permanent_object, as they are no
  longer needed with the BDW GC.
2009-12-05 11:32:50 +01:00
Andy Wingo
9ea31741da fluids are tc7 objects
If you're wondering what I'm doing, I'm trying to eventually reimplement
smobs in terms of structs, so that applicable smobs can just follow the
applicable struct dispatch path. But to do that I have to get structs
initialized before things that use smobs, which means transforming a
bunch of smobby things to tc7 things. But this transformation is good
for performance anyway, and we currently have a glut of unused tc7s,
so here we go...

* libguile/tags.h (scm_tc7_fluid, scm_tc7_dynamic_state): Fluids (and
  dynamic states) now have tc7s.

* libguile/fluids.h: Remove scm_fluids_prehistory, and add internal
  scm_i_fluid_print. Update a comment.

* libguile/fluids.c: Update for tc7 representation. Also remove the next
  pointers while we're at it, as they aren't used in the new BDW GC.

* libguile/eq.c (scm_equal_p): Remove the hashtable case. Hashtables
  could never be equal? before, I don't see why to add stubs doing the
  same thing now.

* libguile/print.c (iprin1):
* libguile/gc.c (scm_i_tag_name):
* libguile/evalext.c (scm_self_evaluating_p): Add fluid and
  dynamic_state cases.

* libguile/goops.h: Remove scm_class_hashtable; it will be static.
* libguile/goops.c: Make <hashtable> static, and add <fluid> and
  <dynamic-state> classes.

* libguile/hashtab.h:
* libguile/hashtab.c: Remove scm_i_hashtable_equal_p.

* libguile/init.c (scm_i_init_guile): Remove call to fluids_prehistory.
2009-12-05 10:52:18 +01:00